/* Couleurs : une par issue, identiques sur tout le site. Palette vérifiée pour les daltoniens, en clair et en sombre. */
:root {
  color-scheme: light;
  --fond: #f6f6f4; --surface: #fcfcfb; --bord: #dedcd6;
  --texte: #0b0b0b; --texte-2: #52514e; --texte-3: #6f6e69;
  --dom: #2a78d6; --nul: #eb6834; --ext: #1baf7a;
  --bon: #0b7a0b; --mauvais: #c03030; --alerte-fond: #fff4d6; --alerte-texte: #5c4300;
  --lien: #1c5cab; --grille: #e4e2dc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #121211; --surface: #1a1a19; --bord: #34342f;
    --texte: #f0efec; --texte-2: #c3c2b7; --texte-3: #9c9b92;
    --dom: #3987e5; --nul: #d95926; --ext: #199e70;
    --bon: #3fc13f; --mauvais: #ee7a7a; --alerte-fond: #3a2f0f; --alerte-texte: #f4dc9a;
    --lien: #86b6ef; --grille: #2b2b27;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #121211; --surface: #1a1a19; --bord: #34342f;
  --texte: #f0efec; --texte-2: #c3c2b7; --texte-3: #9c9b92;
  --dom: #3987e5; --nul: #d95926; --ext: #199e70;
  --bon: #3fc13f; --mauvais: #ee7a7a; --alerte-fond: #3a2f0f; --alerte-texte: #f4dc9a;
  --lien: #86b6ef; --grille: #2b2b27;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.conteneur { max-width: 960px; margin: 0 auto; padding-inline: 16px; }
a { color: var(--lien); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 1.5rem 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.chapeau { font-size: 1.05rem; color: var(--texte-2); margin-top: 0; max-width: 65ch; }
.discret { color: var(--texte-2); font-size: .9rem; }
section p, section li { max-width: 72ch; }
[hidden] { display: none !important; }

/* En-tête et navigation */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 10; }
.entete-contenu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
.marque { font-weight: 700; color: var(--texte); text-decoration: none; margin-right: auto; }
.entete nav { display: flex; gap: 2px; order: 3; width: 100%; }
.entete nav a { color: var(--texte-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.entete nav a[aria-current="page"] { color: var(--texte); background: var(--fond); font-weight: 600; }
.entete nav a:hover { color: var(--texte); }
.bouton-theme { background: none; border: 1px solid var(--bord); color: var(--texte); border-radius: 6px;
  width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; }
@media (min-width: 600px) { .entete nav { order: 0; width: auto; } }
.avertissement { background: var(--alerte-fond); color: var(--alerte-texte); font-size: .9rem; padding-block: 6px; font-weight: 600; }
.bandeau-test { background: var(--mauvais); color: #fff; font-size: .9rem; padding-block: 6px; font-weight: 600; }
:root[data-theme="dark"] .bandeau-test { color: #1a1a19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bandeau-test { color: #1a1a19; } }
.pied { color: var(--texte-3); font-size: .85rem; border-top: 1px solid var(--bord); margin-top: 3rem; padding-block: 1rem 2rem; }
.pied p { margin: .2rem 0; }

/* Tuiles de chiffres clés */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.tuile { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 14px 16px; }
.tuile-valeur { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile-nom { font-weight: 600; margin-top: 2px; }
.tuile-note { color: var(--texte-2); font-size: .85rem; margin-top: 4px; }
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 4px 16px 8px; }
.carte p { font-size: .95rem; color: var(--texte-2); }
.bouton { display: inline-block; background: var(--texte); color: var(--fond); text-decoration: none; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; margin: 4px 6px 4px 0; }
.bouton.secondaire { background: none; color: var(--texte); border: 1px solid var(--bord); }

/* Légende, pastilles, barre de probabilités */
.legende, .probas { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; color: var(--texte-2); }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.dom { background: var(--dom); } .nul { background: var(--nul); } .ext { background: var(--ext); }
.barre { display: flex; gap: 2px; height: 12px; margin: 8px 0 4px; }
.barre .seg { flex: 1 1 0; min-width: 2px; }
.barre .seg:first-child { border-radius: 4px 0 0 4px; } .barre .seg:last-child { border-radius: 0 4px 4px 0; }
.probas strong { color: var(--texte); font-variant-numeric: tabular-nums; }

/* Onglets */
.onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--bord); margin-top: 16px; scrollbar-width: thin; }
.onglets button { flex: none; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--texte-2);
  font: inherit; padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.onglets button[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--texte); font-weight: 600; }
.titre-ligue { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.journee { font-size: 1.15rem; margin: 1.4rem 0 0; }
.date { font-size: .95rem; font-weight: 600; color: var(--texte-2); margin: 1rem 0 .4rem; }

/* Matchs à venir */
.matchs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .matchs { grid-template-columns: 1fr 1fr; } }
.match { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px; }
.match-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.heure { font-weight: 700; font-variant-numeric: tabular-nums; }
.equipes { font-weight: 600; flex: 1 1 60%; overflow-wrap: anywhere; }
.sep { color: var(--texte-3); font-weight: 400; }
.badge { font-size: .75rem; border: 1px solid var(--bord); border-radius: 999px; padding: 1px 8px; color: var(--texte-2); white-space: nowrap; }
.match-pied { margin: 6px 0 0; font-size: .9rem; }
.horodatage { display: block; color: var(--texte-3); font-size: .8rem; margin-top: 2px; }
.vide { color: var(--texte-2); background: var(--surface); border: 1px dashed var(--bord); border-radius: 10px; padding: 16px; }

/* Tableaux */
.defilement { overflow-x: auto; }
.tableau { border-collapse: collapse; width: 100%; font-size: .92rem; background: var(--surface); }
.tableau th, .tableau td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau th { font-size: .8rem; color: var(--texte-2); font-weight: 600; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tr.total td { font-weight: 700; }
.tableau th.groupe { text-align: center; border-left: 1px solid var(--bord); color: var(--texte); }
.tableau th[rowspan] { vertical-align: bottom; }
.matchs-joues td:nth-child(1) { white-space: nowrap; color: var(--texte-2); }
.matchs-joues .barre { width: 120px; height: 8px; margin: 2px 0 4px; }
.sous { display: block; color: var(--texte-3); font-size: .8rem; }
.verdict { white-space: nowrap; font-weight: 600; }
.verdict.bon { color: var(--bon); } .verdict.mauvais { color: var(--mauvais); }
.gagnant { font-weight: 700; }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.filtres label { display: flex; flex-direction: column; font-size: .8rem; color: var(--texte-2); gap: 2px; }
.filtres select { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); min-width: 150px; }

/* Graphique */
.graphique { position: relative; background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 8px; }
.graphique svg { display: block; width: 100%; height: auto; }
.graphique .axe text { fill: var(--texte-3); font-size: 12px; }
.graphique .grille { stroke: var(--grille); stroke-width: 1; }
.graphique .ligne-modele { stroke: var(--texte); stroke-width: 2; fill: none; }
.graphique .ligne-ref { stroke: var(--texte-3); stroke-width: 2; fill: none; stroke-dasharray: 5 4; }
.graphique .point-modele { fill: var(--texte); stroke: var(--surface); stroke-width: 2; }
.graphique .point-ref { fill: var(--texte-3); stroke: var(--surface); stroke-width: 2; }
.graphique .etiquette { fill: var(--texte-2); font-size: 12px; }
.graphique .reticule { stroke: var(--texte-3); stroke-width: 1; }
.trait { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--texte); margin-right: 6px; vertical-align: middle; }
.trait.reference { border-top: 2px dashed var(--texte-3); }
.infobulle { position: absolute; pointer-events: none; background: var(--texte); color: var(--fond); font-size: .8rem;
  padding: 6px 8px; border-radius: 6px; line-height: 1.35; white-space: nowrap; z-index: 5; }

/* Téléphone : chaque match joué devient une fiche, sans défilement horizontal */
@media (max-width: 640px) {
  .matchs-joues thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .matchs-joues, .matchs-joues tbody { display: block; }
  .matchs-joues tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--bord); }
  .matchs-joues td { border: 0; padding: 0; }
  .matchs-joues td:nth-child(1) { grid-area: 1 / 1; font-size: .8rem; }
  .matchs-joues td:nth-child(1) .sous { display: inline; margin-left: 6px; }
  .matchs-joues td:nth-child(5) { grid-area: 1 / 2; text-align: right; }
  .matchs-joues td:nth-child(2) { grid-area: 2 / 1; }
  .matchs-joues td:nth-child(4) { grid-area: 2 / 2; }
  .matchs-joues td:nth-child(3) { grid-area: 3 / 1 / 4 / 3; margin-top: 4px; }
  .matchs-joues td:nth-child(3) .barre { width: 100%; }
  .matchs-joues td:nth-child(6) { grid-area: 4 / 1 / 5 / 3; text-align: left; font-size: .85rem; color: var(--texte-2); white-space: normal; }
  .matchs-joues td:nth-child(6)::before { content: "Probabilité donnée au résultat réel : "; }
}
.defilement { scrollbar-width: thin; scrollbar-color: var(--texte-3) transparent; }

/* Deux versions d'une prédiction : sans / avec la composition officielle */
.version-titre { margin: 8px 0 0; font-size: .8rem; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .03em; }
.version.secondaire { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--bord); opacity: .85; }
.version.secondaire .barre { height: 8px; }
.attente-compo { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--bord); font-size: .8rem; color: var(--texte-3); }
.entete nav a { padding-inline: 8px; }
/* Page Méthode */
.article { max-width: 74ch; }
.article h2 { margin-top: 2.4rem; padding-top: .6rem; border-top: 1px solid var(--bord); }
.formule { display: block; background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; padding: 10px 14px; margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; overflow-x: auto; white-space: pre; }
.sommaire { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 16px 10px 34px; font-size: .95rem; }
.article .tableau { margin: 10px 0; }
.note-tableau { font-size: .85rem; color: var(--texte-2); margin-top: 4px; }
