/* Concept : tableau d'affichage de stade, la nuit, sur pelouse tondue en bandes. Thème sombre assumé.
   Retouche 27/11/2026 : chiffres en points lumineux (Doto), texte en Barlow, plus d'étiquettes en capitales espacées,
   la Chaîne du jour en carton jaune. Voir PRODUCT.md. */
:root {
  --pitch: #0c2419;
  --pitch-2: #0f2c1f;
  --panel: #133526;
  --line: #2a5a43;
  --chalk: #eef5ee;
  --muted: #9fbcaa;
  --card: #f6c945;      /* carton jaune : accent */
  --red: #ff5d5d;
  --ok: #57e39a;
  --p1: #6fd3ff;
  --p2: #ffad4d;
  /* couleurs des joueurs (jusqu'à 10) */
  --c0: var(--p1); --c1: var(--p2); --c2: #b79bff; --c3: #57e39a; --c4: #ff8fb7;
  --c5: #f3e37c; --c6: #5ad8cc; --c7: #ff7b6b; --c8: #a6e05a; --c9: #c9d2da;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --board: "Doto", "Big Shoulders Display", monospace;   /* chiffres du tableau d'affichage */
  --board-bg: #07120c;
  --led: #ffd25a;
  --ink: #17140a;      /* texte sur fond jaune */
  --radius: 8px;
  --tex: rgb(255 255 255 / .05);        /* points lumineux du tableau */
  --board-edge: #24392d;
  --led-ink: #fff8e1;
  --row-line: #143224;
  --select-bg: #1b4632;
  --danger-bg: #3a1d1d;
  --ok-bg: #1f3a2a;
  --badge-ink: #10140f;
  --p1-ink: #04202c; --p2-ink: #2a1600;
  --shadow: rgb(0 0 0 / .55);
  --scrim: rgb(2 10 6 / .86);
  --ad-bg: #0a1d14;
  --disabled: #1d3a2c;

  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow-x: clip; }
::selection { background: var(--card); color: var(--ink); }
input, textarea { caret-color: var(--card); }
html { scrollbar-color: var(--line) var(--pitch); }
body {
  margin: 0; font-family: var(--body); font-size: 16px; color: var(--chalk);
  background: var(--pitch);
  background-image: repeating-linear-gradient(90deg, var(--pitch) 0 56px, var(--pitch-2) 56px 112px);
}
.app {
  max-width: 560px; margin: 0 auto; min-height: 100%;
  padding-block: 18px 110px; /* marge basse : le badge Netlify couvre le coin en bas à droite */
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: .01em; margin: 0; text-wrap: balance; text-transform: uppercase; }
h1 { font-size: 44px; line-height: .95; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
p { margin: 0; line-height: 1.5; color: var(--muted); }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--card); outline-offset: 2px; transition: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.logo span { color: var(--card); }
.ghost { background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; color: var(--muted); font-size: 14px; }
.ghost:hover { color: var(--chalk); border-color: var(--muted); }

.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.games { display: flex; flex-direction: column; border-top: 2px solid var(--line); }
.game {
  text-align: left; border: 0; border-bottom: 2px solid var(--line); background: none; border-radius: 0;
  padding: 16px 2px; display: flex; flex-direction: column; gap: 6px; position: relative;
}
.game:hover h2, .game:hover h3 { color: var(--card); }
.game[disabled] { color: var(--muted); cursor: not-allowed; }
.game[disabled] p { color: var(--line); }
.game[disabled]:hover h3 { color: inherit; }
.tag { align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--card); }
.game[disabled] .tag { color: var(--muted); }
.chainpreview { font-family: var(--display); font-size: 17px; text-transform: uppercase; color: var(--chalk); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chainpreview i { color: var(--card); font-style: normal; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-size: 12px;  color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 14px; color: var(--chalk); }
.chip[aria-pressed="true"] { background: var(--chalk); color: var(--pitch); border-color: var(--chalk); font-weight: 600; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type=text] {
  width: 100%; background: var(--pitch); border: 1px solid var(--line); color: var(--chalk);
  border-radius: var(--radius); padding: 12px; font: inherit; font-size: 16px;
}
.hint { font-size: 12px; color: var(--muted); }

.cta { background: var(--card); color: var(--ink); border: 0; border-radius: var(--radius); padding: 15px; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; }
.cta.secondary { background: transparent; color: var(--chalk); border: 1px solid var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

/* --- Tableau d'affichage --- */
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; background-color: var(--board-bg); background-image: radial-gradient(circle, var(--tex) 1px, transparent 1.6px); background-size: 6px 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.side.right { text-align: right; }
.side .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side.s1 .nm { color: var(--p1); } .side.s2 .nm { color: var(--p2); }
.side.active .nm::after { content: " ●"; }
.score { font-family: var(--board); font-weight: 900; font-size: 38px; font-variant-numeric: tabular-nums; color: var(--led); line-height: 1; }
.timer { height: 8px; border-radius: 4px; background: var(--board-bg); overflow: hidden; border: 1px solid var(--line); }
.timer > div { height: 100%; background: var(--ok); transform-origin: left center; transition: transform .1s linear; }
.timer.low > div { background: var(--red); }
.clock { font-family: var(--board); font-weight: 900; font-size: 24px; font-variant-numeric: tabular-nums; color: var(--led); }
.clock.low { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.current { text-align: center; padding: 22px 12px 18px; border-radius: var(--radius); border: 2px solid var(--chalk); position: relative; border-color: var(--board-edge); background-color: var(--board-bg); background-image: radial-gradient(circle, var(--tex) 1px, transparent 1.6px); background-size: 6px 6px; }
.current .kind { font-size: 14px; color: var(--muted); }
.current .big { font-family: var(--display); font-weight: 900; color: var(--led-ink); font-size: clamp(34px, 10vw, 54px); line-height: 1; text-transform: uppercase; margin-top: 6px; overflow-wrap: anywhere; }
.ask { text-align: center; font-size: 17px; font-weight: 600; }
.ask b { padding: 1px 6px; border-radius: 4px; }
.ask.t1 b { background: var(--p1); color: var(--p1-ink); } .ask.t2 b { background: var(--p2); color: var(--p2-ink); }

.inputwrap { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--board-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; z-index: 5; }
.sugg button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-bottom: 1px solid var(--row-line); font-size: 15px; }
.sugg button:last-child { border-bottom: 0; }
.sugg button:hover, .sugg button.sel { background: var(--panel); }
.feedback { min-height: 22px; text-align: center; font-size: 14px; font-weight: 600; }
.feedback.bad { color: var(--red); } .feedback.warn { color: var(--card); } .feedback.good { color: var(--ok); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Chaîne en cours : pastilles reliées par des flèches */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill { border: 2px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13.5px; font-weight: 600; background: var(--pitch); }
.pill.start { border-color: var(--chalk); }
.pill.by0 { border-color: var(--p1); } .pill.by1 { border-color: var(--p2); }
.pill.q { border-style: dashed; border-color: var(--card); color: var(--card); }
.arr { color: var(--card); font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--chalk); display: inline-block; margin-left: 6px; }
.sw.by0 { border-color: var(--p1); } .sw.by1 { border-color: var(--p2); }

/* Récap de fin de manche : liste verticale reliée par des flèches */
.chain { display: flex; flex-direction: column; }
.link { border: 0; padding: 4px 0; }
.link .t { color: var(--chalk); }
.link .who { font-size: 14px; font-weight: 600; color: var(--pc, var(--muted)); }
.link .t { font-weight: 700; }
.link .d { font-size: 14px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.down { color: var(--card); font-weight: 800; padding: 2px 0 2px 8px; }

.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--card); text-decoration: underline; font-size: 13px; }
.linkbtn.center { align-self: center; }
.chainpreview .q { color: var(--card); font-size: 22px; }

/* Signalement */
.reportbox { width: min(460px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cats { display: flex; flex-direction: column; gap: 4px; }
.cat { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; cursor: pointer; }
.cat:has(input:checked) { border-color: var(--card); background: var(--select-bg); }
.lbl { font-size: 14px; color: var(--muted); font-weight: 600; }
textarea { width: 100%; background: var(--pitch); border: 1px solid var(--line); color: var(--chalk); border-radius: var(--radius); padding: 10px; font: inherit; font-size: 16px; resize: vertical; }

/* --- Fin de manche --- */
.verdict { text-align: center; display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.verdict .big { font-family: var(--display); font-weight: 900; font-size: 40px; text-transform: uppercase; line-height: 1; }
.yellow { display: inline-block; width: 22px; height: 30px; background: var(--card); border-radius: 3px; transform: rotate(8deg); margin: 0 auto 4px; }
.yellow.redc { background: var(--red); }
.reveal { position: relative; }
.answers { display: flex; flex-wrap: wrap; gap: 6px; }
.answers span { background: var(--pitch); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 13.5px; }
.locked .answers { filter: blur(6px); user-select: none; pointer-events: none; }
.lockbtn { position: absolute; inset: 0; display: grid; place-items: center; }
.adbtn { background: var(--chalk); color: var(--pitch); border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 24px var(--shadow); }

.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: 20px; }
.adbox { width: min(420px, 100%); aspect-ratio: 4/3; max-width: 100%; border: 2px dashed var(--muted); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; background: var(--ad-bg); }
.adbox .count { font-family: var(--display); font-size: 60px; font-weight: 900; color: var(--card); font-variant-numeric: tabular-nums; }

.footer { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- Mode en ligne --- */
.codeinput { text-transform: uppercase; letter-spacing: .4em; font-family: var(--display); font-size: 26px !important; text-align: center; }
.bigcode { font-family: var(--board); font-weight: 900; font-size: 64px; letter-spacing: .08em; text-align: center; color: var(--card); line-height: 1; }
.sharebox input { font-size: 13px !important; color: var(--muted); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; }
.dotpulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse .7s infinite alternate; flex: none; }
.side .away { font-size: 11px; color: var(--red); }

/* Réponses cachées avant la pub */
.answers .ph { height: 28px; border-radius: 999px; background: var(--line); border: 0; padding: 0; }
.hiddenans { font-style: italic; color: var(--card); }
.pass { align-self: center; }
.pass.armed { border-color: var(--red); color: var(--red); }
.reveal.locked .lockbtn { inset: auto 0 0 0; top: 78px; }

/* --- Parties à plus de 2 joueurs --- */
.names { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.multiboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.multiboard .pl { display: flex; align-items: center; gap: 8px; background: var(--board-bg); border: 2px solid color-mix(in srgb, var(--pc) 55%, transparent); border-radius: var(--radius); padding: 7px 10px; min-width: 0; flex-wrap: wrap; }
.multiboard .pl .nm { font-weight: 700; color: var(--pc); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multiboard .pl .sc { font-family: var(--board); font-weight: 900; font-size: 22px; color: var(--led); font-variant-numeric: tabular-nums; }
.multiboard .pl.active { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc) inset; }
.multiboard .pl.out { opacity: .45; }
.multiboard .pl.out .nm { text-decoration: line-through; }
.multiboard .away { width: 100%; font-size: 11px; color: var(--red); }
.ask b { color: var(--badge-ink); }
.banner { background: var(--danger-bg); border: 1px solid var(--red); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.muted { color: var(--muted); font-size: 13px; }
.roster { display: flex; flex-wrap: wrap; gap: 6px; }
.roster .who { border: 2px solid var(--pc); color: var(--pc); border-radius: 999px; padding: 5px 11px; font-weight: 600; font-size: 14px; }
.cta[disabled] { background: var(--disabled); color: var(--muted); cursor: not-allowed; }

/* --- Chaîne du jour, Le lien, stats --- */
.game.daily { background: var(--card); color: var(--ink); border: 0; border-radius: var(--radius); padding: 18px 16px; margin: 14px 0; transform: rotate(-1deg); box-shadow: 0 10px 24px -12px var(--shadow); }
.game.daily p, .game.daily .status { color: var(--ink); }
.game.daily:hover h2 { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.game.daily .tag { color: var(--ink); opacity: .75; }
.game .status { font-size: 14px; font-weight: 700; color: var(--card); }
.stats-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; text-align: center; }
.stats-mini b { font-variant-numeric: tabular-nums; display: block; font-family: var(--board); font-size: 36px; font-weight: 900; color: var(--led); line-height: 1; }
.stats-mini span { font-size: 12px; color: var(--muted); }
.lives { color: var(--red); letter-spacing: 2px; font-size: 16px; }
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.duo .current { padding: 16px 8px; }
.duo .big { font-size: clamp(20px, 6vw, 30px); }
.duo .plus { font-family: var(--display); font-size: 32px; color: var(--card); font-weight: 900; }
.center { text-align: center; }
.banner.ok { background: var(--ok-bg); border-color: var(--ok); }
a.linkbtn { color: var(--card); }
.logo.withicon { display: flex; align-items: center; gap: 8px; }
.logo.withicon span { margin-left: -2px; }
.legal h1 { font-size: 34px; }
.legal h2 { font-size: 22px; }
.legal p, .legal li { color: var(--chalk); opacity: .9; line-height: 1.55; }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
a.ghost { text-decoration: none; }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .game.daily { transform: none; } }
.footlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.logline b { display: inline-block; min-width: 64px; } .logline.ok b { color: var(--ok); } .logline.ko b { color: var(--red); }
a.game { color: inherit; text-decoration: none; }
.sub { font-size: 15px; font-weight: 600; color: var(--muted); }
.verdict .sub { color: var(--card); }
.ask { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: baseline; }
/* Carrière d'un joueur dans l'ordre, avec flèches */
.career { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.career span:not(.arr) { background: var(--pitch); border: 1px solid var(--card); border-radius: 999px; padding: 4px 12px; font-size: 15px; }
.career span.used { border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.career .arr { color: var(--card); font-weight: 700; }
.tb-right { display: flex; gap: 8px; }
