/* Nuit du Basket – style
   Concept : un tableau de marque de nuit. Fond bleu nuit, or du JCBF pour l'action,
   chiffres condensés façon panneau de score. Thème sombre assumé (la « Nuit »). */
/* Polices hébergées sur le site (licence SIL OFL) : pas d'appel à Google, plus rapide sur mobile */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); }
:root {
  /* Couleurs de l'affiche officielle 2026 : fond blanc et bleu ciel, orange et bleu */
  --nuit: #F2F7FC;        /* fond de page (bleu ciel très pâle) */
  --panneau: #FFFFFF;     /* cartes */
  --panneau-2: #E8F1FA;   /* cartes secondaires, champs */
  --trait: #D3E1EF;       /* bordures */
  --texte: #10233F;       /* texte principal (bleu nuit) */
  --doux: #55667E;        /* texte secondaire */
  --or: #C2500A;          /* orange d'action (boutons) : 4,6:1 avec du blanc */
  --or-fonce: #A84504;    /* orange lisible en petit texte */
  --sur-or: #FFFFFF;      /* texte posé sur l'orange */
  --orange: #EA6606;      /* orange vif (titres) */
  --bleu: #2472B4;        /* bleu de l'affiche : liens, titres */
  --bleu-clair: #3684C0;
  --sur-bleu: #FFFFFF;
  --rouge-plein: #D7363C; /* fond des boutons rouges (texte blanc) */
  --vert: #178A4E;
  --rouge: #D7363C;
  --rouge-texte: #B8232A;
  --rouge-doux: rgba(215, 54, 60, .10);
  --rouge-bord: rgba(215, 54, 60, .45);
  --ombre: 0 1px 2px rgba(16, 35, 63, .06), 0 4px 14px rgba(16, 35, 63, .06);
  --entete: rgba(255, 255, 255, .95);  /* en-tête et menu du bas */
  --champ: #FFFFFF;                    /* champs de formulaire */
  --hero-fond: radial-gradient(120% 90% at 85% 10%, #DCEBFA 0%, #F4F9FE 45%, #FFFFFF 75%);
  --live-fond: linear-gradient(160deg, #FFF1E6, #FFFFFF 70%);
  --teinte-fond: 75% 93%; --teinte-bord: 45% 80%; --teinte-texte: 55% 30%; /* initiales colorées */
  --wa-texte: #13834A;
  --f-titre: "Fredoka", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  --f-score: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-texte: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px;       /* arrondi des éléments */
  --r-bloc: 20px;  /* arrondi des grands blocs */
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nuit); color: var(--texte); font: 15px/1.5 var(--f-texte); }
a { color: var(--bleu); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--doux); }

/* ---------- En-tête ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--nuit); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--entete); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.top-in, .wrap, .foot-in, .annonce-in { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top-in { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); flex-shrink: 0; }
.brand img { width: 40px; height: 40px; }
.brand b { font: 700 21px/1 var(--f-titre); letter-spacing: .01em; text-transform: uppercase; color: var(--bleu); }
.brand b span { color: var(--orange); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--doux); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--texte); }
.nav a.on { color: var(--nuit); background: var(--texte); }
.nav a.cta { color: var(--nuit); background: var(--or); }
.nav a.cta.on { background: var(--or); box-shadow: 0 0 0 2px var(--texte) inset; }
.top-live { display: none; margin-left: auto; white-space: nowrap; flex: none; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--rouge-doux); color: var(--rouge-texte); font-weight: 700; font-size: 13px; text-decoration: none; text-transform: uppercase; letter-spacing: .05em; }
.top-live i, .tb-cta.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--rouge); animation: pulse 1.4s infinite; }

/* Menu du bas (téléphone) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .top-live:not([hidden]) { display: inline-flex; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    background: var(--entete); backdrop-filter: blur(8px); border-top: 1px solid var(--trait);
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 4px 2px; border-radius: var(--r); color: var(--doux); text-decoration: none; font-size: 11px; font-weight: 600; line-height: 1.1; min-height: 48px; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--texte); background: var(--panneau-2); }
  .tabbar a.tb-cta { color: var(--sur-or); background: var(--or); }
  .tabbar a.tb-cta.live { color: #fff; background: var(--rouge-plein); }
  .tabbar a.tb-cta.live svg { display: none; }
  .tabbar a.tb-cta.live i { background: #fff; width: 10px; height: 10px; margin: 6px 0; }
  .tabbar a.tb-cta.neutre { color: var(--texte); background: var(--panneau-2); }
  .foot-in { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
/* Mode table de marque : plein écran, sans menus */
body.mode-table .top, body.mode-table .foot, body.mode-table .tabbar, body.mode-table .annonce { display: none !important; }
body.mode-table main.wrap { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.annonce { background: var(--bleu); color: var(--sur-bleu); font-weight: 600; font-size: 14px; }
.annonce-in { padding-block: 8px; }
.demo-flag { position: fixed; z-index: 40; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--orange); color: #fff; font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }

main.wrap { padding-block: 20px 56px; min-height: 60vh; }

/* ---------- Héros ---------- */
/* Bannière compacte : photo d'un match à Pissy + affiche officielle en miniature (cliquable) */
.hero {
  /* Mode clair : la photo apparaît à travers un voile blanc et bleu ciel, comme le fond de l'affiche */
  --ban-voile: linear-gradient(90deg, rgba(255, 255, 255, .97) 0%, rgba(244, 249, 254, .9) 48%, rgba(226, 238, 250, .55) 100%);
  --ban-voile-tel: linear-gradient(180deg, rgba(255, 255, 255, .86) 0%, rgba(244, 249, 254, .96) 55%);
  --ban-fond: #EAF3FC;
  --ban-texte: var(--texte); --ban-doux: var(--doux);
  --ban-t1: var(--orange); --ban-t2: var(--bleu); --ban-t3: var(--bleu); --ban-dates: var(--or);
  --ban-case: rgba(255, 255, 255, .85); --ban-case-bord: var(--trait); --ban-chiffre: var(--bleu);
  --ban-ghost-fond: rgba(255, 255, 255, .85); --ban-ghost: var(--bleu);
  --ban-etiquette: rgba(255, 255, 255, .9); --ban-etiquette-texte: var(--texte);
  position: relative; border-radius: var(--r-bloc); overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 26px clamp(18px, 4vw, 40px); color: var(--ban-texte); box-shadow: var(--ombre); border: 1px solid var(--trait);
  background: var(--ban-fond) url("../img/hero.jpg") 38% 30% / 160% auto no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--ban-voile); pointer-events: none; }
:root[data-theme="dark"] .hero {
  /* Mode sombre : photo sous un voile bleu nuit */
  --ban-voile: linear-gradient(90deg, rgba(10, 22, 42, .94) 0%, rgba(10, 22, 42, .8) 50%, rgba(10, 22, 42, .62) 100%);
  --ban-voile-tel: linear-gradient(180deg, rgba(10, 22, 42, .78) 0%, rgba(10, 22, 42, .93) 60%);
  --ban-fond: #0A162A;
  --ban-texte: #E6EEF8; --ban-doux: #C9D8EC;
  --ban-t1: #FF8A33; --ban-t2: #8CC4F5; --ban-t3: #fff; --ban-dates: #FF8A33;
  --ban-case: rgba(10, 22, 42, .7); --ban-case-bord: rgba(255, 255, 255, .25); --ban-chiffre: #fff; /* opaque : la photo ne colore pas les chiffres */
  --ban-ghost-fond: rgba(255, 255, 255, .1); --ban-ghost: #fff;
  --ban-etiquette: rgba(255, 255, 255, .14); --ban-etiquette-texte: #fff;
  border-color: transparent; }
.hero::after { content: ""; position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--orange), var(--bleu-clair)); }
.hero-in { position: relative; z-index: 2; display: grid; gap: 8px; min-width: 0; }
.eyebrow { margin: 0; color: var(--ban-doux); font-weight: 600; font-size: 13px; }
.titre-affiche { margin: 0; font-family: var(--f-titre); font-weight: 700; text-transform: uppercase; line-height: .95; font-size: clamp(34px, 5.4vw, 58px); }
.titre-affiche .t1 { color: var(--ban-t1); display: block; } /* « LA NUIT » puis « du BASKET » : deux lignes nettes */
.titre-affiche .t2 { color: var(--ban-t2); font-size: .5em; text-transform: lowercase; margin: 0 .15em; vertical-align: .35em; }
.titre-affiche .t3 { color: var(--ban-t3); }
.edition { margin: 0; font: 700 15px/1 var(--f-titre); color: var(--ban-doux); }
.edition sup { font-size: .65em; }
.hero-dates { margin: 2px 0 0; font: 700 clamp(20px, 3vw, 28px)/1.1 var(--f-titre); color: var(--ban-dates); text-transform: uppercase; }
.hero-lieu { margin: 0; font-weight: 600; color: var(--ban-texte); line-height: 1.6; } /* texte qui passe à la ligne naturellement */
.hero-lieu svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; vertical-align: -3px; margin-right: 4px; }
.hero-lieu .gratuit { display: inline-block; margin-left: 6px; line-height: 1.4; padding: 2px 8px; border-radius: 999px; background: #2472B4; color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; white-space: nowrap; } /* bleu fixe : 5,1:1 en clair comme en sombre */
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.hero-cta .btn.ghost { background: var(--ban-ghost-fond); border-color: var(--ban-ghost); color: var(--ban-ghost); }
.count { display: flex; gap: 8px; flex-wrap: wrap; }
.count > div { background: var(--ban-case); border: 1px solid var(--ban-case-bord); border-radius: var(--r); padding: 6px 12px; text-align: center; min-width: 64px; }
.count b { display: block; font: 800 26px/1 var(--f-score); font-variant-numeric: tabular-nums; color: var(--ban-chiffre); }
.count small { color: var(--ban-doux); font-size: 11px; }
.count > span { color: var(--ban-texte); }
/* Affiche en miniature, encadrée, légèrement inclinée ; un clic l'ouvre en grand */
.affiche-mini { position: relative; z-index: 2; display: grid; gap: 8px; justify-items: center; text-decoration: none; color: var(--ban-etiquette-texte); font-size: 13px; font-weight: 700; }
.affiche-mini img { display: block; width: clamp(150px, 17vw, 200px); height: auto; aspect-ratio: 4 / 5; border: 5px solid #fff; border-radius: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); transform: rotate(3deg); transition: transform .2s; }
.affiche-mini:hover img, .affiche-mini:focus-visible img { transform: rotate(0deg) scale(1.03); }
.affiche-mini span { display: inline-flex; align-items: center; gap: 6px; background: var(--ban-etiquette); box-shadow: var(--ombre); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 760px) {
  /* Téléphone : texte en pleine largeur, affiche en vignette dans le coin */
  .hero { grid-template-columns: 1fr; padding: 20px 16px 22px; gap: 14px;
    background: var(--ban-fond) url("../img/hero.jpg") 45% 30% / cover; }
  .hero::before { background: var(--ban-voile-tel); }
  .hero-in { padding-right: 92px; }
  .affiche-mini { position: absolute; top: 18px; right: 14px; }
  .affiche-mini img { width: 78px; border-width: 3px; }
  .affiche-mini span { font-size: 11px; padding: 3px 8px; }
  .hero-cta, .count { margin-right: -92px; } /* les boutons reprennent toute la largeur sous la vignette */
  .hero-cta { flex-wrap: nowrap; gap: 8px; }
  .hero-cta .btn { flex: 1 1 auto; padding: 10px 10px; font-size: 14px; white-space: nowrap; }
  .count > div { padding: 5px 10px; min-width: 58px; }
  .count b { font-size: 22px; }
}
/* Pendant le tournoi : bannière réduite, le direct passe devant */
.hero.compact { margin-top: 24px; padding-block: 16px; }
.hero.compact .count, .hero.compact .hero-cta, .hero.compact .eyebrow { display: none; }
.hero.compact .titre-affiche { font-size: clamp(26px, 4vw, 36px); }
.hero.compact .affiche-mini img { width: 90px; }
@media (max-width: 760px) { .hero.compact .affiche-mini img { width: 60px; } .hero.compact .hero-in { padding-right: 72px; } }
.live-first { margin-bottom: 4px; }
.live-first h2 { margin-top: 0; }

/* ---------- Boutons, pastilles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--trait); background: var(--panneau-2); color: var(--texte); padding: 10px 18px; border-radius: var(--r); font-weight: 700; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { border-color: var(--doux); }
.btn.primary { background: var(--or); border-color: var(--or); color: var(--sur-or); }
.btn.primary:hover { background: var(--or-fonce); }
.btn.ghost { background: transparent; border-color: var(--bleu); color: var(--bleu); }
.btn.neutre { background: var(--texte); border-color: var(--texte); color: var(--nuit); }
.btn.neutre:hover { opacity: .9; }
.btn.danger { background: transparent; border-color: var(--rouge-bord); color: var(--rouge-texte); }
.btn.armed { background: var(--rouge-plein); border-color: var(--rouge-plein); color: #fff; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--bleu); cursor: pointer; padding: 0 4px; font-weight: 600; font-size: 13px; }
.link.danger { color: var(--rouge-texte); }
.link.armed { color: #fff; background: var(--rouge); border-radius: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--panneau-2); color: var(--doux); white-space: nowrap; }
.pill.ok { background: rgba(53, 194, 123, .15); color: var(--vert); }
.pill.fin { color: var(--texte); }
.pill.live { background: var(--rouge-doux); color: var(--rouge-texte); }
.pill.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--rouge); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pill.live i, .top-live i, .tb-cta.live i { animation: none; } }
.chip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--panneau-2); border: 1px solid var(--trait); color: var(--or); white-space: nowrap; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--or); color: var(--sur-or); font-size: 12px; line-height: 20px; text-align: center; }
.badge.live { background: var(--rouge-plein); color: #fff; }
.badge.soft { background: var(--trait); color: var(--texte); }

/* ---------- Sections ---------- */
.block { margin-top: 28px; }
.block-h .row { gap: 14px; }
.block-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h2, .sec { font: 700 24px/1.15 var(--f-titre); text-transform: uppercase; letter-spacing: .01em; color: var(--bleu); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec { margin-top: 28px; }
h3 { font: 700 18px/1.2 var(--f-titre); text-transform: uppercase; color: var(--texte); margin: 0 0 8px; }
.more { font-weight: 600; font-size: 14px; text-decoration: none; display: inline-block; padding: 10px 0; margin: -10px 0; }
.page-h { margin-bottom: 18px; }
.page-h h1 { margin: 0; font: 700 clamp(32px, 6vw, 52px)/1 var(--f-titre); text-transform: uppercase; color: var(--orange); }
.page-h p { margin: 6px 0 0; color: var(--doux); max-width: 65ch; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.cols > * { min-width: 0; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.empty { border: 1px dashed var(--trait); border-radius: var(--r); padding: 22px; text-align: center; color: var(--doux); }
.empty strong { color: var(--texte); display: block; margin-bottom: 4px; }
.empty p { margin: 0; }
.loading { padding: 60px 0; text-align: center; color: var(--doux); }
.note { color: var(--doux); font-size: 14px; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 10px 14px; }
.day-info { color: var(--doux); font-size: 14px; margin: 4px 0 12px; }
.err { color: var(--rouge-texte); font-weight: 600; margin: 0; }

/* ---------- Onglets ---------- */
/* Les filtres passent à la ligne au lieu de disparaître hors de l'écran */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tab { white-space: nowrap; border: 1px solid var(--trait); background: var(--panneau); color: var(--doux); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 42px; }
.tab.on { background: var(--texte); color: var(--nuit); border-color: var(--texte); }

/* ---------- Places ---------- */
.places { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .places { grid-template-columns: repeat(2, 1fr); } }
.place { display: grid; gap: 6px; background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px; color: var(--texte); text-decoration: none; }
.place:hover { border-color: var(--or); }
.pl-cat { font: 700 17px/1 var(--f-titre); text-transform: uppercase; }
.pl-num { color: var(--doux); font-size: 14px; }
.pl-num b { color: var(--bleu); font: 800 26px/1 var(--f-score); margin-right: 2px; }
.bar { height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bleu); border-radius: 3px; }
.pl-prix { font-size: 13px; color: var(--doux); }

/* ---------- Lignes de match ---------- */
.list { display: grid; gap: 8px; }
.mrow { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--trait); border-radius: var(--r); padding: 10px 14px; }
.mrow.en_cours { border-color: var(--rouge-bord); box-shadow: 0 0 0 1px var(--rouge-doux) inset; }
.mtime { font: 800 22px/1 var(--f-score); font-variant-numeric: tabular-nums; }
.mtime small { display: block; font: 600 12px/1.3 var(--f-texte); color: var(--doux); margin-top: 4px; }
.mteams { display: grid; gap: 4px; min-width: 0; }
.mteams .t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mteams .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mteams .t b { font: 800 22px/1 var(--f-score); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.mteams .t.win span, .mteams .t.win b { color: var(--texte); font-weight: 800; }
.mteams .t.lose { opacity: .62; }
.mteams.ev strong { font-weight: 700; }
.mteams .res { color: var(--bleu); font-size: 14px; }
@media (max-width: 520px) {
  .mrow { grid-template-columns: 64px 1fr; }
  .mstat { grid-column: 2; }
  .mtime { font-size: 19px; }
}
/* Repère « Maintenant » dans le programme */
.now-mark { display: flex; align-items: center; gap: 10px; color: var(--rouge); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; scroll-margin: 120px; }
.now-mark::before, .now-mark::after { content: ""; flex: 1; height: 2px; background: var(--rouge-bord); }

/* ---------- Direct ---------- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
@media (max-width: 420px) { .live-grid { grid-template-columns: 1fr; } }
.live-card { background: var(--live-fond); border: 1px solid var(--rouge-bord); border-radius: var(--r); padding: 14px 16px; }
.lc-meta { display: flex; gap: 10px; align-items: center; color: var(--doux); font-size: 13px; flex-wrap: wrap; }
.lc-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 10px; }
.lc-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lc-team.r { justify-content: flex-end; text-align: right; }
.lc-team span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.lc-team b { font: 800 52px/1 var(--f-score); color: var(--texte); font-variant-numeric: tabular-nums; }
.lc-sep { font: 800 30px/1 var(--f-score); color: var(--doux); }

/* ---------- Classements ---------- */
.poules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; }
@media (max-width: 420px) { .poules { grid-template-columns: 1fr; } }
.poule { background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px; min-width: 0; }
.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--trait); }
@media (max-width: 420px) { th, td { padding: 7px 3px; font-size: 13px; } }
th { color: var(--doux); font-weight: 600; font-size: 12px; text-transform: uppercase; }
th.l, td.l { text-align: left; }
td.nm { font-weight: 600; white-space: nowrap; }
td.rk { color: var(--doux); width: 24px; }
td.pts { font: 800 18px/1 var(--f-score); color: var(--texte); }
tr.top td.rk { color: var(--bleu); font-weight: 800; }
tr.top td:first-child { box-shadow: 3px 0 0 var(--bleu) inset; }
.legend { color: var(--doux); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.legend i { width: 3px; height: 14px; background: var(--bleu); display: inline-block; }
/* Téléphone : colonnes essentielles seulement ; toucher le tableau montre tout */
.poule { cursor: pointer; }
.astuce { display: none; color: var(--doux); font-size: 13px; margin: 0 0 10px; }
@media (max-width: 520px) {
  .poule:not(.tout) .c-x { display: none; }
  .astuce { display: block; }
  td.nm { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.round { display: grid; gap: 8px; align-content: start; }

/* ---------- Équipes ---------- */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.team { background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.team-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.team p { margin: 2px 0 0; font-size: 14px; }
details summary { cursor: pointer; color: var(--bleu); font-size: 14px; margin-top: 6px; }
.roster { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 14px; }
.roster li { display: flex; align-items: center; gap: 8px; }
.roster b { display: inline-block; width: 24px; text-align: center; color: var(--bleu); font-family: var(--f-score); font-size: 16px; }

/* ---------- Formulaires ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 860px) { .cat-cards { grid-template-columns: repeat(2, 1fr); } }
.cat-card { text-align: left; display: grid; gap: 4px; background: var(--panneau); border: 2px solid var(--trait); border-radius: var(--r); padding: 14px; cursor: pointer; }
.cat-card:hover { border-color: var(--doux); }
.cat-card.on { border-color: var(--or); background: var(--panneau-2); }
.cc-l { font: 700 18px/1 var(--f-titre); text-transform: uppercase; }
.cc-p { color: var(--bleu); font: 800 24px/1 var(--f-score); }
.cc-p small { color: var(--doux); font: 500 13px var(--f-texte); }
.cc-s { font-size: 13px; color: var(--vert); }
.cc-s.full { color: var(--orange); }
.form { display: grid; gap: 14px; background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--trait); border-radius: var(--r); padding: 18px; margin-top: 18px; max-width: 760px; }
.form.narrow { max-width: 420px; }
.form h2 { margin: 0; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea { width: 100%; background: var(--champ); border: 1px solid var(--trait); border-radius: var(--r); padding: 10px 12px; min-height: 44px; font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: var(--or); outline: none; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; margin: 0; display: grid; gap: 10px; }
legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.players { display: grid; gap: 8px; }
.player { display: grid; grid-template-columns: 18px 44px 1fr 60px 28px; gap: 8px; align-items: center; }
.player.ed { grid-template-columns: 44px 1fr 60px 28px; }
.player span { color: var(--doux); font-family: var(--f-score); font-size: 18px; text-align: right; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--or); }
label.check.big { font-weight: 700; font-size: 16px; }
.checks { display: grid; gap: 8px; }
.done { background: var(--panneau); border: 1px solid var(--or); border-radius: var(--r); padding: 20px; max-width: 760px; display: grid; gap: 12px; }
.done .big { font-size: 18px; margin: 0; }
.ref { font: 800 24px/1 var(--f-score); color: var(--texte); letter-spacing: .05em; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Admin ---------- */
.admin-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.admin-tabs { margin-bottom: 16px; }
.ad-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ad-bar .tabs { margin: 0; }
.pupitres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.pupitre { background: var(--panneau-2); border: 1px solid var(--rouge-bord); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.pp-meta { color: var(--doux); font-size: 13px; }
.pp-score { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pp-team { display: grid; gap: 6px; justify-items: center; text-align: center; min-width: 0; }
.pp-team span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.pp-team b { font: 800 56px/1 var(--f-score); color: var(--texte); font-variant-numeric: tabular-nums; }
.pp-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
.pp-btns .btn { padding: 0; min-height: 44px; font-size: 16px; }
.adrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.adrow .adl { min-width: 0; }
.adbtns { display: flex; gap: 6px; }
@media (max-width: 620px) { .adrow { grid-template-columns: 1fr; } .adbtns { justify-content: flex-end; } }
.inscs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.insc { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px; display: grid; gap: 6px; min-width: 0; }
.insc.en_attente { border-color: rgba(226, 96, 10, .5); }
.insc.refusee { opacity: .7; }
.insc h3 { margin: 0; }
.insc p { margin: 0; font-size: 14px; }
.insc-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.insc-h .ref { font-size: 18px; }
.insc-h .st { margin-left: auto; font-weight: 700; }
.insc.validee .st { color: var(--vert); } .insc.en_attente .st { color: var(--or-fonce); } .insc.refusee .st { color: var(--rouge-texte); }
.msg { font-style: italic; color: var(--doux); }
.ad-cat { margin-top: 22px; }
.eqs { display: grid; gap: 6px; }
.eq { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 10px; align-items: center; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 8px 12px; }
.eq .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
label.inline select { width: auto; min-height: 36px; padding: 4px 8px; }
@media (max-width: 560px) { .eq { grid-template-columns: 1fr auto; } .eq .muted { display: none; } }
.inline-form { display: grid; grid-template-columns: 160px 1fr 1fr auto; gap: 8px; align-items: center; padding: 12px; max-width: none; }
@media (max-width: 720px) { .inline-form { grid-template-columns: 1fr; } }
.gen { max-width: none; }
.qual { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.qual ul { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.qual p { font-size: 13px; margin: 8px 0 0; }
.dlg-back { position: fixed; inset: 0; z-index: 50; background: rgba(16, 35, 63, .45); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.dlg { margin: 0; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(16, 35, 63, .25); }

/* ---------- Pied de page, toast ---------- */
.foot { border-top: 1px solid var(--trait); color: var(--doux); font-size: 13px; }
.foot-in { padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot a { color: var(--bleu); display: inline-block; padding: 10px 2px; margin: -10px 0; }
.foot .partenaires { flex-basis: 100%; color: var(--or-fonce); font-weight: 600; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--texte); color: var(--nuit); font-weight: 700; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--rouge-plein); color: #fff; }

/* ---------- Logos et photos ---------- */
.lg { --t: 28px; flex: none; width: var(--t); height: var(--t); border-radius: 8px; overflow: hidden; display: inline-grid; place-items: center;
  background: var(--panneau-2); border: 1px solid var(--trait); color: var(--doux); font: 700 calc(var(--t) * .38)/1 var(--f-texte); letter-spacing: .02em; }
.lg img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.lg.rond { border-radius: 50%; }
.lg.rond img { object-fit: cover; }
.lg.xs { --t: 22px; border-radius: 6px; }
.lg.sm { --t: 32px; }
.lg.md { --t: 40px; }
.lg.lgx { --t: 52px; border-radius: var(--r); }
.lg.av { --t: 32px; }
.tn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.tn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mteams .t .tn span { font-weight: 600; }
.lc-n { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.lc-team.r .lc-n { align-items: flex-end; }
.lc-n > span:last-child { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.team-h .grow, .eq-top .grow { flex: 1; min-width: 0; }
.team-h { justify-content: flex-start; }
.team-h .chip { margin-left: auto; }
.grow { min-width: 0; }

/* Champ d'envoi d'image */
.up { display: flex; align-items: center; gap: 10px; }
.up-zone { position: relative; width: 88px; height: 88px; border-radius: var(--r); border: 2px dashed var(--trait); background: var(--panneau-2);
  display: grid; place-items: center; overflow: hidden; cursor: pointer; flex: none; transition: border-color .15s; }
.up-zone:hover, .up-zone:focus-within { border-color: var(--or); }
.up-zone.plein { border-style: solid; }
.up.rond .up-zone { border-radius: 50%; }
.up-zone img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.up.rond .up-zone img { object-fit: cover; }
.up-in { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.up-vide { display: grid; justify-items: center; gap: 2px; color: var(--doux); text-align: center; padding: 4px; pointer-events: none; }
.up-vide b { font: 700 26px/1 var(--f-texte); color: var(--or); }
.up-vide small { font-size: 11px; line-height: 1.2; }
.up-busy { font-size: 11px; color: var(--bleu); pointer-events: none; }
.up.petit .up-zone { width: 44px; height: 44px; border-width: 1.5px; }
.up.petit .up-vide b { font-size: 20px; }
.up.petit .up-busy { font-size: 9px; }
.insc-logo { display: flex; align-items: center; gap: 14px; }
.insc-logo .muted { margin: 0; font-size: 14px; }
.eq-top { display: flex; gap: 14px; align-items: flex-start; }

/* Initiales des équipes sans logo : une couleur par équipe (--h = teinte calculée sur le nom) */
.lg.teinte { background: hsl(var(--h) var(--teinte-fond)); border-color: hsl(var(--h) var(--teinte-bord)); color: hsl(var(--h) var(--teinte-texte)); }

/* ---------- Inscription ---------- */
.cat-choisie { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panneau); border: 2px solid var(--or); border-radius: var(--r); padding: 12px 14px; }
.cat-choisie b { font: 700 18px/1 var(--f-titre); text-transform: uppercase; }
.cat-choisie .cc-p { font-size: 20px; }
.cat-choisie .btn { margin-left: auto; }
input.invalid, textarea.invalid { border-color: var(--rouge); box-shadow: 0 0 0 1px var(--rouge); }
label.check.invalid span { color: var(--rouge-texte); }
.field-err { color: var(--rouge-texte); font-weight: 600; font-size: 13px; margin: -4px 0 0; }
.player .link.danger { font-size: 16px; padding: 4px; }
.done .row .btn { flex: 1 1 auto; }
.btn.wa { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn.wa:hover { background: #24BF61; }
.btn.block { width: 100%; }
/* Bouton d'envoi qui indique ce qui manque : reste cliquable, mais moins appuyé */
.btn.primary.incomplet { background: transparent; color: var(--or); border-style: dashed; }
#i-envoyer { width: 100%; min-height: 52px; }

/* ---------- Admin : lignes cliquables ---------- */
.adrow { cursor: pointer; border-radius: var(--r); }
.adrow:hover .mrow, .adrow:focus-visible .mrow { border-color: var(--doux); }
.adrow .adbtns:empty { display: none; }
@media (max-width: 620px) { .adrow { grid-template-columns: 1fr auto; } }
.tel { color: var(--texte); font-weight: 600; text-decoration: none; }
.lien-wa { color: var(--wa-texte); font-weight: 700; font-size: 13px; text-decoration: none; }
.btn.table-cta { width: 100%; min-height: 56px; font-size: 17px; }

/* ---------- Mode table de marque ---------- */
.tm-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tm-h h1 { margin: 0; font: 700 26px/1 var(--f-titre); color: var(--orange); text-transform: uppercase; }
.tm { background: var(--panneau); box-shadow: var(--ombre); border: 1px solid var(--rouge-bord); border-radius: var(--r); padding: 14px; display: grid; gap: 14px; margin-bottom: 14px; }
.tm-meta { display: flex; gap: 10px; align-items: center; color: var(--doux); font-size: 14px; flex-wrap: wrap; }
.tm-score { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tm-team { display: grid; gap: 8px; justify-items: center; text-align: center; min-width: 0; background: var(--panneau-2); border-radius: var(--r); padding: 12px 8px; }
.tm-team .nm { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tm-team .sc { font: 800 84px/1 var(--f-score); color: var(--texte); font-variant-numeric: tabular-nums; }
/* +1 / +2 / +3 empilés : toute la largeur de l'équipe, impossible de se tromper de bouton */
.tm-plus { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; }
.tm-plus .btn { min-height: 60px; font: 800 28px/1 var(--f-score); padding: 0; background: var(--or); border-color: var(--or); color: var(--sur-or); }
@media (min-width: 700px) { .tm-plus { grid-template-columns: repeat(var(--n, 3), 1fr); } }
.tm-plus .btn:active { transform: scale(.96); }
.tm-moins { min-height: 40px; font-size: 14px; color: var(--doux); }
.tm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-actions .btn { min-height: 52px; }
/* Fautes d'équipe : 5 pastilles, tout passe en rouge au seuil */
.fautes { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--doux); white-space: nowrap; }
.fautes b { font: 800 20px/1 var(--f-score); color: var(--texte); }
.puces { display: inline-flex; gap: 3px; }
.puces i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--doux); }
.puces i.on { background: var(--orange); border-color: var(--orange); }
.fautes.rouge { color: var(--rouge-texte); font-weight: 800; }
.fautes.rouge b { color: var(--rouge-texte); }
.fautes.rouge .puces i { background: var(--rouge); border-color: var(--rouge); }
.lc-fautes { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tm-team.rouge { background: rgba(215, 54, 60, .14); box-shadow: 0 0 0 2px var(--rouge) inset; }
.tm-fautes { display: grid; grid-template-columns: 1fr auto; gap: 6px; width: 100%; align-items: center; border-top: 1px solid var(--trait); padding-top: 8px; }
.tm-fautes .fautes { grid-column: 1 / -1; justify-content: center; }
.tm-faute { min-height: 48px; border-color: var(--rouge-bord); color: var(--rouge-texte); font-weight: 800; }
.tm-fautes .btn.sm { min-height: 48px; }
/* Règlement 5x5 sur la table de marque */
.pill.prolong { background: var(--panneau-2); color: var(--bleu); }
.tm-victoire { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: rgba(53, 194, 123, .14); border: 2px solid var(--vert); border-radius: var(--r); padding: 12px 14px; }
.tm-victoire div { display: grid; gap: 2px; }
.tm-victoire b { font: 700 20px/1.1 var(--f-titre); text-transform: uppercase; color: var(--vert); }
.tm-victoire span { color: var(--doux); font-size: 13px; }
.tm-victoire .btn { min-height: 52px; }
.tm-team.gagne { box-shadow: 0 0 0 2px var(--vert) inset; }
.tm-prol { color: var(--bleu); font-size: 13px; font-weight: 700; }
.tm-lf { grid-column: 1 / -1; text-align: center; color: var(--rouge-texte); font-size: 12px; font-weight: 700; }
.tm-tm { width: 100%; min-height: 44px; }
div.tm-tm { display: grid; place-items: center; border-radius: var(--r); font-size: 13px; color: var(--doux); border: 1px dashed var(--trait); }
div.tm-tm.en-cours { color: var(--sur-or); background: var(--or); border: 0; font-weight: 700; }
div.tm-tm.en-cours b { font: 800 22px/1 var(--f-score); }
.tm-prolonger { width: 100%; min-height: 52px; border-color: var(--or); color: var(--or); }
.tm-note { margin: 0; font-size: 13px; color: var(--doux); background: var(--panneau); border-radius: var(--r); padding: 10px 12px; }

/* Page Règlement */
.regle { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 16px 18px; max-width: 760px; margin-bottom: 14px; }
.regle h2 { margin-bottom: 10px; }
.regle ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.regle li::marker { color: var(--bleu); font-weight: 800; }
.tm-suivant { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.tm-suivant .btn { min-height: 56px; font-size: 17px; }
.tm-vide { text-align: center; padding: 24px 14px; }
@media (max-width: 380px) { .tm-team .sc { font-size: 68px; } .tm-plus .btn { min-height: 56px; } }
.eq .link { white-space: nowrap; }
@media (max-width: 560px) {
  .player { grid-template-columns: 14px 44px 1fr 48px 24px; gap: 6px; }
  .player.ed { grid-template-columns: 44px 1fr 52px 24px; }
  .eq-top { flex-direction: column; }
  .lc-team b { font-size: 44px; }
}

/* ---------- Mode sombre (bouton lune/soleil, choix mémorisé) ---------- */
:root[data-theme="dark"] {
  --nuit: #0A1424;
  --panneau: #111F36;
  --panneau-2: #182B48;
  --trait: #26406A;
  --texte: #EAF1FA;
  --doux: #A2B3CB;
  --or: #F07A1E;
  --or-fonce: #FF9D52;
  --sur-or: #170A00;
  --orange: #FF8A33;
  --bleu: #6AB2F2;
  --bleu-clair: #8CC4F5;
  --sur-bleu: #0A1424;
  --rouge-plein: #C42F37;
  --vert: #3FCB84;
  --rouge: #F0565B;
  --rouge-texte: #FF9DA1;
  --rouge-doux: rgba(240, 86, 91, .16);
  --rouge-bord: rgba(240, 86, 91, .5);
  --ombre: 0 1px 2px rgba(0, 0, 0, .25);
  --entete: rgba(10, 20, 36, .95);
  --champ: #0D192C;
  --hero-fond: radial-gradient(120% 90% at 85% 10%, #1D3558 0%, #12223B 45%, #0E1A2E 75%);
  --live-fond: linear-gradient(160deg, #2A1A14, #111F36 70%);
  --teinte-fond: 40% 24%; --teinte-bord: 40% 34%; --teinte-texte: 85% 82%;
  --wa-texte: #4ED98A;
  color-scheme: dark;
}

/* Bouton lune/soleil */
.theme-btn { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--trait); background: var(--panneau); color: var(--texte); cursor: pointer; padding: 0; }
.theme-btn:hover { border-color: var(--bleu); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .soleil { display: none; }
:root[data-theme="dark"] .theme-btn .soleil { display: block; }
:root[data-theme="dark"] .theme-btn .lune { display: none; }
.tm-h .theme-btn { margin-left: auto; }
@media (max-width: 760px) {
  .top-in { gap: 8px; }
  .brand { margin-right: auto; min-width: 0; }
  .brand b { font-size: 18px; white-space: nowrap; }
  .brand img { width: 34px; height: 34px; }
  .top-live { margin-left: 0; padding: 6px 10px; font-size: 12px; }
  .theme-btn { width: 40px; height: 40px; }
}
@media (max-width: 360px) { .top-live { font-size: 0; gap: 0; padding: 10px; } .top-live i { width: 10px; height: 10px; } } /* très petit écran : seul le point rouge */

/* ---------- Affiche officielle en plein écran (Partager / Enregistrer) ---------- */
.visionneuse { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: 1fr auto; gap: 12px; justify-items: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(14px, env(safe-area-inset-bottom, 0px)); background: rgba(6, 12, 24, .92); }
.visionneuse img { min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; align-self: center; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; }
.visionneuse .v-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.visionneuse .v-actions .btn { min-height: 48px; }
.visionneuse .v-actions .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .7); }
.visionneuse .v-fermer { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.visionneuse .v-fermer:hover { background: rgba(255, 255, 255, .28); }
/* Petite loupe sur la vignette : on comprend qu'elle s'agrandit */
.affiche-mini::after { content: ""; position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(10, 22, 42, .75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 16px no-repeat; }
@media (max-width: 760px) { .affiche-mini::after { width: 20px; height: 20px; background-size: 12px; right: 4px; top: 4px; } }

/* ---------- Diaporama de la bannière ---------- */
.hero-photos { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: 0; transition: opacity 1.4s ease; }
.hero-photos img.on { opacity: 1; animation: zoom-lent 9s ease-out both; }
@keyframes zoom-lent { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ---------- Revivez 2025 : film et moments forts ---------- */
.film { position: relative; border-radius: var(--r-bloc); overflow: hidden; background: #000; box-shadow: var(--ombre); aspect-ratio: 16 / 9; max-width: 900px; }
.film video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.film-choix { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.film-choix .muted { font-size: 13px; }
.sous-titre { margin: 22px 0 10px; color: var(--bleu); }
.clips { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.clip { position: relative; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; aspect-ratio: 9 / 16; background: #0A162A center / cover no-repeat; cursor: pointer; /* image de couverture derrière la vidéo : jamais de bloc vide */ scroll-snap-align: start; box-shadow: var(--ombre); }
.clip video { width: 100%; height: 100%; object-fit: cover; display: block; background: transparent; }
.clip-ic { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(10, 22, 42, .7) center / 16px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6' stroke='white' stroke-width='2'/%3E%3C/svg%3E"); }
.clip.son .clip-ic { background-color: var(--or); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M16 8a5 5 0 0 1 0 8M18.5 5.5a8.5 8.5 0 0 1 0 13' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }
/* Connexion lente : pas de lecture automatique, un bouton ▶ au centre */
.clips.manuel .clip-ic { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: 48px; height: 48px; background-size: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E"); }
.clips.manuel .clip.son .clip-ic { opacity: 0; }

/* ---------- Galerie ---------- */
.galerie { columns: 3 220px; column-gap: 10px; }
.gal { display: block; width: 100%; padding: 0; margin: 0 0 10px; border: 0; border-radius: var(--r); overflow: hidden; background: var(--panneau-2); cursor: zoom-in; break-inside: avoid; box-shadow: var(--ombre); }
.gal img { display: block; width: 100%; height: auto; transition: transform .35s; }
.gal:hover img, .gal:focus-visible img { transform: scale(1.04); }
.credit { margin-top: 14px; font-size: 13px; }
@media (max-width: 520px) { .galerie { columns: 2; column-gap: 8px; } .gal { margin-bottom: 8px; } }
.apercu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.apercu .gal { margin: 0; aspect-ratio: 4 / 3; }
.apercu .gal img { height: 100%; object-fit: cover; }
@media (max-width: 620px) { .apercu { grid-template-columns: repeat(2, 1fr); } }
.lien-btn { background: none; border: 0; cursor: pointer; color: var(--bleu); font: inherit; font-weight: 600; font-size: 14px; }
.partenaires-bande .logos { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.partenaires-bande a { display: grid; place-items: center; min-width: 120px; height: 70px; padding: 10px 16px; border-radius: var(--r); background: #fff; border: 1px solid var(--trait); color: var(--texte); font-weight: 700; text-decoration: none; }
.partenaires-bande img { max-height: 50px; max-width: 140px; object-fit: contain; }

/* Photo en grand (même fond que l'affiche) */
.visionneuse.photo .v-actions { align-items: center; }
.visionneuse .v-nav { min-width: 56px; font-size: 26px; line-height: 1; color: #fff; border-color: rgba(255, 255, 255, .6); }
.v-compteur { color: #E6EEF8; font-size: 14px; min-width: 120px; text-align: center; }

/* ---------- Effets ---------- */
/* Entrée d'une page : les blocs montent en douceur, l'un après l'autre */
#view.entree > * { animation: monter .5s cubic-bezier(.2, .7, .3, 1) both; }
#view.entree > *:nth-child(2) { animation-delay: .06s; } #view.entree > *:nth-child(3) { animation-delay: .12s; }
#view.entree > *:nth-child(4) { animation-delay: .18s; } #view.entree > *:nth-child(5) { animation-delay: .24s; }
#view.entree > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes monter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Score qui vient de changer */
.flash { animation: flash-score 1.1s ease-out; display: inline-block; }
@keyframes flash-score { 0% { transform: scale(1.45); color: var(--orange); text-shadow: 0 0 18px rgba(234, 102, 6, .6); } 100% { transform: none; } }
/* Compte à rebours : le chiffre qui change bascule */
.count > div.bascule b { animation: bascule .6s ease-out; }
@keyframes bascule { 0% { transform: rotateX(90deg); opacity: .2; } 100% { transform: none; opacity: 1; } }
.confettis { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-photos img.on { animation: none; }
  #view.entree > *, .flash, .count > div.bascule b { animation: none; }
  .gal img { transition: none; }
}

/* Texte réservé aux lecteurs d'écran */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- État du direct (sous l'en-tête) ---------- */
.etat-direct { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 16px; font-size: 13px; font-weight: 700; text-align: center; }
.etat-direct.perdue { background: var(--rouge-plein); color: #fff; }
.etat-direct.perdue i { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none; animation: pulse 1.4s infinite; }
.etat-direct.ok { background: var(--vert); color: #fff; }

/* ---------- Pause du diaporama et des clips ---------- */
.diapo-pause { position: absolute; z-index: 3; left: 12px; bottom: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--trait);
  background: var(--panneau); color: var(--texte); font-size: 12px; cursor: pointer; opacity: .85; display: grid; place-items: center; }
.diapo-pause:hover, .diapo-pause:focus-visible { opacity: 1; }
@media (min-width: 761px) { .diapo-pause { left: auto; right: 14px; bottom: 16px; } }
.clips-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 10px; }
.clips-tete p { margin: 0; font-size: 13px; }
.clips-pause { flex: none; gap: 6px; }
.clips-pause b { font-weight: 700; }
/* Icône « agrandir » sur chaque clip */
.clip-ic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E") !important; background-color: rgba(10, 22, 42, .7) !important; }
.clips.manuel .clip-ic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") !important; }

/* ---------- Visionneuse plein écran (photo ou vidéo) ---------- */
.visionneuse.plein video { min-height: 0; max-width: 100%; max-height: 100%; align-self: center; border-radius: 6px; background: #000; }
.visionneuse .v-bas { display: grid; gap: 10px; justify-items: center; }
.visionneuse .v-outils { display: flex; gap: 10px; }
.visionneuse .v-outils .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .7); }

/* ---------- Filtres de la galerie : compacts ---------- */
.filtres-galerie { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.segment { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panneau); border: 1px solid var(--trait); }
.segment button { border: 0; background: none; color: var(--doux); font: inherit; font-weight: 700; font-size: 14px; padding: 6px 14px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.segment button.on { background: var(--texte); color: var(--nuit); }
.nb-photos { font-size: 13px; }
.tabs.defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
.tabs.defile::-webkit-scrollbar { display: none; }
.tabs.defile .tab { flex: none; }

/* ---------- Chrono de match (table de marque) ---------- */
.tm-chrono { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--panneau-2); border-radius: var(--r); padding: 10px 12px; }
.tm-chrono b { font: 800 44px/1 var(--f-score); font-variant-numeric: tabular-nums; color: var(--texte); min-width: 3.2ch; }
.tm-chrono.marche b { color: var(--vert); }
.tm-chrono.fini { background: var(--rouge-doux); box-shadow: 0 0 0 2px var(--rouge) inset; }
.tm-chrono.fini b { color: var(--rouge-texte); }
.tm-chrono .btn { min-height: 48px; }
@media (prefers-reduced-motion: reduce) { .etat-direct.perdue i { animation: none; } }

/* Écrans moyens (tablette, petit portable) : le menu du haut doit tenir sans rien cacher */
@media (min-width: 761px) and (max-width: 1100px) {
  .top-in { gap: 10px; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .nav a[href="#accueil"] { display: none; } /* le logo ramène déjà à l'accueil */
}
@media (min-width: 761px) and (max-width: 900px) {
  .brand b { display: none; } /* on garde le logo seul */
}

/* ---------- Concours ---------- */
.places { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.place-concours { border-style: dashed; border-color: var(--bleu); }
.place-concours .pl-num { font-size: 13px; }
.insc-mode { margin: 0 0 14px; }
.concours-choix { display: grid; gap: 8px; }
.concours-ligne { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--trait); border-radius: var(--r); background: var(--panneau); cursor: pointer; font-weight: 500; }
.concours-ligne input { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--or); }
.concours-ligne .grow { display: grid; gap: 2px; flex: 1; }
.concours-ligne b { font: 700 16px/1.2 var(--f-titre); text-transform: uppercase; color: var(--texte); }
.concours-ligne small { font-size: 13px; }
.concours-ligne .prix { font: 800 18px/1 var(--f-score); color: var(--bleu); white-space: nowrap; }
.concours-ligne.on { border-color: var(--or); background: var(--panneau-2); }
.total-concours { margin: 0; font-size: 15px; }
.total-concours b { font: 800 22px/1 var(--f-score); color: var(--texte); }
.participants { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.participants li { display: flex; align-items: center; gap: 10px; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--r); padding: 8px 12px; box-shadow: var(--ombre); }
.participants li > span:last-child { display: grid; min-width: 0; }
.participants small { font-size: 12px; }

/* ---------- Liste de joueurs à compléter ---------- */
.astuce-liste { margin: 0; font-size: 13px; }
.note.manque-liste { border-color: var(--or); background: var(--panneau-2); color: var(--texte); display: grid; gap: 8px; justify-items: start; }
.note.manque-liste p { margin: 0; }
.note.ok-liste { border-color: var(--vert); color: var(--texte); }
.manque-liste-admin { margin: 0; font-size: 13px; font-weight: 700; color: var(--or-fonce); }
.liste-a-completer { margin: 6px 0 0; font-size: 13px; color: var(--or-fonce); }
fieldset[disabled] { opacity: .6; }

/* Encart « Équipe déjà inscrite ? Compléter ma liste » */
.encart-liste { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px;
  border: 2px dashed var(--bleu); border-radius: var(--r); background: var(--panneau); color: var(--texte); text-decoration: none; box-shadow: var(--ombre); }
.encart-liste > span:first-child { display: grid; gap: 2px; flex: 1 1 220px; }
.encart-liste b { font: 700 16px/1.2 var(--f-titre); color: var(--bleu); }
.encart-liste small { color: var(--doux); font-size: 13px; }
.encart-liste:hover { border-style: solid; }
.empty + .encart-liste { margin-top: 14px; }

/* ---------- Signature de la plateforme (© WOUTI) ---------- */
.signature { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--trait); font-size: 12px; color: var(--doux); }
.foot .signature-wouti { display: inline-flex; align-items: center; gap: 8px; color: var(--doux); text-decoration: none; padding: 4px 0; }
.signature-wouti small { font-size: 12px; }
.signature-wouti img { display: block; height: 20px; width: auto; transition: transform .2s, opacity .2s; opacity: .92; }
.signature-wouti:hover img, .signature-wouti:focus-visible img { transform: translateY(-1px); opacity: 1; }
@media (max-width: 760px) {
  .foot-in { padding-bottom: 18px; }
  .signature { justify-content: center; text-align: center; flex-direction: column-reverse; gap: 6px; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } /* place pour le menu du bas */
}
@media (prefers-reduced-motion: reduce) { .signature-wouti img { transition: none; } }
