/* ---------------------------------------------------
   VARIABLES GLOBALES
--------------------------------------------------- */
:root {
    --bleu-usc: #005bbb;
    --bleu-fonce: #003f7d;
    --rouge-usc: #e63946;
    --gris-clair: #f5f5f5;
    --gris: #dcdcdc;
    --noir: #222;
    --blanc: #fff;

    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.15);

    --font-titre: 'Montserrat', sans-serif;
    --font-texte: 'Roboto', sans-serif;
}

/* ---------------------------------------------------
   RESET SIMPLE
--------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-texte);
    background: var(--gris-clair);
    color: var(--noir);
    line-height: 1.6;
}

/* ---------------------------------------------------
   HEADER
--------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bleu-usc);
    padding: 12px 0;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.header-container {
    width: 90%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    height: 60px;
}

.nav a {
    color: var(--blanc);
    margin-left: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.nav a:hover {
    color: var(--rouge-usc);
}

.footer {
    width: 90%;
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #444;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer a {
    color: var(--bleu-usc);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: var(--bleu-fonce);
}

/* ---------------------------------------------------
   HERO
--------------------------------------------------- */
.hero {
    position: relative;
    height: auto;
    overflow: visible;
}

.hero-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    filter: brightness(70%);
    display: block;
}

@media (max-width: 900px) {
    .hero-img {
        max-height: 220px;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.6));
}

.hero-content {
    position: absolute;
    bottom: 18px;
    left: 24px;
    color: var(--blanc);
    max-width: calc(100% - 48px);
}

.hero-content h1 {
    font-family: var(--font-titre);
    font-size: 2rem;
    margin-bottom: 8px;
}

.hero-content p {
    font-size: 1rem;
}

@media (min-width: 1200px) {
    .hero-content h1 { font-size: 3rem; }
    .hero-content p { font-size: 1.2rem; }
}

/* ---------------------------------------------------
   MATCH SECTIONS
--------------------------------------------------- */
.match-section {
    width: 90%;
    margin: 40px auto;
}

.match-section h2 {
    font-family: var(--font-titre);
    margin-bottom: 15px;
}

.match-card {
    background: var(--blanc);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 80px;
}

.stats-season {
    margin-bottom: 30px;
}

.stats-season-matches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.stats-season-matches.stats-season-single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.stats-season-matches.stats-season-single .stats-match-box {
    width: min(50%, 520px);
}

.stats-match-box {
    background: var(--blanc);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-match-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.stats-match-teams-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-match-club {
    font-weight: 600;
}

.stats-match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--bleu-usc);
    font-weight: 700;
}

.stats-match-score-extra {
    font-size: 0.85rem;
    margin-left: 6px;
    color: #555;
    font-weight: 600;
}

@media (max-width: 900px) {
    .stats-season-matches {
        grid-template-columns: 1fr;
    }

    .stats-season-matches.stats-season-single .stats-match-box {
        width: 100%;
    }
}

/* ---------------------------------------------------
   CLASSEMENT MINI
--------------------------------------------------- */
.classement-section {
    width: 90%;
    margin: 40px auto;
}

.classement-layout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 420px) minmax(220px, 280px);
    gap: 22px;
    align-items: start;
}

.classement-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.classement-sidebar {
    display: grid;
    gap: 16px;
}

.classement-extra {
    background: var(--blanc);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    color: #555;
}

.classement-extra h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-family: var(--font-titre);
    color: var(--bleu-usc);
}

.classement-extra p {
    margin: 0 0 14px;
    line-height: 1.5;
}

.reserved-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.reserved-links li a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f3f8ff;
    color: var(--bleu-usc);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.reserved-links li a:hover {
    background: #e6f0ff;
    transform: translateY(-1px);
}

.classement-mini,
.match-sidebar-card {
    background: var(--blanc);
    padding: 16px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.classement-mini {
    margin-bottom: 0;
}

.classement-mini h3 {
    margin-top: 0;
    margin-bottom: 14px;
    font-family: var(--font-titre);
    color: var(--bleu-usc);
}

.match-sidebar-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    font-family: var(--font-titre);
    font-size: 1rem;
}

.match-card {
    min-height: auto;
    padding: 0;
}

.classement-mini {
    padding: 18px;
}

.stats-card h3 {
    margin-top: 0;
}

.stats-match-box-home {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    padding: 16px;
    border-radius: 18px;
}

.match-card .stats-match-box-home {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.match-card .stats-match-teams-row {
    justify-content: space-between;
}

.match-card .stats-match-top {
    display: flex;
}

.classement-note {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #555;
}

.btn {
    width: fit-content;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 0.88rem;
}

.mini-table th,
.mini-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mini-table.compact th,
.mini-table.compact td {
    padding: 8px 10px;
}

.mini-table.compact.classement-complete th,
.mini-table.compact.classement-complete td {
    padding: 8px 10px;
    font-size: 0.88rem;
}

.mini-table.compact.classement-complete th:nth-child(n+3),
.mini-table.compact.classement-complete td:nth-child(n+3) {
    width: 1%;
    white-space: nowrap;
}

.mini-table.compact.classement-complete td {
    white-space: nowrap;
}

.mini-table th {
    background: var(--bleu-usc);
    color: var(--blanc);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.mini-table tbody tr:nth-child(even) {
    background: rgba(30, 95, 168, 0.05);
}

.mini-table tbody tr:hover {
    background: rgba(30, 95, 168, 0.12);
}

.mini-table.compact {
    font-size: 0.82rem;
}

.mini-table.compact th,
.mini-table.compact td {
    padding: 8px 10px;
}

.mini-table td:first-child {
    font-weight: 700;
    width: 36px;
}

.mini-table tr.promotion {
    background: rgba(112, 218, 132, 0.18);
}

.mini-table tr.playoff {
    background: rgba(108, 174, 255, 0.16);
}

.mini-table tr.relegation {
    background: rgba(255, 118, 118, 0.18);
}

.mini-table td:nth-child(2) {
    text-align: left;
    width: 180px;
    max-width: 180px;
}

.mini-table .club-name {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .classement-layout {
        grid-template-columns: 1fr;
    }
    .classement-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .mini-table th:nth-child(n+7),
    .mini-table td:nth-child(n+7) {
        display: none;
    }
    .mini-table td:nth-child(2) {
        min-width: 130px;
    }
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bleu-usc);
    color: var(--blanc);
    text-decoration: none;
    border-radius: var(--radius);
    transition: 0.2s;
}

.btn:hover {
    background: var(--bleu-fonce);
}

/* ---------------------------------------------------
   ACCROCHES
--------------------------------------------------- */
.accroches {
    width: 90%;
    margin: 50px auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 25px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .accroches {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 700px) {
    .accroches {
        grid-template-columns: 1fr;
    }
}

.accroche-card {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: center;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.accroche-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

@media (max-width: 900px) {
    .accroche-card img {
        height: 100px;
    }
}

.accroche-card .btn {
    margin: 18px auto 0;
}

.mini-ranking {
    padding: 0 15px 15px;
}

.mini-ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.9rem;
}

.mini-ranking-table th,
.mini-ranking-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    text-align: left;
}

.mini-ranking-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 0 15px 10px;
    font-weight: 600;
}

.mini-match-summary {
    padding: 0 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.mini-match-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stats-match-box {
    background: var(--blanc);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-match-teams-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-match-teams-row--single {
    width: 100%;
}

.stats-match-club {
    font-weight: 600;
}

.stats-match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--bleu-usc);
    font-weight: 700;
}

.mini-match-result {
    width: 28px;
    height: 28px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
}

.mini-match-result {
    width: 28px;
    height: 28px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
}

.mini-match-detail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 600;
}

.mini-match-score {
    color: var(--rouge-usc);
    font-weight: 700;
}

.mini-match-status--win {
    background: #1f7a3d;
}

.mini-match-status--draw {
    background: #b59f1d;
}

.mini-match-status--loss {
    background: #b42318;
}

.highlight-row {
    background: rgba(51, 102, 204, 0.08);
}

.accroche-card h3 {
    font-family: var(--font-titre);
    margin: 15px 0 10px;
}

.accroche-card p {
    padding: 0 15px;
    margin-bottom: 15px;
}

/* ---------------------------------------------------
   FOOTER
--------------------------------------------------- */
.footer {
    background: var(--bleu-fonce);
    color: var(--blanc);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer a {
    color: var(--rouge-usc);
    text-decoration: none;
    font-weight: bold;
}

/* ---------------------------------------------------
   PAGE PALMARÈS
--------------------------------------------------- */
.hero-page {
    height: 320px;
}

.page-content {
    width: min(1120px, 92%);
    margin: 0 auto 60px;
}

.section {
    margin: 36px auto 0;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
}

.section-title h2 {
    font-family: var(--font-titre);
    font-size: 2rem;
    color: var(--bleu-fonce);
    margin-bottom: 8px;
}

.section-title p {
    color: #555;
    max-width: 760px;
    margin: 0 auto;
}

.section-intro-card {
    background: linear-gradient(135deg, var(--bleu-usc), var(--bleu-fonce));
    color: var(--blanc);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.section-intro-card p {
    margin: 0;
    font-size: 1rem;
}

.palmares-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.palmares-controls .btn {
    border: none;
    cursor: pointer;
    font: inherit;
}

.palmares-chart {
    overflow-x: auto;
    padding: 18px;
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.palmares-chart-note {
    margin: 0 0 12px;
    color: #4a5568;
}

.palmares-chart[hidden] {
    display: none;
}

.palmares-chart svg {
    display: block;
    width: 100%;
    min-width: 720px;
    height: auto;
}

.palmares-chart-gridline {
    stroke: #dfe5ed;
    stroke-width: 1;
}

.palmares-chart-gridline--vertical {
    stroke-dasharray: 4 5;
}

.palmares-chart-axis {
    stroke: #65758b;
    stroke-width: 1.5;
}

.palmares-chart-axis-label,
.palmares-chart-axis-title {
    fill: #39485a;
    font: 13px sans-serif;
}

.palmares-chart-axis-title {
    font-weight: 600;
}

.palmares-chart-line {
    fill: none;
    stroke: var(--bleu-usc);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.palmares-chart-point {
    fill: var(--bleu-usc);
    stroke: var(--blanc);
    stroke-width: 1.5;
}

.palmares-chart-point:focus {
    stroke: #f0a500;
    stroke-width: 3;
    outline: none;
}

.timeline-decennies {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.decade-block {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.decade-title {
    font-family: var(--font-titre);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bleu-fonce);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--gris);
    padding-bottom: 8px;
}

.decade-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.timeline-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid #e6ebf2;
    border-left: 5px solid var(--bleu-usc);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timeline-card-up {
    background: linear-gradient(180deg, #f2fff4 0%, #e3f7e7 100%);
    border-left-color: #2e8b57;
}

.timeline-card-down {
    background: linear-gradient(180deg, #fff4f4 0%, #fde8e8 100%);
    border-left-color: #d64545;
}

.timeline-year {
    font-weight: 700;
    color: var(--bleu-usc);
    margin-bottom: 6px;
    font-size: 1rem;
}

.timeline-championnat {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--noir);
}

.timeline-meta {
    font-size: 0.95rem;
    color: #4a5568;
    margin-top: 6px;
    line-height: 1.45;
}

.timeline-decennies.compact .timeline-card {
    padding: 12px;
}

.timeline-decennies.compact .timeline-meta {
    display: none;
}

/* ---------------------------------------------------
   HISTORIQUE
--------------------------------------------------- */
.historique-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.historique-select {
    padding: 10px 14px;
    border: 1px solid var(--gris);
    border-radius: 999px;
    min-width: 180px;
    font: inherit;
}

.historique-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.historique-season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.historique-season-box {
    border: 1px solid #d3d9e5;
    border-radius: 10px;
    padding: 10px 8px;
    background: #f8fbff;
    color: #1f3248;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    min-height: 52px;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.historique-season-box:hover,
.historique-season-box:focus {
    border-color: var(--bleu-usc);
    background: #eef5ff;
}

.historique-season-box.is-active {
    border-color: var(--bleu-fonce);
    background: var(--bleu-usc);
    color: var(--blanc);
}

.historique-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.historique-season-header {
    background: linear-gradient(135deg, var(--bleu-usc), var(--bleu-fonce));
    color: var(--blanc);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow);
}

.historique-season-header h3 {
    font-family: var(--font-titre);
    margin-bottom: 6px;
}

.historique-section {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.historique-section h3 {
    font-family: var(--font-titre);
    color: var(--bleu-fonce);
    margin-bottom: 16px;
}

.historique-match-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.historique-match-card {
    border: 1px solid #e7ebf0;
    border-left: 4px solid var(--bleu-usc);
    border-radius: 10px;
    background: #fbfcfe;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.historique-match-card.is-open {
    grid-column: span 2;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

@media (max-width: 900px) {
    .historique-match-card.is-open {
        grid-column: span 1;
    }
}

.historique-match-card--win {
    border-left-color: #1f7a3d;
    background: #f2fbf4;
}

.historique-match-card--lose {
    border-left-color: #b42318;
    background: #fdf2f2;
}

.historique-match-card--draw {
    border-left-color: #8a8f98;
    background: #ffffff;
}

.historique-match-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.historique-match-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.25;
}

.historique-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.historique-match-details {
    display: none;
    padding: 0 14px 14px;
    line-height: 1.35;
    font-size: 0.88rem;
}

.historique-spectateurs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #56606f;
    font-size: 0.7rem;
}

.historique-event {
    color: #5b6472;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.4;
}

.historique-buts,
.historique-cartons {
    display: grid;
    gap: 6px;
    margin: 8px 0;
    color: #48515f;
    font-size: 0.7rem;
    line-height: 1.35;
}

.historique-match-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.historique-journee {
    font-weight: 700;
    color: var(--bleu-fonce);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.historique-match-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
}

.historique-score {
    font-weight: 700;
    color: var(--rouge-usc);
    font-size: 0.9rem;
    text-align: right;
}

.historique-match-extra-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(0, 91, 187, 0.09);
    color: var(--bleu-fonce);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.historique-match-teams {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
    color: #314050;
    font-size: 0.88rem;
    align-items: center;
}

.historique-match-teams span {
    white-space: nowrap;
}

.historique-team-level {
    color: #6b7480;
    font-size: 1em;
    font-weight: 600;
    white-space: nowrap;
}

.historique-match-card.is-open .historique-match-details {
    display: block;
}

.historique-icon {
    font-size: 1rem;
    line-height: 1;
}

.historique-buts {
    display: grid;
    gap: 6px;
    margin: 8px 0;
    color: #48515f;
    font-size: 0.7rem;
}

.historique-cartons {
    display: grid;
    gap: 6px;
    margin: 8px 0;
    color: #48515f;
    font-size: 0.82rem;
}

.historique-icon {
    display: inline-block;
    margin-right: 4px;
}

.historique-icon-red {
    filter: grayscale(0.1);
}

.historique-carton-meta {
    font-size: 0.75rem;
    color: #6b7480;
}

.historique-carton-equipe {
    font-weight: 600;
}

.historique-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    align-items: center;
}

.historique-links--split {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.historique-links-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.historique-link-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.historique-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #48515f;
    font-size: 0.72rem;
    font-weight: 600;
}

.historique-link-text {
    color: #48515f;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 700;
}

.historique-links a {
    color: var(--bleu-usc);
    text-decoration: none;
    font-weight: 600;
}

.historique-link-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef3f8;
}

.historique-empty {
    padding: 16px;
    text-align: center;
    color: #666;
    background: #f8f9fb;
    border-radius: 10px;
}

.historique-season-subtitle {
    margin-top: 8px;
    opacity: 0.9;
}

/* ---------------------------------------------------
   SAISON & STATISTIQUES
--------------------------------------------------- */
.decade-list,
.alphabet-buttons,
.teams-list,
.page-controls,
.classement-container,
.calendar-container,
.stats-container,
.selection-summary {
    width: 100%;
    margin-bottom: 24px;
}

.decade-block,
.selection-card,
.classement-card,
.calendar-card,
.stats-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    padding: 22px;
}

.decade-title,
.stats-card h3,
.classement-card h3,
.calendar-card h3,
.selection-card h3 {
    font-family: var(--font-titre);
    color: var(--bleu-fonce);
    margin-bottom: 16px;
}

.decade-items,
.historique-season-grid,
.stats-season {
    display: grid;
    gap: 14px;
}

.decade-items {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.decade-card,
.alphabet-btn,
.team-select-btn,
.journee-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--gris);
    border-radius: 999px;
    background: var(--blanc);
    color: var(--noir);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font: inherit;
}

.decade-card:hover,
.alphabet-btn:hover,
.team-select-btn:hover,
.journee-filter:focus {
    background: #eef4ff;
    border-color: var(--bleu-usc);
}

.decade-card {
    text-align: left;
    width: 100%;
    white-space: normal;
    border-radius: 16px;
    min-height: 60px;
}

.alphabet-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    padding: 18px;
}

.team-search-form {
    margin-bottom: 20px;
}

.total-match-count {
    display: grid;
    gap: 4px;
    margin: 12px auto 0;
    padding: 12px 16px;
    max-width: 720px;
    background: #eef4ff;
    border-left: 4px solid var(--bleu-usc);
    border-radius: 8px;
    color: var(--bleu-fonce);
    font-weight: 600;
    text-align: left;
}

.total-match-count p {
    margin: 0;
}

.team-search-form > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.team-search-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.team-search-controls .form-control {
    max-width: 420px;
}

.team-search-btn {
    border: 1px solid var(--bleu-usc);
    background: var(--bleu-usc);
    color: var(--blanc);
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font: inherit;
}

.team-search-btn:hover:not(:disabled) {
    background: var(--bleu-fonce);
    border-color: var(--bleu-fonce);
}

.team-search-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.team-search-help {
    margin: 8px 0 0;
    color: #555;
}

.team-search-results {
    width: 100%;
    margin-bottom: 24px;
    padding: 18px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.teams-list {
    min-height: 250px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    padding: 18px;
}

.team-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
}

.team-item {
    margin: 0;
}

.team-select-btn {
    width: 100%;
    border-radius: 12px;
}

.form-control,
.journee-filter {
    width: 100%;
    max-width: 320px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 14px;
    background: #fff;
    color: var(--noir);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.journee-filter:focus {
    outline: none;
    border-color: var(--bleu-usc);
    box-shadow: 0 0 0 4px rgba(0, 91, 187, 0.12);
}

.contact-section .section-title p {
    max-width: 720px;
}

.contact-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
}

.contact-card {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    padding: 28px;
}

.contact-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-family: var(--font-titre);
    color: var(--bleu-usc);
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: grid;
    gap: 10px;
}

.contact-list li {
    color: #333;
}

.contact-form-card form {
    display: grid;
    gap: 18px;
}

.contact-submit {
    width: fit-content;
}

.contact-status {
    margin-top: 8px;
    font-weight: 600;
}

.contact-status-loading {
    color: #0065d6;
}

.contact-status-success {
    color: #1f7a3d;
}

.contact-status-error {
    color: #d02f2f;
}

@media (max-width: 1024px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

.calendar-table,
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.calendar-table th,
.calendar-table td,
.stats-table th,
.stats-table td {
    border: 1px solid rgba(0,0,0,0.08);
    padding: 10px 12px;
    text-align: left;
}

.calendar-table th,
.stats-table th {
    background: var(--bleu-usc);
    color: var(--blanc);
    font-size: 0.85rem;
}

.stats-card,
.classement-card,
.calendar-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    padding: 18px;
    font-size: 0.88rem;
}

.stats-card p,
.stats-card td,
.stats-card th,
.stats-card h4,
.classement-card p,
.classement-card td,
.classement-card th,
.classement-card h3,
.calendar-card h3 {
    font-size: 0.88rem;
}

.classement-card table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    background: transparent;
}

.classement-card th,
.classement-card td {
    border: 1px solid rgba(0,0,0,0.08);
    padding: 10px 12px;
    text-align: left;
    background: rgba(248, 250, 253, 0.8);
}

.stats-season-header {
    margin-bottom: 12px;
}

.stats-season h4 {
    margin: 0;
    font-family: var(--font-titre);
    color: var(--bleu-usc);
}

.stats-season-matches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.stats-season-matches.stats-season-single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.stats-season-matches.stats-season-single .stats-match-box {
    width: min(50%, 480px);
}

.stats-match-box {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: auto;
    font-size: 0.88rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

@media (max-width: 900px) {
    .stats-season-matches {
        grid-template-columns: 1fr;
    }

    .stats-season-matches.stats-season-single .stats-match-box {
        width: 100%;
    }
}

.stats-match-meta {
    font-weight: 700;
    color: var(--bleu-fonce);
}

.stats-match-teams-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    font-weight: 600;
}

.stats-match-teams-row--single {
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
}

.stats-match-teams-row--single .stats-match-club {
    min-width: 0;
    max-width: 10rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-match-club {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-match-teams-row strong {
    margin: 0 6px;
    font-weight: 700;
}

.stats-match-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.stats-match-result {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blanc);
}

.stats-match-score {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rouge-usc);
    text-align: right;
    min-width: 42px;
}

.stats-match-win {
    border-color: #1f7a3d;
    background: rgba(31, 122, 61, 0.08);
}

.stats-match-win .stats-match-result {
    background: #1f7a3d;
}

.stats-match-draw {
    border-color: #b59f1d;
    background: rgba(181, 159, 29, 0.1);
}

.stats-match-draw .stats-match-result {
    background: #b59f1d;
}

.stats-match-loss {
    border-color: #b42318;
    background: rgba(180, 35, 24, 0.1);
}

.stats-match-loss .stats-match-result {
    background: #b42318;
}

.page-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
}

    .display-mode-group {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
    }

    .display-mode-option {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .saison-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 18px;
        align-items: start;
    }

    .saison-layout .classement-container,
    .saison-layout .calendar-container {
        min-width: 0;
        width: 100%;
    }

    .saison-layout .calendar-container .stats-match-box {
        padding: 14px 16px;
        gap: 8px;
        min-height: auto;
    }

    .saison-layout .calendar-container .stats-match-top {
        margin-bottom: 12px;
    }

    .saison-layout .calendar-container .stats-season-matches {
        grid-template-columns: 1fr;
    }

    @media (max-width: 1100px) {
        .saison-layout {
            grid-template-columns: 1fr;
        }
    }


.team-toggle-btn {
    border: 1px solid var(--gris);
    background: var(--blanc);
    color: var(--noir);
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font: inherit;
}

.team-toggle-btn:hover {
    background: #eef4ff;
    border-color: var(--bleu-usc);
}

.stats-summary-card {
    background: #f7fbff;
    border: 1px solid rgba(0, 91, 187, 0.14);
    border-radius: 16px;
    padding: 14px;
    margin-top: 18px;
}

.stats-summary-card--compact {
    max-width: 360px;
}

.stats-summary-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.stats-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.stats-summary-table th,
.stats-summary-table td {
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.08);
    text-align: center;
}

.stats-summary-note {
    margin: 0;
    font-size: 0.8rem;
    border-color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

.stats-match-unknown .stats-match-result {
    background: #6b7280;
}

.historique-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.historique-photo-card {
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e7ebf0;
}

.historique-photo-card img {
    display: block;
    width: 100%;
    height: auto;
}

.historique-photo-card figcaption {
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #4f5a67;
    line-height: 1.3;
}

.historique-photo-card figcaption p {
    margin: 0;
}

.historique-photo-card figcaption p + p {
    margin-top: 0.2rem;
}

.historique-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 14px 0 10px;
}

.historique-action-btn {
    border: 0;
    background: var(--bleu-usc);
    color: var(--blanc);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    line-height: 1.4;
}

.historique-action-btn:hover {
    background: var(--bleu-fonce);
}

.historique-panel {
    margin-top: 10px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.historique-panel .historique-match-card,
.historique-panel .historique-match-summary,
.historique-panel .historique-match-details,
.historique-panel .historique-match-teams,
.historique-panel .historique-match-topline,
.historique-panel .historique-journee,
.historique-panel .historique-score {
    font-size: 0.60rem;
}

.historique-panel .historique-match-details {
    line-height: 1.4;
}

.historique-panel-loading {
    color: #5b6472;
    font-style: italic;
}

.historique-match-niveau {
    color: #5b6472;
    margin-bottom: 6px;
}

.historique-badge-row {
    margin: 8px 0;
}

.historique-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e7f7ec;
    color: #1f7a3d;
    font-size: 0.9rem;
    font-weight: 600;
}

.historique-badge-false {
    background: #fdecec;
    color: #b42318;
}

/* ---------------------------------------------------
   RESPONSIVE
--------------------------------------------------- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .header-container {
        flex-direction: column;
        gap: 12px;
    }

    .nav a {
        margin: 0 10px;
    }

    .palmares-controls {
        justify-content: center;
    }

    .decade-block {
        padding: 16px;
    }
}
