/* Zone18 — Statistiques & Classements */

.z18-stats-shell,
.z18-stats-page,
.z18-classement-page {
    --z18s-red: #e5483f;
    --z18s-ink: #343a40;
    --z18s-muted: #878a99;
    --z18s-line: #e4e7eb;
    --z18s-soft: #f5f6f8;
}

.z18-stats-page .grid-1,
.z18-stats-page .content-gird-2 {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.stats-page,
.classement-page {
    display: grid;
    gap: 14px;
}

/* Hide legacy inline tab bars if present */
.classement-page > .classement-tabs {
    display: none !important;
}

.stats-kpi-grid,
.classement-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.stats-kpi-grid.stats-kpi-grid-8 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-kpi-card,
.classement-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--z18s-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(56, 65, 74, .05);
}

.stats-kpi-card small,
.classement-card small {
    color: var(--z18s-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stats-kpi-card b,
.classement-card b {
    color: var(--z18s-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

.stats-kpi-card span {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
}

.stats-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stats-section,
.classement-panel,
.classement-page .classement-card.full,
.classement-page section.classement-card {
    margin: 0;
    border: 1px solid var(--z18s-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(56, 65, 74, .04);
    overflow: hidden;
}

.stats-section-head,
.classement-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef1f4;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.stats-section-head h3,
.classement-panel-head h3 {
    margin: 0;
    color: var(--z18s-ink);
    font-size: 14px;
    font-weight: 700;
}

.stats-section-head span,
.classement-panel-head span {
    color: var(--z18s-muted);
    font-size: 12px;
}

.stats-section-body {
    padding: 12px 14px;
}

.stats-metric-list {
    display: grid;
    gap: 8px;
}

.stats-metric-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid var(--z18s-line);
    border-radius: 10px;
    background: #f8f9fb;
}

.stats-metric-line span {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.stats-metric-line b {
    color: var(--z18s-ink);
    font-size: 13px;
    text-align: right;
}

.stats-muted {
    color: #94a3b8;
    font-weight: 600;
}

.stats-wide-table,
.stats-clean-table,
.classement-table,
.classement-page table.display {
    width: 100% !important;
    border-collapse: collapse;
    margin: 0 !important;
    border: 0 !important;
    font-size: 13px;
}

.stats-wide-table th,
.stats-wide-table td,
.stats-clean-table th,
.stats-clean-table td,
.classement-table th,
.classement-table td,
.classement-page table.display th,
.classement-page table.display td {
    padding: 9px 8px !important;
    border: 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left;
    vertical-align: middle;
    height: auto !important;
    font-size: 12px !important;
}

.stats-wide-table th,
.classement-table th,
.classement-page table.display th {
    color: #64748b !important;
    background: #f8f9fb !important;
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.stats-wide-table tbody tr:nth-child(even) td,
.classement-table tbody tr:nth-child(even) td,
.classement-page table.display tbody tr:nth-child(even) td {
    background: #f8f9fb;
}

.stats-row-link {
    cursor: pointer;
}

.stats-row-link:hover td {
    background: #fff7f6 !important;
}

.stats-centre-link {
    color: var(--z18s-ink);
    font-weight: 700;
    text-decoration: none;
}

.stats-centre-link:hover {
    color: var(--z18s-red);
}

.stats-grade {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
}

.stats-bars {
    display: grid;
    gap: 8px;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
}

.stats-bar-row span {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bar-row b {
    color: var(--z18s-ink);
    font-size: 12px;
}

.stats-bar-row > div {
    grid-column: 1 / -1;
    height: 7px;
    border-radius: 999px;
    background: #eef1f5;
    overflow: hidden;
}

.stats-bar-row > div > em {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e5483f, #f06548);
}

.stats-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--z18s-muted);
}

.stats-ops-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.stats-ops-intro {
    margin: 0;
    max-width: 420px;
    color: #64748b;
    font-size: 12px;
}

.stats-ops-period {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.stats-ops-period > span {
    color: var(--z18s-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.stats-ops-period-link {
    display: inline-flex;
    padding: 6px 10px;
    border: 1px solid var(--z18s-line);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.stats-ops-period-link:hover {
    background: var(--z18s-soft);
    color: var(--z18s-ink);
}

.stats-ops-period-link.is-active {
    border-color: var(--z18s-red);
    background: var(--z18s-red);
    color: #fff;
}

.stats-ops-note {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 11px;
}

/* Classement content polish */
.classement-page .classement-summary {
    margin: 0;
}

.classement-page .title-grid,
.classement-page .content-gird-1,
.classement-page .content-gird-2,
.classement-page .grid-1,
.classement-page .grid-2 {
    float: none !important;
    width: 100% !important;
    margin: 0 0 12px !important;
}

body.z18-velzon-test .z18-classement-page .title-grid {
    min-height: 40px;
    padding: 10px 14px !important;
    border: 1px solid var(--z18s-line) !important;
    border-bottom: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    color: var(--z18s-ink) !important;
    background: #fff !important;
    font-size: 12px;
    font-weight: 700;
}

body.z18-velzon-test .z18-classement-page .content-gird-1,
body.z18-velzon-test .z18-classement-page .content-gird-2 {
    padding: 14px !important;
    border: 1px solid var(--z18s-line) !important;
    border-radius: 0 0 12px 12px !important;
    background: #fff !important;
}

@media (max-width: 1100px) {
    .stats-kpi-grid,
    .stats-kpi-grid.stats-kpi-grid-8,
    .classement-summary,
    .stats-two-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stats-kpi-grid,
    .stats-kpi-grid.stats-kpi-grid-8,
    .classement-summary,
    .stats-two-cols {
        grid-template-columns: 1fr;
    }
}

/* Classement components */
.classement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.classement-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.classement-search {
    box-sizing: border-box;
    max-width: 320px;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--z18s-line);
    border-radius: 8px;
    background: #fff;
    color: var(--z18s-ink);
    font-size: 12px;
}

.classement-rank {
    display: inline-block;
    min-width: 38px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--z18s-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.classement-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.classement-grade {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.classement-detail-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--z18s-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(56, 65, 74, .04);
}

.classement-detail-head h3 {
    margin: 0 0 4px;
    color: var(--z18s-ink);
    font-size: 20px;
    font-weight: 700;
}

.classement-detail-head img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.classement-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.classement-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--z18s-ink);
    font-size: 12px;
    font-weight: 700;
}

.classement-badge.renfort {
    background: #fff4d6;
    color: #7a5100;
}

.classement-centres-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.classement-centres-abbr {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--z18s-ink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
}

.classement-centres-abbr.large {
    padding: 10px 12px;
    font-size: 16px;
    line-height: 20px;
}

.classement-centre-link {
    color: var(--z18s-red);
    font-weight: 700;
    text-decoration: none;
}

.classement-centre-link:hover {
    text-decoration: underline;
}

.classement-row-link {
    cursor: pointer;
}

.classement-row-link:hover td {
    background: #fff7f6 !important;
}

.classement-history {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.classement-history-line {
    padding: 9px;
    border: 1px solid #e4eaf1;
    border-radius: 8px;
    background: #f8fafc;
}

.classement-history-line strong {
    color: var(--z18s-ink);
}

.classement-points-plus {
    color: #168a43;
    font-weight: 700;
}

.classement-points-minus {
    color: #b63128;
    font-weight: 700;
}

.classement-muted {
    color: #94a3b8;
    font-weight: 600;
}

.classement-nested-summary {
    margin: 0;
}

.saison-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1f252e 0%, #2f3b52 55%, #b22922 140%);
    box-shadow: 0 10px 28px rgba(31, 37, 46, .18);
    color: #fff;
}

.saison-hero-icon {
    font-size: 42px;
    line-height: 1;
}

.saison-hero h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.saison-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .85);
    line-height: 1.45;
}

.saison-hero-meta {
    text-align: right;
}

.saison-hero-meta strong {
    display: block;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.saison-hero-meta span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
}

.saison-note {
    margin: 0;
    color: #5f6874;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .classement-detail-head,
    .saison-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .classement-badges {
        justify-content: center;
    }

    .saison-hero-meta {
        text-align: left;
    }
}
