/* public/css/ui.css — Refonte UI 2D « neutre + orange » (2026-07-21).
   Système papier/encre + un seul accent orange soleil. Fredoka partout.
   La scène 3D « Beach Show » reste le fond ; l'UI flotte par-dessus en
   panneaux clairs (menus) ou scrims sombres + flou (au-dessus de la 3D).
   Voir docs/superpowers/specs/2026-07-21-ui-refonte-neutre-orange-design.md */

@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Neutres papier/encre */
  --paper: #eceae5;
  --ink: #2f2d2a;
  --ink2: #77736c;
  --line: #cfccc4;
  --line2: #a9a59c;
  --panel: #ffffff;
  --fill: #e4e1da;
  /* Accent unique : orange soleil */
  --accent: #df7526;
  --accent-weak: #f6e2ce;
  --accent-ink: #a2551b;
  /* Sémantique révélation seulement */
  --ok-line: #4a7c59; --ok-bg: #eaf2ec; --ok-ink: #2f5138;
  --no-line: #a8544a; --no-bg: #f3e7e5; --no-ink: #7a3a32;
  /* Scrims au-dessus de la 3D */
  --scrim-lt: rgba(255,255,255,.93);
  --scrim-lt-bd: rgba(0,0,0,.14);
  --scrim-dk: rgba(44,41,37,.74);
  --scrim-dk-bd: rgba(255,255,255,.16);
  --radius: 14px;
  --font: 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Couches scène / overlay ---------- */
#stage3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
body.no-webgl #stage3d { display: none; }
body.no-webgl {
  background: linear-gradient(-25deg, #241f1a, #6b5f52 40%, #b98b55 70%, #df7526);
  background-size: 400% 400%;
  animation: bg-drift 18s ease infinite;
}
@keyframes bg-drift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

#overlay { position: fixed; inset: 0; pointer-events: none; }
#overlay .screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
}
#overlay .screen > * { pointer-events: auto; }
#overlay .screen[hidden] { display: none; }

/* ================= COMPOSANTS ================= */

.btn {
  font: 600 14px/1.1 var(--font);
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--line2);
  border-radius: var(--radius);
  padding: 12px 16px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; text-align: center;
  transition: transform .1s ease, filter .15s ease, background .15s ease, border-color .15s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(223,117,38,.35); }
.btn.gho { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.lg { font-size: 16px; padding: 15px; }
.btn.dis, .btn:disabled { opacity: .4; pointer-events: none; }

/* Boutons sur scrim sombre (au-dessus de la 3D) */
.scrim.dk .btn { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.scrim.dk .btn.pri { background: var(--accent); border-color: var(--accent); }
.scrim.dk .btn.gho { background: transparent; border-color: rgba(255,255,255,.35); }

.field {
  font: 400 14px/1.2 var(--font);
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--line2);
  border-radius: 13px;
  padding: 12px 13px; min-height: 44px; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.field::placeholder, .field .ph-txt { color: var(--ink2); }
.field:focus, .field:focus-within { outline: none; border-color: var(--accent); }
.field.is-error { border-color: var(--accent); }
input.field { display: block; }

.scrim {
  background: var(--scrim-lt);
  border: 1.5px solid var(--scrim-lt-bd);
  border-radius: 16px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.scrim.dk { background: var(--scrim-dk); color: #fff; border-color: var(--scrim-dk-bd); }

.pill {
  border: 1.5px solid var(--line2); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  background: var(--panel); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.pill.acc { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-weak); }
.pill.btnlike { cursor: pointer; }
.scrim.dk .pill { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.scrim.dk .pill.acc { background: var(--accent); border-color: var(--accent); color: #fff; }

.badge {
  font: 700 10px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .03em;
  padding: 3px 7px; border-radius: 6px; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge.acc { background: var(--accent); color: #fff; }
.badge.gr { background: var(--fill); color: var(--ink2); }

.toggle { width: 38px; height: 22px; border-radius: 999px; background: var(--fill); border: 1.5px solid var(--line2); position: relative; flex: none; cursor: pointer; }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s ease; }
.toggle.on i { left: 18px; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line2); flex: none; transition: width .2s, background .2s; }
.dot.on { background: var(--accent); width: 20px; border-radius: 999px; }

/* Timer réutilisable (écran 07) : barre + chiffre. Urgence = orange + pulsation. */
.timer { position: relative; height: clamp(16px, 2.6vw, 20px); border-radius: 999px; background: var(--fill); border: 1.5px solid var(--line2); overflow: hidden; width: 100%; }
.timer i { display: block; height: 100%; background: var(--ink2); transition: width .12s linear; }
.timer.urg i { background: var(--accent); }
.timer.urg { animation: timer-urg 0.9s ease-in-out infinite; }
@keyframes timer-urg { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); } }
/* Sous ~3 s : le chrono « chauffe » — rouge franc + pulsation accélérée. */
.timer.hot i { background: var(--no-line); }
.timer.hot { animation: timer-hot 0.5s ease-in-out infinite; }
@keyframes timer-hot { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--no-line) 34%, transparent); } }
.scrim.dk .timer { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }
.scrim.dk .timer i { background: rgba(255,255,255,.85); }
.scrim.dk .timer.urg i { background: var(--accent); }
.timer-num { font: 700 clamp(14px, 3.4vw, 20px)/1 ui-monospace, Menlo, monospace; color: var(--ink2); }
.scrim.dk .timer-num { color: rgba(255,255,255,.85); }
.timer-num.urg, .timer.urg + .timer-num { color: var(--accent-ink); }
.timer-num.hot, .timer.hot + .timer-num { color: var(--no-ink); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); border: 1.5px solid var(--line2); flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.avatar.sm { width: clamp(28px, 6vw, 36px); height: clamp(28px, 6vw, 36px); }
.scrim.dk .avatar { border-color: rgba(255,255,255,.3); }

.lbl { font: 600 12px/1.3 ui-monospace, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.scrim.dk .lbl { color: rgba(255,255,255,.75); }
.title-s { font-size: 24px; font-weight: 700; line-height: 1.15; }
.body-s { font-size: 15px; color: var(--ink2); line-height: 1.5; }
.scrim.dk .body-s { color: rgba(255,255,255,.82); }

/* Spinner générique */
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; }
.spin.lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.ad-slot { min-height: 0; width: 100%; max-width: 480px; }
.ad-slot:not(:empty) { min-height: 60px; margin: 4px 0; }

/* ================= 01 · ONBOARDING ================= */
#overlay #screen-onboarding { justify-content: stretch; padding: 0; }
#overlay #screen-onboarding[hidden] { display: none; }
.onb { width: 100%; max-width: 460px; margin: auto; padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.onb-top { display: flex; justify-content: space-between; align-items: center; }

/* Carte d'explication : un seul panneau givré cohérent (badge emoji + texte),
   pas un placeholder rayé. La scène 3D transparaît doucement à travers. */
.onb-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 30px 24px; border-radius: 26px; }
.onb-badge { width: min(42vw, 172px); aspect-ratio: 1; border-radius: 30%; display: flex; align-items: center; justify-content: center; font-size: clamp(58px, 20vw, 100px); line-height: 1;
  background: radial-gradient(130% 130% at 32% 22%, #fff 0%, var(--accent-weak) 60%, #f3c393 100%);
  border: 1.5px solid var(--accent);
  box-shadow: 0 18px 36px rgba(223,117,38,.26), inset 0 2px 0 rgba(255,255,255,.75); }
.onb-card .title-s { font-size: 23px; }
.onb-card .body-s { font-size: 14px; max-width: 32ch; }

/* Carte avatar : haut transparent (l'avatar 3D transparaît), texte + sélecteur
   réunis sur le panneau sombre — plus aucun chevauchement. */
.onb-live { flex: 1; min-height: 120px; }
/* Panneau compact et centré : plus étroit que les cartes d'explication pour que
   les pastilles couleur restent petites (sinon le panneau devient trop haut et
   masque l'avatar). Ancré en bas via le spacer .onb-live. */
.onb-picker { width: min(320px, 94%); align-self: center; display: flex; flex-direction: column; gap: 9px; padding: 13px 14px; }
.onb-picker-title { font-size: 18px; text-align: center; }

.onb-grp { display: flex; flex-direction: column; gap: 7px; }
.onb-dots { display: flex; justify-content: center; gap: 6px; }
.brand-badge { font: 700 12px/1 var(--font); letter-spacing: .02em; color: var(--accent-ink); background: var(--accent-weak); border: 1.5px solid var(--accent); padding: 5px 11px; border-radius: 8px; }

/* ================= 02 · ACCUEIL ================= */
.home-top { width: 100%; max-width: 760px; display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.wordmark { font-family: var(--font); font-weight: 700; font-size: clamp(26px, 7vw, 44px); letter-spacing: -.01em; color: var(--ink); }
.wordmark .wm-q { color: var(--accent); }
.home-preview { width: 100%; max-width: 760px; flex: 1; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.home-body { width: 100%; max-width: 760px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: stretch; margin-top: auto; margin-bottom: 2vh; }
.home-form { flex: 1 1 320px; display: flex; flex-direction: column; gap: 11px; }
/* Accueil : picker compact (comme .onb-picker) pour degager l'avatar 3D dessine
   derriere — le panneau ne doit plus remonter par-dessus le perso. */
.home-picker { flex: 0 1 300px; align-self: center; }
.home-picker .picker { gap: 7px; }
.home-picker .picker-colors { gap: 6px; }
.form-error { color: var(--accent-ink); background: var(--accent-weak); border: 1.5px solid var(--accent); border-radius: 12px; padding: 9px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.form-error[hidden] { display: none; } /* le display:flex ci-dessus battrait le [hidden] du navigateur */
.home-join { display: flex; gap: 8px; }
.home-join .field { flex: 1; }
.input--code { text-transform: uppercase; letter-spacing: .18em; font-weight: 600; }
.lang-pill { cursor: pointer; }
.lang-select { font: inherit; border: 1.5px solid var(--line2); border-radius: 999px; padding: 5px 10px; background: var(--panel); color: var(--ink); }

/* Sélecteur d'avatar (picker) : réutilisé onboarding + accueil */
.picker { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.picker-title { font-size: 15px; font-weight: 600; }
.picker-colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.picker-swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.picker-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); outline: 2px solid var(--panel); outline-offset: -4px; }
.scrim.dk .picker-swatch[aria-checked="true"] { outline-color: rgba(0,0,0,.2); }
.picker-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.picker-label { color: var(--ink2); }
.scrim.dk .picker-label { color: rgba(255,255,255,.75); }
.picker-stepper { display: flex; align-items: center; gap: 9px; }
.picker-arrow { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--panel); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.scrim.dk .picker-arrow { border-color: rgba(255,255,255,.35); background: transparent; color: #fff; }
.picker-value { font-weight: 600; font-size: 13px; min-width: 64px; text-align: center; }

/* ================= 03 · SALON ================= */
.lobby { width: 100%; max-width: 460px; margin: auto 0; display: flex; flex-direction: column; gap: 11px; }
.lobby-top { display: flex; justify-content: space-between; align-items: center; }
.lobby-code-panel { padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lobby-code { font-size: clamp(28px, 8vw, 34px); font-weight: 700; letter-spacing: .12em; }
.lobby-listhead { display: flex; justify-content: space-between; align-items: baseline; }
.lobby-players { list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 34vh; overflow-y: auto; }
.lobby-player { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 8px; }
.lobby-player-name { flex: 1; font-size: 12px; font-weight: 500; }
.lobby-player.is-offline { opacity: .45; }
.lobby-settings { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.settings-seg { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.settings-seg .pill { cursor: pointer; padding: 3px 9px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.settings-locked { display: flex; gap: 7px; align-items: center; color: var(--ink2); border-top: 1px dashed var(--line); padding-top: 7px; }
.lobby-note { text-align: center; font-size: 12px; color: var(--ink2); min-height: 1.2em; }
/* Bouton « Je suis prêt » : invitation neutre au repos, vert franc une fois
   activé (le clic confirme l'état — plus de « Pas prêt » ambigu). */
.lobby-ready.is-ready { background: #2b7d4d; border-color: #2b7d4d; color: #fff; box-shadow: 0 4px 14px rgba(43,125,77,.38); }
.lobby-ready.is-ready:active { transform: scale(0.97); }

/* ================= 04 · HUD EN JEU ================= */
/* game/end : plein cadre, la 3D respire au centre. */
#overlay #screen-game, #overlay #screen-end { padding: 0; justify-content: stretch; }
#overlay #screen-game[hidden], #overlay #screen-end[hidden] { display: none; }
.band--window { position: absolute; inset: 0; pointer-events: none; }
#overlay .screen > .band--window { pointer-events: none; }

.hud-bar { position: absolute; left: 10px; right: 10px; padding: 9px 12px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.hud-bar.top { top: max(10px, env(safe-area-inset-top)); }
.hud-bar.bottom { bottom: max(10px, env(safe-area-inset-bottom)); }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-me { display: flex; align-items: center; gap: 9px; }
.hud-me-txt { line-height: 1.1; }
.hud-me .avatar.sm { width: clamp(34px, 9vw, 48px); height: clamp(34px, 9vw, 48px); }
.hud-score { font-size: clamp(18px, 4.4vw, 28px); font-weight: 700; }
.hud-rank { font-size: clamp(12px, 3vw, 16px); color: rgba(255,255,255,.82); }
.hud-jokers { display: flex; gap: 8px; }
.hud-joker { flex: 1; flex-direction: column; gap: 2px; font-size: clamp(13px, 2vw, 15px); padding: clamp(9px, 1.6vw, 13px); min-height: 44px; }
.hud-joker span { font-size: clamp(9px, 1.5vw, 11px); color: rgba(255,255,255,.78); }
.hud-help { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 4; }

/* Panneau central flottant (vote, question, scoreboard) sur scrim clair. */
.gpanel { position: absolute; inset: 12px; z-index: 3; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.gpanel-head { display: flex; justify-content: space-between; align-items: center; }
.gpanel-title { font-size: clamp(18px, 3.2vw, 28px); font-weight: 700; }

/* ================= 05 · VOTE ================= */
.vote-meta { display: flex; justify-content: space-between; align-items: center; }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px;
  -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
.vote-card { border: 1.5px solid var(--line2); border-radius: 12px; padding: 9px; display: flex; flex-direction: column; gap: 5px; background: var(--panel); cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.vote-card.is-mine { border: 2px solid var(--accent); background: var(--accent-weak); }
/* Non-chooser : cartes en lecture seule (seul le plus bas au score choisit). */
.vote-card.is-readonly { cursor: default; opacity: .82; }
.pick-chooser { display: inline-flex; align-items: center; gap: 6px; }
.vote-card.is-winner { border: 2px solid var(--accent); background: var(--accent); color: #fff; animation: answer-pop .4s cubic-bezier(.34,1.56,.64,1); }
.vote-card.is-winner .vote-count, .vote-card.is-winner .vote-name { color: #fff; }
.vote-art { width: 100%; height: 34px; display: flex; align-items: center; justify-content: center; }
.vote-art svg { height: 100%; width: auto; }
.vote-name { font-size: 12px; font-weight: 600; }
.vote-count { font-size: 10px; color: var(--ink2); font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .05em; }
.vote-card.is-mine .vote-count { color: var(--accent-ink); }
.vote-foot { text-align: center; font-size: 11px; color: var(--ink2); }
/* Résultat du vote (« X l'emporte ») */
.vote-result { position: absolute; inset: 12px; z-index: 3; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; text-align: center; }

/* ================= 06 · QUESTION + RÉPONSES ================= */
.q-meta { display: flex; justify-content: space-between; align-items: center; }
.q-text { background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: clamp(12px, 2.2vw, 20px); font-size: clamp(18px, 4.6vw, 30px); font-weight: 700; line-height: 1.3; text-wrap: balance; color: var(--ink); }
/* Cartes claires imbriquées dans le panneau sombre (.gpanel.scrim.dk) : elles
   héritent sinon du color:#fff du scrim → texte blanc sur fond blanc. On force
   l'encre foncée (la spécificité de .scrim.dk .* battait leurs couleurs). */
.scrim.dk .q-text, .scrim.dk .score-row, .scrim.dk .score-name, .scrim.dk .score-val { color: var(--ink); }
.scrim.dk .q-fastest .body-s { color: var(--accent-ink); }
.answers { display: flex; flex-direction: column; gap: clamp(7px, 1.4vw, 12px); flex: 1; min-height: 0; }
.answer-wrap { display: flex; flex-direction: column; gap: 3px; }
.answer {
  position: relative;
  font: 700 clamp(15px, 3.8vw, 22px)/1.2 var(--font); color: var(--ink);
  background: var(--panel); border: 2px solid var(--line2); border-radius: 12px;
  padding: clamp(13px, 2vw, 20px) clamp(42px, 9vw, 58px); min-height: clamp(52px, 8vw, 68px);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-align: center; width: 100%;
  transition: opacity .25s, background .2s, border-color .2s, transform .1s;
}
/* Lettre A/B/C/D ancrée à l'extrémité gauche ; texte de la réponse centré. */
.answer-key { position: absolute; left: clamp(14px, 2.6vw, 22px); top: 50%; transform: translateY(-50%); opacity: .75; }
.answer-text { flex: 0 1 auto; text-wrap: balance; }
.answer .answer-verdict { position: absolute; right: clamp(12px, 2.4vw, 20px); top: 50%; transform: translateY(-50%); }
.answer:not(:disabled):active { transform: scale(0.98); }
.answer.is-hidden { visibility: hidden; }
.answer.is-locked, .answer:disabled { cursor: default; }
.answer.is-dead { opacity: .4; text-decoration: line-through; }
.answer.is-picked { background: var(--accent); border-color: var(--accent); color: #fff; }
.answer.is-picked .badge { background: rgba(255,255,255,.25); }
.answer.is-pop { animation: answer-pop .4s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes answer-pop { from { transform: scale(.7) translateY(14px); opacity: 0; } 60% { transform: scale(1.04); } }
/* Révélation — feedback vif : bonne réponse pop + glow vert, mauvaise shake + glow rouge. */
.answer.is-correct { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink);
  box-shadow: 0 0 0 2px var(--ok-line), 0 8px 20px rgba(74,124,89,.28); animation: correct-pop .45s cubic-bezier(.34,1.56,.64,1); }
.answer.is-wrong { border-color: var(--no-line); background: var(--no-bg); color: var(--no-ink);
  box-shadow: 0 6px 18px rgba(168,84,74,.22); animation: wrong-shake .4s ease; }
@keyframes correct-pop { 0% { transform: scale(1); } 40% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes wrong-shake { 10%, 90% { transform: translateX(-2px); } 30%, 70% { transform: translateX(3px); } 50% { transform: translateX(-3px); } }
.answer.is-faded { opacity: .55; }
.answer-verdict { font-size: 10px; font-weight: 700; }
/* Chips de pseudos des autres joueurs sous chaque réponse */
.who { display: flex; flex-wrap: wrap; gap: 3px; padding-left: 2px; }
.who .pill { padding: 0 7px; font-size: 10px; }
.who .pill.me { border-color: var(--accent); color: var(--accent-ink); }
.who .pill.first { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-weak); }
.q-foot { text-align: center; font-size: 11px; color: var(--ink2); }
.q-fastest { border-color: var(--accent) !important; background: var(--accent-weak) !important; padding: 8px; display: flex; align-items: center; gap: 8px; }
.q-fastest .body-s { color: var(--accent-ink); font-size: 12px; }

/* ================= 08 · SCOREBOARD ================= */
.score-list { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; overflow-y: auto; }
.score-row { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 11px; padding: 7px 9px; }
.score-row.is-me { border-color: var(--line2); box-shadow: 0 0 0 1.5px var(--line2); }
.score-row.is-first { background: var(--accent-weak); border-color: var(--accent); }
.score-rank { font-weight: 700; width: 16px; text-align: center; }
.score-name { flex: 1; font-size: 13px; font-weight: 600; }
.score-delta { font-size: 11px; }
.score-delta.up { color: var(--ok-ink); }
.score-delta.down { color: var(--no-ink); }
.score-delta.flat { color: var(--ink2); }
.score-val { font-weight: 700; font-size: 13px; }
.score-row.is-sliding { animation: rank-slide .5s cubic-bezier(.2,1.1,.4,1); }
@keyframes rank-slide { from { transform: translateY(var(--from)); } }

/* ================= 09 · PODIUM ================= */
.podium-wrap { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; padding: 14px; gap: 11px; }
.podium-head { padding: 10px; text-align: center; }
.podium-title { font-size: 19px; font-weight: 700; }
.podium-spacer { flex: 1; }
.podium-row { display: flex; align-items: flex-end; gap: 8px; justify-content: center; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 30%; max-width: 120px; }
.podium-name { font-size: 12px; font-weight: 600; text-align: center; }
.podium-step { width: 100%; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; }
.podium-step .rk { font-weight: 700; }
.podium-col.first .podium-step { border-color: var(--accent); background: var(--accent-weak); }
.podium-col.first .podium-step .rk, .podium-col.first .podium-step .lbl { color: var(--accent-ink); }
.podium-more { padding: 8px; display: flex; justify-content: space-between; align-items: center; }
.podium-actions { display: flex; gap: 8px; }
.podium-actions .btn { flex: 1; }

/* ================= 10 · MODALE COMMENT JOUER ================= */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(44,41,37,.5); pointer-events: auto; display: flex; align-items: flex-end; justify-content: center; }
.modal-overlay.ingame { background: rgba(44,41,37,.32); }
.modal-overlay[hidden] { display: none; }
.modal-sheet { width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 15px; display: flex; flex-direction: column; gap: 11px; max-height: 88vh; animation: sheet-up .25s cubic-bezier(.2,1.2,.4,1); }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line2); align-self: center; }
.modal-close { cursor: pointer; }
.howto-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; -webkit-mask-image: linear-gradient(#000 92%, transparent); mask-image: linear-gradient(#000 92%, transparent); }
.howto-card { display: flex; gap: 10px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; align-items: center; }
.howto-num { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-weak); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.howto-card h4 { font-size: 13px; font-weight: 600; }

/* ================= SCRIM RECONNEXION (global) ================= */
.reconnect { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; pointer-events: auto; }
.reconnect[hidden] { display: none; }
.reconnect-card { width: min(86vw, 360px); padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }

/* ================= ANNONCEUR (plein cadre) ================= */
.announcer { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 20; }
.announcer[hidden] { display: none; }
.announcer-card {
  font-family: var(--font); font-size: clamp(22px, 6vw, 42px); font-weight: 700; text-align: center;
  padding: 16px 30px; border-radius: 18px;
  background: var(--scrim-dk); color: #fff; border: 2px solid rgba(255,255,255,.16);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; gap: 14px;
  animation: announce-in .3s cubic-bezier(.2,1.4,.4,1);
}
.announcer.is-out .announcer-card { animation: announce-out .25s ease forwards; }
@keyframes announce-in { from { transform: scale(.7) translateY(24px); opacity: 0; } }
@keyframes announce-out { to { transform: scale(.9) translateY(-16px); opacity: 0; } }
.announcer-sub { font-size: .5em; color: rgba(255,255,255,.8); margin-top: 4px; }
.announcer-badge { display: block; font-size: 1.5em; line-height: 1; margin-bottom: 4px; }
.announcer-art { flex: 0 0 64px; width: 64px; height: 64px; }
.announcer-art svg { width: 100%; height: 100%; }
.announcer.is-round .announcer-card, .announcer.is-finale .announcer-card { flex-direction: column; gap: 4px; font-size: clamp(28px, 8vw, 52px); padding: 22px 40px; }
.announcer.is-finale .announcer-card { border-color: var(--accent); color: #fff; background: rgba(60,42,20,.86); }
.announcer.is-finale .announcer-badge { color: var(--accent); animation: finale-badge 1s ease-in-out infinite alternate; }
@keyframes finale-badge { to { transform: scale(1.12); } }

/* ================= CHARGEMENT ================= */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 18px; background: var(--paper); transition: opacity .4s ease; }
#loading.is-done { opacity: 0; pointer-events: none; }
.loading-logo { font-family: var(--font); font-size: clamp(30px, 9vw, 52px); font-weight: 700; color: var(--ink); text-align: center; }
.loading-logo span { color: var(--accent); display: inline-block; transform: rotate(8deg); animation: logo-pulse 1.1s ease-in-out infinite; }
@keyframes logo-pulse { 50% { transform: rotate(8deg) scale(1.12); } }
.loading-bar { width: min(260px, 60vw); height: 10px; border-radius: 999px; background: var(--fill); border: 1.5px solid var(--line2); overflow: hidden; margin: 0 auto; }
.loading-fill { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

/* ================= TOASTS ================= */
.toasts { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--panel); border: 1.5px solid var(--line); border-left: 4px solid var(--ink2); border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: 0 6px 22px rgba(0,0,0,.12); animation: toast-in .25s ease; text-align: center; }
.toast--warn { border-left-color: var(--accent); }
.toast--error { border-left-color: var(--no-line); }
.toast.is-out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-12px); opacity: 0; } }

/* ================= TRANSITIONS ================= */
.anim-out { animation: slide-down-out .2s ease forwards; }
.anim-in { animation: slide-up-in .25s cubic-bezier(.2,1.2,.4,1) backwards; }
.screen-enter { animation: screen-fade-in .3s ease backwards; }
@keyframes slide-down-out { to { transform: translateY(14px); opacity: 0; } }
@keyframes slide-up-in { from { transform: translateY(16px); opacity: 0; } }
@keyframes screen-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ================= CONTRASTE SUR LA 3D ================= */
/* Tout texte posé à nu sur la scène (pas sur un panneau) : encre foncée +
   halo clair. --ink2 gris clair est banni ici (illisible sur le sable doré) ;
   on force --ink et on ajoute un liseré blanc pour garantir ≥ 4.5:1. */
.home-top .wordmark,
.lobby-listhead .title-s {
  text-shadow: 0 1px 2px rgba(255,255,255,.8), 0 0 12px rgba(255,255,255,.55);
}
.onb-top .btn.gho,
.lobby-top .btn.gho,
.lobby-listhead .lbl,
.lobby-note {
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255,255,255,.85), 0 0 10px rgba(255,255,255,.6);
}
/* Points de pagination à nu : off-state plus dense + anneau blanc pour
   ressortir sur le fond clair. */
.onb-dots .dot { background: var(--line2); box-shadow: 0 0 0 1.5px rgba(255,255,255,.7), 0 1px 3px rgba(0,0,0,.25); }
.onb-dots .dot.on { background: var(--accent); }

/* ================= DESKTOP / PAYSAGE ================= */
@media (min-width: 720px) and (orientation: landscape) {
  .hud-bar { left: 12px; right: 12px; }
  .hud-bar.top .hud-row { justify-content: space-between; }
  .gpanel { inset: 14px; }
  .vote-grid { grid-template-columns: repeat(5, 1fr); }
  .answers.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
}

/* Paliers hauts : sur grand écran, on POUSSE les plafonds des clamp() plus loin
   pour que le HUD soit généreux et respire (au lieu de rester coincé au max). */
@media (min-width: 900px) {
  .gpanel { padding: clamp(14px, 2.2vw, 26px); gap: clamp(10px, 1.6vw, 16px); }
  .q-text { font-size: clamp(28px, 3vw, 38px); }
  .answer { font-size: clamp(20px, 2.2vw, 26px); min-height: clamp(60px, 6vw, 74px); }
  .answers { gap: clamp(10px, 1.4vw, 14px); }
  .gpanel-title { font-size: clamp(26px, 2.8vw, 34px); }
  .hud-score { font-size: clamp(26px, 2.6vw, 34px); }
  .hud-rank { font-size: clamp(15px, 1.4vw, 18px); }
  .hud-me .avatar.sm { width: clamp(46px, 4.4vw, 56px); height: clamp(46px, 4.4vw, 56px); }
  .timer { height: clamp(20px, 1.8vw, 24px); }
  .timer-num { font-size: clamp(20px, 2vw, 26px); }
}
@media (min-width: 1200px) {
  .q-text { font-size: clamp(36px, 3vw, 46px); }
  .answer { font-size: clamp(24px, 2vw, 30px); min-height: clamp(70px, 5vw, 84px); }
  .gpanel-title { font-size: clamp(32px, 2.6vw, 42px); }
  .hud-score { font-size: clamp(32px, 2.4vw, 42px); }
  .hud-rank { font-size: clamp(17px, 1.4vw, 20px); }
  .hud-me .avatar.sm { width: clamp(54px, 4vw, 66px); height: clamp(54px, 4vw, 66px); }
  .timer { height: clamp(24px, 1.6vw, 28px); }
  .timer-num { font-size: clamp(24px, 1.8vw, 30px); }
}
