/* Fantasy Jeudi Soir — style sombre « match du jeudi soir », pensé d'abord pour le téléphone. */

:root {
  --fond: #0d121c;          /* nuit */
  --surface: #151c2a;       /* cartes, tableaux */
  --surface-2: #1d2638;     /* survol, en-têtes de tableau */
  --trait: #2a3548;
  --texte: #e9edf4;
  --texte-doux: #a3adbf;    /* contraste ≥ 7:1 sur --fond */
  --accent: #f6b73c;        /* projecteurs du stade */
  --accent-fonce: #c98d16;
  --vert: #4cc38a;
  --orange: #f0a04b;
  --rouge: #f0716a;
  --rayon: 10px;
  --largeur: 72rem;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 1rem/1.6 var(--police);
}

a { color: var(--accent); text-underline-offset: 0.18em; }
[id] { scroll-margin-top: 8rem; } /* l'en-tête fixe ne cache pas la cible d'une ancre */
a:hover { color: #ffd27a; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin-top: 0.8em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1em; }

.enveloppe { width: min(100% - 2rem, var(--largeur)); margin-inline: auto; }

.aller-au-contenu {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: #111; padding: 0.5rem 0.9rem; border-radius: var(--rayon); font-weight: 600;
}
.aller-au-contenu:focus { top: 1rem; }

/* En-tête et menu */
.entete { background: var(--surface); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 5; }
.entete-interieur { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.5rem; padding-block: 0.65rem; }
.marque { color: var(--texte); text-decoration: none; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.marque strong { color: var(--accent); }
.marque-lune {
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  box-shadow: inset -0.32rem -0.08rem 0 0 var(--accent);
}
nav ul { list-style: none; display: flex; gap: 0.2rem; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
nav a {
  display: block; padding: 0.45rem 0.7rem; border-radius: 999px;
  color: var(--texte-doux); text-decoration: none; white-space: nowrap; font-size: 0.95rem;
}
nav a:hover { color: var(--texte); background: var(--surface-2); }
nav a[aria-current="page"] { color: #111; background: var(--accent); font-weight: 600; }
@media (max-width: 40rem) {
  .entete-interieur > nav { width: 100%; margin-inline: -0.3rem; }
  .entete nav ul { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 2.5rem; }
}

main { padding-bottom: 3rem; }

/* Pied de page */
.pied { border-top: 1px solid var(--trait); color: var(--texte-doux); font-size: 0.9rem; padding: 1.5rem 0 2.5rem; }
.pied p { margin: 0.3rem 0; }

/* Éléments communs */
.chapeau { color: var(--texte-doux); font-size: 1.05rem; max-width: 42rem; }
.mise-a-jour { color: var(--texte-doux); font-size: 0.85rem; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem 1.1rem; }
.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

/* Statuts de blessure */
.statut { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.statut-incertain { color: var(--orange); }
.statut-douteux { color: #f58b5b; }
.statut-forfait, .statut-liste-des-blesses, .statut-suspendu { color: var(--rouge); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--rayon); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.95rem; }
caption { text-align: left; padding: 0.7rem 0.9rem; color: var(--texte-doux); font-size: 0.85rem; caption-side: bottom; }
th, td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--trait); white-space: nowrap; }
th { background: var(--surface-2); color: var(--texte-doux); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.sous-ligne { display: none; }
@media (max-width: 40rem) {
  .col-large { display: none; }
  .sous-ligne { display: block; color: var(--texte-doux); font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.55rem; }
  table.triable td:nth-child(2) { white-space: normal; min-width: 9.5rem; }
}
td.nombre, th.nombre { text-align: right; font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* Articles */
.article { max-width: 44rem; }
.fil { margin: 1rem 0 0; font-size: 0.9rem; }
.texte-article { font-size: 1.05rem; }
.texte-article table { margin: 1rem 0; border: 1px solid var(--trait); border-radius: var(--rayon); }
.texte-article li { margin-bottom: 0.35rem; }
.bandeau-brouillon {
  margin: 1rem 0 0; padding: 0.6rem 0.9rem; border-radius: var(--rayon);
  background: repeating-linear-gradient(45deg, #3a2a08, #3a2a08 12px, #2b2008 12px, #2b2008 24px);
  color: var(--accent); font-weight: 700; border: 1px solid var(--accent-fonce);
}
.liste-articles { list-style: none; padding: 0; display: grid; gap: 0.9rem; }
.liste-articles h2, .liste-articles h3 { margin: 0.1rem 0 0.4rem; font-size: 1.2rem; }
.liste-articles :is(h2, h3) a { color: var(--texte); text-decoration: none; }
.liste-articles :is(h2, h3) a:hover { color: var(--accent); }

/* Accueil */
.accroche { padding: 1.5rem 0 0.5rem; }
.accroche h1 { max-width: 30rem; }
.carte h3 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.top3 { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; margin: 0; }
.top3 dt { font-weight: 700; color: var(--accent); font-family: var(--chiffres); }
.top3 dd { margin: 0; }
.gros-chiffre { font-size: 2.6rem; font-weight: 800; line-height: 1; margin: 0.2rem 0 0.4rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.liste-articles p { margin: 0; }
.texte-brouillon { color: var(--accent); text-transform: uppercase; font-size: 0.8rem; }
.avertissement { margin-top: 2rem; color: var(--texte-doux); font-size: 0.9rem; border-top: 1px solid var(--trait); padding-top: 1rem; }

/* Blessures */
.liste-blesses { list-style: none; padding: 0; margin: 0; }
.liste-blesses li { padding: 0.55rem 0; border-top: 1px solid var(--trait); }
.liste-blesses li:first-child { border-top: 0; padding-top: 0; }
.liste-blesses .poste { color: var(--texte-doux); font-size: 0.85rem; }
.liste-blesses .detail { display: block; color: var(--texte-doux); font-size: 0.9rem; }
.carte h2 { margin: 0 0 0.6rem; font-size: 1.15rem; color: var(--accent); }

/* Byes */
.liste-byes { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.semaine-byes { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 0.8rem 1rem; }
.semaine-byes.passee { opacity: 0.55; }
.semaine-byes.a-venir { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.semaine-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; margin-bottom: 0.5rem; }
.semaine-titre .detail { color: var(--texte-doux); font-size: 0.9rem; }
.badge { background: var(--accent); color: #111; font-weight: 700; font-size: 0.75rem; padding: 0.1rem 0.55rem; border-radius: 999px; }
.equipes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.equipes li { font-family: var(--chiffres); background: var(--surface-2); border-radius: 6px; padding: 0.15rem 0.55rem; font-weight: 600; }

/* Compositions */
.grille-compositions { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.composition h3 { margin: 0.9rem 0 0.3rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-doux); }
.postes { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.8rem; margin: 0; font-size: 0.95rem; }
.postes dt { color: var(--texte-doux); white-space: nowrap; }
.postes dd { margin: 0; }
.postes .joueur { color: var(--texte-doux); }
.postes .titulaire { color: var(--texte); font-weight: 600; }
.etiquette-nouveau { display: inline-block; background: var(--vert); color: #0b1a12; font-size: 0.7rem; font-weight: 700; padding: 0 0.4rem; border-radius: 4px; text-transform: uppercase; }

/* Onglets des postes (classements) */
.onglets ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 1rem 0 0.5rem; }
.onglets a {
  display: block; min-width: 3.2rem; text-align: center; padding: 0.45rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--trait); color: var(--texte); text-decoration: none; font-weight: 600;
}
.onglets a:hover { background: var(--surface-2); }
.onglets a[aria-current] { background: var(--accent); border-color: var(--accent); color: #111; }
.avec-onglets section.poste > h2 { margin-top: 1rem; }

/* En-têtes de colonnes triables */
.bouton-tri {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem;
}
.bouton-tri:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bouton-tri::after { content: "↕"; opacity: 0.45; font-size: 0.9em; }
th[aria-sort="ascending"] .bouton-tri::after { content: "↑"; opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .bouton-tri::after { content: "↓"; opacity: 1; color: var(--accent); }

/* Emplacements de publicité : présents dans chaque page, invisibles tant que la pub n'est pas activée.
   Avec la classe « pub-active » sur <body>, ils prennent une hauteur fixe : la page ne bouge pas au chargement des annonces. */
.emplacement-pub { display: none; }
.pub-active .emplacement-pub { display: block; min-height: 100px; margin: 1.5rem 0; }
@media (min-width: 48rem) { .pub-active .emplacement-pub { min-height: 90px; } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
