/* Jeu foot : habillage « Tableau » (graphite, craie, un accent orange), repris de la maquette B de Ghicko Foot.
   Polices locales dans polices/ (OFL). Pas de photo, pas de logo, pas de confettis. */

@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(polices/big-shoulders-display-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(polices/big-shoulders-display-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(polices/geist-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(polices/geist-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(polices/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(polices/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0f1012; --panel: #17191c; --panel-2: #1f2226; --line: #2b2f35;
  --chalk: #f1efe8; --chalk-2: #b9b7b0; --chalk-3: #8b8a86;
  --sig: #ff5b22; --sig-text: #ff6d38; --sig-big: #ff5b22; --sig-ink: #111214; --sig-dim: #3a1d12;
  --radius: 4px;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-text: 'Geist', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
/* Sombre d'abord : le clair ne s'applique que sur choix explicite (bouton du bandeau). */
:root[data-theme="light"] {
  --bg: #e8e9eb; --panel: #f7f7f8; --panel-2: #eeeff1; --line: #cfd1d5;
  --chalk: #111214; --chalk-2: #3d4047; --chalk-3: #5c6068;
  --sig: #f0601f; --sig-text: #a8360a; --sig-big: #cf440c; --sig-ink: #111214; --sig-dim: #fbe1d6;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--chalk); font: 400 16px/1.5 var(--f-text); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; text-transform: none; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; }
[data-ic] { display: inline-flex; width: 1em; height: 1em; flex: none; }
[data-ic] svg { width: 100%; height: 100%; }

/* ---------- Barre du site ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 6px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: .25em; min-height: 44px; white-space: nowrap; font: 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; text-decoration: none; }
.wordmark b { color: var(--sig-text); }
.top__crumb { display: none; font: 700 20px/1 var(--f-display); text-transform: uppercase; color: var(--chalk-3); letter-spacing: .03em; }
.top__end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 20px; color: var(--chalk-2); border-radius: var(--radius); }
.icon-btn:hover { background: var(--panel-2); color: var(--chalk); }
.icon-btn .ic-sun { display: none; }
#musique .ic-on { display: none; }
#musique[aria-pressed="true"] { color: var(--sig-text); border-color: var(--sig-text); }
#musique[aria-pressed="true"] .ic-on { display: inline-flex; }
#musique[aria-pressed="true"] .ic-off { display: none; }
#musique[hidden] { display: none; }
:root[data-theme="light"] .icon-btn .ic-sun { display: inline-flex; }
:root[data-theme="light"] .icon-btn .ic-moon { display: none; }
@media (min-width: 720px) {
  .top { padding: 6px 28px; min-height: 64px; }
  .top__crumb { display: inline; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--radius); border: 0; cursor: pointer; background: var(--sig); color: var(--sig-ink); font: 800 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; white-space: nowrap; transition: transform .15s; }
.btn:active { transform: scale(.98); }
.btn [data-ic] { font-size: 20px; }
.btn--ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--panel-2); }
.link-btn { min-height: 44px; border: 0; background: none; color: var(--chalk-3); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; cursor: pointer; }
.link-btn:disabled { visibility: hidden; }

/* ---------- Accueil ---------- */
.hub, .play { max-width: 1180px; margin: 0 auto; }
.hub { padding: 20px 16px 48px; }
.hub__bar { padding-bottom: 12px; border-bottom: 2px solid var(--chalk); }
.hub__bar h1 { font: 800 clamp(30px, 6vw, 44px)/1 var(--f-display); text-transform: uppercase; }
.hub__sub { margin-top: 6px; color: var(--chalk-2); max-width: 52ch; }
.rows { list-style: none; margin-top: 8px; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 72px; }
a.row:hover { background: var(--panel); }
.row__name { display: block; font: 800 30px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.row__sub { display: block; margin-top: 6px; font-size: 14px; color: var(--chalk-3); max-width: 50ch; }
.row__state { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1.2 var(--f-text); color: var(--sig-text); white-space: nowrap; }
.row--soon .row__name { color: var(--chalk-2); }
.row--soon .row__state { color: var(--chalk-3); font-weight: 600; }
.foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--chalk-3); }

/* ---------- Jeu ---------- */
.play { padding-bottom: 48px; }
.score { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 16px; padding: 18px 16px 14px; border-bottom: 2px solid var(--chalk); }
.score__title { font: 900 clamp(40px, 12vw, 84px)/.9 var(--f-display); text-transform: uppercase; }
.score__title span { color: var(--sig-big); }
.score__count { text-align: right; font: 600 13px/1.2 var(--f-text); color: var(--chalk-3); }
.score__count b { display: block; font: 900 52px/1 var(--f-display); color: var(--chalk); margin-bottom: 4px; }
.score__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; color: var(--chalk-2); }
.levels { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.levels button { min-height: 44px; padding: 0 16px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; font: 700 15px/1 var(--f-text); color: var(--chalk-2); transition: background .2s, color .2s; }
.levels button:last-child { border-right: 0; }
.levels button[aria-pressed="true"] { background: var(--sig); color: var(--sig-ink); }
.levels button:not([aria-pressed="true"]):hover { background: var(--panel-2); }
.play__layout { display: grid; gap: 24px; padding: 16px; }
@media (min-width: 960px) {
  .score { padding: 28px 28px 18px; }
  .play__layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 24px 28px; align-items: start; }
  .hub { padding: 32px 28px 64px; }
}

.ask { position: relative; }
.ask label { display: block; margin-bottom: 8px; font: 700 18px/1 var(--f-display); text-transform: uppercase; letter-spacing: .05em; color: var(--chalk-2); }
.field { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); }
.field [data-ic] { font-size: 20px; color: var(--chalk-3); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; }
.field input::placeholder { color: var(--chalk-3); }
.field:focus-within { border-color: var(--sig); }
.field:has(input:disabled) { opacity: .6; }
.sugg { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); list-style: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); max-height: 320px; overflow-y: auto; }
.sugg:empty { display: none; }
.sugg li { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.sugg li:last-child { border-bottom: 0; }
.sugg li:hover, .sugg li[aria-selected="true"] { background: var(--line); }
.sugg li.vide { cursor: default; font-weight: 500; color: var(--chalk-3); }
.msg { min-height: 1.5em; margin-top: 8px; font-size: 14px; color: var(--chalk-2); }
.msg--err { color: var(--sig-text); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 4px; }
.hint__btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: 2px solid var(--sig); border-radius: var(--radius); background: transparent; cursor: pointer; font-weight: 700; transition: background .2s; }
.hint__btn [data-ic] { color: var(--sig-text); font-size: 20px; }
.hint__btn:hover:not(:disabled) { background: var(--sig-dim); }
.hint__btn:disabled { border-color: var(--line); color: var(--chalk-3); cursor: default; }
.hint__btn:disabled [data-ic] { color: var(--chalk-3); }
.pips { display: inline-flex; gap: 4px; margin-left: 4px; }
.pips i { width: 10px; height: 18px; border-radius: 1px; background: var(--sig); }
.pips i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--chalk-3); }
.notes { list-style: none; display: grid; gap: 4px; margin: 8px 0; }
.notes li { padding: 8px 10px; border-radius: 2px; background: var(--sig-dim); font: 600 14px/1.35 var(--f-text); }
.list-h { margin: 22px 0 8px; font: 700 18px/1 var(--f-display); text-transform: uppercase; letter-spacing: .05em; color: var(--chalk-2); }
.guesses { list-style: none; display: grid; gap: 6px; }
.guess { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 6px 12px; padding: 12px 12px 15px; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.guess__heat { min-width: 3.6ch; font: 700 24px/1 var(--f-mono); color: color-mix(in srgb, var(--sig-text) calc(var(--heat) * 1%), var(--chalk-3)); letter-spacing: -.04em; }
.guess__name { min-width: 0; font: 800 22px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.guess__rank { text-align: right; font: 700 17px/1 var(--f-mono); white-space: nowrap; }
.guess__rank small { display: block; margin-top: 4px; font: 500 12px/1 var(--f-text); color: var(--chalk-3); }
.guess__bar { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--heat) * 1%); background: var(--sig); opacity: calc(.25 + var(--heat) / 133); }
.guess--win { box-shadow: inset 0 0 0 2px var(--sig); }
.fiche { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--chalk-3); }
.fiche b { font-weight: 600; color: var(--chalk-2); }
@media (min-width: 640px) { .guess { padding: 14px 16px 17px; } .guess__heat { font-size: 30px; } .guess__name { font-size: 26px; } .fiche { grid-column: 2 / -1; } }

/* Comparaison : cases */
.case-guess { margin-top: 8px; padding: 12px; background: var(--panel); border-radius: var(--radius); }
.case-guess__head { display: flex; justify-content: space-between; gap: 10px; font: 800 22px/1.1 var(--f-display); text-transform: uppercase; }
.case-guess__head small { font: 600 13px/1.3 var(--f-mono); color: var(--chalk-3); text-transform: none; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px; margin-top: 8px; list-style: none; }
.cell { padding: 8px; border-radius: 2px; font-size: 14px; background: var(--panel-2); color: var(--chalk-2); overflow-wrap: anywhere; }
.cell b { display: flex; justify-content: space-between; gap: 6px; font: 600 12px/1.2 var(--f-text); text-transform: uppercase; letter-spacing: .03em; color: var(--chalk-3); }
.cell.exact { background: var(--sig); color: var(--sig-ink); } .cell.exact b { color: var(--sig-ink); }
.cell.proche, .cell.partiel { box-shadow: inset 0 0 0 2px var(--sig); color: var(--chalk); }

/* Fin de partie, panneaux, classement */
.done { margin-bottom: 18px; padding: 18px; display: grid; gap: 10px; border-radius: var(--radius); background: var(--sig); color: var(--sig-ink); }
.done h2 { font: 900 38px/1.05 var(--f-display); text-transform: uppercase; }
.done--lost { background: var(--panel-2); color: var(--chalk); box-shadow: inset 0 0 0 2px var(--line); }
.done .btn { background: var(--sig-ink); color: var(--sig); }
.done--lost .btn { background: var(--sig); color: var(--sig-ink); }
.share { white-space: pre-wrap; padding: 12px; border-radius: var(--radius); background: rgba(0, 0, 0, .18); font: 500 14px/1.5 var(--f-mono); }
.pseudo { display: flex; flex-wrap: wrap; gap: 8px; }
.pseudo input { flex: 1; min-width: 140px; height: 48px; padding: 0 12px; border: 2px solid var(--sig-ink); border-radius: var(--radius); background: transparent; }
.pseudo input::placeholder { color: var(--sig-ink); opacity: .75; }
.aside { display: grid; gap: 14px; align-content: start; }
.panel { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { margin-bottom: 10px; font: 800 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; }
.panel p { font-size: 14px; color: var(--chalk-2); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; cursor: pointer; font-weight: 600; color: var(--chalk-2); transition: background .2s; }
.tabs button[aria-pressed="true"] { background: var(--chalk); color: var(--bg); border-color: var(--chalk); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--chalk-2); }
.board { width: 100%; border-collapse: collapse; font: 500 14px/1.3 var(--f-mono); }
.board th { text-align: left; font: 600 12px/1.2 var(--f-text); color: var(--chalk-3); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.board td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.board td:first-child { font-family: var(--f-text); font-weight: 600; overflow-wrap: anywhere; }
.fini .ask, .fini .actions { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Sélecteur de langue (en-tête) ---------- */
.lang { height: 44px; max-width: 132px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--chalk-2); font: 500 14px/1 var(--f-text); cursor: pointer; text-overflow: ellipsis;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.lang:hover { background-color: var(--panel-2); color: var(--chalk); }
.lang option { background: var(--panel); color: var(--chalk); }
@media (max-width: 420px) { .top { gap: 8px; padding: 6px 10px; } .top__end { gap: 4px; } .wordmark { font-size: 22px; } .lang { max-width: 96px; padding: 0 22px 0 8px; font-size: 13px; background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; } }
@media (max-width: 340px) { .icon-btn { width: 40px; height: 40px; } .lang { max-width: 86px; height: 40px; } }
