/* =============================================================================
   THE BEATBOX GAME — style pixel / rétro (maquette BBC 2026)
   Noir profond, cyan glacier, crème. Cadres crantés, polices pixel, aucun dégradé.
   ============================================================================= */
/* Police pixel lisible (lot 8r) : Jersey 10 (OFL, hébergée ici). Remplace Pixelify Sans (3/8/9 confondus) et Silkscreen
   (0/O, 5/S, 8/B identiques). Deux noms, deux réglages de taille : le reste de la feuille ne change pas de tailles. */
@font-face { font-family: 'BBC Pixel'; src: url(fonts/jersey10-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 116%;
  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: 'BBC Pixel'; src: url(fonts/jersey10-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 116%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'BBC Tiny'; src: url(fonts/jersey10-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 128%;
  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: 'BBC Tiny'; src: url(fonts/jersey10-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 128%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #090c0e;
  --panel: #0e1215;
  --panel-2: #141a1e;
  --cyan: #84FAFA;
  --cream: #F1EADB;
  --lime: #E2F075;
  --dim: #3a4248;
  --grey: #8b949a;
  --line: #2a3237;
  --px: 3px;                                   /* épaisseur « pixel » des bordures */
  --pixel: 'BBC Pixel', 'Pixelify Sans', ui-monospace, monospace;
  --tiny: 'BBC Tiny', 'Pixelify Sans', ui-monospace, monospace;
  /* coins crantés façon pixel art */
  --notch: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--cream); }
body {
  font-family: var(--pixel); font-size: 17px; line-height: 1.4; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: none;
  /* tramage pixel discret sur les bords de l'écran */
  background-image:
    repeating-conic-gradient(#11171a 0 25%, transparent 0 50%);
  background-size: 6px 6px;
}
[hidden] { display: none !important; }
svg { image-rendering: pixelated; }

.app {
  position: relative; max-width: 520px; margin: 0 auto; min-height: 100dvh; overflow-x: hidden;
  background: var(--bg);
  border-left: var(--px) solid var(--cream); border-right: var(--px) solid var(--cream);
  box-shadow: inset 6px 0 0 var(--bg), inset -6px 0 0 var(--bg), inset 9px 0 0 var(--dim), inset -9px 0 0 var(--dim);
}
@media (min-width: 560px) {
  .app { margin: 18px auto; min-height: calc(100dvh - 36px); border: var(--px) solid var(--cream); clip-path: var(--notch);
    box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 9px var(--dim); }
}
.screen { padding: 22px 22px calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; min-height: inherit; }

/* --- titres ---------------------------------------------------------------- */
.brand { text-align: center; padding-top: 6px; }
.kicker { margin: 0; font: 700 14px var(--tiny); text-transform: uppercase; letter-spacing: .02em; color: var(--cyan); }
.title { margin: 6px 0 0; font-family: var(--pixel); font-weight: 700; text-transform: uppercase; line-height: .9; }
.title .t1, .title .t2 { display: block; transform: skewX(-10deg); }
.title .t1 { font-size: clamp(34px, 11vw, 54px); display: flex; align-items: center; justify-content: center; gap: 10px; }
.title .t2 { font-size: clamp(44px, 14vw, 68px); }
.title .bar { display: inline-block; width: 8px; height: .9em; background: var(--cyan); transform: skewX(10deg); }
.year { margin: 10px 0 0; font: 700 clamp(48px, 15vw, 78px)/1 var(--tiny); color: var(--cream); letter-spacing: .06em; text-shadow: 4px 4px 0 var(--cyan); }
.lead { margin: 0; text-align: center; font: 700 15px var(--tiny); text-transform: uppercase; }
.h2 { margin: 2px 0 0; font: 700 30px/1 var(--pixel); text-transform: uppercase; display: flex; align-items: center; gap: 10px; transform: skewX(-8deg); }
.h2::before { content: ''; width: 8px; height: 26px; background: var(--cyan); }
.lbl { font: 700 12px var(--tiny); text-transform: uppercase; color: var(--grey); }

/* --- boutons ---------------------------------------------------------------- */
.btn {
  appearance: none; width: 100%; min-height: 54px; padding: 10px 16px; cursor: pointer;
  font: 700 18px var(--pixel); text-transform: uppercase; letter-spacing: .04em;
  color: var(--cream); background: var(--panel); border: var(--px) solid var(--cream); border-radius: 0;
  clip-path: var(--notch);
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.btn-primary:hover { background: #a6fcfc; }
.btn-xl { min-height: 70px; font-size: 30px; }
.btn-ghost { border-color: var(--dim); color: var(--grey); font-size: 15px; min-height: 46px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* --- cartes, panneaux --------------------------------------------------------- */
.card, .tuto, .legend .item, .review-card, .alert, .mode-banner, .banner {
  border: var(--px) solid var(--dim); background: var(--panel); clip-path: var(--notch);
}
.card { padding: 14px 16px; }
.card p { margin: 0 0 8px; }
.ticks { margin: 0; padding-left: 20px; }
.ticks li { margin: 5px 0; }
.alert { padding: 12px 14px; border-color: var(--cream); font-weight: 700; }
.alert::before { content: '! '; color: var(--lime); }
.alert.ok::before { content: '✓ '; color: var(--cyan); }
.hint { margin: 0; font-size: 13px; color: var(--grey); }
.mode-banner { margin: 0; padding: 10px 12px; font: 700 12px var(--tiny); text-transform: uppercase; border-style: dashed; }
.mode-banner.online { border-color: var(--cyan); color: var(--cyan); border-style: solid; }
.privacy { margin: 0; font-size: 12px; color: var(--grey); text-align: center; }
.best { margin: 0; text-align: center; color: var(--cyan); font: 700 13px var(--tiny); text-transform: uppercase; }

/* --- symboles ----------------------------------------------------------------- */
.sym { width: 44px; height: 44px; display: inline-block; vertical-align: middle; }
.sym svg { width: 100%; height: 100%; display: block; }
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.legend .item { padding: 14px 6px 10px; text-align: center; border-color: var(--grey); color: var(--cream); font: inherit; cursor: pointer; width: 100%; }
.legend .item:hover, .legend .item:focus-visible { border-color: var(--cyan); outline: none; }
.legend .item .sym { width: 48px; height: 48px; }
.legend .item b { display: block; margin-top: 8px; font: 700 17px var(--pixel); text-transform: uppercase; }
.legend .item small { display: block; color: var(--grey); font-size: 11px; }

/* --- sélecteur de difficulté -------------------------------------------------- */
.difficulty { border: 0; padding: 0; margin: 0; }
.difficulty legend { font: 700 12px var(--tiny); text-transform: uppercase; color: var(--grey); margin-bottom: 6px; }
.difficulty .hint { margin-top: 6px; }
.seg { display: flex; border: var(--px) solid var(--cream); clip-path: var(--notch); background: var(--panel); }
.seg button {
  flex: 1; min-height: 50px; background: transparent; color: var(--cream); border: 0; border-right: var(--px) solid var(--cream);
  font: 700 16px var(--pixel); text-transform: uppercase; cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--cyan); color: var(--bg); }

/* --- bande date ---------------------------------------------------------------- */
.band { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--cyan); color: var(--bg); padding: 12px 16px; font: 700 clamp(18px, 5.6vw, 24px)/1.1 var(--tiny); letter-spacing: .03em; clip-path: var(--notch); text-decoration: none; }
a.band:hover { background: #a6fcfc; }
.band small { display: block; font: 700 11px var(--tiny); letter-spacing: .04em; }
.stairs { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.stairs i { width: 8px; height: 8px; background: var(--bg); }
.stairs i:nth-child(2) { margin-bottom: 4px; } .stairs i:nth-child(3) { margin-bottom: 8px; }
.stairs i:nth-child(4) { margin-bottom: 12px; } .stairs i:nth-child(5) { margin-bottom: 16px; }

/* --- tutoriel ------------------------------------------------------------------- */
.tuto { padding: 18px; min-height: 250px; display: flex; flex-direction: column; gap: 12px; }
.tuto h3 { margin: 0; font: 700 24px var(--pixel); text-transform: uppercase; color: var(--cyan); }
.tuto p { margin: 0; }
.tuto .demo { display: flex; gap: 10px; flex-wrap: wrap; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 12px; height: 12px; border: 2px solid var(--cream); }
.dots i.on { background: var(--cyan); border-color: var(--cyan); }

.screen-game { gap: 10px; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: var(--px) solid var(--line); }
.hud-score { margin: 0; font: 700 22px var(--pixel); text-transform: uppercase; }
.hud-score .lbl { font: 700 20px var(--pixel); color: var(--cream); }
.hud-score b { color: var(--cyan); letter-spacing: .06em; }
.hud-lives { display: flex; gap: 8px; }
.life { width: 30px; height: 30px; display: inline-block; }
.life svg { width: 100%; height: 100%; display: block; }
.life.blink { animation: blink .18s steps(1) 6; }
.life.gain { animation: pop .25s steps(2) 3; }
.round-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.round-row .deco { width: 30px; height: 12px; background:
  linear-gradient(var(--dim) 0 0) 0 0 / 4px 4px, linear-gradient(var(--dim) 0 0) 8px 0 / 4px 4px, linear-gradient(var(--dim) 0 0) 16px 0 / 4px 4px,
  linear-gradient(var(--dim) 0 0) 0 8px / 4px 4px, linear-gradient(var(--dim) 0 0) 8px 8px / 4px 4px, linear-gradient(var(--dim) 0 0) 16px 8px / 4px 4px;
  background-repeat: no-repeat; }
.round { margin: 0; font: 700 28px var(--pixel); text-transform: uppercase; }
.round b { color: var(--cyan); }
.hud-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font: 700 11px var(--tiny); text-transform: uppercase; color: var(--grey); }
.hud-sub b { color: var(--cyan); }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 2px; width: 100%; }
.pattern-name { margin: 0; font: 700 12px var(--tiny); text-transform: uppercase; color: var(--grey); }
.banner { width: 100%; padding: 12px; text-align: center; border-color: var(--grey); background: var(--panel-2); }
.phase { margin: 0; min-height: 1.2em; font: 700 28px var(--pixel); text-transform: uppercase; color: var(--cyan); }
.banner.play { border-color: var(--cyan); }
.banner.play .phase { color: var(--cream); }

.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.step {
  width: calc((100% - 3 * 8px) / 4); max-width: 104px; aspect-ratio: 1; position: relative;
  border: var(--px) solid var(--cream); background: var(--panel); clip-path: var(--notch);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.seq[data-len="8"] .step, .seq[data-len="12"] .step, .seq[data-len="16"] .step { width: calc((100% - 7 * 6px) / 8); max-width: 58px; border-width: 2px; }
.seq[data-len="8"], .seq[data-len="12"], .seq[data-len="16"] { gap: 6px; }
.step .sym { width: 58%; height: auto; aspect-ratio: 1; }
.step small { font: 700 8px var(--tiny); text-transform: uppercase; color: var(--grey); white-space: nowrap; display: none; }
.seq[data-len="4"] .step small { display: block; font-size: 10px; }
.step.rest { border-color: var(--line); }
.step.rest::after { content: ''; width: 30%; height: 4px; background: var(--line); }
.step.beatstart { margin-left: 4px; }
.step.now { border-color: var(--cyan); background: var(--cyan); }
.step.now .sym svg g { fill: var(--bg); }
.step.r-hit { border-color: var(--cyan); background: var(--cyan); }
.step.r-hit .sym svg g { fill: var(--bg); }
.step.r-hit small { color: var(--bg); }
.step.r-wrong, .step.r-miss { border-style: dashed; opacity: .5; }
.step.r-wrong::before, .step.r-miss::before { content: '✕'; position: absolute; top: 0; right: 3px; font: 700 12px var(--pixel); }
.step.r-unknown { border-color: var(--lime); }
.step.r-unknown::before { content: '?'; position: absolute; top: 0; right: 3px; font: 700 12px var(--pixel); color: var(--lime); }

.pulse { display: flex; gap: 12px; justify-content: center; }
.pulse i { width: 18px; height: 18px; border: var(--px) solid var(--grey); }
.pulse i.on { background: var(--cyan); border-color: var(--cyan); }
.pulse.beat i.on { transform: scale(1.25); }
.pulse.heard i { border-color: var(--cream); }

.mic-row { display: flex; align-items: center; gap: 10px; }
.mic-ico { width: 30px; height: 30px; display: inline-block; }
.mic-ico svg { width: 100%; height: 100%; display: block; }
.seg-meter { display: flex; gap: 3px; }
.seg-meter i { width: 12px; height: 22px; background: var(--dim); }
.seg-meter i.on { background: var(--cyan); }
.seg-meter i.thr { box-shadow: inset 0 -4px 0 var(--cream); }
.captured { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 38px; max-width: 100%; }
.captured i { width: 34px; height: 34px; border: var(--px) solid var(--grey); display: grid; place-items: center; background: var(--panel); }
.captured i .sym { width: 70%; height: 70%; }
.captured i.got { border-color: var(--cream); animation: pop .15s steps(2); }
.seq[data-len="12"] ~ .captured i, .seq[data-len="16"] ~ .captured i { width: 24px; height: 24px; border-width: 2px; }

.feedback { min-height: 46px; width: 100%; text-align: center; font: 700 20px/1.1 var(--pixel); text-transform: uppercase; overflow-wrap: anywhere; }
.feedback .sub { display: block; font: 400 14px var(--pixel); text-transform: none; color: var(--grey); margin-top: 4px; }
.feedback .good { color: var(--cyan); }
.feedback .bad { color: var(--cream); text-decoration: line-through 3px; }
.feedback .captured { color: var(--cream); }
.feedback.pop { animation: pop .15s steps(2); }
.estimate { margin: 0; font-size: 12px; color: var(--grey); min-height: 1.3em; text-align: center; }
.btn-quit { width: auto; align-self: center; min-width: 200px; }

/* --- overlays / bilan -------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(9, 12, 14, .92); display: grid; place-items: center; padding: 14px; z-index: 10; }
.review-card { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; min-width: 0; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; text-align: center; border-color: var(--cream); }
.review-card.slam { animation: slam .3s steps(3); }
.review-card.shake { animation: shake .4s steps(8); }
.verdict { margin: 0; font: 700 clamp(26px, 8vw, 38px)/1.05 var(--pixel); text-transform: uppercase; overflow-wrap: anywhere; }
.verdict.pass { background: var(--cyan); color: var(--bg); padding: 8px; }
.verdict.fail { border: var(--px) dashed var(--cream); padding: 6px; }
.review-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.review-stats div { border: var(--px) solid var(--dim); padding: 8px 4px; background: var(--panel-2); }
.review-stats b { display: block; font: 700 24px var(--pixel); }
.review-stats span { font: 700 9px var(--tiny); text-transform: uppercase; color: var(--grey); }
.review-note { margin: 0; font-size: 15px; }
.timeline svg { width: 100%; height: auto; display: block; }
.timeline-legend { margin: 4px 0 0; font-size: 11px; color: var(--grey); }
.trend { margin: 4px 0 0; font-size: 14px; }
.trend b { color: var(--cyan); }
.detail { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; font-size: 13px; }
.detail .row { display: grid; grid-template-columns: 30px 22px 92px 1fr; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 2px solid var(--line); }
.detail .pos { color: var(--grey); font-weight: 700; }
.detail .exp .sym { width: 18px; height: 18px; }
.gauge { position: relative; height: 12px; border: 2px solid var(--dim); }
.gauge.empty { border-style: dashed; }
.gauge .gz { position: absolute; top: 0; bottom: 0; background: rgba(132, 250, 250, .22); }
.gauge .g0 { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 2px; background: var(--grey); }
.gauge .gm { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--cyan); }
.gauge .gm.r-wrong { background: var(--cream); }
.gauge .gm.r-unknown { background: var(--lime); }
.detail .v-miss { color: var(--grey); font-weight: 700; }
.detail .v-wrong { font-weight: 700; text-decoration: underline; }
.detail .v-unk { color: var(--lime); }
.detail .v-guided { color: var(--grey); }

/* bonus */
.bonus-target { display: flex; align-items: center; justify-content: center; gap: 12px; }
.bonus-target .sym { width: 56px; height: 56px; }
.bonus-target p { margin: 0; font-size: 18px; font-weight: 700; text-align: left; }
.bonus-count { font: 700 84px/1 var(--pixel); color: var(--cyan); }
.bonus-count.go, .bonus-count.countdown { color: var(--cream); }
.bonus-sub { margin: 0; color: var(--grey); font-size: 15px; min-height: 1.4em; }
.bonus-bar { height: 16px; border: var(--px) solid var(--cream); }
.bonus-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--cyan) 0 8px, transparent 8px 11px); }
.bonus-hits { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 28px; }
.bonus-hits .sym { width: 22px; height: 22px; }
.bonus-hits .miss { opacity: .3; }

/* --- résultat, classement, formulaires ----------------------------------------------------- */
.final { text-align: center; }
.final-score { margin: 0; font: 700 clamp(60px, 20vw, 100px)/1 var(--pixel); color: var(--cyan); letter-spacing: .04em; }
.record { display: inline-block; margin: 6px 0; background: var(--lime); color: var(--bg); padding: 4px 10px; font: 700 14px var(--tiny); text-transform: uppercase; animation: blink .5s steps(1) 6; }
.board { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.board li { counter-increment: r; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 12px 6px; border-bottom: 2px solid var(--line); }
.board li::before { content: counter(r, decimal-leading-zero); font: 700 22px var(--pixel); color: var(--cyan); }
.board li.me { background: var(--panel-2); }
.board .pts { font: 700 22px var(--pixel); }
.board .date { display: block; font-size: 11px; color: var(--grey); }
.board .empty { grid-template-columns: 1fr; color: var(--grey); }
.board .empty::before { content: none; }
form { display: flex; flex-direction: column; gap: 10px; }
label { font: 700 11px var(--tiny); text-transform: uppercase; color: var(--grey); display: flex; flex-direction: column; gap: 4px; }
input { font: 400 18px var(--pixel); min-height: 50px; padding: 10px 12px; background: var(--bg); color: var(--cream); border: var(--px) solid var(--cream); border-radius: 0; }
input:focus { outline: 3px solid var(--cyan); outline-offset: 1px; }

/* =========================================================================================
   EFFETS DE RÉCOMPENSE / D'ÉCHEC (ui/fx.js) — animations en « steps » façon console 8 bits
   ========================================================================================= */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fx .word {
  position: absolute; left: 50%; top: 22%; transform: translate(-50%, 0) skewX(-10deg);
  font: 700 clamp(40px, 13vw, 72px)/1 var(--pixel); text-transform: uppercase; white-space: nowrap;
  color: var(--cyan); text-shadow: 4px 4px 0 var(--bg), -4px -4px 0 var(--bg), 4px -4px 0 var(--bg), -4px 4px 0 var(--bg);
  animation: word-in .45s steps(4) both, word-out .3s steps(3) 1.1s forwards;
}
.fx-lose .word, .fx-gameover .word { color: var(--cream); animation: word-in .3s steps(3) both, glitch .5s steps(5) .3s 2, word-out .3s steps(3) 1.3s forwards; }
.fx-gameover .word { top: 34%; animation: word-in .3s steps(3) both, blink .3s steps(1) .3s 6; }
.fx .px { position: absolute; left: var(--x0); top: var(--y0); width: var(--s); height: var(--s); background: var(--c);
  animation: burst .9s steps(9) var(--d) forwards; }
.fx .flash { position: absolute; inset: 0; background: var(--c, var(--cyan)); animation: flash .2s steps(2) forwards; }
.fx .scan { position: absolute; left: 0; right: 0; height: var(--h); top: var(--y); background: var(--cream); mix-blend-mode: difference;
  animation: scan .6s steps(6) var(--d) forwards; }
.screen-game.shake-all { animation: shake .45s steps(9); }

@keyframes pop { 50% { transform: scale(1.15); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes slam { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes word-in { 0% { transform: translate(-50%, 30px) skewX(-10deg) scale(.4); opacity: 0; } 60% { transform: translate(-50%, -6px) skewX(-10deg) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, 0) skewX(-10deg) scale(1); opacity: 1; } }
@keyframes word-out { to { opacity: 0; transform: translate(-50%, -30px) skewX(-10deg); } }
@keyframes glitch { 0%, 100% { margin-left: 0; } 25% { margin-left: -8px; } 50% { margin-left: 8px; } 75% { margin-left: -4px; } }
@keyframes burst { 0% { transform: translate(0, 0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }
@keyframes scan { 0% { opacity: 1; } 100% { opacity: 0; transform: translateX(var(--dx)); } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .fx { display: none; } }
/* titres focalisés par la navigation (accessibilité) : pas de cadre visible */
[tabindex="-1"]:focus { outline: none; }
.step.beatstart { margin-left: 0; }
.seq[data-len="8"] .step:nth-child(2n+1), .seq[data-len="16"] .step:nth-child(4n+1), .seq[data-len="12"] .step:nth-child(4n+1) { box-shadow: inset 0 -4px 0 var(--dim); }
.legend .item small { font-size: 10px; }

/* --- choix du micro --- */
.mic-pick { flex-direction: row; align-items: center; gap: 10px; }
.mic-pick select { flex: 1; min-width: 0; min-height: 42px; font: 400 15px var(--pixel); color: var(--cream); background: var(--panel); border: var(--px) solid var(--dim); border-radius: 0; padding: 4px 8px; }
.mic-pick select:focus { outline: 3px solid var(--cyan); }

/* --- choix de langue --- */
.lang { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: -6px; }
.lang button { min-width: 44px; min-height: 34px; font: 700 13px var(--tiny); color: var(--grey); background: transparent; border: 2px solid var(--dim); cursor: pointer; }
.lang button[aria-pressed="true"] { color: var(--bg); background: var(--cream); border-color: var(--cream); }
.lang button:focus-visible { outline: 3px solid var(--cyan); }

/* --- partage, défi, billetterie --- */
.btn-tickets { background: var(--bg); border-color: var(--cyan); color: var(--cyan); text-decoration: none; display: flex; align-items: center; justify-content: center; }
.btn-tickets:hover { background: var(--panel-2); }
.btn-ico { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.challenge { border: var(--px) solid var(--cyan); background: var(--panel-2); clip-path: var(--notch); padding: 12px 14px; text-align: center; }
.challenge p { margin: 0; }
.challenge b { color: var(--cyan); }
.challenge .big { font: 700 22px var(--pixel); text-transform: uppercase; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
  background: var(--cream); color: var(--bg); padding: 10px 16px; font: 700 15px var(--pixel); clip-path: var(--notch); animation: pop .2s steps(2); }
.actions-top { margin-top: 0; }

/* --- guide des sons (débutant) --- */
.guides { display: grid; gap: 12px; }
.guide { border: var(--px) solid var(--dim); background: var(--panel); clip-path: var(--notch); padding: 12px 14px; text-align: left; }
.guide h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 700 20px var(--pixel); text-transform: uppercase; color: var(--cyan); }
.guide h3 .sym { width: 36px; height: 36px; flex: none; }
.guide-say { margin: 0 0 6px; font: 700 15px var(--tiny); color: var(--cream); }
.guide-steps { margin: 0 0 8px; padding-left: 20px; line-height: 1.45; }
.guide-steps li { margin-bottom: 4px; }
.guide-tip { margin: 0 0 10px; color: var(--grey); font-size: 14px; }
.guide-tip::before { content: '► '; color: var(--cyan); }
.btn-example { width: 100%; min-height: 48px; border-color: var(--cyan); color: var(--cyan); }
.guide-src { margin: 6px 0 0; min-height: 1em; }
.guide summary { cursor: pointer; font: 700 14px var(--tiny); text-transform: uppercase; color: var(--cyan); list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: '+ '; }
.guide[open] summary::before { content: '− '; }
.guide[open] summary { margin-bottom: 8px; }
.guide-practice { border-color: var(--cyan); }
.studio-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.studio-row .btn { min-width: 0; padding: 8px 4px; font-size: 14px; }

/* =========================================================================================
   TOUT TIENT DANS L'ÉCRAN (téléphone) — tailles qui suivent la hauteur visible (dvh)
   ========================================================================================= */
:root { --read: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; --gap: clamp(6px, 1.3dvh, 14px); }
.app { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 560px) { .app { height: calc(100dvh - 36px); min-height: 0; } }
.screen { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: var(--gap);
  padding: clamp(10px, 2dvh, 22px) 16px calc(clamp(10px, 2dvh, 22px) + env(safe-area-inset-bottom)); }

/* accueil */
.brand { padding-top: 0; }
.kicker { font-size: clamp(10px, 1.6dvh, 14px); }
.title { margin-top: 2px; }
.title { margin-top: 2px; }
.title .t1 { font-size: clamp(22px, min(9vw, 4.4dvh), 48px); }
.title .t2 { font-size: clamp(28px, min(12vw, 5.6dvh), 60px); }
.year { margin-top: clamp(0px, .5dvh, 8px); font-size: clamp(28px, min(13vw, 5.8dvh), 70px); text-shadow: 3px 3px 0 var(--cyan); }
.brand { padding-top: 0; }
[data-screen="home"] { padding-top: clamp(6px, 1.2dvh, 16px); }
.lead { font-size: clamp(11px, 1.7dvh, 15px); }
.legend { gap: 8px; }
.legend .item { padding: clamp(5px, 1dvh, 14px) 4px clamp(4px, .8dvh, 10px); }
.legend .item .sym { width: clamp(26px, 4.6dvh, 48px); height: clamp(26px, 4.6dvh, 48px); }
.legend .item b { margin-top: 4px; font-size: clamp(13px, 2dvh, 17px); }
.seg button { min-height: clamp(36px, 5.4dvh, 50px); font-size: clamp(13px, 1.9dvh, 16px); }
.difficulty legend { margin-bottom: 4px; font-size: clamp(10px, 1.4dvh, 12px); }
.difficulty .hint { margin-top: 4px; }
.btn { min-height: clamp(40px, 6dvh, 54px); font-size: clamp(14px, 2.1dvh, 18px); padding: 6px 12px; }
.btn-xl { min-height: clamp(48px, 7.6dvh, 70px); font-size: clamp(20px, 3.6dvh, 30px); }
.btn-ghost { min-height: clamp(36px, 5dvh, 46px); font-size: clamp(12px, 1.8dvh, 15px); }
.actions { gap: clamp(6px, 1.1dvh, 10px); }
.row { gap: 8px; }
.band { padding: clamp(6px, 1.2dvh, 12px) 14px; font-size: clamp(16px, min(5.6vw, 2.8dvh), 24px); }
.privacy { font-size: 11px; }
.lang { justify-content: center; margin: 0; }
.lang button { min-height: 30px; }
/* écrans très bas : on retire les textes d'aide les moins utiles */
@media (max-height: 640px) {
  [data-screen="home"] .privacy, [data-screen="home"] .legend .item small { display: none; }
}
/* le bandeau « 28 NOV. @ VK → tickets » doit se voir sans défiler : on allège l'accueil sur les écrans de téléphone */
@media (max-height: 960px) {
  [data-screen="home"] .privacy { display: none; }
  [data-screen="home"] .lead { font-size: clamp(10px, 1.5dvh, 13px); }
  [data-screen="home"] .legend .item small { display: none; }
  .prize { padding: 4px 8px; }
  .prize-title { display: inline; margin: 0 6px 0 0; font-size: 9px; }
  .prize-body { display: inline; font-size: 10.5px; line-height: 1.25; }
  .prize-body br { display: none; }
  .prize-body strong:nth-of-type(2)::before { content: ' · '; color: var(--cream); font-weight: 400; }
  .jury-title { font-size: 9px; margin-bottom: 2px; }
  .jury-portrait img, .jury-portrait { width: 36px !important; height: 36px !important; }
  .jury-list li small { font-size: 8px; }
  .jury-list li b { font-size: 8px; }
  .title .t1 { font-size: clamp(20px, min(8.5vw, 4dvh), 44px); }
  .title .t2 { font-size: clamp(26px, min(11vw, 5.2dvh), 56px); }
  .year { font-size: clamp(26px, min(12vw, 5.4dvh), 64px); }
  [data-screen="home"] .btn-xl { min-height: clamp(42px, 6.4dvh, 60px); font-size: clamp(18px, 3dvh, 26px); }
  [data-screen="home"] { gap: clamp(4px, .9dvh, 10px); }
}
@media (max-height: 620px) {
  [data-screen="home"] .lead, .jury-list li small, .jury-title { display: none; }
  .jury-portrait img, .jury-portrait { width: 30px !important; height: 30px !important; }
  [data-screen="home"] .legend .item { padding: 3px 4px; }
  [data-screen="home"] .btn-ico { min-height: 34px; font-size: 12px; }
}

/* textes à lire (explications, aides) : police lisible au lieu de la police pixel */
.guide-steps, .guide-tip, .tuto p, .card p, .card li, .hint, .privacy, .review-note, .timeline-legend, .trend, .detail, .alert, .mic-pick select, .guide-practice {
  font-family: var(--read); -webkit-font-smoothing: antialiased; letter-spacing: 0;
}
.guide-say { font: 700 16px/1.35 var(--read); color: var(--cream); }
.guide-steps { font-size: 16px; line-height: 1.5; padding-left: 22px; }
.guide-tip { font-size: 15px; line-height: 1.45; color: #c7cdd1; }
.hint { font-size: 13px; line-height: 1.4; }

/* guide des sons : onglets K / S / H */
.guide-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.guide-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 4px; cursor: pointer;
  font: 700 14px var(--pixel); text-transform: uppercase; color: var(--cream); background: var(--panel); border: var(--px) solid var(--dim); clip-path: var(--notch); }
.guide-tabs button .sym { width: 26px; height: 26px; }
.guide-tabs button[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }
.guides { gap: var(--gap); }
.guide { padding: 12px 14px; }
.guide h3 { font-size: 18px; }

/* tutoriel */
.tuto { min-height: 0; padding: clamp(10px, 2dvh, 18px); }
.tuto h3 { font-size: clamp(18px, 3dvh, 24px); }
.tuto p { font-size: 16px; line-height: 1.45; }


/* jeu */
.screen-game { gap: clamp(4px, 1dvh, 10px); }
.hud { padding-bottom: 6px; }
.hud-score { font-size: clamp(16px, 2.6dvh, 22px); }
.hud-score .lbl { font-size: clamp(14px, 2.3dvh, 20px); }
.life { width: clamp(22px, 3.4dvh, 30px); height: clamp(22px, 3.4dvh, 30px); }
.round { font-size: clamp(20px, 3.4dvh, 28px); }
.stage { gap: clamp(6px, 1.3dvh, 12px); }
.banner { padding: clamp(6px, 1.2dvh, 12px); }
.phase { font-size: clamp(20px, 3.4dvh, 28px); }
.step { max-width: min(104px, 12dvh); }
.seq[data-len="8"] .step, .seq[data-len="12"] .step, .seq[data-len="16"] .step { max-width: min(58px, 7.4dvh); }
.feedback { min-height: 36px; font-size: clamp(16px, 2.5dvh, 20px); }
.btn-quit { min-width: 160px; }

/* bilan de manche : visible d'un coup, détail replié */
.review-card { max-height: calc(100dvh - 28px); padding: clamp(10px, 2dvh, 18px) 14px; gap: clamp(6px, 1.2dvh, 12px); }
.verdict { font-size: clamp(22px, min(8vw, 4.4dvh), 38px); }
.review-stats b { font-size: clamp(18px, 3dvh, 24px); }
.review-more { text-align: left; border-top: 2px solid var(--line); padding-top: 6px; }
.review-more summary, .opts summary { cursor: pointer; font: 700 13px var(--tiny); text-transform: uppercase; color: var(--cyan); list-style: none; }
.review-more summary::-webkit-details-marker, .opts summary::-webkit-details-marker { display: none; }
.review-more summary::before, .opts summary::before { content: '+ '; }
.review-more[open] summary::before, .opts[open] summary::before { content: '− '; }
.bonus-count { font-size: clamp(56px, 11dvh, 84px); }

/* résultat */
.final-score { font-size: clamp(48px, min(18vw, 10dvh), 100px); }
.record { margin: 4px 0; }
.opts { border: var(--px) solid var(--dim); clip-path: var(--notch); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.opts[open] summary { margin-bottom: 2px; }
/* concours : pas de choix de difficulté (les réglages viennent du palier) */
body.contest .training-only { display: none !important; }
.hint.center { text-align: center; margin: 0; }
#save-box { padding: 10px 12px; }
#save-box form { gap: 8px; }
input { min-height: 44px; font-size: 17px; padding: 8px 12px; }

/* classement */
.board li { padding: clamp(6px, 1.1dvh, 12px) 6px; }
.board li::before, .board .pts { font-size: clamp(16px, 2.6dvh, 22px); }
.save-row { display: flex; gap: 8px; }
.save-row input { flex: 1; min-width: 0; }
.save-row .btn { width: auto; flex: none; }
#save-box p { margin: 0 0 6px; }
@media (max-height: 760px) {
  [data-screen="home"] .privacy, [data-screen="sounds"] > .guides > .lead { display: none; }
  [data-screen="results"] .h2 { display: none; }
  .guide-steps { font-size: 15px; line-height: 1.4; }
  .guide-steps li { margin-bottom: 2px; }
}
@media (max-height: 600px) {
  [data-screen="home"] .difficulty .hint, [data-screen="home"] .best { display: none; }
  .guide-tip { display: none; }
}
@media (max-height: 860px) { [data-screen="home"] .privacy { display: none; } }
.final-score { font-size: clamp(44px, min(18vw, 8dvh), 100px); }
#final-stats div { padding: 4px; }
#final-stats b { font-size: clamp(16px, 2.6dvh, 24px); }
@media (max-height: 600px) { [data-screen="sounds"] .guides > .hint { display: none; } }
[data-screen="results"] { gap: clamp(5px, 1dvh, 12px); }
[data-screen="results"] .final .lbl { display: none; }
@media (max-height: 600px) {
  #final-stats, #final-best { display: none; }
  [data-screen="results"] .btn-xl { min-height: 44px; font-size: 20px; }
}
.screen-game.danger { box-shadow: inset 0 0 0 3px var(--lime); animation: danger-pulse 1.1s steps(1) infinite; }
.screen-game.danger .hud { border-bottom: 6px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--lime) 0 8px, var(--bg) 8px 16px) 6; }
.screen-game.danger .hud-lives .life:first-child { animation: blink .55s steps(1) infinite; }
.screen-game.danger .banner { border-color: var(--lime); }
@keyframes danger-pulse { 0%, 18%, 36% { box-shadow: inset 0 0 0 3px var(--lime); } 9%, 27% { box-shadow: inset 0 0 0 7px var(--lime); } 50%, 100% { box-shadow: inset 0 0 0 2px rgba(226, 240, 117, .35); } }
/* manche de sauvetage */
.screen-game.rescue .banner { background: var(--lime); border-color: var(--lime); }
.screen-game.rescue .phase { color: var(--bg); }
.screen-game.rescue .pattern-name { color: var(--lime); }
.verdict.rescue-offer { border-color: var(--lime); color: var(--lime); animation: blink .4s steps(1) 4; }
#review-note strong { color: var(--lime); }
@media (prefers-reduced-motion: reduce) { .screen-game.danger { box-shadow: inset 0 0 0 4px var(--lime); } }

/* --- échauffement --- */

/* --- carte « Comment jouer », entrée du juge, essais, clic du décompte (lot 2) --- */
.intro { display: flex; flex-direction: column; gap: 10px; }
.intro p { margin: 0; font-size: 16px; line-height: 1.45; }
.intro b { color: var(--cyan); }
.intro .demo { display: flex; gap: 10px; }
.intro .demo .sym { width: 32px; height: 32px; }
.entry-card { text-align: center; cursor: pointer; }
.entry-sub { margin: 0; font: 700 12px var(--tiny); text-transform: uppercase; color: var(--grey); }
.screen-game.trial .pattern-name { color: var(--lime); }
.seq .step.barstart { box-shadow: -4px 0 0 var(--bg), -7px 0 0 var(--cyan); }
.banner.click { animation: click-flash .16s steps(1); }
.pulse.click i.on { background: var(--cream); border-color: var(--cream); }
@keyframes click-flash { 0% { border-color: var(--cyan); background: var(--cyan); } 100% { background: var(--panel-2); } }
.banner.click .phase { animation: click-text .16s steps(1); }
@keyframes click-text { 0% { color: var(--bg); } 100% { color: inherit; } }
.opts .mic-pick { display: flex; }
.review-stats .tend b { font-size: 15px; line-height: 1.15; }

/* --- boîte de dialogue des juges (lot 4) ---------------------------------------------------- */
.jbox { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: var(--px) solid var(--cream); clip-path: var(--notch); background: var(--panel); text-align: left; cursor: pointer; }
.jbox-figure { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.judge-portrait { display: block; width: 96px; height: 96px; background: var(--bg); }
.judge-portrait img, .judge-portrait svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.jbox-figure .judge-portrait { border: var(--px) solid var(--cream); clip-path: var(--notch); box-sizing: content-box; }
.jbox-name { display: block; margin-top: 4px; padding: 3px 4px; background: var(--cyan); color: var(--bg); font: 700 11px var(--tiny); text-transform: uppercase; text-align: center; letter-spacing: .04em; }
.jbox-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.jbox-line { margin: 0; min-height: 2.7em; font: 400 16px/1.35 var(--pixel); color: var(--cream); overflow-wrap: anywhere; }
.jbox-line .snd { color: var(--cyan); font-weight: 700; }
.jbox-second { margin: 0; font: 400 10px/1.4 var(--tiny); text-transform: uppercase; color: var(--grey); }
.jbox-second:empty { display: none; }
.jbox.more .jbox-body::after { content: '▼'; align-self: flex-end; color: var(--cyan); font: 700 12px var(--tiny); animation: blink .8s steps(1) infinite; }
.jbox.no-figure { justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.judge-silhouette { background: var(--bg); }
/* avatar 32 px du HUD */
.hud-avatar .judge-portrait { width: 32px; height: 32px; outline: 2px solid var(--dim); }
/* entrée, relais */
.entry-card { gap: 10px; }
.relay-card { gap: 12px; }
.relay-portraits { display: flex; justify-content: center; gap: 18px; }
.relay-judge { display: flex; flex-direction: column; width: 102px; opacity: .45; }
.relay-judge.speaking { opacity: 1; }
.relay-judge .judge-portrait { border: var(--px) solid var(--cream); clip-path: var(--notch); box-sizing: content-box; }
.relay-judge.speaking .judge-portrait { border-color: var(--cyan); }
/* fin de partie : portrait ×2 (192 px), réplique dessous */
.jbox-xl .jbox { flex-direction: column; align-items: center; text-align: center; }
.jbox-xl .judge-portrait { width: 192px; height: 192px; }
.jbox-xl .jbox-body { align-items: center; }
.jbox-xl .jbox-line { min-height: 0; }
/* grand écran : même composant, portrait 192 px */
@media (min-width: 900px) and (min-height: 760px) {
  .jbox-host:not(.jbox-xl) .jbox .judge-portrait { width: 192px; height: 192px; }
  .relay-judge { width: 198px; }
}
.status-row { display: flex; justify-content: center; align-items: center; gap: 4px 14px; flex-wrap: wrap; }

/* --- journal des scores : cadre de télé pixel (lot 5) ---------------------------------------- */
.tv { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: var(--px) solid var(--cream); clip-path: var(--notch); background: var(--panel); box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 9px var(--dim); }
.tv-title { display: flex; align-items: center; gap: 10px; background: var(--lime); color: var(--bg); padding: 6px 10px; clip-path: var(--notch); }
.tv-title .h2 { margin: 0; font: 700 clamp(15px, 4.4vw, 20px) var(--tiny); text-transform: uppercase; color: var(--bg); letter-spacing: .03em; }
.tv-title .h2::before { display: none; }
.tv-live { width: 10px; height: 10px; flex: none; background: var(--bg); animation: blink 1s steps(1) infinite; }
.tv-flash { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--lime); color: var(--bg); font: 700 13px var(--tiny); text-transform: uppercase; animation: flash-blink .25s steps(1) 4; }
.tv-flash b { font-size: 18px; letter-spacing: .08em; }
@keyframes flash-blink { 50% { background: var(--cream); } }
.board.contest .date { color: var(--cyan); }
.ticker { overflow: hidden; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 6px 0; font: 700 12px var(--tiny); text-transform: uppercase; white-space: nowrap; }
.ticker-track { display: inline-flex; }
.ticker-track.moving { animation: ticker 30s steps(300) infinite; }
.ticker-run { display: inline-flex; }
.tick { padding-right: 22px; color: var(--cream); }
.tick b { color: var(--cyan); }
.tick::after { content: '◆'; margin-left: 22px; color: var(--lime); }
.tick.empty { color: var(--grey); white-space: normal; }
.tick.empty::after { content: none; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track.moving { animation: none; } .ticker { white-space: normal; } .ticker-run[aria-hidden] { display: none; } }
.tv-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tv-by { font: 700 10px var(--tiny); text-transform: uppercase; color: var(--grey); }
/* logos partenaires : hauteur fixe, largeur libre, jamais étirés ; espace de protection = ½ hauteur */
.partners { display: inline-flex; align-items: center; gap: calc(var(--ph, 28px) / 2); padding: calc(var(--ph, 28px) / 2); }
.partner { display: inline-flex; align-items: center; text-decoration: none; }
.partner img { display: block; height: var(--ph, 28px); width: auto; max-width: none; object-fit: contain; }
.partner-text { display: inline-flex; align-items: center; height: var(--ph, 28px); padding: 0 calc(var(--ph, 28px) / 3); border: 2px solid var(--cream); font: 700 calc(var(--ph, 28px) * .5) var(--tiny); letter-spacing: .06em; color: var(--cream); line-height: 1; }
.credits { margin: 0; display: flex; align-items: center; justify-content: center; gap: 4px; font: 700 10px var(--tiny); text-transform: uppercase; color: var(--grey); }
.credits .partners { padding: 4px 10px; }
.tv .seg button { padding: 0 2px; font-size: clamp(10px, 3vw, 14px); min-width: 0; }
.tv .seg button:first-child { flex: 1.25; }

/* annonce du score façon JT (canvas 1080×1350, pixels nets) */
.news-scene { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 1350; max-width: 460px; margin: 0 auto; }

/* --- Tes sons : enregistrement son par son, avant la première partie ---------------------- */
.voice-choice, .voice-rec, .voice-done { display: flex; flex-direction: column; gap: 14px; }
.voice-legend .item { cursor: default; }
.voice-steps { display: flex; gap: 6px; padding: 0; margin: 0; list-style: none; }
.voice-steps li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 11px var(--tiny); text-transform: uppercase; padding: 8px 2px; border-bottom: 4px solid var(--line); color: var(--grey); }
.voice-steps li .sym { width: 20px; height: 20px; opacity: .45; }
.voice-steps li.active { border-color: var(--cyan); color: var(--cream); }
.voice-steps li.active .sym, .voice-steps li.done .sym { opacity: 1; }
.voice-steps li.done { border-color: var(--cream); color: var(--cream); }
.voice-symbol { text-align: center; }
.voice-symbol .sym { width: clamp(64px, 13dvh, 112px); height: clamp(64px, 13dvh, 112px); }
.voice-symbol.flash { animation: pop .2s steps(2); }
.voice-instr { text-align: center; font-size: 20px; font-weight: 700; margin: 0; }
.voice-dots { display: flex; justify-content: center; gap: 10px; }
.voice-dots > i { width: 22px; height: 22px; border: var(--px) solid var(--cream); }
.voice-dots > i.on { background: var(--cyan); border-color: var(--cyan); }
#voice-detail { min-height: 1.4em; margin: 0; }

/* --- icônes pixel des boutons ---------------------------------------------------------------- */
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.btn-ico { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

/* --- bouton musique (accueil, fin de partie) --------------------------------------------------- */
.app { position: relative; }
.music-btn { position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--cyan); background: var(--bg); border: 2px solid var(--dim); cursor: pointer; }
.music-btn[aria-pressed="false"] { color: var(--grey); }
.music-btn .ico { width: 20px; height: 20px; }
.music-btn:focus-visible { outline: 3px solid var(--cyan); }
[data-screen="home"] .brand { padding-top: 34px; } /* place pour le bouton musique */
[data-screen="leaderboard"] .tv { margin-top: 46px; } /* idem : la télé ne passe pas sous le bouton */

/* --- le jury de l'accueil : six juges, assombris tant qu'ils ne sont pas validés ----------------- */
.jury { display: flex; flex-direction: column; gap: 8px; }
.jury-title { margin: 0; text-align: center; font: 700 11px var(--tiny); text-transform: uppercase; letter-spacing: .08em; color: var(--grey); }
.jury-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 0; margin: 0; list-style: none; }
.jury-list li { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.jury-list .judge-portrait { width: 48px; height: 48px; box-sizing: content-box; display: block; border: 2px solid var(--line); background: var(--panel); }
.jury-list .judge-portrait img, .jury-list .judge-portrait svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.jury-list b { font: 700 9px var(--tiny); text-transform: uppercase; color: var(--cream); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jury-list small { font: 400 9px var(--tiny); color: var(--grey); white-space: nowrap; }
.jury-list .jury-locked .judge-portrait { filter: grayscale(1) brightness(.32); }
.jury-list .jury-locked b { color: var(--dim); }
.jury-list .jury-next .judge-portrait { filter: grayscale(1) brightness(.55); border-color: var(--cyan); }
.jury-list .jury-ok .judge-portrait { border-color: var(--cream); }
.jury-list .jury-ok small { color: var(--cyan); }

/* --- lot 8 : prix, nom de joueur, clé de reprise, bouton tickets du juge ------------------------ */
.prize { border: 2px solid var(--lime); padding: 10px 12px; clip-path: var(--notch); text-align: center; }
.prize-title { margin: 0 0 4px; font: 700 12px var(--tiny); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.prize-body { margin: 0; font-size: 13px; line-height: 1.4; }
.prize-body strong { color: var(--lime); }
.prize-note { margin: 4px 0 0; font-size: 11px; color: var(--grey); }
.prize-line { margin: 6px 0 0; font: 700 12px var(--tiny); text-transform: uppercase; color: var(--lime); }
.tv-prize { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--lime); color: var(--bg); }
.tv-prize b { font: 700 13px var(--tiny); text-transform: uppercase; }
.tv-prize span { font-size: 12px; }
.tv-key { margin: 0; padding: 6px 10px; font-size: 11px; color: var(--grey); text-align: center; }
.board li.top3::before { color: var(--lime); }
.prize-tag { display: inline-block; margin-left: 8px; font: 700 10px var(--tiny); color: var(--lime); text-transform: uppercase; vertical-align: middle; }
.key-card { text-align: center; }
.key-code { margin: 8px 0; font: 700 clamp(22px, 7vw, 32px)/1.2 var(--pixel); letter-spacing: .06em; color: var(--cyan); user-select: all; -webkit-user-select: all; }
.key-card .row { justify-content: center; }
#name-form label, #claim-form label, #claim-form-acc label { display: block; margin: 8px 0; font: 700 12px var(--tiny); text-transform: uppercase; color: var(--grey); }
#name-form input, #claim-form input, #claim-form-acc input { display: block; width: 100%; margin-top: 4px; box-sizing: border-box; }
#claim-form input, #claim-form-acc input { font-family: var(--pixel); text-transform: uppercase; letter-spacing: .08em; }
.jbox-tickets { display: inline-block; margin-top: 6px; padding: 6px 10px; border: 2px solid var(--cyan); color: var(--cyan); text-decoration: none; font: 700 11px var(--tiny); text-transform: uppercase; clip-path: var(--notch); }
.jbox-tickets:hover { background: var(--cyan); color: var(--bg); }
@media (max-height: 740px) { .prize-body { font-size: 12px; } .prize-note { display: none; } }

/* --- options pendant la partie (barre du bas, au-dessus des cartes des juges) --------------------- */
.game-opts { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: var(--px) solid var(--line); }
.gopt { min-height: 44px; padding: 4px 6px; background: var(--panel); color: var(--cream); border: var(--px) solid var(--line); border-radius: 0; font-family: var(--tiny); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.gopt .gopt-k { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.gopt b { font-size: 11px; text-transform: uppercase; color: var(--cyan); }
.gopt[aria-pressed="true"] b { color: var(--lime); }
.gopt-quit { color: var(--grey); }
.gopt-quit b { color: var(--grey); font-size: 10px; }
.screen-game { padding-bottom: 64px; }
.screen-game .btn-quit { display: none; }
.overlay { padding-bottom: 70px; }
.prize { padding: 6px 10px; }
.prize-title { font-size: 10px; margin-bottom: 2px; }
.prize-body { font-size: 12px; line-height: 1.35; }
.voice-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice-pick .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 96px; gap: 4px; padding: 10px 8px; font-size: 13px; line-height: 1.15; text-align: center; }
.voice-pick .btn > span:not(.ico) { display: block; }
.voice-pick .btn small { display: block; font: 400 11px var(--tiny); text-transform: none; opacity: .75; }
.voice-pick .btn .ico svg { width: 22px; height: 22px; }
.band-results { margin-top: 8px; }
.gopt.forced { opacity: .85; } .gopt.forced b { color: var(--grey); }

/* classement : le reste des joueurs en colonnes compactes sous le top 20 */
.board-rest { padding: 8px 6px 4px; border-top: 2px solid var(--line); }
.rest-title { margin: 0 0 6px; font: 700 10px var(--tiny); text-transform: uppercase; letter-spacing: .08em; color: var(--grey); }
.rest-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 14px; counter-reset: rr 20; }
.rest-list li { counter-increment: rr; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; padding: 2px 0; break-inside: avoid; }
.rest-list li::before { content: counter(rr) '.'; color: var(--grey); font: 700 11px var(--tiny); min-width: 24px; }
.rest-list li span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-list li b { font: 700 12px var(--pixel); color: var(--cream); }
.rest-list li.me { color: var(--cyan); }
.inapp { border-color: var(--lime); } .inapp strong { color: var(--lime); }
.inapp-home { text-align: left; } .inapp-home .row { margin-top: 6px; } .inapp-home .btn { min-height: 40px; font-size: 13px; }

/* micro : sensibilité (barre d'options, 5 boutons) et filtre anti-bruit */
.game-opts { grid-template-columns: 1fr 1fr 1.1fr 1fr .9fr; gap: 3px; padding-left: 6px; padding-right: 6px; }
.gopt { padding: 4px 3px; }
.toggle { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; text-transform: none; color: var(--cream); font: 14px/1.3 var(--read); padding: 8px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--cyan); margin: 0; }
.toggle small { grid-column: 2; font-size: 12px; color: var(--grey); }
@media (max-width: 380px) { .gopt .gopt-k { font-size: 8px; } .gopt b { font-size: 10px; } }

/* lot 8r — ordinateur : la barre d'options suit le cadre du jeu (le clip-path cranté de .app la coupait) */
@media (min-width: 560px) {
  .game-opts { left: 50%; right: auto; width: calc(min(520px, 100vw) - 2 * var(--px)); transform: translateX(-50%); bottom: calc(18px + var(--px)); padding-bottom: 6px; }
  .screen-game { padding-bottom: 72px; }
}
/* lot 8r — petits libellés un cran plus grands avec la nouvelle police */
.hud-sub { font-size: 13px; }
.pattern-name { font-size: 13px; }
.gopt .gopt-k { font-size: 10px; }
.gopt b { font-size: 12px; }
@media (max-width: 380px) { .gopt .gopt-k { font-size: 9px; } .gopt b { font-size: 11px; } }

/* lot 8r — message aux joueurs qui reviennent */
.news8r { border-color: var(--cyan); text-align: left; } .news8r strong { color: var(--cyan); } .news8r p { margin: 0 0 6px; font-size: 14px; } .news8r .btn { min-height: 40px; font-size: 14px; }

/* lot 8u — proposition de refaire ses sons quand ils sont confondus */
.revoice { border: var(--px) dashed var(--lime); padding: 10px 12px; text-align: left; }
.revoice p { margin: 0 0 8px; font: 400 14px/1.35 var(--read); color: var(--cream); }
.revoice .btn { min-height: 40px; font-size: 14px; width: 100%; }
