@font-face { font-family: "Zilla Slab"; font-weight: 600; font-display: swap; src: url("fonts/zilla-slab-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-display: swap; src: url("fonts/zilla-slab-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("fonts/figtree-latin.woff2") format("woff2"); }

:root {
  --night: #0f1f4d;
  --night-2: #142a66;
  --azur: #1e3a8a;
  --or: #f2b705;
  --or-deep: #c99400;
  --or-light: #ffd34d;
  --sinople: #2f7a14;
  --paper: #fbf4e2;
  --paper-edge: #e9dcb8;
  --ink: #1b2237;
  --muted: #5a6276;
  --wood: #a8713d;
  --wood-dark: #6e4422;
  --felt: #1f6a33;
  --felt-dark: #154d24;
  --good: #2f9a2a;
  --bad: #d63a3a;
  --a0: #d63a3a;
  --a1: #2f6fdf;
  --a2: #f2b705;
  --a3: #2f9a2a;
  --game-texture: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%27210%27%20height%3D%27210%27%20viewBox%3D%270%200%20210%20210%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-opacity%3D%270.065%27%20stroke-width%3D%271.6%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%3E%3Cg%20transform%3D%27translate%2835%2035%29%27%3E%3Crect%20x%3D%27-15%27%20y%3D%27-15%27%20width%3D%2730%27%20height%3D%2730%27%20rx%3D%276%27/%3E%3Ccircle%20cx%3D%27-7%27%20cy%3D%27-7%27%20r%3D%272%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3Ccircle%20cx%3D%270%27%20cy%3D%270%27%20r%3D%272%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3Ccircle%20cx%3D%277%27%20cy%3D%277%27%20r%3D%272%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28105%2035%29%27%3E%3Ccircle%20cx%3D%270%27%20cy%3D%27-10%27%20r%3D%275.5%27/%3E%3Cpath%20d%3D%27M-3.5%20-4.8C-4%202%20-8%207%20-10%2011H10C8%207%204%202%203.5%20-4.8%27/%3E%3Crect%20x%3D%27-13%27%20y%3D%2711%27%20width%3D%2726%27%20height%3D%275%27%20rx%3D%272%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28175%2035%29%27%3E%3Cpath%20d%3D%27M0%20-17l14.7%208.5v17L0%2017l-14.7-8.5v-17z%27/%3E%3Cpath%20d%3D%27M0%20-9l9%2016H-9z%27/%3E%3Cpath%20d%3D%27M0%20-17v8M-14.7%20-8.5L0%20-9M14.7%20-8.5L0%20-9M-14.7%20-8.5L-9%207M14.7%20-8.5L9%207M-14.7%208.5L-9%207M14.7%208.5L9%207M0%2017L-9%207M0%2017l9-10%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%2835%20105%29%27%3E%3Cpath%20d%3D%27M-11%20-16H11M-11%2016H11%27/%3E%3Cpath%20d%3D%27M-8%20-16C-8%20-6%20-2%20-3%20-2%200C-2%203%20-8%206%20-8%2016M8%20-16C8%20-6%202%20-3%202%200C2%203%208%206%208%2016%27/%3E%3Cpath%20d%3D%27M-5%2013L0%208L5%2013Z%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3Cpath%20d%3D%27M-5%20-10H5%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28105%20105%29%27%3E%3Cpath%20transform%3D%27translate%28-18%20-19%29%20scale%280.36%29%27%20vector-effect%3D%27non-scaling-stroke%27%20d%3D%27M50%208C60%208%2067%2016%2067%2026C67%2030%2066%2033%2064%2036L88%2044C96%2047%2099%2053%2096%2059C94%2064%2088%2065%2082%2064L70%2062L80%2088C82%2094%2079%2098%2073%2098L58%2098L50%2082L42%2098L27%2098C21%2098%2018%2094%2020%2088L30%2062L18%2064C12%2065%206%2064%204%2059C1%2053%204%2047%2012%2044L36%2036C34%2033%2033%2030%2033%2026C33%2016%2040%208%2050%208Z%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28175%20105%29%27%3E%3Crect%20x%3D%27-4.5%27%20y%3D%27-17%27%20width%3D%279%27%20height%3D%274%27%20rx%3D%271.5%27/%3E%3Cpath%20d%3D%27M-3%20-13V-5C-10%20-3%20-12%203%20-11%207C-10%2013%20-5%2016%200%2016C5%2016%2010%2013%2011%207C12%203%2010%20-3%203%20-5V-13%27/%3E%3Cpath%20d%3D%27M-10.5%205C-5%203%205%207%2010.5%205%27/%3E%3Ccircle%20cx%3D%27-2%27%20cy%3D%2710%27%20r%3D%271.5%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3Ccircle%20cx%3D%273%27%20cy%3D%278%27%20r%3D%271%27%20fill%3D%27white%27%20fill-opacity%3D%270.065%27%20stroke%3D%27none%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%2835%20175%29%27%3E%3Cpath%20d%3D%27M-14%20-10H-6a4%204%200%201%201%208%200H10V-2a4%204%200%201%201%200%208V14H2a4%204%200%201%200%20-8%200H-14Z%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28105%20175%29%27%3E%3Crect%20x%3D%27-13%27%20y%3D%27-15%27%20width%3D%2726%27%20height%3D%275%27%20rx%3D%272.5%27/%3E%3Crect%20x%3D%27-13%27%20y%3D%2710%27%20width%3D%2726%27%20height%3D%275%27%20rx%3D%272.5%27/%3E%3Cpath%20d%3D%27M-10%20-10V10M10%20-10V10M-5%20-5H5M-5%200H5M-5%205H2%27/%3E%3C/g%3E%3Cg%20transform%3D%27translate%28175%20175%29%27%3E%3Cpath%20d%3D%27M-14%20-2V-7C-14%20-13%2014%20-13%2014%20-7V-2Z%27/%3E%3Crect%20x%3D%27-14%27%20y%3D%27-2%27%20width%3D%2728%27%20height%3D%2716%27%20rx%3D%272%27/%3E%3Cpath%20d%3D%27M-8%20-11.2V14M8%20-11.2V14%27/%3E%3Crect%20x%3D%27-3%27%20y%3D%27-4%27%20width%3D%276%27%20height%3D%277%27%20rx%3D%271%27/%3E%3C/g%3E%3C/svg%3E");
  --display: "Zilla Slab", Georgia, serif;
  --text: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--text);
  color: #fff;
  background-color: var(--night);
  background-image: var(--game-texture), radial-gradient(ellipse at 50% 0%, var(--night-2) 0%, var(--night) 70%);
  background-size: 210px 210px, 100% 100%;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* --- Pièces de jeu communes --- */

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 0 0 3px var(--paper-edge) inset, 0 0 0 7px var(--paper) inset, 0 0 0 8px rgba(27, 34, 55, .18) inset, 0 14px 30px rgba(0, 0, 0, .35);
  padding: 1.4em 1.6em;
}

.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 14px;
  padding: .7em 1.5em;
  font-family: var(--display); font-weight: 700; font-size: 1.2em;
  color: var(--ink);
  background: linear-gradient(var(--or-light), var(--or));
  box-shadow: 0 6px 0 var(--or-deep), 0 10px 18px rgba(0, 0, 0, .35);
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--or-deep), 0 4px 8px rgba(0, 0, 0, .35); }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
.btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); font-size: 1em; }

.meeple { display: block; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .35)); }
.die { display: block; }

.answer-tile {
  position: relative;
  display: flex; align-items: center; gap: .8em;
  border-radius: 16px;
  padding: .6em .9em;
  color: #fff;
  font-weight: 700;
  text-align: left;
  border: 0;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28), 0 10px 20px rgba(0, 0, 0, .25);
  transition: opacity .4s, transform .4s, filter .4s;
}
.answer-tile .die { flex: none; }
.answer-tile.c0 { background: var(--a0); }
.answer-tile.c1 { background: var(--a1); }
.answer-tile.c2 { background: var(--a2); color: var(--ink); }
.answer-tile.c3 { background: var(--a3); }

.timer-bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.timer-bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--or), var(--or-light)); transform-origin: left; }
.timer-bar.urgent > i { background: linear-gradient(90deg, var(--bad), #ff8a6b); }

@keyframes pop-in { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.15) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.15); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes flip-in { 0% { transform: perspective(1200px) rotateY(180deg) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: perspective(1200px) rotateY(0) scale(1); opacity: 1; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes drop { 0% { transform: translateY(-120vh) rotate(-30deg); } 70% { transform: translateY(10px) rotate(6deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 6px #fff, 0 0 30px 10px rgba(255, 255, 255, .55); } 50% { box-shadow: 0 0 0 6px #fff, 0 0 50px 20px rgba(255, 255, 255, .8); } }
@keyframes fade-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ======================================================================
   Écran de l'animateur (projeté)
   ====================================================================== */

body.host { overflow: hidden; font-size: clamp(14px, 1.15vw + .6vh, 30px); }
.host-screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding: 2.2vh 2.4vw; gap: 2vh; }

.host-tools { position: fixed; bottom: 1vh; left: 50%; transform: translateX(-50%); display: flex; gap: .4em; z-index: 20; opacity: 0; pointer-events: none; transition: opacity .3s; background: rgba(15, 31, 77, .9); padding: .3em; border-radius: 12px; }
body.mouse .host-tools { opacity: 1; pointer-events: auto; }
.host-tools a { background: rgba(255, 255, 255, .12); color: #fff; border-radius: 10px; padding: .35em .6em; font-size: .75em; text-decoration: none; }
.host-tools button { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 10px; padding: .35em .6em; font-size: .75em; }

.brand { display: flex; align-items: center; gap: 1em; }
.brand img { width: 4.2em; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.brand h1 { font-size: 2.6em; line-height: 1; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.brand p { margin: .25em 0 0; color: var(--or); font-family: var(--display); font-weight: 600; font-size: 1.2em; letter-spacing: .08em; text-transform: uppercase; }

/* Lobby */
.lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 30em) 1fr; gap: 2.4vw; min-height: 0; }
.join-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6em; align-self: start; }
.join-card h2 { font-size: 1.7em; }
.join-card .steps { margin: 0; color: var(--muted); font-size: .95em; }
.qr { width: min(21em, 36vh); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: .5em; box-shadow: 0 0 0 4px var(--ink); }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.join-url { font-family: var(--display); font-size: 1.6em; font-weight: 700; color: var(--azur); word-break: break-all; }
/* Le code de la partie : assez grand pour se lire du fond de la salle. */
.join-code { display: flex; flex-direction: column; align-items: center; gap: .1em; }
.join-code span { color: var(--muted); font-size: .95em; }
.join-code b { font-family: var(--display); font-size: clamp(2.2em, 6vh, 3.2em); line-height: 1; letter-spacing: .12em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
/* Sur le téléphone : le champ du code, s'il n'est pas venu avec le QR code. */
.join-form .code-input { font-family: var(--display); font-size: 1.6em; letter-spacing: .35em; text-align: center; font-variant-numeric: lining-nums tabular-nums; }

/* La table de jeu vue d'en haut : feutre ovale cerclé de bois, les pions assis tout autour.
   Chaque pion a sa place en % sur une ellipse (seats()) ; quand un joueur arrive, les autres
   glissent pour lui faire de la place. */
.table-zone { display: flex; flex-direction: column; min-height: 0; padding: 1.2em 1.4em .4em; }
.table {
  position: relative; flex: 1; min-height: 0; border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .09), transparent 65%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .035) 0 2px, transparent 2px 6px),
    var(--felt);
  box-shadow:
    inset 0 0 0 .5em rgba(0, 0, 0, .12), inset 0 0 4em rgba(0, 0, 0, .5),
    0 0 0 .9em var(--wood), 0 0 0 1.05em var(--wood-dark), 0 1.6em 3em rgba(0, 0, 0, .5);
}
.table::before { content: ""; position: absolute; inset: 16% 20%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .1); }
.table-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.table-centre b { font-family: var(--display); font-size: 4.2em; line-height: 1; color: var(--or); text-shadow: 0 .06em 0 rgba(0, 0, 0, .3); }
.table-centre span { font-family: var(--display); font-weight: 600; font-size: 1.1em; color: rgba(255, 255, 255, .85); }
.table-centre .die { width: 3em; height: 3em; margin-bottom: .6em; animation: roll 2.4s ease-in-out infinite; }
.pawn {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: .15em; width: 6.6em;
  transform: translate(-50%, -62%); transition: left .6s cubic-bezier(.3, 1.2, .5, 1), top .6s cubic-bezier(.3, 1.2, .5, 1); cursor: pointer;
}
.pawn .meeple { width: 3.1em; height: 3.1em; animation: pop-in .5s ease-out both; }
.pawn span { font-weight: 700; font-size: .8em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(0, 0, 0, .45); padding: .05em .55em; border-radius: 99px; }
.pawn.offline { opacity: .4; }
.table.many .pawn { width: 5.6em; }
.table.many .pawn .meeple { width: 2.5em; height: 2.5em; }
.table.many .pawn span { font-size: .72em; }
.table.lots .pawn { width: 4.6em; }
.table.lots .pawn .meeple { width: 1.9em; height: 1.9em; }
.table.lots .pawn span { font-size: .6em; }
.table.lots .table-centre b { font-size: 2.6em; }
.table.lots .table-centre span { display: none; }
.lobby-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1em; margin-top: 2em; }
.lobby-actions:not(:has(.btn)) { justify-content: center; }
.hint { color: rgba(255, 255, 255, .6); font-size: .8em; }
.hint kbd { font-family: inherit; background: rgba(255, 255, 255, .15); border-radius: 5px; padding: .05em .4em; }

/* Question */
.q-top { display: flex; align-items: center; gap: 2vw; }
/* La piste de score, comme celle qui borde un plateau : une case par question, reliées par un
   trait ; les cases passées sont pleines, le pion se tient sur celle en cours. */
.q-track { flex: 1; display: flex; justify-content: space-between; align-items: center; list-style: none; margin: 0; padding: 1.1em 0 0; position: relative; }
.q-track::before { content: ""; position: absolute; left: .8em; right: .8em; top: calc(1.1em + .8em); height: .18em; background: rgba(255, 255, 255, .16); border-radius: 99px; }
.q-track li { position: relative; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; background: var(--night); box-shadow: inset 0 0 0 .14em rgba(255, 255, 255, .28); }
.q-track li span { font-family: var(--display); font-weight: 700; font-size: .62em; color: rgba(255, 255, 255, .55); }
.q-track li.done { background: var(--or-deep); box-shadow: none; }
.q-track li.done span { color: rgba(0, 0, 0, .45); }
.q-track li.now { background: var(--or); box-shadow: 0 0 0 .2em #fff, 0 0 1em rgba(255, 255, 255, .5); transform: scale(1.25); }
.q-track li.now span { color: var(--ink); font-size: .7em; }
.q-track .marker { position: absolute; bottom: 72%; width: 1.4em; height: 1.4em; animation: drop .6s cubic-bezier(.3, 1.2, .5, 1) both; }
.hourglass { flex: none; display: flex; align-items: center; gap: .3em; font-family: var(--display); font-weight: 700; font-size: 2.6em; min-width: 3.2em; justify-content: flex-end; }
.hourglass svg { width: .9em; height: 1.1em; }
.hourglass.urgent { color: #ff8a6b; animation: shake .5s infinite; }

.q-main { flex: 1; display: grid; grid-template-columns: 1fr; gap: 2vw; min-height: 0; align-items: center; }
.q-main.with-side { grid-template-columns: 1fr auto; }
.q-left { display: flex; flex-direction: column; gap: 1.6vh; min-height: 0; }
.q-main.is-revealed .q-card { font-size: 1.6em; padding: .7em 1em; animation: none; }
.q-card { font-size: 2.1em; line-height: 1.25; text-align: center; padding: 1.1em 1.3em; font-family: var(--display); font-weight: 700; animation: fade-up .5s ease-out; position: relative; overflow: hidden; }
.sand { position: absolute; left: 0; right: 0; bottom: 0; height: .22em; background: var(--paper-edge); }
.sand i { display: block; height: 100%; background: var(--or); transform-origin: left; transition: background .3s; }
.sand i.urgent { background: var(--bad); }
.side { display: flex; align-items: center; justify-content: center; min-height: 0; max-height: 100%; padding: 1em; }
.box-art { max-width: 24vw; max-height: 34vh; border-radius: 8px; box-shadow: 0 0 0 .3em #fff, 0 1em 2em rgba(0, 0, 0, .45); transform: rotate(2deg); background: #fff; animation: drop .7s ease-out both; }
.fact { font-size: 1.05em; line-height: 1.4; padding: .9em 1.3em; animation: fade-up .5s .3s both; }
.fact h3 { font-size: 1.15em; color: var(--azur); margin-bottom: .3em; }
.fact p { margin: 0; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vw; }
.answers .answer-tile { font-size: 1.55em; min-height: 3.2em; }
.answers .answer-tile .die { width: 1.9em; height: 1.9em; }
.answers .answer-tile .label { flex: 1; }
.answers.waiting .answer-tile { opacity: .25; filter: blur(3px); }
.answers .votes { flex: none; font-family: var(--display); font-size: .9em; background: rgba(0, 0, 0, .22); border-radius: 99px; padding: .1em .6em; }
.answers .vote-bar { position: absolute; left: 0; bottom: 0; height: .35em; background: rgba(255, 255, 255, .7); border-radius: 0 99px 0 16px; transition: width .8s ease-out; }
.answers.revealed .answer-tile:not(.right) { opacity: .3; transform: scale(.96); filter: grayscale(.5); }
body.host .answers .answer-tile { overflow: hidden; }
body.host .answers .answer-tile > :not(.vote-bar) { position: relative; }
body.host .answers .vote-bar { top: 0; height: auto; border-radius: 0; background: rgba(255, 255, 255, .2); transition: width 1s .3s cubic-bezier(.2, .8, .3, 1); }
body.host .answers .votes { font-size: 1em; min-width: 1.8em; text-align: center; background: rgba(0, 0, 0, .25); }
body.host .answers.revealed .answer-tile:not(.right) { opacity: 1; transform: scale(.97); color: rgba(255, 255, 255, .72); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
body.host .answers.revealed .answer-tile.c0:not(.right) { background: color-mix(in srgb, var(--a0) 38%, var(--night)); }
body.host .answers.revealed .answer-tile.c1:not(.right) { background: color-mix(in srgb, var(--a1) 38%, var(--night)); }
body.host .answers.revealed .answer-tile.c2:not(.right) { background: color-mix(in srgb, var(--a2) 38%, var(--night)); }
body.host .answers.revealed .answer-tile.c3:not(.right) { background: color-mix(in srgb, var(--a3) 38%, var(--night)); }
body.host .answers.revealed .answer-tile:not(.right) .die { opacity: .55; }
.answers.revealed .answer-tile.right { animation: glow 1.6s ease-in-out infinite; }
.answers .check { flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; background: #fff; color: var(--good); display: grid; place-items: center; font-size: .9em; animation: pop-in .4s both; }

.read-bar { height: .5em; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.read-bar > i { display: block; height: 100%; background: #fff; width: 0; }

.q-foot { display: flex; align-items: center; gap: 1em; min-height: 2.6em; }
.answered-row { flex: 1; display: flex; flex-wrap: wrap; gap: .25em; align-items: center; }
.answered-row .meeple { width: 1.5em; height: 1.5em; transition: opacity .3s, transform .3s; }
.answered-row .meeple.no { opacity: .22; filter: grayscale(1) brightness(1.6); }
.answered-row .meeple.yes { transform: translateY(-.2em); }
.answered-count { font-family: var(--display); font-weight: 700; font-size: 1.2em; white-space: nowrap; }

/* Distinctions : une pioche à gauche, la carte retournée au centre. La carte a son médaillon
   et son bandeau, comme une carte objectif. */
.awards { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4vw; }
.deck { position: relative; width: 9em; height: 13em; flex: none; }
.deck i {
  position: absolute; inset: 0; border-radius: 14px; transform: translate(calc(var(--k) * -.35em), calc(var(--k) * -.3em)) rotate(calc(var(--k) * -1.5deg));
  background: url("brand-logo.webp") center / 46% no-repeat, radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .16) 0 30%, transparent 31%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 6px, transparent 6px 12px), var(--azur);
  box-shadow: inset 0 0 0 .35em var(--paper), 0 .5em 1em rgba(0, 0, 0, .35);
}
.deck span { position: absolute; left: 0; right: 0; top: calc(100% + .9em); text-align: center; font-family: var(--display); font-weight: 600; color: rgba(255, 255, 255, .7); }
.award-card {
  position: relative; width: min(30em, 60vw); text-align: center; padding: 1.8em 2em 1.6em;
  animation: deal .9s cubic-bezier(.2, .9, .3, 1.05) both;
  background: radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--or) 30%, transparent), transparent 55%), var(--paper);
}
@keyframes deal { 0% { transform: translateX(-38vw) rotate(-14deg) rotateY(180deg) scale(.55); opacity: 0; } 40% { opacity: 1; } 100% { transform: none; } }
.award-card .medal { width: 2.1em; height: 2.1em; margin: 0 auto; display: grid; place-items: center; font-size: 3.4em; line-height: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--paper) 70%); box-shadow: 0 0 0 .09em var(--or), 0 0 0 .16em var(--or-deep), 0 .25em .5em rgba(0, 0, 0, .25); }
.award-card h2 { margin: .7em -2.6em .55em; font-size: 2em; }
.award-card h2 span { display: inline-block; padding: .25em 1.6em; color: #fff; background: var(--azur);
  clip-path: polygon(0 0, 100% 0, calc(100% - .7em) 50%, 100% 100%, 0 100%, .7em 50%); }
.award-card .winner { display: flex; align-items: center; justify-content: center; gap: .5em; font-size: 1.7em; font-weight: 800; animation: fade-up .5s 1s both; }
.award-card .winner.none { font-size: 1.2em; color: var(--muted); font-weight: 600; }
.award-card .winner .meeple { width: 1.8em; height: 1.8em; }
.award-card p { color: var(--muted); font-size: 1.15em; line-height: 1.4; margin: .7em 0 0; animation: fade-up .5s 1.2s both; }

/* Podium : trois blocs de bois, les pions debout dessus, leur score sur un jeton ; la suite
   du classement sur une feuille de score. Les blocs montent du 3e au 1er. */
.podium-screen { flex: 1; display: grid; grid-template-columns: 1fr minmax(0, 19em); gap: 3vw; min-height: 0; align-items: end; }
.podium-screen.alone { grid-template-columns: 1fr; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1vw; }
.step { display: flex; flex-direction: column; align-items: center; width: 12em; }
.step .who { display: flex; flex-direction: column; align-items: center; gap: .3em; margin-bottom: .5em; animation: drop .9s cubic-bezier(.3, 1.2, .5, 1) both; }
.step .who .meeple { width: 4.6em; height: 4.6em; }
.step .who b { font-size: 1.4em; text-align: center; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .chip { font-family: var(--display); font-weight: 700; font-size: 1.15em; color: var(--ink); background: var(--paper); border-radius: 99px; padding: .1em .7em; box-shadow: inset 0 0 0 .14em var(--or), 0 .2em 0 var(--paper-edge); }
.step .chip small { font-size: .7em; margin-left: .25em; color: var(--muted); }
.step .block {
  width: 100%; border-radius: .5em .5em 0 0; transform-origin: bottom; animation: rise .8s ease-out both;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 3px, transparent 3px 19px, rgba(255, 255, 255, .05) 19px 21px, transparent 21px 37px),
    linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 25%, rgba(255, 255, 255, .12) 70%, rgba(0, 0, 0, .2)),
    var(--wood);
  box-shadow: inset 0 .45em 0 rgba(255, 255, 255, .16), inset 0 -.3em 0 rgba(0, 0, 0, .2), 0 1em 2em rgba(0, 0, 0, .4);
  display: grid; place-items: start center; padding-top: .5em;
}
.step .block span { font-family: var(--display); font-weight: 700; font-size: 3.2em; line-height: 1; color: rgba(0, 0, 0, .38); text-shadow: 0 .03em 0 rgba(255, 255, 255, .25); }
.step.p1 .block { height: 34vh; background-color: var(--or-deep); }
.step.p2 .block { height: 24vh; background-color: #8d97ab; }
.step.p3 .block { height: 16vh; }
.step.p3 .block, .step.p3 .who { animation-delay: .3s, .3s; }
.step.p3 .who { animation-delay: .9s; }
.step.p2 .block { animation-delay: 2.2s; }
.step.p2 .who { animation-delay: 2.8s; }
.step.p1 .block { animation-delay: 4.4s; }
.step.p1 .who { animation-delay: 5.1s; }
.step.p1 .who .meeple { width: 5.6em; height: 5.6em; }
.crown { font-size: 2.4em; line-height: 1; margin-bottom: -.2em; }
.score-sheet { align-self: center; padding: 1.1em 1.3em; animation: fade-up .6s 6s both; transform: rotate(1.2deg); }
.score-sheet h3 { color: var(--azur); font-size: 1.15em; margin-bottom: .4em; }
.score-sheet ol { list-style: none; margin: 0; padding: 0; }
.score-sheet li { display: flex; align-items: center; gap: .5em; padding: .28em 0; border-bottom: 1px solid var(--paper-edge); }
.score-sheet li:last-child { border-bottom: 0; }
.score-sheet .meeple { width: 1.3em; height: 1.3em; }
.score-sheet b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-sheet .n { font-family: var(--display); font-weight: 700; width: 1.4em; color: var(--muted); }
.score-sheet .pts { font-family: var(--display); font-weight: 700; color: var(--azur); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

.host-foot { display: flex; justify-content: flex-end; align-items: center; gap: 1em; }

/* ======================================================================
   Téléphone des joueurs
   ====================================================================== */

body.play { min-height: 100%; font-size: 17px; }
.phone { min-height: 100dvh; display: flex; flex-direction: column; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); gap: 14px; max-width: 560px; margin: 0 auto; }
.me-bar { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 8px 12px; }
.me-bar .meeple { width: 34px; height: 34px; }
.me-bar b { flex: 1; font-size: 1.1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-bar .score { font-family: var(--display); font-weight: 700; font-size: 1.3em; color: var(--or); }
.phone-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.phone .center { text-align: center; }
.phone h1 { font-size: 1.9em; line-height: 1.1; }
.phone .lead { color: rgba(255, 255, 255, .8); margin: 0; }

.join-logo { width: 96px; margin: 0 auto; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.edition { margin: .4em 0 0; color: var(--or); font-family: var(--display); font-weight: 700; letter-spacing: .04em; }
.edition:empty { display: none; }
.join-form { display: flex; flex-direction: column; gap: 14px; }
.join-form label { font-family: var(--display); font-weight: 700; font-size: 1.1em; }
.join-form input {
  font: inherit; font-size: 1.3em; width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 3px solid var(--paper-edge); background: #fff; color: var(--ink);
}
.join-form .hint-site { margin: -6px 0 0; color: var(--muted); font-size: .85em; }
.join-form input:focus { outline: none; border-color: var(--or); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatches button { background: rgba(0, 0, 0, .06); border: 3px solid transparent; border-radius: 12px; padding: 6px; display: grid; place-items: center; }
.swatches button .meeple { width: 36px; height: 36px; }
.swatches button[aria-pressed="true"] { border-color: var(--azur); background: color-mix(in srgb, var(--azur) 12%, transparent); }
.join-form .btn { width: 100%; font-size: 1.35em; padding: 14px; }
.error { color: var(--bad); font-weight: 700; margin: 0; }

.big-meeple { width: 140px; height: 140px; margin: 0 auto; animation: bob 1.6s ease-in-out infinite; }
.phone .q-label { font-family: var(--display); color: var(--or); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .9em; }
.phone .q-text { font-family: var(--display); font-weight: 700; font-size: 1.35em; line-height: 1.25; padding: 14px 16px; }
.phone .answers { grid-template-columns: 1fr; gap: 12px; }
.phone .answer-tile { font-size: 1.2em; min-height: 68px; width: 100%; }
.phone .answer-tile .die { width: 40px; height: 40px; }
.phone .answer-tile:active { transform: scale(.97); }
.phone .answers.two-col { grid-template-columns: 1fr 1fr; }
.phone .answers.two-col .answer-tile { min-height: 110px; flex-direction: column; justify-content: center; text-align: center; font-size: 1.05em; }

.verdict { text-align: center; padding: 26px 18px; border-radius: 22px; animation: pop-in .5s both; }
.verdict.good { background: var(--good); }
.verdict.bad { background: var(--bad); animation: shake .5s; }
.verdict.none { background: rgba(255, 255, 255, .12); }
.verdict .big { font-size: 3.4em; line-height: 1; }
.verdict h2 { font-size: 2em; margin: 8px 0 4px; }
.verdict p { margin: 4px 0 0; font-size: 1.1em; }
.verdict .pts { font-family: var(--display); font-weight: 700; font-size: 2.2em; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.8em; color: var(--or); }
.stat span { font-size: .85em; color: rgba(255, 255, 255, .75); }
.chosen { display: flex; align-items: center; gap: 12px; justify-content: center; }
.chosen .die { width: 70px; height: 70px; animation: roll 1.2s ease-in-out; }
.my-awards { display: flex; flex-direction: column; gap: 10px; }
.my-awards .card { padding: 14px 16px; display: flex; gap: 12px; align-items: center; animation: flip-in .8s both; }
.my-awards .card .e { font-size: 2.2em; }
.my-awards .card b { font-family: var(--display); color: var(--azur); font-size: 1.15em; display: block; }
.my-awards .card span { color: var(--muted); font-size: .9em; }
.timer-bar.phone-timer { height: 12px; }

/* ======================================================================
   Parties précédentes (historique, réservé aux admins)
   ====================================================================== */

body.archive { font-size: 16px; }
.archive-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px 8px; }
.archive-head .brand img { width: 56px; }
.archive-head .brand h1 { font-size: 2em; }
.archive-head .brand p { font-size: .95em; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.archive-actions .btn { text-decoration: none; }
.archive-main { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; padding: 16px 24px 40px; align-items: start; }
.archive-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 16px; }
.archive-item { text-align: left; border: 0; border-radius: 12px; padding: 10px 14px; background: rgba(255, 255, 255, .08); color: #fff; display: flex; flex-direction: column; gap: 2px; }
.archive-item:hover { background: rgba(255, 255, 255, .14); }
.archive-item.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--paper-edge); }
.archive-item .when { font-size: .8em; opacity: .75; }
.archive-item .meta { font-size: .85em; opacity: .75; }
.archive-empty { color: rgba(255, 255, 255, .75); line-height: 1.5; }
.archive-group { display: flex; flex-direction: column; gap: 8px; }
.archive-group + .archive-group { margin-top: 14px; }
.archive-group-items { display: flex; flex-direction: column; gap: 8px; }
.archive-list-h { font-size: 1.05em; color: var(--or); letter-spacing: .04em; text-transform: uppercase; }
.archive-item .tag { background: var(--or); color: var(--ink); border-radius: 99px; padding: 0 6px; font-weight: 700; }
.quiz-current { margin: 12px 0 0; }
.theme-pick { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--paper-edge); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.theme-options { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-options button { border: 2px solid var(--paper-edge); background: #fff; color: var(--ink); border-radius: 99px; padding: 6px 14px; font-weight: 700; }
.theme-options button[aria-checked="true"] { border-color: var(--azur); background: var(--azur); color: #fff; }
.quiz-spoiler { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--paper-edge); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.quiz-spoiler p { margin: 0; color: var(--muted); }
.quiz-spoiler .btn.ghost { background: var(--azur); color: #fff; }
.quiz-fact { display: flex; gap: 10px; align-items: flex-start; padding-top: 8px; border-top: 1px dashed var(--paper-edge); font-size: .88em; color: var(--muted); }
.quiz-fact img { width: 56px; border-radius: 6px; flex: none; }
.quiz-fact p { margin: 0; line-height: 1.4; }
.archive-detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.archive-card { padding: 20px 24px; }
.archive-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.archive-title h2 { font-size: 1.5em; color: var(--azur); }
.archive-title .meta { margin: 4px 0 0; color: var(--muted); }
.link-danger { background: none; border: 0; color: var(--bad); text-decoration: underline; font-size: .9em; }
.archive-h { font-size: 1.4em; color: var(--or); margin-top: 10px; }

.mini-podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin-top: 16px; }
.mini-step { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 150px; }
.mini-step .meeple { width: 48px; height: 48px; }
.mini-step b { font-size: 1.05em; text-align: center; }
.mini-step small { color: var(--muted); font-family: var(--display); font-weight: 700; }
.mini-block { width: 100%; margin-top: 6px; border-radius: 8px 8px 0 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.8em; color: rgba(255, 255, 255, .9); background: var(--wood); }
.mini-step.p1 .mini-block { height: 90px; background: var(--or-deep); }
.mini-step.p2 .mini-block { height: 64px; background: #8d97ab; }
.mini-step.p3 .mini-block { height: 44px; }

.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.award-mini { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.award-mini .e { font-size: 2em; line-height: 1; }
.award-mini b { font-family: var(--display); color: var(--azur); font-size: 1.1em; }
.award-mini .who { display: flex; align-items: center; gap: 6px; font-weight: 800; margin: 2px 0; }
.award-mini .who .meeple { width: 20px; height: 20px; }
.award-mini span { color: var(--muted); font-size: .9em; }

.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th { text-align: left; font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--paper-edge); }
.rank-table td { padding: 7px 8px; border-bottom: 1px solid var(--paper-edge); }
.rank-table td:first-child { font-family: var(--display); font-weight: 700; width: 2em; }
.rank-table td.name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.rank-table td.name .meeple { width: 22px; height: 22px; }
.rank-table tbody tr:nth-child(-n+3) td:first-child { color: var(--or-deep); }

.q-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.q-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.q-stat-head { display: flex; gap: 10px; align-items: flex-start; }
.q-stat-head .num { font-family: var(--display); font-weight: 700; color: var(--azur); }
.q-stat-head p { flex: 1; margin: 0; font-weight: 700; line-height: 1.3; }
.q-stat-head .pct { font-family: var(--display); font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--paper-edge); }
.q-stat-head .pct.easy { background: #d6efcf; color: #1f5a0c; }
.q-stat-head .pct.hard { background: #f9d4d0; color: #8f1d14; }
.q-stat-answers { display: flex; flex-direction: column; gap: 4px; }
.q-stat-answer { display: flex; align-items: center; gap: 8px; font-size: .92em; color: var(--muted); }
.q-stat-answer .die { width: 18px; height: 18px; flex: none; }
.q-stat-answer span { flex: 1; }
.q-stat-answer.right { color: var(--ink); font-weight: 700; }
.q-stat-answer.right span::after { content: " ✔"; color: var(--good); }

@media (max-width: 760px) {
  .archive-main { grid-template-columns: 1fr; padding: 12px 16px 32px; }
  .archive-head { padding: 16px 16px 4px; }
  .archive-list { position: static; }
  .archive-group-items { flex-direction: row; overflow-x: auto; }
  .archive-item { flex: none; }
  .q-stats { grid-template-columns: 1fr; }
}

@media print {
  body.archive { background: #fff; color: var(--ink); font-size: 12px; }
  .archive-actions, .archive-list, .link-danger { display: none !important; }
  .archive-main { display: block; padding: 0; }
  .archive-head .brand h1 { color: var(--ink); text-shadow: none; }
  .archive-h { color: var(--azur); }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .q-stats, .award-grid { gap: 8px; }
}

/* Télécommande de l'animateur, sur le téléphone d'un admin connecté */
.remote {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 21, 54, .96); border-top: 3px solid var(--or);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .4);
}
.remote-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.remote-tag { font-family: var(--display); font-weight: 700; color: var(--or); font-size: .72em; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.remote-status { font-size: .9em; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remote .btn { flex: none; font-size: 1.05em; padding: 12px 16px; }
body.has-remote .phone { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* Lien de partage, cumul des parties, résultats d'un participant */
.share { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--paper-edge); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.share .btn.ghost { background: var(--azur); color: #fff; }
.share-label { font-family: var(--display); font-weight: 700; color: var(--azur); }
.share-help { color: var(--muted); font-size: .9em; }
.share-row { display: flex; gap: 8px; width: 100%; }
.share-row input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--paper-edge); background: #fff; color: var(--ink); }
.share-row .btn { font-size: 1em; padding: 8px 16px; }
.share-replay-block { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; width: 100%; }
.share-qr { width: 160px; flex: none; aspect-ratio: 1; background: #fff; border-radius: 10px; padding: 6px; box-shadow: 0 0 0 3px var(--ink); }
.share-qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.share-replay-text { flex: 1; min-width: 14em; display: flex; flex-direction: column; gap: 8px; }
.share-open { font-size: .9em; color: var(--muted); }
.share-open a { color: var(--azur); font-weight: 600; }
.rank-table tr.me td { background: #fff3c4; font-weight: 800; }
.archive-single { max-width: 1100px; margin: 0 auto; padding: 16px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.archive-foot { color: rgba(255, 255, 255, .75); text-align: center; margin-top: 12px; }
.archive-foot a, .inline-link { color: var(--or); }
.table-wrap { overflow-x: auto; }
.rank-table td.emojis, .emojis { letter-spacing: .1em; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.game-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; transition: transform .15s; }
.game-card:hover { transform: translateY(-3px); }
.game-card .when { font-size: .85em; color: var(--muted); }
.game-card .meta { font-size: .9em; color: var(--muted); }
.game-card .go { margin-top: 6px; color: var(--azur); font-weight: 700; font-size: .9em; }
.my-line { font-size: 1.1em; line-height: 1.5; }
.mine-stats .stat b { font-size: 2.2em; }
.my-game { padding: 0; }
.my-game summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.my-game summary::-webkit-details-marker { display: none; }
.my-game summary .medal { font-size: 1.8em; }
.my-game summary .sum { flex: 1; }
.my-game summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
.my-game[open] summary::after { transform: rotate(180deg); }
.my-game-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.my-game-body .meta { color: var(--muted); margin: 0; }
.my-game-body .archive-h { color: var(--azur); }
.my-game-body .archive-card { padding: 12px; }
@media (max-width: 760px) {
  .archive-single { padding: 12px 16px 32px; }
  .rank-table:not(.cumul) th:nth-child(5), .rank-table:not(.cumul) td:nth-child(5) { display: none; }
}
@media print {
  .archive-single { max-width: none; padding: 0; }
}

/* Rejouer en solo */
.phone .lead.small { font-size: .85em; opacity: .8; }
.solo-art { display: block; max-width: 70%; max-height: 22vh; margin: 0 auto; border-radius: 8px; box-shadow: 0 0 0 4px #fff, 0 10px 20px rgba(0, 0, 0, .4); }
.solo-fact { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.solo-fact img { width: 70px; border-radius: 6px; flex: none; }
.solo-fact b { font-family: var(--display); color: var(--azur); }
.solo-fact p { margin: 4px 0 0; color: var(--ink); line-height: 1.4; }
.solo-ranking .archive-h { font-size: 1.2em; color: var(--or); margin: 6px 0 8px; }
.solo-ranking .archive-card { padding: 10px; font-size: .9em; }
.solo-ranking .rank-table th:nth-child(5), .solo-ranking .rank-table td:nth-child(5) { display: none; }
.solo-actions { display: flex; gap: 10px; }
.solo-actions .btn { flex: 1; text-decoration: none; }
.share-replay { margin-top: 4px; }
.center-actions { display: flex; justify-content: center; }
.center-actions .btn, .my-game-body > .btn { text-decoration: none; align-self: flex-start; }

/* --- Thèmes de soirée (Halloween, Noël) ---
   Choisis par quiz depuis l'accueil des admins, posés sur <body data-theme> par Theme.apply
   (common.js) : palette, motif de fond, décor animé. Les couleurs des réponses ne changent
   pas, pour que l'écran et les téléphones parlent toujours la même langue. */

body[data-theme="halloween"] {
  --night: #160b26;
  --night-2: #2e1552;
  --azur: #5b2a8c;
  --or: #ff8a1f;
  --or-deep: #c45a08;
  --or-light: #ffb866;
  --paper: #f8eedb;
  --paper-edge: #e5cfa6;
  --game-texture: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='210'%20height='210'%20viewBox='0%200%20210%20210'%20fill='none'%20stroke='white'%20stroke-opacity='0.065'%20stroke-width='1.6'%20stroke-linejoin='round'%20stroke-linecap='round'%3E%3Cg%20transform='translate%2835%2035%29'%3E%3Cpath%20d='M0%20-9C-6%20-14%20-16%20-11%20-17%20-1C-18%209%20-10%2015%200%2013C10%2015%2018%209%2017%20-1C16%20-11%206%20-14%200%20-9Z'/%3E%3Cpath%20d='M0%20-9C-5%20-4%20-5%208%200%2013M0%20-9C5%20-4%205%208%200%2013'/%3E%3Cpath%20d='M0%20-9C0%20-13%201%20-16%204%20-17'/%3E%3Cpath%20d='M-9%20-2l3%20-4l3%204zM3%20-2l3%20-4l3%204z'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3Cpath%20d='M-8%205C-4%208%204%208%208%205'/%3E%3C/g%3E%3Cg%20transform='translate%28105%2035%29'%3E%3Cpath%20d='M0%20-3C-3%20-7%20-6%20-6%20-7%20-3C-10%20-9%20-17%20-9%20-20%20-4C-16%20-3%20-14%200%20-14%203C-11%200%20-8%201%20-6%204C-4%201%20-2%201%200%203C2%201%204%201%206%204C8%201%2011%200%2014%203C14%200%2016%20-3%2020%20-4C17%20-9%2010%20-9%207%20-3C6%20-6%203%20-7%200%20-3Z'/%3E%3Cpath%20d='M-2%20-6l-1%20-4M2%20-6l1%20-4'/%3E%3C/g%3E%3Cg%20transform='translate%28175%2035%29'%3E%3Cpath%20d='M-11%2014V-2C-11%20-10%20-6%20-15%200%20-15C6%20-15%2011%20-10%2011%20-2V14L7%2010L3%2014L0%2010L-3%2014L-7%2010Z'/%3E%3Ccircle%20cx='-4'%20cy='-4'%20r='2'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3Ccircle%20cx='4'%20cy='-4'%20r='2'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3Cpath%20d='M-2%203C-1%205%201%205%202%203'/%3E%3C/g%3E%3Cg%20transform='translate%2835%20105%29'%3E%3Cpath%20d='M-17%2012C-8%2015%208%2015%2017%2012C12%209%20-12%209%20-17%2012Z'/%3E%3Cpath%20d='M-9%2010L-2%20-10C0%20-15%206%20-17%2010%20-14C5%20-13%203%20-10%204%20-6L9%2010'/%3E%3Cpath%20d='M-8%206C-3%207%203%207%208%206'/%3E%3C/g%3E%3Cg%20transform='translate%28105%20105%29'%3E%3Cpath%20d='M-16%20-16L16%20-16M-16%20-16L-16%2016M-16%20-16L14%204M-16%20-16L4%2014'/%3E%3Cpath%20d='M-4%20-16C-4%20-11%20-2%20-9%201%20-8C1%20-5%20-1%20-3%20-5%20-1C-8%20-2%20-11%20-3%20-16%20-3'/%3E%3Cpath%20d='M8%20-16C7%20-9%209%20-5%2013%20-1C9%203%207%206%206%2011C1%209%20-5%209%20-16%209'/%3E%3C/g%3E%3Cg%20transform='translate%28175%20105%29'%3E%3Cellipse%20cx='0'%20cy='0'%20rx='8'%20ry='6'/%3E%3Cpath%20d='M-8%200L-16%20-6V6ZM8%200L16%20-6V6Z'/%3E%3Cpath%20d='M-3%20-5.5L2%205.5'/%3E%3C/g%3E%3Cg%20transform='translate%2835%20175%29'%3E%3Cpath%20d='M-14%20-4H14C14%208%208%2014%200%2014C-8%2014%20-14%208%20-14%20-4Z'/%3E%3Cpath%20d='M-16%20-4H16'/%3E%3Cpath%20d='M-9%2014L-11%2017M9%2014L11%2017'/%3E%3Ccircle%20cx='-4'%20cy='-9'%20r='3'/%3E%3Ccircle%20cx='3'%20cy='-12'%20r='2'/%3E%3Ccircle%20cx='8'%20cy='-8'%20r='1.5'/%3E%3C/g%3E%3Cg%20transform='translate%28105%20175%29'%3E%3Cpath%20d='M4%20-15C-6%20-14%20-13%20-6%20-13%203C-13%2012%20-5%2017%204%2015C-4%2011%20-7%204%20-6%20-3C-5%20-9%20-1%20-13%204%20-15Z'/%3E%3Cpath%20d='M10%20-6l1%20-3l1%203l3%201l-3%201l-1%203l-1%20-3l-3%20-1z'/%3E%3C/g%3E%3Cg%20transform='translate%28175%20175%29'%3E%3Cpath%20d='M0%20-18V-4'/%3E%3Cellipse%20cx='0'%20cy='2'%20rx='5'%20ry='6'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3Cellipse%20cx='0'%20cy='2'%20rx='5'%20ry='6'/%3E%3Cpath%20d='M-4%200L-11%20-5L-14%20-1M-4%203L-12%202L-15%207M-4%206L-10%2010L-12%2015M4%200L11%20-5L14%20-1M4%203L12%202L15%207M4%206L10%2010L12%2015'/%3E%3C/g%3E%3C/svg%3E");
  background-image: var(--game-texture),
    radial-gradient(circle at 88% 9%, #fff4cf 0, #ffe39a min(3.2vw, 46px), rgba(255, 214, 140, .22) calc(min(3.2vw, 46px) + 1px), transparent min(12vw, 170px)),
    radial-gradient(ellipse at 50% 0%, var(--night-2) 0%, var(--night) 70%);
  background-size: 210px 210px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

body[data-theme="noel"] {
  --night: #0b2a24;
  --night-2: #134a3a;
  --azur: #b3242c;
  --or: #f4c542;
  --or-deep: #c9971b;
  --or-light: #ffe28a;
  --paper: #fdf8ee;
  --paper-edge: #ead8b0;
  --game-texture: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='210'%20height='210'%20viewBox='0%200%20210%20210'%20fill='none'%20stroke='white'%20stroke-opacity='0.065'%20stroke-width='1.6'%20stroke-linejoin='round'%20stroke-linecap='round'%3E%3Cg%20transform='translate%2835%2035%29'%3E%3Cpath%20d='M0%20-17L-8%20-6H-4L-11%203H-6L-14%2012H14L6%203H11L4%20-6H8Z'/%3E%3Cpath%20d='M-2%2012V17H2V12'/%3E%3C/g%3E%3Cg%20transform='translate%28105%2035%29'%3E%3Cpath%20d='M0%20-16V16M-13.9%20-8L13.9%208M-13.9%208L13.9%20-8'/%3E%3Cpath%20d='M-4%20-12L0%20-8L4%20-12M-4%2012L0%208L4%2012M-12.4%20-2.5L-6.9%20-4L-8.4%20-9.5M12.4%202.5L6.9%204L8.4%209.5M-8.4%209.5L-6.9%204L-12.4%202.5M8.4%20-9.5L6.9%20-4L12.4%20-2.5'/%3E%3C/g%3E%3Cg%20transform='translate%28175%2035%29'%3E%3Crect%20x='-13'%20y='-4'%20width='26'%20height='18'%20rx='2'/%3E%3Crect%20x='-15'%20y='-9'%20width='30'%20height='6'%20rx='2'/%3E%3Cpath%20d='M0%20-9V14'/%3E%3Cpath%20d='M0%20-9C-4%20-16%20-11%20-15%20-9%20-11C-8%20-9%20-4%20-9%200%20-9C4%20-9%208%20-9%209%20-11C11%20-15%204%20-16%200%20-9Z'/%3E%3C/g%3E%3Cg%20transform='translate%2835%20105%29'%3E%3Cpath%20d='M0%20-16L4.5%20-5.5L15.5%20-5L7%202.5L9.7%2013.5L0%207.5L-9.7%2013.5L-7%202.5L-15.5%20-5L-4.5%20-5.5Z'/%3E%3C/g%3E%3Cg%20transform='translate%28105%20105%29'%3E%3Cpath%20d='M-3%2016V-6C-3%20-13%202%20-16%206%20-16C10%20-16%2013%20-13%2013%20-9V-6'/%3E%3Cpath%20d='M3%2016V-6C3%20-9%204%20-10%206%20-10C7%20-10%208%20-9%207%20-6'/%3E%3Cpath%20d='M-3%2010L3%206M-3%202L3%20-2M-2%20-8L3%20-12M6%20-16L7%20-10M11%20-14L8%20-9'/%3E%3C/g%3E%3Cg%20transform='translate%28175%20105%29'%3E%3Ccircle%20cx='0'%20cy='4'%20r='12'/%3E%3Crect%20x='-4'%20y='-12'%20width='8'%20height='5'%20rx='1'/%3E%3Cpath%20d='M0%20-12C-2%20-16%202%20-18%203%20-15'/%3E%3Cpath%20d='M-11%201C-4%205%204%20-1%2011%202M-11%208C-4%2012%204%206%2011%209'/%3E%3Ccircle%20cx='-5'%20cy='-1'%20r='1.6'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3C/g%3E%3Cg%20transform='translate%2835%20175%29'%3E%3Cpath%20d='M-14%2010C-12%20-6%20-2%20-14%208%20-12C12%20-11%2014%20-8%2013%20-4C10%20-8%206%20-6%207%200L9%2010'/%3E%3Crect%20x='-16'%20y='9'%20width='27'%20height='7'%20rx='3.5'/%3E%3Ccircle%20cx='14'%20cy='-4'%20r='3.5'/%3E%3C/g%3E%3Cg%20transform='translate%28105%20175%29'%3E%3Cpath%20d='M-12%209C-10%207%20-9%204%20-9%20-2C-9%20-9%20-5%20-13%200%20-13C5%20-13%209%20-9%209%20-2C9%204%2010%207%2012%209Z'/%3E%3Cpath%20d='M-13%209H13'/%3E%3Ccircle%20cx='0'%20cy='12.5'%20r='2.5'%20fill='white'%20fill-opacity='0.065'%20stroke='none'/%3E%3Cpath%20d='M0%20-13V-16'/%3E%3Cpath%20d='M-4%20-16C-6%20-18%20-9%20-17%20-9%20-15M4%20-16C6%20-18%209%20-17%209%20-15'/%3E%3C/g%3E%3Cg%20transform='translate%28175%20175%29'%3E%3Cpath%20d='M-2%202C-6%20-2%20-9%20-2%20-12%20-6C-12%20-9%20-15%20-10%20-16%20-12C-10%20-12%20-8%20-8%20-4%20-8C-6%20-11%20-5%20-14%20-7%20-16C-2%20-14%20-1%20-10%200%20-6C0%20-3%20-1%200%20-2%202Z'/%3E%3Cpath%20d='M2%202C6%20-2%209%20-2%2012%20-6C12%20-9%2015%20-10%2016%20-12C10%20-12%208%20-8%204%20-8C6%20-11%205%20-14%207%20-16C2%20-14%201%20-10%200%20-6'/%3E%3Ccircle%20cx='-3'%20cy='7'%20r='3'/%3E%3Ccircle%20cx='3'%20cy='7'%20r='3'/%3E%3Ccircle%20cx='0'%20cy='12'%20r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Le décor tient en deux couches qui ne captent aucun clic : derrière le contenu (brume,
   citrouilles, neige au sol), et devant (chauves-souris, araignée, guirlande, flocons — petits
   et pâles, ils passent seuls devant le texte). */
.theme-deco { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.theme-deco.back { z-index: 0; }
body[data-theme] :is(.host-screen, .phone, .archive-head, .archive-main, .archive-single) { z-index: 1; }
body[data-theme] :is(.phone, .archive-head, .archive-main, .archive-single) { position: relative; }
.theme-deco svg { display: block; }

/* Halloween : pleine lune (dans le fond), chauves-souris qui traversent, araignée qui descend,
   citrouilles allumées, brume. */
.deco-bat { position: absolute; left: -10vw; width: clamp(34px, 4vw, 70px); animation: bat-fly var(--d, 16s) linear infinite; animation-delay: var(--delay, 0s); }
.deco-bat svg { width: 100%; animation: bat-flap .28s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes bat-fly {
  0% { transform: translate(0, 0); }
  25% { transform: translate(30vw, 4vh); }
  50% { transform: translate(60vw, -2vh); }
  75% { transform: translate(90vw, 5vh); }
  100% { transform: translate(120vw, 0); }
}
@keyframes bat-flap { from { transform: scaleY(1); } to { transform: scaleY(.45); } }
.deco-spider { position: absolute; top: 0; right: 22vw; display: flex; flex-direction: column; align-items: center; animation: spider-drop 9s ease-in-out infinite; }
.deco-spider i { width: 1px; height: 12vh; background: rgba(255, 255, 255, .5); }
.deco-spider svg { width: clamp(22px, 2.4vw, 40px); margin-top: -2px; }
@keyframes spider-drop { 0%, 100% { transform: translateY(-6vh); } 45%, 60% { transform: translateY(6vh); } }
.deco-pumpkin { position: absolute; bottom: -.6vh; width: clamp(56px, 7vw, 130px); filter: drop-shadow(0 0 18px rgba(255, 140, 30, .55)); }
.deco-pumpkin.left { left: 1.5vw; }
.deco-pumpkin.right { right: 1.5vw; width: clamp(44px, 6vw, 110px); }
.deco-pumpkin .glow { animation: flicker 2.6s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .75; } 45% { opacity: 1; } 70% { opacity: .85; } }
.deco-fog { position: absolute; left: -10%; right: -10%; bottom: 0; height: 18vh;
  background: radial-gradient(ellipse at 30% 100%, rgba(170, 140, 220, .22), transparent 60%), radial-gradient(ellipse at 75% 100%, rgba(140, 200, 160, .14), transparent 55%);
  animation: fog 18s ease-in-out infinite alternate; }
@keyframes fog { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

/* Noël : guirlande lumineuse, flocons qui tombent, congère. */
.deco-garland { position: absolute; top: 0; left: 0; width: 100%; height: clamp(20px, 3.2vh, 38px); }
.deco-garland .bulb { animation: twinkle 1.8s ease-in-out infinite; }
.deco-garland .bulb:nth-of-type(3n+1) { animation-delay: .6s; }
.deco-garland .bulb:nth-of-type(3n+2) { animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.deco-flake { position: absolute; top: -4vh; color: #fff; opacity: var(--o, .7); font-size: var(--s, 14px); line-height: 1; animation: snow var(--d, 12s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes snow {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(var(--drift, 20px), 55vh) rotate(180deg); }
  100% { transform: translate(0, 110vh) rotate(360deg); }
}
.deco-drift { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(18px, 4vh, 46px); }

/* Pendant une question et sa réponse, le texte passe avant le décor : seuls les couleurs, le
   motif et la lune restent sur l'écran projeté. */
body.host:is([data-phase="question"], [data-phase="reveal"]) .theme-deco { display: none; }

/* Sur un téléphone, le décor se fait discret : pas de citrouille sous les boutons. */
body.play .deco-pumpkin, body.play .deco-drift, body.play .deco-fog { display: none; }
body.play .deco-spider { display: none; }

@media (prefers-reduced-motion: reduce) {
  .theme-deco *, .theme-deco *::after { animation: none !important; }
  .deco-flake, .deco-bat { display: none; }
}
@media print { .theme-deco { display: none; } }

/* Question bonus : points ×2 */
.bonus-tag { display: inline-block; align-self: center; margin: .3em auto; padding: .3em .9em; border-radius: 999px; background: var(--or); color: var(--ink); font-family: var(--display); font-weight: 700; white-space: nowrap; box-shadow: 0 0 0 .15em #fff, 0 0 1.2em var(--or); animation: bonus-pulse 1.6s ease-in-out infinite; }
.q-label + .bonus-tag { display: table; }
.q-top .bonus-tag { font-size: 1.4em; margin: 0 .6em; }
.q-stat-head .bonus-tag { font-size: .8em; margin: 0 .5em; animation: none; box-shadow: none; }
@keyframes bonus-pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .bonus-tag { animation: none; } }

/* La question bonus pour rire, révélée à l'écran */
.joke-reveal { margin: auto; text-align: center; max-width: 34em; }
.joke-reveal .joke-mask { font-size: 9em; line-height: 1; animation: joke-wobble 1.4s ease-in-out infinite; }
.joke-reveal h1 { font-size: 3.4em; margin: .2em 0; }
.joke-reveal p { font-size: 1.6em; line-height: 1.4; }
@keyframes joke-wobble { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: reduce) { .joke-reveal .joke-mask { animation: none; } }
