:root {
  --bg: #0e2342;
  --surface: #1b1d4a;
  --surface-2: #262a63;
  --border: #3b3f85;
  --border-input: #6569b0; /* 3:1 against --surface and --bg (WCAG 1.4.11) */
  --edge: #0b0c2a; /* the solid underside every raised thing sits on */
  --text: #ecebf8;
  --text-2: #bdbbe0;
  --muted: #9d9bca;
  --accent: #ff8a65;
  --accent-edge: #b8553a;
  --on-accent: #1a1b45;
  --yellow: #ffd96b;
  --yellow-edge: #b8982f;
  --purple: #b8a2c8;
  --blue: #9bb8ff;
  --silver: #c9ced9;
  --silver-edge: #7f8598;
  --dirt: #c9b98a;
  --dirt-edge: #7d6c3f;
  --link: #a9c0ff;
  --good: #67d6a4;
  --bad: #ff8fa0;
  --on-soft: #1a1b45;
  --cream: #fbf3df;
  --paper: #fff;
  --danger: #e5484d;
  --bad-edge: #b5566a;
  --edge-2: #14163f;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-title: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

/* Desktop shown at 133 %; zoom does not shrink vh/vw, so --vh/--vw pre-divide them to keep filling the viewport exactly. */
:root { --vh: 100dvh; --vw: 100vw; }
@media (min-width: 900px) { html { zoom: 1.33; } :root { --vh: calc(100dvh / 1.33); --vw: calc(100vw / 1.33); } }

html { background-color: var(--bg); } /* the iOS rubber band shows html, not black */
@media (max-width: 1179.98px) { html, body { overscroll-behavior-y: none; } }
* { box-sizing: border-box; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: var(--vh);
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { position: relative; flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px 16px; }
main > .screen { flex: 1; align-content: start; } /* the credits footer below never adds a scrollbar: the page is exactly one viewport tall unless a screen really is taller */
#credits p { margin: 0; color: var(--text-2); font-size: 0.9rem; }
#credits a { color: var(--link); }
#credits .link { justify-self: center; }
/* Credits: one tiny link under the page; fixed at the bottom so it never adds height (and a page scrollbar) to the screens. Hidden in game, where the answer dock owns the bottom. */
.site-foot { position: fixed; inset: auto 0 0; z-index: 5; display: flex; justify-content: center; padding: 0 16px 6px; pointer-events: none; }
.site-foot > * { pointer-events: auto; }
body:has(#game:not([hidden])) .site-foot { display: none; }
button.credits-link { position: relative; min-height: 24px; padding: 0 12px; color: var(--muted); font: 600 0.75rem Nunito, sans-serif; text-decoration: none; opacity: 0.8; }
button.credits-link::before { content: ""; position: absolute; inset: -10px -8px; } /* 44px touch target around the small text */
button.credits-link:hover { color: var(--text-2); text-decoration: underline; opacity: 1; }
h1, h2 { font-family: var(--font-title); font-weight: 800; margin: 0; }
h1 { font-size: clamp(2.75rem, 11vw, 5.5rem); font-stretch: 78%; line-height: 0.95; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 1.5rem; font-stretch: 85%; }
.screen { display: grid; gap: 24px; justify-items: center; }
.screen > * { max-width: 100%; }
[hidden] { display: none !important; }

.topbar { position: relative; z-index: 1; background: color-mix(in srgb, var(--bg) 85%, black); }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.logo .drop { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none; }
.logo { position: relative; display: inline-block; rotate: -4deg; padding: 0 14px; border-radius: var(--radius-sm); background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-edge); color: var(--on-accent); text-decoration: none; font-family: var(--font-title); font-weight: 800; font-stretch: 80%; font-size: 1.75rem; letter-spacing: 0.04em; }
.label, .badge, .rank, .muted.mono { font-family: Nunito, system-ui, sans-serif; font-weight: 700; font-size: 13px; text-transform: none; letter-spacing: 0; }
.timer { font-family: var(--font-mono); font-weight: 600; font-size: 11px; }

.muted { color: var(--text-2); font-size: 0.9rem; margin: 0; }
.center { text-align: center; }
.lead { margin: 12px 0 0; color: var(--text-2); }
.hero { text-align: center; padding-top: 24px; }
#q-number { font: 700 13px Nunito, sans-serif; color: var(--text-2); }

label { display: grid; gap: 6px; font-family: Nunito, sans-serif; font-weight: 700; font-size: 13px; color: var(--muted); }
input, select, button { font: inherit; }
input:not([type="checkbox"]):not([type="file"]), select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font: 400 1rem Nunito, system-ui, sans-serif; /* 16px avoids the iOS zoom on focus */
}
input[readonly] { opacity: 0.6; }
input:not([type="checkbox"]):not([type="file"]):focus, select:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgb(169 192 255 / 0.25); }
::selection { background: rgb(95 96 232 / 0.6); color: var(--paper); }
input { caret-color: var(--link); }
input::placeholder { color: var(--muted); opacity: 1; }
* { scrollbar-color: var(--border) transparent; }
button {
  --edge: var(--accent-edge);
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  cursor: pointer;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
/* Buzzer: a solid underside that the press flattens. */
button:not(.icon, .link, .avatar-edit, .reel-item, .bob-item, .code, .leave, .chat-tab) { box-shadow: 0 5px 0 var(--edge); }
@media (hover: hover) { button:not(.icon, .link, .avatar-edit, .reel-item, .bob-item, .code, .leave, .chat-tab):hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 0 var(--edge); } }
button:not(.icon, .link, .avatar-edit, .reel-item, .bob-item, .code, .leave, .chat-tab):active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
button:is(.icon, .reel-item, .avatar-edit):active:not(:disabled) { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { button, button.reel-item { transition: none; } button:hover:not(:disabled), button:active:not(:disabled) { transform: none !important; } }
button.outline { --edge: var(--edge-2); background: var(--surface-2); color: var(--text); }
button.yellow { --edge: var(--yellow-edge); background: var(--yellow); }
button.link { background: none; color: var(--link); text-decoration: underline; }
button.big { min-height: 60px; padding: 14px 44px; font-size: 1.25rem; border-radius: var(--radius-lg); }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm); box-shadow: 0 6px 0 var(--edge); padding: 24px; display: grid; gap: 16px; align-content: start; }

/* Home */
#home-form { display: grid; gap: 24px; width: 100%; justify-items: center; }
input:not([type="checkbox"]):not([type="file"])[aria-invalid="true"] { border-color: var(--bad); }
.who { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 480px; }
.nick { flex: 1; min-width: 0; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 56px; position: relative; }
/* Place du message réservée au-dessus des cartes (margin-top) : hors flux, rien ne bouge à son apparition. */
/* Bulle BD blanche à bordure rouge, collée sous le pseudo (haut de la place réservée), queue vers le champ. */
#name-error { position: absolute; top: -65px; left: max(0px, calc(50% - 240px + 88px)); width: max-content; max-width: calc(100% - 88px); margin: 0; z-index: 1; padding: 4px 12px; gap: 6px; border-color: var(--danger); border-radius: var(--radius-lg); background: var(--paper); color: var(--on-accent); font-size: 0.8125rem; rotate: -1.5deg; transform-origin: 40px 0; }
/* Ouverture et fermeture par la même transition (pop) ; masquée, la bulle reste en place mais invisible. */
#name-error[hidden] { display: flex !important; visibility: hidden; opacity: 0; scale: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  #name-error { animation: none; transition: opacity 380ms, scale 380ms cubic-bezier(0.34, 1.56, 0.64, 1); }
  #name-error[hidden] { transition: opacity 190ms, scale 190ms cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s 190ms; }
}
#name-error::before { width: 16px; height: 16px; background: var(--danger); }
#name-error::after { content: ""; position: absolute; top: -7px; left: 32px; width: 10px; height: 10px; rotate: 45deg; background: var(--paper); border: 2px solid var(--danger); border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 13px Nunito, sans-serif; }
.pills li:nth-child(5n+2) { background: var(--yellow); rotate: 2deg; }
.pills li:nth-child(5n+3) { background: var(--purple); rotate: -2deg; }
.pills li:nth-child(5n+4) { background: var(--blue); rotate: 1.5deg; }
.pills li:nth-child(5n+5) { background: var(--good); rotate: -1.5deg; }
.card.yellow { border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl); }
.panels .card { display: flex; flex-direction: column; }
.panels .card button { margin-top: auto; }
.code-field input:not([type="checkbox"]):not([type="file"]) { /* same specificity as the base input rule, which came first and won */
  min-height: 64px;
  text-align: center;
  font: 600 2rem var(--font-mono);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--yellow);
  border-style: dashed;
  border-color: var(--yellow);
  text-transform: uppercase;
}
.code-field { text-align: center; }

/* Rejoin banners */
.rejoin-list { display: grid; gap: 8px; width: min(640px, 100%); }
.rejoin-list:empty { display: none; }
.rejoin { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--blue); }
.rejoin-text { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* The 5px solid shadow weighs down the button's bottom; lift the face 3px via top so the banner height stays unchanged. */
.rejoin button { position: relative; top: -3px; }

/* Lobby */
.room-code { display: grid; justify-items: center; gap: 4px; }
.room-code .code { margin-bottom: 14px; } /* clears the tilted ticket's corners and underside */
.card > span.muted, .room-code .muted, .code-field .muted, .reveal .muted { font: 700 13px Nunito, sans-serif; color: var(--muted); }
.code-row { position: relative; display: flex; align-items: center; gap: 8px; }
/* Click-to-copy feedback: the ticket gets stamped (squash + rebound) and a check sticker pops on its corner; app.js adds .copied for under a second. */
.room-code .code { position: relative; }
.room-code .code.copied { animation: code-stamp 0.45s ease-out; }
.room-code .code.copied::after { content: "✓"; position: absolute; top: -12px; right: -12px; width: 32px; height: 32px; border: 2px solid var(--edge); border-radius: 50%; background: var(--good); color: var(--edge); font: 800 18px/28px var(--font-body, sans-serif); letter-spacing: 0; text-indent: 0; text-align: center; animation: code-check 0.9s ease-out forwards; }
@keyframes code-stamp { 25% { transform: scale(0.93) translateY(3px); } 60% { transform: scale(1.05); } }
@keyframes code-check { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 35% { transform: scale(1.25) rotate(8deg); opacity: 1; } 55%, 80% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .room-code .code.copied { animation: none; } .room-code .code.copied::after { animation-duration: 0.01s; animation-delay: 0.8s; } }
.room-code .code:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }
.room-code .code { padding: 4px 20px; background: var(--yellow); border: 0; border-radius: var(--radius-md); box-shadow: 0 6px 0 var(--yellow-edge); outline: 2px dashed rgb(26 27 69 / 0.3); outline-offset: -8px; font: 600 clamp(3rem, 12vw, 5rem)/1.1 var(--font-mono); letter-spacing: 0.15em; text-indent: 0.15em; color: var(--on-accent); cursor: copy; }
button.icon { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0; background: var(--surface-2); border: 2px solid var(--border); color: var(--text-2); }
@media (hover: hover) { button.icon:hover { color: var(--text); } }
button.danger:not(.icon) { --edge: var(--bad-edge); background: var(--bad); border-color: var(--bad); color: var(--on-soft); }
#confirm-leave .link { justify-self: center; }
button.leave { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; background: none; border: 2px solid var(--bad); color: var(--bad); font-weight: 800; }
@media (hover: hover) { button.leave:hover { background: var(--bad); color: var(--on-soft); } }
button.leave svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#toggle-code .slash { display: none; }
#toggle-code[aria-pressed="true"] .slash { display: inline; }
.copy-status { display: inline-block; min-height: 1.4em; color: var(--good); font: 700 13px Nunito, sans-serif; overflow-wrap: anywhere; }
/* The confirmation follows the check sticker on the ticket: same 0.9 s timeline, pops in, holds, then fades out (app.js clears the text when it ends). */
.copy-status.show { animation: copy-pop 0.9s ease-out forwards; }
@keyframes copy-pop { 0% { transform: scale(0.4); opacity: 0; } 35% { transform: scale(1.12); opacity: 1; } 55%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .copy-status.show { animation-name: copy-fade; } @keyframes copy-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } } }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 24px; width: min(640px, 100%); box-sizing: border-box; margin: 0; padding: 16px 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.rules dt { font: 700 13px Nunito, sans-serif; color: var(--muted); }
.rules dd { margin: 4px 0 0; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.players { list-style: none; margin: 0; padding: 0; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--on-soft); font: 400 0.95rem var(--font-title); object-fit: cover; background: var(--surface-2); text-indent: -9999px; /* a failed load paints light slivers of the broken-image frame on the round edge */ }
.photo-me { display: grid; justify-items: center; gap: 10px; }
.photo-me .avatar { width: 72px; height: 72px; }
button.avatar-edit { position: relative; display: inline-grid; min-height: 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
button.avatar-edit:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.pencil { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); color: var(--text); }
.pencil svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .avatar-edit:hover .pencil { border-color: var(--link); color: var(--link); } }
.tiles .me { grid-template-columns: 100%; } /* the wider "Retirer" link overflows evenly instead of shifting the tile */
/* Visually hidden but still read by screen readers (the photo picker is opened by its button). */
.photo-file, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; }
input[type="file"] { min-width: 0; max-width: 100%; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 6px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: 800 0.875rem Nunito, sans-serif; cursor: pointer; }
@media (hover: hover) { input[type="file"]::file-selector-button:hover { border-color: var(--link); } } /* native file inputs won't shrink on phones otherwise */
.name { font-weight: 600; overflow-wrap: anywhere; }
.me .name { color: var(--blue); }
.gain { color: var(--good); font: 800 14px Nunito, sans-serif; }
.guess { min-width: 0; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 600 13px Nunito, sans-serif; }

.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 24px; max-width: 760px; }
.tiles li { display: grid; align-content: start; justify-items: center; gap: 6px; width: 96px; text-align: center; }
#lobby .tiles .clone { display: none; } /* reel copies, phone only */
.tiles .avatar { width: 72px; height: 72px; font-size: 2rem; }
.tiles .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-width: 100%; overflow: hidden; }
.ring { display: grid; justify-items: center; gap: 32px; }
/* « Billet de séance » : le code est le talon d'un billet, les joueurs sont dans le corps. Bureau uniquement ; sous 720px le salon reste empilé. */
@media (min-width: 720px) {
  #lobby { align-content: center; } /* billet, règles et boutons restent centrés dans la page */
  .ring.billet { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0; width: min(920px, calc(var(--vw) - 48px)); height: auto; place-items: stretch; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 2px solid var(--border); border-radius: var(--radius-xl); box-shadow: 0 8px 0 var(--edge); }
  /* Talon : le code, détachable. */
  .ring.billet .room-code { align-content: center; padding: 36px 40px; border-right: 3px dashed color-mix(in srgb, var(--border-input) 70%, transparent); position: relative; }
  .ring.billet .room-code::before, .ring.billet .room-code::after { content: ""; position: absolute; right: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); }
  .ring.billet .room-code::before { top: -16px; clip-path: inset(50% 0 0 0); }
  .ring.billet .room-code::after { bottom: -16px; clip-path: inset(0 0 50% 0); }
  .ring.billet .room-code .code { font-size: clamp(2.5rem, 4.4vw, 3.5rem); }
  /* Corps : joueurs en rangs, tuiles inchangées. */
  .ring.billet .tiles { max-width: none; align-content: center; justify-content: flex-start; padding: 32px 36px; gap: 20px 18px; }
}

@media (max-width: 719.98px) {
  /* Phone lobby: four compact tiles per row and tighter blocks keep the start button on screen. */
  #lobby { gap: 14px; }
  /* One swipeable reel row: snap to the centred tile, fade at both edges. */ /* Full-bleed: the row spans the whole screen (breaking out of the 16px page padding), the looping reel (see loopReel) fills it edge to edge. */
  #lobby .tiles { gap: 12px; flex-wrap: nowrap; justify-content: flex-start; width: 100vw; max-width: none; justify-self: start; margin-inline: calc(50% - 50vw); box-sizing: border-box; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 8px 0; mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
  #lobby .tiles::-webkit-scrollbar { display: none; }
  #lobby .tiles .clone { display: grid; }
  #lobby .tiles li { width: 80px; flex: none; scroll-snap-align: center; gap: 4px; }
  @supports (animation-timeline: view(inline)) {
    #lobby .tiles li { animation: reel-focus linear both; animation-timeline: view(inline); }
    @keyframes reel-focus { 0%, 100% { transform: scale(0.8); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 1; } }
  }
  /* Few players: no loop, no copies, just a centred row. */
  #lobby .tiles.static { justify-content: center; overflow-x: visible; scroll-snap-type: none; mask-image: none; }
  #lobby .tiles.static li { animation: none; }
  #lobby .tiles .avatar { width: 56px; height: 56px; font-size: 1.5rem; }
  #lobby .rules { grid-template-columns: repeat(2, 1fr); gap: 8px 16px; padding: 10px 16px; }
  #lobby .rules dd { margin-top: 0; }
}

.list { display: grid; gap: 4px; width: 100%; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-2); }
.list .score { margin-left: auto; font: 800 14px Nunito, sans-serif; color: var(--yellow); }
.list li.is-found { background: color-mix(in srgb, var(--good) 18%, var(--surface-2)); }
.list li.is-wrong { background: color-mix(in srgb, var(--bad) 16%, var(--surface-2)); }
.list li:is(.is-found, .is-wrong) .guess { color: var(--text-2); } /* --muted drops under 4.5:1 on the tinted rows */
.players li.is-away { opacity: 0.7; }
.away-tag { color: var(--text); font: 700 12px Nunito, sans-serif; }

/* Settings dialog */
dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: 0 8px 0 var(--edge), 0 24px 48px rgb(0 0 0 / 0.4); }
dialog[open] { display: grid; gap: 16px; }
dialog::backdrop { background: rgb(10 11 40 / 0.7); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.themes { display: grid; gap: 4px; }
.theme { display: flex; align-items: center; gap: 12px; min-height: 44px; font: 600 1rem Nunito, sans-serif; text-transform: none; letter-spacing: 0; color: var(--text); }
.theme input { width: 20px; height: 20px; accent-color: var(--accent); }
.theme .muted { margin-left: auto; }

/* Game: one centred column (question, then the answer), the answer dock stuck to the bottom, players on the right edge. */
/* overflow-y: clip : le bas caché de la zone de réponse ne doit pas allonger la page (sticky reste OK). */
main:has(#game:not([hidden])) { max-width: none; padding-bottom: 0; overflow-y: clip; }
#game { --theme: var(--yellow); justify-items: stretch; align-content: stretch; grid-template-rows: 1fr; }
.game-layout { display: flex; flex-direction: column; gap: 16px; }
.game-main { display: grid; grid-template-rows: auto auto 1fr; gap: 16px; flex: 1; width: 100%; max-width: 900px; margin-inline: auto; }
.stage { display: grid; gap: 16px; align-content: start; padding-bottom: 8px; }
.game-head { display: flex; align-items: center; gap: 12px; }
.q-progress { display: grid; gap: 6px; padding: 12px 16px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 4px 0 var(--edge); }
.q-progress .cap { font: 700 12px Nunito, sans-serif; color: var(--text-2); }
.q-progress .track { display: block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.q-progress i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 400ms ease; }
@media (prefers-reduced-motion: reduce) { .q-progress i { transition: none; } }
.timer { margin-left: auto; padding: 2px 16px; border-radius: 999px; background: var(--surface-2); font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: 0; color: var(--yellow); }

/* The theme owns a colour (set from its name in app.js): banner, card edge and clock bar all carry it. */
.question { position: relative; display: grid; gap: 16px; justify-items: center; margin: 20px 0 44px; padding: 44px 24px 40px; text-align: center; background: var(--surface); border: 2px solid color-mix(in oklab, var(--theme) 60%, var(--surface)); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm); box-shadow: 0 6px 0 color-mix(in oklab, var(--theme) 25%, var(--edge)); }
.badge { position: absolute; top: 0; left: 50%; translate: -50% -50%; max-width: calc(100% - 32px); padding: 6px 24px; overflow: hidden; border-radius: var(--radius-md); background: var(--theme); box-shadow: 0 4px 0 color-mix(in oklab, var(--theme) 55%, black); color: var(--on-soft); font: 800 1.125rem/1.3 var(--font-title); letter-spacing: 0.06em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.prompt { margin: 0; font: 800 clamp(1rem, 0.5rem + 1vw, 1.4rem)/1.25 var(--font-title); overflow-wrap: anywhere; } /* fitPrompt() in app.js shrinks it to 2 lines, never cuts */
.question img { width: 100%; height: min(max(140px, calc(var(--vh) - 540px)), 640px); /* fixed box, reserved before the image loads */ object-fit: contain; border-radius: var(--radius-md); background: var(--surface-2); }

/* The right answer is a sticker straddling the bottom edge (like the badge on top): the box keeps the size of its content, the room below is reserved. */
.reveal { position: absolute; left: 50%; bottom: 0; translate: -50% 50%; display: grid; gap: 2px; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 20px; border-radius: var(--radius-md); background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-edge); color: var(--on-accent); text-align: center; }
.reveal strong { min-width: 0; font: 800 clamp(1.125rem, 3.2vw, 1.5rem)/1.25 var(--font-title); color: var(--on-accent); overflow-wrap: anywhere; }
.reveal .muted { color: var(--on-accent); }
/* Phone: a long answer (3+ lines) would outgrow the room reserved under the card; keep the sticker in the flow so it pushes instead of overlapping the answer zone. */
@media (max-width: 420px) {
  .question:has(.reveal) { margin-bottom: 20px; padding-bottom: 24px; }
  .reveal { position: static; translate: none; width: auto; max-width: 100%; box-sizing: border-box; }
}

/* Answer dock: stays at the bottom of the screen (and above the phone keyboard), result stickers pop above it. */
.answer-area { --dock-hide: calc(var(--radius-lg) + 2px); position: sticky; bottom: calc(-1 * var(--dock-hide)); z-index: 5; width: 100%; max-width: 900px; margin: auto auto calc(-1 * var(--dock-hide)); padding: 14px 16px calc(14px + var(--dock-hide) + env(safe-area-inset-bottom)); background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35); transform: translateY(calc(-1 * var(--kb, 0px))); }
.answer { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.answer input { min-height: 60px; font-size: 1.25rem; }
.answer button { min-height: 60px; padding: 10px 28px; font-size: 1.125rem; }

/* Round clock: a bar that drains under the head (it keeps its size), its colour follows the time left. */
/* Bar colour: green, then the site's yellow, then red (weights --g and --r, set by updateTimer in app.js). */
.clock { --c: color-mix(in srgb, color-mix(in srgb, var(--good) calc(var(--g, 100) * 1%), var(--yellow)), #ff5a4a calc(var(--r, 0) * 1%)); height: 14px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 2px 0 rgb(0 0 0 / 0.25); overflow: hidden; }
.clock i { display: block; height: 100%; border-radius: inherit; background: var(--c); transform-origin: left; transform: scaleX(var(--left, 0)); transition: transform 250ms linear, background-color 300ms; }
.timer.urgent { color: var(--accent); }
.timer:empty { visibility: hidden; }
.timer:empty::before, .reveal strong:empty::before { content: '\200b'; } /* keeps the head height */
.reveal[hidden] { display: grid !important; visibility: hidden; } /* the answer's room is reserved */

/* Result stickers: slapped on the table above the dock. */
.feedback { position: absolute; left: 16px; bottom: calc(100% + 12px); margin: 0; }
.feedback:not(:empty) { width: fit-content; padding: 8px 18px; border-radius: var(--radius-md); font: 800 1.25rem/1.4 var(--font-title); color: var(--on-soft); box-shadow: 0 4px 0 var(--edge); }
.feedback.good { background: var(--good); rotate: -2deg; }
.feedback.bad { background: var(--bad); rotate: 1.5deg; }
@media (prefers-reduced-motion: no-preference) {
  .feedback:not(:empty) { animation: pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
  .shake { animation: shake 0.3s, pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1); }
}
@keyframes pop { from { scale: 0.5; opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Players: a scrolling strip above the question, a column beside the centred column once there is room. */
.side-col { order: -1; display: grid; gap: 12px; min-width: 0; }
.side { display: grid; gap: 8px; min-width: 0; }
.side h2 { display: none; font-size: 1rem; }
.side .list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
/* One row per player, in the phone strip and in the desktop column alike (gameRow in app.js): avatar | pseudo and answer on one line with the score bar under | points won above the score. */
.side .list li { flex: none; width: 200px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 10px; border: 1px solid var(--border); }
.side .list li.is-found { border-color: var(--good); }
.side .list li.is-wrong { border-color: var(--bad); }
.side .list .avw { position: relative; display: grid; }
.side .list .avatar { width: 28px; height: 28px; font-size: 0.85rem; }
.side .list .chk { position: absolute; right: -6px; bottom: -4px; width: 16px; height: 16px; border: 2px solid var(--edge); border-radius: 50%; background: var(--good); color: var(--edge); font: 800 10px/12px Nunito, sans-serif; text-align: center; animation: pop 0.3s ease-out; }
.side .list .main { min-width: 0; }
.side .list .who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.side .list .name { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .list .guess, .side .list .answer, .side .list .away-tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px Nunito, sans-serif; }
.side .list .guess { color: var(--text-2); }
.side .list .answer { color: var(--good); font-weight: 800; animation: pop 0.35s ease-out; }
.side .list .bar { display: block; height: 7px; margin-top: 5px; border-radius: 4px; background: color-mix(in srgb, var(--text) 9%, transparent); overflow: hidden; }
.side .list .bar i { display: block; height: 100%; border-radius: 4px; }
.side .list .right { display: grid; justify-items: end; gap: 2px; }
.side .list .gain { min-height: 14px; font-size: 12px; line-height: 14px; }
.side .list .score { margin: 0; min-width: 0; }
/* 1180px, not 960px: from 900px the page is zoomed 133 %, and the three columns need 876 CSS px (876 x 1.33 ≈ 1165 px of window, plus a scrollbar). */
@media (min-width: 1180px) {
  /* The game column is centred on the page; the list sits to its right, level with the question box. Too narrow for that: the left track gives way first, so the box shifts left just enough. */
  .game-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(560px, var(--vw) - 600px, 900px) minmax(284px, 1fr); grid-template-rows: auto auto 1fr auto; gap: 16px 0; }
  .game-main { display: contents; }
  .game-head, .clock, .stage, .answer-area { grid-column: 2; }
  .game-head { grid-row: 1; } .clock { grid-row: 2; } .stage { grid-row: 3; } .answer-area { grid-row: 4; }
  .side-col { order: 0; grid-column: 3; grid-row: 3; align-self: start; justify-self: start; width: 260px; margin: 20px 0 0 24px; }
  .side { max-height: calc(var(--vh) - 140px); overflow-y: auto; padding: 16px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 6px 0 var(--edge); }
  .side h2 { display: block; }
  .side .list { display: grid; gap: 6px; overflow: visible; }
  .side .list li { width: auto; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 12px; padding-block: 9px; border: 0; }
  .side .list .avatar { width: 34px; height: 34px; font-size: 0.9rem; }
}

/* Ended: podium (2-1-3 on screen, 1-2-3 for screen readers), the worst player under flies beside it, then everyone. */
.finale { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 40px 56px; width: 100%; }
.podium { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.podium li { display: flex; flex-direction: column; align-items: center; gap: 6px; width: clamp(80px, 28vw, 140px); text-align: center; }
.podium .slot-0 { order: 1; } .podium .slot-1 { order: 0; } .podium .slot-2 { order: 2; }
.place-1 { --c: var(--yellow); --c-edge: var(--yellow-edge); --h: 132px; }
.place-2 { --c: var(--silver); --c-edge: var(--silver-edge); --h: 96px; }
.place-3 { --c: var(--accent); --c-edge: var(--accent-edge); --h: 68px; }
.podium .avatar { width: min(72px, 100%); height: auto; aspect-ratio: 1; box-shadow: 0 0 0 4px var(--c), 0 5px 0 4px var(--edge); }
.podium .place-1 .avatar { width: min(96px, 100%); }
.podium .name, .loser-card .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-width: 100%; overflow: hidden; font: 800 1.125rem/1.2 var(--font-title); }
.podium .name { margin-top: 6px; color: var(--cream); }
.podium .points, .loser-card .points { font: 600 1rem var(--font-mono); color: var(--yellow); }
.podium .step { order: 1; display: grid; place-items: start center; width: 100%; height: var(--h); margin-top: 4px; padding-top: 8px; border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-sm); background: var(--c); box-shadow: 0 6px 0 var(--c-edge); color: var(--on-soft); font: 800 1.75rem/1.1 var(--font-title); font-stretch: 80%; }

.loser { display: grid; justify-items: center; gap: 12px; }
.loser-tag { padding: 4px 14px; border-radius: var(--radius-md); background: var(--bad); box-shadow: 0 4px 0 var(--bad-edge); color: var(--on-soft); font-size: 1.125rem; }
/* A grubby sticker: stains kept to the corners so the dark text stays above 4.5:1. */
.loser-card { position: relative; display: grid; justify-items: center; gap: 4px; width: 168px; padding: 16px; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg); color: var(--on-accent); text-align: center; box-shadow: 0 6px 0 var(--dirt-edge);
  background: radial-gradient(circle at 12% 16%, rgb(96 70 30 / 0.45) 0 9px, transparent 10px), radial-gradient(circle at 22% 26%, rgb(96 70 30 / 0.3) 0 4px, transparent 5px), radial-gradient(30px 14px at 86% 88%, rgb(96 70 30 / 0.4) 0 70%, transparent 72%), radial-gradient(circle at 90% 12%, rgb(110 130 50 / 0.4) 0 7px, transparent 8px), var(--dirt); }
.loser-card .place { font: 700 13px Nunito, sans-serif; }
.loser-card .avatar { width: 72px; height: 72px; filter: grayscale(0.6) sepia(0.3); box-shadow: 0 0 0 3px var(--dirt-edge); }
.loser-card .points { color: var(--on-accent); }
/* Flies circle the card; still (but present) when motion is reduced. */
.fly { position: absolute; top: 50%; left: 50%; width: 6px; height: 5px; margin: -2px 0 0 -3px; border-radius: 50%; background: #1b1b1b; pointer-events: none; transform: rotate(var(--a)) translateX(var(--r)); }
.fly::before, .fly::after { content: ""; position: absolute; top: -4px; width: 5px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / 0.75); }
.fly::before { left: -3px; rotate: -30deg; }
.fly::after { right: -3px; rotate: 30deg; }
.fly-0 { --a: 20deg; --r: 88px; animation-duration: 3.2s; }
.fly-1 { --a: 110deg; --r: 100px; animation-duration: 4.1s; animation-direction: reverse; animation-delay: -1s; }
.fly-2 { --a: 200deg; --r: 76px; animation-duration: 2.6s; animation-delay: -2s; }
.fly-3 { --a: 250deg; --r: 96px; animation-duration: 5s; animation-direction: reverse; animation-delay: -3s; }
.fly-4 { --a: 320deg; --r: 82px; animation-duration: 3.7s; animation-delay: -0.5s; }

.confetti { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
.confetto { position: absolute; top: 0; border-radius: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .podium li { animation: rise 600ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
  .podium .slot-1 { animation-delay: 150ms; }
  .podium .slot-0 { animation-delay: 300ms; }
  .loser { animation: pop 380ms 600ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
  .fly { animation-name: buzz; animation-timing-function: linear; animation-iteration-count: infinite; }
  .fly::before, .fly::after { animation: flap 90ms linear infinite alternate; }
}
@keyframes rise { from { opacity: 0; translate: 0 40px; } }
@keyframes buzz {
  0% { transform: rotate(var(--a)) translateX(var(--r)); }
  25% { transform: rotate(calc(var(--a) + 90deg)) translateX(calc(var(--r) - 14px)); }
  50% { transform: rotate(calc(var(--a) + 180deg)) translateX(calc(var(--r) + 8px)); }
  75% { transform: rotate(calc(var(--a) + 270deg)) translateX(calc(var(--r) - 10px)); }
  100% { transform: rotate(calc(var(--a) + 360deg)) translateX(var(--r)); }
}
@keyframes flap { to { scale: 1 0.4; } }

.ranking-title { margin-top: 8px; }
.ranking { max-width: 480px; gap: 8px; }
.ranking li { background: var(--surface-2); border: 1px solid var(--border); padding: 12px 16px; }
.ranking li.me { border-color: var(--blue); }
.ranking .rank { width: 2.5em; font-size: 14px; color: var(--muted); }
.ranking .score { font: 600 14px var(--font-mono); }
/* Same colour code as the podium and the dirty card; .me keeps its blue border (higher specificity). */
.ranking .rank-1 { --c: var(--yellow); --c-edge: var(--yellow-edge); }
.ranking .rank-2 { --c: var(--silver); --c-edge: var(--silver-edge); }
.ranking .rank-3 { --c: var(--accent); --c-edge: var(--accent-edge); }
.ranking .rank-last { --c: var(--dirt); --c-edge: var(--dirt-edge); }
.ranking .rank-1, .ranking .rank-2, .ranking .rank-3, .ranking .rank-last { background: var(--c); border-color: var(--c); box-shadow: 0 5px 0 var(--c-edge); color: var(--on-accent); }
.ranking :is(.rank-1, .rank-2, .rank-3, .rank-last) :is(.rank, .score, .name) { color: var(--on-accent); }
.ranking :is(.rank-1, .rank-2, .rank-3, .rank-last) .name { font-weight: 800; }
.ranking :is(.rank-1, .rank-2, .rank-3, .rank-last) .avatar { box-shadow: 0 0 0 3px var(--on-accent); }

.error { display: flex; align-items: center; gap: 10px; box-sizing: border-box; max-width: 480px; margin: 0 auto 16px; padding: 8px 8px 8px 14px; rotate: -1deg; border: 2px solid var(--bad); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 4px 0 var(--edge); color: var(--text); font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.error::before { content: ""; flex: none; width: 22px; height: 22px; background: var(--bad); mask: var(--icon-alert) center / contain no-repeat; }
.error.closed::before { mask-image: var(--icon-clock); }
.error span { flex: 1; min-width: 0; }
.error button.icon { flex: none; width: 44px; height: 44px; margin: -6px; } /* 44px target, same 32px footprint */
.error { --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E"); --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: no-preference) { .error { animation: pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards; } }
.success { margin: 0; color: var(--good); white-space: pre-wrap; font: inherit; }
pre { overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .panels, .row { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

.list .name { flex: 1; min-width: 0; }
.list .score { white-space: nowrap; }

/* Report flag: greyed next to the timer, lit on hover or focus. */
button.report-open { flex: none; opacity: 0.55; position: relative; }
button.report-open .tip { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 0.75rem; white-space: nowrap; pointer-events: none; }
button.report-open:focus-visible .tip { display: block; }
button.report-open:is(:hover, :focus-visible) { opacity: 1; color: var(--accent); }
.report-form { display: grid; gap: 16px; }
.report-form fieldset { margin: 0; padding: 0; border: 0; }
.theme input[type="radio"] { flex: none; width: 20px; min-height: 0; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; }

/* Profile dialog */
#profile { width: min(480px, calc(100% - 32px)); }
#profile[open] { display: block; }
#profile-form { display: grid; gap: 20px; }
.profile-head { display: flex; align-items: center; justify-content: space-between; }
.profile-head h2 { margin: 0; }
button.icon.ghost { background: none; border-color: transparent; }
.profile-avatar { display: grid; justify-items: center; }
.profile-avatar .avatar { width: 128px; height: 128px; border-radius: 50%; border: 3px solid var(--border); }
.profile-avatar .pencil { width: 36px; height: 36px; right: -8px; bottom: -8px; }
.profile-avatar .pencil svg { width: 18px; height: 18px; }
.reel { display: flex; align-items: center; justify-content: center; gap: 12px; }
.reel-items { position: relative; flex: 1; max-width: 340px; height: 92px; }
button.bob-item { position: absolute; left: 50%; top: 50%; min-height: 0; width: 76px; height: 76px; margin: -38px 0 0 -38px; padding: 4px; background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; transform: translateX(calc(var(--x, 0) * var(--k, 1) * 1px)) scale(var(--s, 1)); transition: transform 360ms cubic-bezier(0.3, 1.15, 0.5, 1), opacity 260ms ease-out, border-color 120ms; }
button.bob-item[aria-pressed="true"] { border-color: var(--accent); }
button.bob-item:disabled { pointer-events: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { button.bob-item { transition: none; } }
button.bob-item img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.field { display: grid; gap: 6px; font: 700 13px Nunito, sans-serif; color: var(--muted); }
.field input { font: 700 16px Nunito, sans-serif; }
dialog .error { margin: 0; }
/* Inline dialog messages keep their slot while hidden, so showing one moves nothing. */
dialog .error[hidden], #import-result[hidden] { display: flex !important; visibility: hidden; }
dialog .error, #import-result { min-height: 68px; box-sizing: border-box; }
#import-result { margin: 0; }
/* Page banner floats over the top of the screen: its room is never taken from the layout, so nothing moves when it shows. */
#error { position: absolute; top: 8px; left: 16px; right: 16px; z-index: 6; margin: 0 auto; overflow: hidden; }
/* Countdown sweep: a tint over the box whose right edge runs to the left in 7s (see ERROR_MS in app.js). */
#error::after { content: ""; position: absolute; inset: 0; transform-origin: left; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { #error.counting::after { background: color-mix(in srgb, var(--bad) 30%, transparent); animation: sweep 7s linear forwards; } }
@keyframes sweep { to { transform: scaleX(0); } }
.muted a { color: var(--link); }
@media (max-width: 420px) {
  .reel { gap: 8px; }
  .reel-items { --k: 0.5; }
  button.bob-item { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
}

/* Home panels are dealt in once, then settle at their tilt. */
#home .hero h1 { rotate: -2deg; }
.panels .card:first-child { rotate: -0.3deg; }
.panels .card:last-child { rotate: 0.25deg; }
@media (prefers-reduced-motion: no-preference) {
  .panels .card { animation: deal 560ms cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .panels .card:last-child { animation-delay: 100ms; }
}
@keyframes deal { from { opacity: 0; translate: 0 28px; rotate: 0deg; } }
@media (max-width: 720px) { .panels .card { rotate: 0deg !important; } }

/* Difficulty colours: soft green / orange / red, used by the rules line and the settings dialog. */
.mix-facile, [data-preset="facile"] { --c: var(--good); }
.mix-moyen, [data-preset="moyen"] { --c: var(--accent); }
.mix-difficile, [data-preset="difficile"] { --c: var(--bad); }
#rules-difficulty span, #settings-recap span { color: var(--c); font-weight: 800; }
/* Always reserves its line so questions with or without difficulty keep the same layout. */
#q-difficulty { min-height: 1.4em; margin-top: -8px; }

/* Game player rows: numbers line up, and the gain line is always reserved so points never resize a row. */
.side .list :is(.score, .gain) { text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .side .list .answer, .side .list .chk { animation: none; } }
.site-version { position: fixed; right: 12px; bottom: 8px; z-index: 1; font: 600 12px Nunito, sans-serif; color: var(--muted); opacity: 0.7; pointer-events: none; }

/* Pseudos du salon et de la liste des joueurs : plus grands, blanc crème (vert/rouge gardés pour trouvé/raté). */
.tiles .name, .tiles .me .name { font-size: 1.125rem; color: var(--cream); }
.side .list .name { font-size: 1.0625rem; color: var(--cream); }
.side .list li.is-found .name { color: var(--good); }
.side .list li.is-wrong .name { color: var(--bad); }

/* Chat: out of the page flow (fixed), so opening it or receiving a message never moves the question box. Bottom drawer on phones, lifted above the keyboard by --kb; a panel stuck to the right edge of the viewport (below the topbar) on wide screens. */
.chat-tab { --chat-h: min(360px, calc((var(--vh) - var(--kb, 0px)) * 0.55)); position: fixed; z-index: 21; right: 16px; bottom: var(--chat-h); translate: 0 calc(-1 * var(--kb, 0px)); width: 56px; height: 28px; padding: 0; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 2px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -4px 0 var(--edge); transition: bottom 0.14s ease; }
.chat-tab[hidden] { display: none; }
.chat-tab::before { content: ""; position: absolute; inset: -8px; } /* 44px+ touch target around the 28px tab */
.chat-tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transition: transform 0.07s ease-out; }
.chat-tab.is-stowed { bottom: 0px; }
/* In game the stowed tab sits on top of the answer dock (its visible height, --dock-h from app.js), never over the Valider button. */
@media (max-width: 1179px) {
  .chat-tab { right: auto; left: 50%; translate: -50% calc(-1 * var(--kb, 0px)); height: 20px; bottom: calc(var(--chat-h) - 2px); } /* centered, thinner; -2px overlaps the drawer's border-top so it sits flush */
  .chat-tab::before { inset: -12px -8px; }
  .chat-tab.is-stowed { bottom: 0px; }
  body:has(#lobby:not([hidden])) .chat-tab { left: 16px; translate: 0 calc(-1 * var(--kb, 0px)); } /* lobby: tab on the left side */
  body:has(#game:not([hidden])) .chat-tab.is-stowed { bottom: calc(var(--dock-h, 0px) - var(--radius-lg) - 4px); }
  body:has(#game:not([hidden])) .site-version { display: none; }
  /* Closing: the drawer first follows the tab down to where the tab lands (same distance, same curve, so they stay glued), then keeps sliding out of sight: it never fades or pops off. */
  .chat { --chat-h: min(360px, calc((var(--vh) - var(--kb, 0px)) * 0.55)); --travel: calc(var(--chat-h) - 2px); }
  body:has(#game:not([hidden])) .chat { --travel: calc(var(--chat-h) - 2px - var(--dock-h, 0px) + var(--radius-lg) + 4px); }
  .chat.is-stowed { transition: none; }
  .chat.is-stowing { animation: chat-stow 0.24s both; }
  .chat.is-opening { transition: none; animation: chat-unstow 0.24s both; }
  .chat-tab:not(.is-stowed) { transition: bottom 0.144s ease 0.096s; }
  /* Lobby: the tab and the drawer travel the same distance, so a plain shared transition keeps them glued (the two-phase animation is for the game, where the tab lands on the dock). */
  body:has(#lobby:not([hidden])) .chat.is-stowed, body:has(#lobby:not([hidden])) .chat:not(.is-stowed) { transition: transform 0.14s ease; }
  body:has(#lobby:not([hidden])) :is(.chat.is-stowing, .chat.is-opening) { animation: none; }
  body:has(#lobby:not([hidden])) .chat-tab, body:has(#lobby:not([hidden])) .chat-tab:not(.is-stowed) { transition: bottom 0.14s ease; }
  .no-anim :is(.chat, .chat-tab, .chat-tab svg) { transition: none !important; animation: none !important; }
  @keyframes chat-unstow { 0% { transform: translateY(100%); animation-timing-function: linear; } 40% { transform: translateY(var(--travel)); animation-timing-function: ease; } 100% { transform: none; } }
  @keyframes chat-stow { 0% { transform: none; animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); } 60% { transform: translateY(var(--travel)); animation-timing-function: linear; } 100% { transform: translateY(100%); } }
}
.chat-tab.is-stowed svg { transform: rotate(-90deg); }
.chat-unread { position: absolute; top: -8px; left: -14px; min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 800 12px/20px Nunito, sans-serif; text-align: center; }
.chat { position: fixed; z-index: 20; left: 0; right: 0; bottom: var(--kb, 0px); display: grid; grid-template-rows: minmax(0, 1fr) auto; height: min(360px, calc((var(--vh) - var(--kb, 0px)) * 0.55)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 2px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35); transition: transform 0.22s ease; }
.chat[hidden] { display: none; }
.chat.is-stowed { transform: translateY(100%); }
@media (prefers-reduced-motion: reduce) { .chat, .chat-tab, .chat-tab svg { transition: none; animation: none !important; } }
/* Messages as floating pills: they stay put, and only fade near the top edge of the log. --k (0..1, set in app.js from scrollTop) blends the fade in as soon as older lines are scrolled out of view, so a log that is not scrolled never dims its first message. */
.chat-log { --k: 0; display: flex; flex-direction: column; gap: 5px; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; -webkit-mask-image: var(--chat-fade); mask-image: var(--chat-fade); --chat-fade: linear-gradient(rgb(0 0 0 / calc(1 - var(--k))) 0, rgb(0 0 0 / calc(1 - var(--k) * 0.96)) 18px, rgb(0 0 0 / calc(1 - var(--k) * 0.84)) 38px, rgb(0 0 0 / calc(1 - var(--k) * 0.62)) 60px, rgb(0 0 0 / calc(1 - var(--k) * 0.35)) 84px, rgb(0 0 0 / calc(1 - var(--k) * 0.12)) 108px, #000 130px); }
.chat-log li:first-child { margin-top: auto; } /* short logs sit at the bottom, next to the input */
.chat-log li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 7px; align-items: start; align-self: flex-start; max-width: 94%; padding: 5px 12px 5px 5px; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); border-radius: 18px; }
.chat-log .time { display: none; } /* kept in the DOM; the time shows as a tooltip (title on the li) */
.chat-log .avatar { width: 22px; height: 22px; font-size: 0.625rem; }
.chat-log .name { min-width: 0; margin-right: 3px; overflow-wrap: anywhere; font-size: 0.8125rem; font-weight: 700; color: var(--accent); }
.chat-log .text { margin: 0; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; word-break: break-word; font-size: 0.875rem; line-height: 20px; }
/* Empty chat: the players sit in velvet seats until the first message arrives (renderChatEmpty in app.js). */
.chat-empty { position: absolute; inset: 16px 16px 78px; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; pointer-events: none; }
.chat-empty[hidden] { display: none; }
.chat-empty p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.chat-seats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; }
.chat-seats li { display: grid; justify-items: center; gap: 6px; }
.chat-seats .seat { display: grid; place-items: start center; width: 40px; height: 52px; padding-top: 4px; border: 2px solid var(--edge); border-radius: 12px 12px 6px 6px; background: var(--surface-2); box-shadow: 0 3px 0 var(--edge); }
.chat-seats .avatar { width: 28px; height: 28px; font-size: 0.7rem; border: 2px solid var(--edge); }
.chat-seats .tag { max-width: 56px; overflow-wrap: anywhere; font: 700 0.75rem/1.1 Nunito, sans-serif; color: var(--text-2); }
.chat-seats .me .tag { color: var(--accent); }
.chat-form { margin-top: 8px; }
.chat-form input { width: 100%; min-height: 44px; }
@media (min-width: 1180px) {
  /* Width = free space left of the question box: column 1 of the grid ((vw - 32 padding - question column) / 2) minus 24 (tab 28 + gap, 16 padding offsets it); never below 280, never above 480. */
  :root { --chat-w: clamp(176px, 0.63 * ((var(--vw) - 32px - clamp(560px, var(--vw) - 600px, 900px)) / 2 - 24px), 302px); }
  .chat-tab { top: 92px; bottom: auto; left: var(--chat-w); right: auto; width: 28px; height: 56px; border: 2px solid var(--border); border-left: 0; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; box-shadow: none; transition: transform 0.22s ease; }
  .chat-tab.is-stowed { bottom: auto; transform: translateX(calc(-1 * var(--chat-w))); }
  .chat-tab svg, .chat-tab.is-stowed svg { transform: rotate(180deg); }
  .chat-tab.is-stowed svg { transform: none; }
  .chat-unread { left: auto; right: -14px; }
  .chat { top: 76px; left: 0; right: auto; bottom: 0; width: var(--chat-w); height: auto; padding: 16px; border: 2px solid var(--border); border-left: 0; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; box-shadow: none; }
  .chat.is-stowed { transform: translateX(-100%); }
}

/* phones: screen alone fills the viewport so the header can scroll out of view */
@media (max-width: 1179px) { #lobby, #game { min-height: var(--vh); } }

/* Settings dialog: tabs with a fixed-height panel, so switching tab or showing a message moves nothing. */
#settings, #settings *, #settings *::before, #settings *::after { box-sizing: border-box; }
#settings { position: relative; gap: 16px; }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-head > div { flex: 1; min-width: 0; }
.set-saved { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.set-saved svg { width: 16px; height: 16px; fill: none; stroke: var(--good); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.set-tabs { display: flex; gap: 4px; margin-bottom: -16px; }
#settings .set-tabs button { flex: 1; min-width: 0; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 8px; border-radius: 14px 14px 0 0; background: var(--bg); color: var(--muted); font: 800 0.92rem Nunito, sans-serif; border-bottom: 3px solid transparent; box-shadow: none; }
#settings .set-tabs button:hover:not(:disabled), #settings .set-tabs button:active:not(:disabled) { transform: none; box-shadow: none; }
.set-tabs button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#settings .set-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); border-bottom-color: var(--accent); }
.set-tabs button[aria-selected="true"] svg { stroke: var(--accent); }
.set-panels { height: clamp(260px, calc(100dvh - 340px), 430px); overflow: auto; padding: 14px; border-radius: 0 0 14px 14px; background: var(--surface-2); }
.set-panels > [role="tabpanel"] { display: grid; gap: 12px; align-content: start; }
.themes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#settings .chip { min-height: 36px; padding: 4px 14px; border-radius: 999px; background: var(--surface); color: var(--text-2); font: 800 0.85rem Nunito, sans-serif; border: 2px solid transparent; box-shadow: none; }
#settings .chip:hover:not(:disabled), #settings .chip:active:not(:disabled) { transform: none; box-shadow: none; }
#settings .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--yellow); }
#settings .themes { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; justify-items: start; align-content: start; gap: 5px; min-height: 104px; padding: 12px; border-radius: 14px; background: var(--bg); border: 2px dashed color-mix(in srgb, var(--border-input) 40%, transparent); color: var(--muted); cursor: pointer; transition: transform 120ms ease-out, background 160ms; }
.tile:active { transform: scale(0.97); }
.tile.pop { animation: tile-pop 360ms cubic-bezier(0.3, 1.5, 0.5, 1) var(--d, 0ms) backwards; }
@keyframes tile-pop { from { scale: 0.88; opacity: 0.4; } 60% { scale: 1.06; } }
#settings .themes-head .chip { transition: transform 90ms ease-out, background 140ms, border-color 140ms; }
#settings .themes-head .chip:active:not(:disabled) { transform: scale(0.92); }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.tile:has(input:disabled) { cursor: default; }
.tile-icon { width: 28px; height: 28px; fill: none; stroke: color-mix(in srgb, var(--muted) 60%, transparent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tile-name { font: 800 1.05rem var(--font-title); color: var(--text); }
.tile-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: var(--on-accent); scale: 0; transition: scale 160ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.tile-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.tile:has(input:checked) { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--text-2); box-shadow: 0 4px 0 var(--edge); }
.tile:has(input:checked) .tile-icon { stroke: var(--c); }
.tile:has(input:checked) .tile-check { scale: 1; }
.add-theme { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--border-input) 55%, transparent); color: var(--text-2); cursor: pointer; font-size: 1rem; }
.add-theme:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.add-theme svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.add-theme span { display: grid; gap: 1px; }
.add-theme b { font-weight: 800; color: var(--text); }
.add-theme .muted { font-size: 0.8rem; }
.format summary { cursor: pointer; padding: 6px 2px; color: var(--link); font: 700 0.9rem Nunito, sans-serif; }
.format pre { margin: 8px 0; padding: 10px 12px; overflow-x: auto; border-radius: 10px; background: var(--bg); color: var(--text-2); font: 500 0.78rem/1.45 var(--font-mono); }
.format ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.85rem; line-height: 1.4; color: var(--text-2); }
.format b { color: var(--text); }
#settings #import-result { min-height: 0; white-space: pre-wrap; }
#settings #import-result[hidden] { display: none !important; }
.set-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.set-card { container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; align-content: start; padding: 12px; border-radius: 14px; background: var(--surface); }
.set-card-t { font: 700 1rem Nunito, sans-serif; color: var(--text-2); }
.goal { display: grid; gap: 2px; justify-items: center; }
.set-card > * { min-width: 0; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; }
.stepper input:not([type="checkbox"]):not([type="file"]) { width: 76px; min-width: 0; flex: 0 1 76px; min-height: 48px; padding: 0; border: 0; background: transparent; text-align: center; font: 800 2.2rem/1 var(--font-title); font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { appearance: none; margin: 0; }
#settings .step { flex: none; width: 44px; height: 44px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--text); --edge: var(--edge-2); }
#settings .step svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; width: 100%; }
@container (min-width: 300px) { .chips { grid-template-columns: repeat(4, 1fr); } }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; padding: 4px 4px 7px; border-radius: 14px; background: var(--bg); border: 2px solid var(--border); }
#settings .seg button { min-height: 44px; padding: 6px 8px; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; font-size: 0.88rem; white-space: nowrap; box-shadow: none; }
#settings .seg button:hover:not(:disabled), #settings .seg button:active:not(:disabled) { transform: none; box-shadow: none; }
#settings .seg button { position: relative; z-index: 1; }
#settings .seg button[aria-pressed="true"] { color: var(--on-accent); }
/* The yellow thumb slides from one button to the other (no script: it follows aria-pressed). */
.seg { position: relative; }
.seg::before { content: ""; position: absolute; top: 4px; bottom: 7px; left: 4px; width: calc(50% - 6px); border-radius: 10px; background: var(--accent); box-shadow: 0 3px 0 var(--accent-edge); translate: 0 0; transition: translate 240ms cubic-bezier(0.3, 1.3, 0.5, 1); }
.seg:has(button:nth-child(2)[aria-pressed="true"])::before { translate: calc(100% + 4px) 0; }
@media (prefers-reduced-motion: reduce) { .seg::before { transition: none; } }
#settings .difficulty { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lvl { color: var(--c); display: grid; justify-items: center; gap: 8px; min-height: 92px; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 2px solid transparent; }
.lvl svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; }
.lvl svg .dim { opacity: 0.28; }
.lvl[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.mixbar { display: grid; gap: 10px; padding: 14px 14px 12px; border-radius: 14px; background: var(--surface); }
.mb-track { --a: 25%; --b: 75%; position: relative; height: 60px; margin: 6px 14px; border-radius: 14px; border: 2px solid var(--border); background: var(--edge); }
.mb-seg { position: absolute; top: 0; bottom: 0; background: var(--c); }
.mb-1 { left: 0; width: var(--a); border-radius: 11px 0 0 11px; }
.mb-2 { left: var(--a); width: calc(var(--b) - var(--a)); }
.mb-3 { left: var(--b); right: 0; border-radius: 0 11px 11px 0; }
.mb-handle { position: absolute; top: -10px; left: var(--p); width: 28px; height: 78px; translate: -50% 0; border-radius: 12px; background: var(--cream); border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); cursor: default; touch-action: none; }
#mb-h1 { --p: var(--a); }
#mb-h2 { --p: var(--b); }
.mb-handle::before { content: ""; position: absolute; inset: 22px 7px; border-inline: 3px solid color-mix(in srgb, var(--edge) 55%, transparent); }
.mb-handle::after { content: ""; position: absolute; inset: 0 -9px; } /* 46px touch target */
.mb-handle:active { scale: 1.06; }
.mb-handle:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.mb-track:not(.drag) :is(.mb-seg, .mb-handle) { transition: left 220ms cubic-bezier(0.3, 1.2, 0.5, 1), width 220ms cubic-bezier(0.3, 1.2, 0.5, 1); }
.mb-handle { transition: scale 120ms ease-out; }
.mb-hint { text-align: center; }
.mb-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font: 800 0.9rem Nunito, sans-serif; color: var(--c); }
.mb-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.mb-legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.mb-legend b { color: var(--c); font-variant-numeric: tabular-nums; }
#settings .error { position: absolute; left: 24px; right: 24px; bottom: 150px; z-index: 2; min-height: 0; max-width: none; background: var(--surface); }
#settings .error[hidden] { display: none !important; }
.set-recap { margin: 0; padding: 10px 12px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--border-input) 40%, transparent); font: 800 0.88rem Nunito, sans-serif; color: var(--text-2); }
.set-done { width: 100%; }
@media (max-width: 720px) {
  #settings { width: 100%; max-width: none; margin: auto 0 0; padding: 16px; border-radius: 20px 20px 0 0; max-height: calc(100% - 8px); }
  #settings .error { left: 16px; right: 16px; bottom: 140px; }
}
/* Every dialog (profil, réglages, signalement…) fades and rises in, and does the reverse when it closes (cross, click outside, Esc). */
@media (prefers-reduced-motion: no-preference) {
  /* Closing is short and straight (no spring); opening takes a little longer. */
  dialog { opacity: 0; translate: 0 8px; scale: 0.98; transition: opacity 110ms ease-in, translate 110ms ease-in, scale 110ms ease-in, overlay 110ms allow-discrete, display 110ms allow-discrete; }
  dialog[open] { opacity: 1; translate: 0 0; scale: 1; transition: opacity 200ms ease-out, translate 240ms cubic-bezier(0.3, 1.2, 0.5, 1), scale 240ms cubic-bezier(0.3, 1.2, 0.5, 1), overlay 240ms allow-discrete, display 240ms allow-discrete; }
  @starting-style { dialog[open] { opacity: 0; translate: 0 18px; scale: 0.96; } }
  dialog::backdrop { opacity: 0; transition: opacity 110ms ease-in, overlay 110ms allow-discrete, display 110ms allow-discrete; }
  dialog[open]::backdrop { opacity: 1; transition: opacity 240ms ease-out, overlay 240ms allow-discrete, display 240ms allow-discrete; }
  @starting-style { dialog[open]::backdrop { opacity: 0; } }
  /* Phone: the settings sheet slides up from the bottom edge. */
  @media (max-width: 720px) {
    #settings { translate: 0 60px; scale: 1; }
    #settings[open] { translate: 0 0; }
    @starting-style { #settings[open] { translate: 0 80px; scale: 1; } }
  }
}
@media (prefers-reduced-motion: reduce) { .tile, .tile-check { transition: none; }
  .mb-track :is(.mb-seg, .mb-handle) { transition: none !important; }
  .tile.pop { animation: none; } .tile:active, .step:active { transform: none; } }
