/* Direkte Filtersteuerung */

.statistics-server-toolbar {
    display: block !important;
    padding: 10px !important;
}

.cir-direct-filter-layout {
    display: grid;
    gap: 12px;
    width: 100%;
}

.cir-direct-filter-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.cir-direct-search {
    flex: 0 1 360px;
    min-width: 230px;
}

.cir-direct-search input {
    width: 100% !important;
    min-height: 38px;
}

.cir-direct-filter-top
.statistics-period-buttons {
    display: flex !important;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 !important;
}

.cir-direct-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.cir-direct-filter-group {
    display: grid;
    flex: 0 1 auto;
    gap: 5px;
    min-width: 0;
}

.cir-direct-filter-title {
    color: #8097a9;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.cir-direct-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cir-direct-filter-button {
    display: inline-grid;
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    place-items: center;
    border: 1px solid rgba(91, 125, 149, 0.24);
    border-radius: 6px;
    color: #a2b6c4;
    background: rgba(12, 33, 49, 0.84);
    font: inherit;
    font-size: 0.69rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.cir-direct-filter-button:hover {
    border-color: rgba(96, 211, 234, 0.38);
    color: #edf6f8;
    background: rgba(17, 45, 65, 0.96);
}

.cir-direct-filter-button.is-active {
    border-color: rgba(239, 185, 87, 0.55);
    color: #f1c866;
    background: rgba(239, 185, 87, 0.1);
    box-shadow:
        inset 0 0 0 1px rgba(239, 185, 87, 0.08);
}

.cir-direct-filter-button img {
    display: block;
    width: 25px;
    height: 15px;
    border-radius: 1px;
    object-fit: cover;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.13);
}

.cir-hidden-statistics-controls {
    display: none !important;
}


/* Tabellenbreiten: nur Inhalt plus geringer Abstand */

.statistics-server-table-scroll,
.cir-my-table-scroll,
.foreign-player-table-scroll,
.clan-statistics-table-scroll {
    width: 100% !important;
    max-width: 100%;
    overflow: auto;
    text-align: center;
}

#statistics-server-table,
.statistics-server-table,
.cir-my-table,
.foreign-player-table,
.clan-statistics-table {
    width: max-content !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-inline: auto !important;
    border-collapse: collapse;
    table-layout: auto !important;
}

#statistics-server-table th,
#statistics-server-table td,
.statistics-server-table th,
.statistics-server-table td,
.cir-my-table th,
.cir-my-table td,
.foreign-player-table th,
.foreign-player-table td,
.clan-statistics-table th,
.clan-statistics-table td {
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 32px;
    padding: 5px 8px !important;
    white-space: nowrap;
}

#statistics-server-table th,
.statistics-server-table th {
    font-size: 0.64rem !important;
}

#statistics-server-table td,
.statistics-server-table td {
    font-size: 0.71rem !important;
}


/* Alte feste Breiten der ersten Spalten neutralisieren */

#statistics-server-table th:nth-child(n),
#statistics-server-table td:nth-child(n) {
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
}

#statistics-server-table
.cir-auto-sticky-column {
    position: sticky !important;
    z-index: 3;
    background-clip: padding-box;
}

#statistics-server-table thead
.cir-auto-sticky-column {
    z-index: 8;
    background: #10283c;
}

#statistics-server-table tbody tr:nth-child(odd)
.cir-auto-sticky-column {
    background: #061727;
}

#statistics-server-table tbody tr:nth-child(even)
.cir-auto-sticky-column {
    background: #0d2538;
}


/* Gruppierte Kopfzeile */

.cir-statistics-group-row th {
    position: sticky;
    z-index: 9;
    top: 0;
    height: 38px !important;
    padding: 7px 10px !important;
    border-right:
        1px solid rgba(80, 116, 142, 0.22);
    border-bottom:
        1px solid rgba(80, 116, 142, 0.24);
    color: #efbd5b !important;
    background: #0b2133 !important;
    font-size: 0.68rem !important;
    font-weight: 950;
    letter-spacing: 0.01em;
    text-align: center !important;
    text-transform: none;
}

.cir-statistics-group-row
+ tr th {
    top: 38px !important;
}


/* Portal exakt zwischen Support und Download */

.cir-header-has-midpoint-portal {
    position: relative !important;
}

.cir-header-portal-midpoint {
    position: absolute;
    z-index: 30;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.cir-header-portal-midpoint
.header-portal-center,
.cir-header-portal-midpoint
a {
    margin: 0 !important;
}


/* Kleine Tabellen zentrieren */

section[data-clan-statistics-panel],
.cir-my-statistics-panel,
.foreign-player-profile {
    text-align: center;
}

section[data-clan-statistics-panel]
> *,
.cir-my-statistics-panel
> *,
.foreign-player-profile
> * {
    text-align: initial;
}

.clan-member-table-grid {
    justify-content: center !important;
}


/* Mobil */

@media (max-width: 1050px) {
    .cir-header-portal-midpoint {
        position: static;
        transform: none;
    }

    .cir-direct-filter-row {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .cir-direct-filter-top {
        align-items: stretch;
        flex-direction: column;
    }

    .cir-direct-search {
        width: 100%;
        min-width: 0;
    }

    .cir-direct-filter-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cir-direct-filter-title {
        text-align: left;
    }

    .cir-direct-filter-button {
        min-width: 37px;
    }
}
/* CIR_FILTER_AND_GROUP_REFINEMENT_20260717 */

/*
 * Filtergruppen stehen direkt nebeneinander.
 * Nur bei zu wenig Platz wird eine komplette Gruppe umgebrochen.
 */
.cir-direct-filter-row {
    display: flex !important;
    width: 100%;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 12px 20px !important;
    flex-wrap: wrap !important;
}

.cir-direct-filter-group {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
}

.cir-direct-filter-buttons {
    display: flex;
    width: max-content;
    max-width: 100%;
    gap: 4px;
    flex-wrap: nowrap;
}

.cir-direct-filter-title {
    text-align: left !important;
}

/*
 * Einheitliche Größe für WoT-typische SVG-Symbole.
 */
.cir-filter-icon {
    display: block;
    width: 18px;
    height: 18px;
    overflow: visible;
    color: currentColor;
}

.cir-direct-filter-button:has(.cir-filter-icon) {
    padding-inline: 8px;
}

.cir-direct-filter-button.is-active
.cir-filter-icon {
    filter:
        drop-shadow(
            0 0 3px
            rgba(239, 189, 91, 0.25)
        );
}

/*
 * Gruppenkopfzeile deutlich von der Spaltenzeile absetzen.
 */
#statistics-server-table
.cir-statistics-group-row th,
.statistics-server-table
.cir-statistics-group-row th {
    height: 40px !important;
    padding: 8px 12px !important;
    border-top:
        1px solid rgba(239, 189, 91, 0.32) !important;
    border-bottom:
        2px solid rgba(239, 189, 91, 0.42) !important;
    color: #f1be56 !important;
    background:
        linear-gradient(
            180deg,
            rgba(17, 47, 70, 0.98),
            rgba(9, 31, 48, 0.98)
        ) !important;
    box-shadow:
        inset 0 -1px 0
        rgba(255, 255, 255, 0.035);
    font-size: 0.7rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.025em;
    text-align: center !important;
}

/*
 * Jede neue Kategorie erhält links eine klare Trennlinie.
 */
#statistics-server-table
.cir-statistics-group-row th + th,
.statistics-server-table
.cir-statistics-group-row th + th {
    border-left:
        3px solid rgba(239, 189, 91, 0.32) !important;
}

/*
 * Startspalten der Kategorien:
 *  1  Allgemein
 *  9  Schadenseffizienz
 * 14  Standhaftigkeit
 * 18  Unterstützungswirkung
 * 24  Matchkontrolle
 */
#statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(9),
#statistics-server-table
tbody td:nth-child(9),

#statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(14),
#statistics-server-table
tbody td:nth-child(14),

#statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(18),
#statistics-server-table
tbody td:nth-child(18),

#statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(24),
#statistics-server-table
tbody td:nth-child(24),

.statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(9),
.statistics-server-table
tbody td:nth-child(9),

.statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(14),
.statistics-server-table
tbody td:nth-child(14),

.statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(18),
.statistics-server-table
tbody td:nth-child(18),

.statistics-server-table
thead tr:not(.cir-statistics-group-row)
th:nth-child(24),
.statistics-server-table
tbody td:nth-child(24) {
    border-left:
        3px solid rgba(239, 189, 91, 0.22) !important;
}

/*
 * Leichte unterschiedliche Tönung der fünf Hauptgruppen.
 */
#statistics-server-table
.cir-statistics-group-row th:nth-child(1),
.statistics-server-table
.cir-statistics-group-row th:nth-child(1) {
    background:
        linear-gradient(
            180deg,
            rgba(55, 48, 24, 0.9),
            rgba(19, 35, 46, 0.98)
        ) !important;
}

#statistics-server-table
.cir-statistics-group-row th:nth-child(2),
.statistics-server-table
.cir-statistics-group-row th:nth-child(2) {
    background:
        linear-gradient(
            180deg,
            rgba(56, 35, 27, 0.9),
            rgba(19, 35, 46, 0.98)
        ) !important;
}

#statistics-server-table
.cir-statistics-group-row th:nth-child(3),
.statistics-server-table
.cir-statistics-group-row th:nth-child(3) {
    background:
        linear-gradient(
            180deg,
            rgba(28, 45, 58, 0.96),
            rgba(19, 35, 46, 0.98)
        ) !important;
}

#statistics-server-table
.cir-statistics-group-row th:nth-child(4),
.statistics-server-table
.cir-statistics-group-row th:nth-child(4) {
    background:
        linear-gradient(
            180deg,
            rgba(22, 50, 52, 0.94),
            rgba(19, 35, 46, 0.98)
        ) !important;
}

#statistics-server-table
.cir-statistics-group-row th:nth-child(5),
.statistics-server-table
.cir-statistics-group-row th:nth-child(5) {
    background:
        linear-gradient(
            180deg,
            rgba(48, 37, 56, 0.92),
            rgba(19, 35, 46, 0.98)
        ) !important;
}

@media (max-width: 900px) {
    .cir-direct-filter-buttons {
        flex-wrap: wrap;
    }
}
/* CIR_BATTLES_HEADER_NORMAL_COLOR */

/*
 * CIR-Gefechte ist eine normale Datenspalte und wird deshalb nicht
 * farblich gegenüber den übrigen Spaltenüberschriften hervorgehoben.
 */
#statistics-server-table
th[data-server-sort="statistics_battles"],
#statistics-server-table
th[data-server-sort="statistics_battles"] button,
#statistics-server-table
th[data-server-sort="statistics_battles"] span,
.statistics-server-table
th[data-server-sort="statistics_battles"],
.statistics-server-table
th[data-server-sort="statistics_battles"] button,
.statistics-server-table
th[data-server-sort="statistics_battles"] span {
    color: #9db9cf !important;
}

/*
 * Auch bei aktiver Sortierung bleibt die Beschriftung in der normalen
 * Headerfarbe. Nur der Sortierpfeil darf weiterhin den Zustand anzeigen.
 */
#statistics-server-table
th[data-server-sort="statistics_battles"]
.clan-sort-indicator,
#statistics-server-table
th[data-server-sort="statistics_battles"]
.statistics-sort-indicator,
.statistics-server-table
th[data-server-sort="statistics_battles"]
.clan-sort-indicator,
.statistics-server-table
th[data-server-sort="statistics_battles"]
.statistics-sort-indicator {
    color: #6f8ca2 !important;
}
