/* ==========================================================
   Histoire de la franchise (ProTeam-statistique.php, layout/historique-section.php)
   Mobile d'abord ; couleurs par variables du thème (sombre et clair)
   ========================================================== */

.histoire { display: grid; gap: 1rem; margin-top: 1rem; min-width: 0; }
.histoire__entete .titre-section { margin-bottom: .35rem; }
.histoire__entete p { margin: 0; }
.histoire__petit { margin: .5rem 0 0; font-size: .8rem; }
.histoire__note { margin: .4rem 0 0; font-size: .8rem; }

/* ---------- Carte d'identité : chiffres clés ---------- */
.histoire__chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.chiffre { display: grid; align-content: start; gap: .15rem; padding: .8rem .9rem; }
.chiffre__valeur { font-family: var(--police-titre); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.chiffre__valeur small { font-size: .5em; margin-left: .1em; color: var(--texte-2); }
.chiffre__libelle { font-weight: 700; font-size: .92rem; }
.chiffre__detail { color: var(--texte-2); font-size: .78rem; line-height: 1.3; }
.chiffre--or { box-shadow: inset 0 3px 0 var(--or); }
@media (min-width: 620px) { .histoire__chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .histoire__chiffres { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Ce qui fait jaser : titres de la ligue et phrases ---------- */
.histoire__jase { display: grid; gap: .7rem; }
.badges-histoire { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.badge-histoire {
    display: grid;
    gap: .05rem;
    padding: .4rem .7rem .45rem;
    border: 1px solid var(--trait);
    border-left: 4px solid var(--bleu);
    border-radius: var(--rayon);
    background: var(--surface-2);
}
.badge-histoire strong { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.badge-histoire span { font-size: .8rem; color: var(--texte-2); }
.badge-histoire--bon { border-left-color: var(--monte); }
.badge-histoire--mauvais { border-left-color: var(--baisse); }
.chirp { margin: 0; padding: .1rem 0 .1rem .8rem; border-left: 3px solid var(--ligne); font-weight: 600; line-height: 1.4; }
.chirp::before { content: "« "; color: var(--texte-2); }
.chirp::after { content: " »"; color: var(--texte-2); }

/* ---------- La courbe ---------- */
.histoire__courbe { margin: 0; display: grid; gap: .5rem; min-width: 0; }
.histoire__courbe-titre { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; }
.histoire__legende { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--texte-2); }
.legende--bande::before { background: color-mix(in srgb, var(--texte-2) 30%, transparent); }
.courbe { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; overflow: visible; }
.courbe__grille { stroke: var(--trait); stroke-width: 1; }
.courbe__axe { fill: var(--texte-2); font-size: 10px; font-family: var(--police-texte); }
.courbe__bande { fill: var(--texte-2); opacity: .16; }
.courbe__moyenne { fill: none; stroke: var(--texte-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.courbe__equipe { fill: none; stroke: var(--bleu); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.courbe__equipe--en-cours { stroke-dasharray: 3 4; opacity: .7; }
.courbe__point { fill: var(--bleu); stroke: var(--surface); stroke-width: 1.5; }
.courbe__point--coupe { fill: var(--or); }
.courbe__point--en-cours { fill: var(--surface); stroke: var(--bleu); stroke-width: 2; }
.courbe__dg { stroke: var(--trait); stroke-width: 1; }
.courbe__dg--0 { fill: color-mix(in srgb, var(--bleu) 20%, var(--surface)); }
.courbe__dg--1 { fill: color-mix(in srgb, var(--or) 24%, var(--surface)); }
.courbe__dg-nom { fill: var(--texte); font-size: 9.5px; font-weight: 700; font-family: var(--police-texte); }

/* ---------- Rivalités et chance ---------- */
.histoire__cartes { display: grid; gap: 1rem; }
@media (min-width: 800px) { .histoire__cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.face { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .1rem .75rem; padding-top: .6rem; border-top: 1px solid var(--trait); }
.face:first-of-type { border-top: 0; padding-top: 0; }
.face__libelle { grid-column: 1 / -1; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.face__equipe { display: flex; align-items: center; gap: .5rem; font-weight: 700; min-width: 0; }
.face__equipe img { flex: none; }
.face__fiche { font-family: var(--police-titre); font-size: 1.5rem; font-weight: 800; }
.face__detail { grid-column: 1 / -1; color: var(--texte-2); font-size: .8rem; }

.chance { display: grid; gap: .1rem; }
.chance__valeur { font-family: var(--police-titre); font-size: 2.3rem; font-weight: 800; line-height: 1; }
.chance--plus { color: var(--monte); }
.chance--moins { color: var(--baisse); }
.chance__saisons { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 72px; }
.chance__saisons li { display: grid; grid-template-rows: minmax(0, 1fr) auto; align-items: end; justify-items: center; gap: 3px; min-width: 0; }
.chance__barre { width: 100%; max-width: 22px; min-height: 2px; border-radius: 3px 3px 0 0; background: currentColor; }
.chance__saison { font-size: .62rem; color: var(--texte-2); white-space: nowrap; }

/* ---------- Saison par saison ---------- */
.tableau--histoire { min-width: 640px; }
.tableau--histoire th, .tableau--histoire td { white-space: nowrap; }
.tableau--histoire .col-saison { text-align: left; font-weight: 800; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tableau--histoire .col-dg { text-align: left; white-space: nowrap; color: var(--texte-2); }
.tableau--histoire .col-pts { font-weight: 800; }
.tableau--histoire tbody tr.est-en-cours > * { background: var(--surface-2); }
.tableau--histoire tbody tr.est-manquante > * { color: var(--texte-2); font-style: italic; text-align: left; }
.tableau--histoire td.chance--plus, .tableau--histoire td.chance--moins { font-weight: 700; }
.rang {
    display: inline-block;
    min-width: 1.7rem;
    padding: .05rem .35rem;
    border-radius: 999px;
    background: var(--surface-2);
    font-weight: 700;
    text-align: center;
}
.rang--petit { min-width: 1.35rem; padding: 0 .25rem; font-size: .72rem; font-weight: 600; color: var(--texte-2); }
.legende-rang { font-weight: 700; }
.legende-rang--haut { color: var(--monte); }
.legende-rang--bas { color: var(--baisse); }
.rang--haut { background: color-mix(in srgb, var(--monte) 24%, var(--surface)); color: var(--texte); }
.rang--bas { background: color-mix(in srgb, var(--baisse) 22%, var(--surface)); color: var(--texte); }
.resultat { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.resultat--coupe { background: var(--or); color: #1C1D1F; }
.resultat--finale { border-color: var(--or); }
.resultat--series { border-color: var(--monte); }
.resultat--exclue { color: var(--texte-2); }
.resultat--en-cours { border-color: var(--bleu); color: var(--texte-2); }

/* Petit écran : le graphique rapetisse, ses textes doivent rester lisibles */
@media (max-width: 600px) {
    .courbe__axe { font-size: 14px; }
    .courbe__dg-nom { font-size: 13px; }
}

/* Trous d'archives (49 à 51) et étiquettes de l'axe */
.courbe__trou { opacity: .6; }
.courbe__hachure { stroke: var(--trait); stroke-width: 2; }
.chance__bornes { display: flex; justify-content: space-between; margin: -.4rem 0 0; font-size: .72rem; }
.domext th small { display: block; font-weight: 400; color: var(--texte-2); font-size: .75rem; }
@media (max-width: 600px) {
    .courbe__axe { font-size: 19px; }
    .courbe__axe--secondaire { display: none; }
    .courbe__dg-nom { font-size: 17px; }
}

/* ---------- Légendes de la franchise ---------- */
.legendes { display: grid; gap: .9rem; }
.legendes__entete .groupe__titre { margin-bottom: .2rem; }
.legendes__entete p { margin: 0; }
.legendes__records { display: grid; gap: .6rem; }
@media (min-width: 700px) { .legendes__records { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.record-franchise { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface-2); min-width: 0; }
.record-franchise img { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.record-franchise p { margin: 0; display: grid; line-height: 1.25; min-width: 0; }
.record-franchise__titre { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-2); }
.record-franchise strong { font-family: var(--police-titre); font-size: 1.7rem; line-height: 1; }
.record-franchise p > span:last-child { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legendes__tableaux { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .legendes__tableaux { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.tableau--legendes caption { text-align: left; font-weight: 800; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-2); padding: 0 0 .35rem; }
.tableau--legendes th, .tableau--legendes td { white-space: nowrap; }
.tableau--legendes .col-nom { text-align: left; font-weight: 600; }
.tableau--legendes .col-pts { font-weight: 800; }
.joueur-legende { display: inline-flex; align-items: center; gap: .45rem; }
.joueur-legende img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.joueur-legende small { color: var(--texte-2); font-weight: 700; font-size: .7rem; }
.tableau--histoire .col-meneur { text-align: left; }
.tableau--histoire .col-meneur small { color: var(--texte-2); }

/* ---------- Palmarès des DG (PalmaresDG.php) ---------- */
.palmares { display: grid; gap: 1rem; min-width: 0; }
.palmares > *, .histoire > *, .records > * { min-width: 0; } /* un grand tableau défile dans son cadre au lieu d'élargir la page */
.palmares__titres { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.titre-dg { display: grid; gap: .3rem; align-content: start; padding: .8rem .9rem; box-shadow: inset 0 3px 0 var(--or); }
.titre-dg__titre { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.titre-dg__qui { display: flex; align-items: center; gap: .5rem; }
.titre-dg__qui strong { font-family: var(--police-titre); font-size: 1.35rem; line-height: 1.1; }
.titre-dg__detail { font-size: .85rem; color: var(--texte-2); line-height: 1.35; }
.tableau--palmares { min-width: 900px; }
.tableau--palmares th, .tableau--palmares td { white-space: nowrap; }
.tableau--palmares .col-dg { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tableau--palmares thead th[data-tri] { cursor: pointer; }
.tableau--palmares .col-equipes { text-align: left; }
.tableau--palmares .col-equipes img { margin-right: 2px; vertical-align: middle; }
.tableau--palmares .col-fort { font-weight: 800; }
.tableau--palmares tr.est-ancien .col-dg { color: var(--texte-2); }
.dg-nom { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; }
.dg-nom__vide { display: inline-block; width: 24px; height: 24px; }
.coupes { display: inline-block; min-width: 1.6rem; padding: .05rem .4rem; border-radius: 999px; background: var(--or); color: #1C1D1F; font-weight: 800; text-align: center; }
.avant-archives { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.avant-archives li { display: grid; padding: .5rem .7rem; border: 1px solid var(--trait); border-radius: var(--rayon); }
.avant-archives span { color: var(--texte-2); font-size: .85rem; }
.titre-dg__egalite { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .8rem; }
.titre-dg__egalite li { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }

/* ---------- Records de la ligue (LeagueRecords.php) ---------- */
.records { display: grid; gap: 1.4rem; min-width: 0; }
.records > section { display: grid; gap: .7rem; scroll-margin-top: 5rem; }
.records__entete .titre-bloc { margin: 0; }
.records__entete p { margin: .15rem 0 0; font-size: .85rem; }
.records__sommaire { display: flex; flex-wrap: wrap; gap: .4rem; }
.records__sommaire a { padding: .3rem .8rem; border: 1px solid var(--trait); border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--texte-2); }
.records__sommaire a:hover { color: var(--texte); text-decoration: none; border-color: var(--bleu); }
.records__grille { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.records__grille--large { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.carte-record { display: grid; gap: .5rem; align-content: start; }
.carte-record__titre { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-2); }
.carte-record__liste { list-style: none; margin: 0; padding: 0; display: grid; }
.carte-record__liste li { display: grid; grid-template-columns: 1.2rem 28px minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--trait); }
.carte-record__liste li:first-child { border-top: 0; }
.carte-record__liste img { width: 28px; height: 28px; object-fit: contain; }
.carte-record__photo { border-radius: 50%; object-fit: cover !important; background: var(--surface-2); }
.carte-record__rang { color: var(--texte-2); font-size: .8rem; font-weight: 700; text-align: center; }
.carte-record__qui { display: grid; min-width: 0; line-height: 1.25; }
.carte-record__qui strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-record__qui small { color: var(--texte-2); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-record__valeur { font-family: var(--police-titre); font-size: 1.15rem; font-weight: 800; }
.carte-record__liste li.est-premier .carte-record__valeur { font-size: 1.5rem; color: var(--texte); }
.carte-record__liste li.est-premier .carte-record__rang { color: var(--or); }

/* ---------- Palmarès des franchises (PalmaresFranchises.php) ---------- */
.tableau--franchises { min-width: 1080px; }
.dg-nom:hover { text-decoration: none; }
.printemps { display: grid; gap: .7rem; }
.printemps__colonnes { display: grid; gap: 1rem; }
@media (min-width: 800px) { .printemps__colonnes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.printemps__titre { margin: 0 0 .4rem; font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.printemps__titre--bon { color: var(--monte); }
.printemps__titre--mauvais { color: var(--baisse); }
.printemps__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.printemps__equipe { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface-2); }
.printemps__texte { display: grid; line-height: 1.3; min-width: 0; }
.printemps__texte span { font-size: .85rem; }
.printemps__texte small { color: var(--texte-2); font-size: .78rem; }
.printemps__valeur { font-family: var(--police-titre); font-size: 1.6rem; font-weight: 800; }
.printemps__methode summary { cursor: pointer; font-weight: 700; color: var(--bleu); }
.printemps__methode p, .printemps__methode ul { margin: .4rem 0 0; font-size: .88rem; color: var(--texte-2); }

/* ---------- Classements d'antan ---------- */
.antan__saisons { display: flex; flex-wrap: wrap; gap: .35rem; }
.antan__saisons a, .antan__saisons span[aria-current] { min-width: 2.6rem; padding: .3rem .55rem; text-align: center; border-radius: 6px; border: 1px solid var(--trait); text-decoration: none; font-weight: 600; }
.antan__saisons span[aria-current] { background: var(--accent-fond); color: var(--accent-texte); border-color: transparent; }
.antan__trou { align-self: center; padding: 0 .3rem; color: var(--texte-2); font-size: .8rem; font-style: italic; }
.antan__titre { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.antan__titre h2 { margin: 0; font-family: var(--police-titre); font-size: 2rem; text-transform: uppercase; }
.antan__titre a:last-child { justify-self: end; }
.antan__titre a { font-weight: 600; text-decoration: none; }
.tableau--antan { min-width: 1000px; }
.tableau--antan tr.est-qualifiee .dg-nom { font-weight: 800; }
.tableau--antan tr.est-exclue .dg-nom { font-weight: 500; }
.tableau--antan tr.est-exclue > * { color: var(--texte-2); }
.tableau--antan tr.est-exclue .col-fort { color: var(--texte); }
.antan__coupe { color: var(--or); font-weight: 800; }
.antan__finale { font-weight: 700; }
.antan__note { padding: .5rem 1rem 0; font-size: .8rem; }
.antan .palmares__titres { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); }
