/* Nakama Quiz — style manga : cases encrées, trames, onomatopées. */
@font-face { font-family: 'Bangers'; src: url('fonts/bangers.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'M PLUS Rounded 1c'; src: url('fonts/mplus-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'M PLUS Rounded 1c'; src: url('fonts/mplus-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'M PLUS Rounded 1c'; src: url('fonts/mplus-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --night: #231552;
  --night-2: #2e1d6b;
  --dot: rgba(255, 255, 255, .08);
  --ink: #130b33;
  --paper: #ffffff;
  --lilac: #efeaff;
  --pink: #ff4f8b;
  --yellow: #ffd23f;
  --teal: #19d3c5;
  --orange: #ff8a3d;
  --violet: #8a6bff;
  --good: #2fd67a;
  --bad: #ff4f5e;
  --muted: #c9bff5;
  --muted-ink: #5d5486;
  --display: 'Bangers', 'Impact', 'Arial Black', sans-serif;
  --body: 'M PLUS Rounded 1c', ui-rounded, 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-l: 6px 6px 0 var(--ink);
  --radius: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--night);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  color: #fff;
  font-family: var(--body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
#app { max-width: 560px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px calc(100px + var(--safe-b)); }
body.wide #app { max-width: 1040px; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Typographie ---------- */
.page-title, .big-title {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .5px;
  line-height: .95;
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}
.page-title { font-size: 48px; margin: 8px 0 14px; transform: rotate(-2deg); transform-origin: left center; }
.big-title { font-size: clamp(44px, 13vw, 76px); text-align: center; margin: 18px 0 18px; transform: rotate(-2deg); }
.ph { font-size: 1.15rem; font-weight: 900; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ph .count { background: var(--ink); color: var(--yellow); border-radius: 999px; padding: 0 10px; font-size: .9rem; }
.hint { font-size: .88rem; color: var(--muted-ink); margin-top: 8px; }
.muted { color: var(--muted); }
.muted-ink { color: var(--muted-ink); }
.center { text-align: center; }
.room > p.center { margin-top: 14px; }
.err { background: var(--bad); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); font-weight: 800; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { width: 100%; min-height: 60px; font-size: 1.15rem; margin-top: 12px; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .9rem; box-shadow: 3px 3px 0 var(--ink); }
.btn.pink { background: var(--pink); }
.btn.teal { background: var(--teal); }
.btn.yellow { background: var(--yellow); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.btn.ghost:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.wide-btn { width: 100%; margin-top: 12px; }
.back { background: none; border: 0; color: var(--muted); font-weight: 800; padding: 6px 0; min-height: 40px; cursor: pointer; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row > .btn { flex: 1 1 auto; }
.center-row { justify-content: center; margin-top: 22px; }
.center-row > .btn { flex: 0 1 auto; }
.stack { display: grid; gap: 2px; margin-top: 20px; }

/* ---------- Cases (panels) avec trame dans le coin ---------- */
.panel {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-l);
  padding: 16px;
  margin: 16px 0;
  overflow: hidden;
}
.panel::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 48%;
  height: 72%;
  pointer-events: none;
  background-image: radial-gradient(var(--ink) 1px, transparent 1.4px);
  background-size: 7px 7px;
  -webkit-mask-image: linear-gradient(135deg, transparent 55%, #000 100%);
  mask-image: linear-gradient(135deg, transparent 55%, #000 100%);
  opacity: .13;
}
.panel > * { position: relative; z-index: 1; }

/* ---------- Formulaires ---------- */
.field + .field { margin-top: 18px; }
.flabel { display: block; font-weight: 900; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.chip small { font-size: .75rem; color: var(--muted-ink); font-weight: 700; }
.chip.on { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.chips.fmt .chip { border-radius: 14px; }
input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--lilac);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
}
input[type="text"]::placeholder { color: #8e86b3; font-weight: 700; }
input[type="text"]:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px var(--yellow); }
input.shake { animation: shake .4s; }
.code-input { font-family: var(--display); font-weight: 400; font-size: 46px; letter-spacing: 12px; text-align: center; text-transform: uppercase; padding-left: 26px; }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.av-btn { aspect-ratio: 1; display: grid; place-items: center; padding: 0; font-size: 22px; border-radius: 12px; border: 2px solid transparent; background: var(--lilac); cursor: pointer; }
.av-btn.on { border-color: var(--ink); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Accueil ---------- */
.logo { position: relative; text-align: center; padding: 38px 0 20px; isolation: isolate; }
.logo-burst {
  position: absolute;
  inset: -30px -70px;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 210, 63, .22) 0 5deg, transparent 5deg 13deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 14%, transparent 66%);
  mask-image: radial-gradient(circle at 50% 50%, #000 14%, transparent 66%);
  animation: spin 70s linear infinite;
}
.logo-title { font-family: var(--display); font-weight: 400; font-size: clamp(70px, 23vw, 120px); line-height: .8; letter-spacing: 1px; transform: rotate(-5deg); }
.logo-title span { display: block; color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--pink), 9px 9px 0 var(--ink); }
.logo-title span + span { color: #fff; margin-left: 22%; text-shadow: 5px 5px 0 var(--teal), 9px 9px 0 var(--ink); }
.tagline { text-align: center; color: var(--muted); max-width: 32ch; margin: 8px auto 0; font-size: 1.02rem; }

.connecting { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; }
.spinner { font-size: 64px; animation: spin 1.2s linear infinite; }

/* ---------- Bandeau de la salle ---------- */
.strip { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.strip-l { display: flex; flex-direction: column; min-width: 0; }
.rd { font-family: var(--display); font-weight: 400; font-size: 1.65rem; letter-spacing: .5px; line-height: 1; color: var(--yellow); -webkit-text-stroke: 1px var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.qnum { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.strip-r { display: flex; align-items: center; gap: 8px; flex: none; }
.conn { width: 12px; height: 12px; border-radius: 50%; background: #8a83a8; border: 2px solid var(--ink); }
.conn.on { background: var(--good); }
.conn.reco { background: var(--yellow); animation: blink 1s steps(2) infinite; }
.conn.off { background: var(--bad); }
.me-score { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 3px 12px; font-weight: 900; box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }

.timer-wrap { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.timer { position: relative; flex: 1; height: 16px; border: 3px solid var(--ink); border-radius: 999px; background: var(--night-2); overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.tfill { position: absolute; inset: 0; transform-origin: left center; background: repeating-linear-gradient(-45deg, var(--teal) 0 10px, #5ae8de 10px 20px); }
.tfill.hurry { background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, #ff86b0 10px 20px); }
.ttxt { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); font-weight: 900; box-shadow: 3px 3px 0 var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Lobby ---------- */
.code-panel { text-align: center; }
.code-hint { color: var(--muted-ink); font-weight: 800; }
.code { font-family: var(--display); font-weight: 400; font-size: clamp(64px, 22vw, 112px); letter-spacing: 10px; line-height: 1; margin: 4px 0 6px; padding-left: 10px; }
.qr { width: 170px; margin: 6px auto 4px; }
.qr svg { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 12px; background: #fff; }
.waiting { text-align: center; }
.wait-emoji { font-size: 64px; line-height: 1.1; animation: bob 1.6s ease-in-out infinite; }
.wait-title { font-size: 1.2rem; font-weight: 900; margin: 6px 0 4px; }
.plist { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border: 2px solid var(--ink); border-radius: 999px; background: var(--lilac); font-weight: 800; }
.pchip.new { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.pchip.off { opacity: .5; }
.pchip .av { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid var(--ink); font-size: 20px; }
.pchip .x { border: 0; background: none; color: var(--muted-ink); font-weight: 900; cursor: pointer; min-width: 30px; min-height: 30px; padding: 0; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border: 3px solid var(--ink); border-radius: 14px; }
.team.tA { background: #ffe1ec; }
.team.tB { background: #d4f7f3; }
.team.mine { box-shadow: 4px 4px 0 var(--ink); }
.team-h { font-weight: 900; }
.team-e { font-size: 1.3rem; }
.team-m { display: flex; flex-wrap: wrap; gap: 4px; min-height: 30px; }
.mini { font-size: 22px; }
.settings-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-sum p { font-size: .95rem; }

/* ---------- Intro de manche (page splash) ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 5;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  text-align: center;
  overflow: hidden;
  color: var(--ink);
}
.splash.c0 { background: var(--pink); }
.splash.c1 { background: var(--teal); }
.splash.c2 { background: var(--yellow); }
.splash.c3 { background: var(--violet); }
.splash.c4 { background: var(--orange); }
.speedlines {
  position: absolute;
  inset: -60%;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(19, 11, 51, .24) 0 1.6deg, transparent 1.6deg 8deg);
  -webkit-mask-image: radial-gradient(circle, transparent 14%, #000 52%);
  mask-image: radial-gradient(circle, transparent 14%, #000 52%);
  animation: spin 30s linear infinite;
}
.sfx-jp {
  position: absolute;
  top: calc(8% + var(--safe-t));
  right: 6%;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  font-size: clamp(48px, 15vw, 88px);
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  transform: rotate(12deg);
  animation: zoom .5s .15s cubic-bezier(.2, 1.6, .4, 1) both;
}
.intro-num { background: rgba(255, 255, 255, .85); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-weight: 900; }
.intro-emoji { font-size: 104px; line-height: 1; filter: drop-shadow(5px 5px 0 var(--ink)); animation: zoom .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.intro-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 17vw, 116px);
  line-height: .9;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-3deg);
  animation: slam .5s .1s cubic-bezier(.2, 1.4, .4, 1) both;
}
.intro-desc { max-width: 420px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 1.05rem; animation: rise-in .4s .35s both; }

/* ---------- Question ---------- */
.qpanel { margin-top: 12px; }
.qtext { font-size: 1.32rem; font-weight: 900; line-height: 1.3; }
.qtext.small { font-size: 1.05rem; margin-bottom: 12px; }
.qsub { color: var(--muted-ink); font-size: .92rem; margin-top: 4px; }
.rebus { font-size: clamp(44px, 14vw, 72px); text-align: center; letter-spacing: .08em; line-height: 1.25; margin: 10px 0 4px; overflow-wrap: anywhere; }
.rebus.small { font-size: 40px; margin: 0 0 12px; }
.clues { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.clue { display: flex; gap: 10px; align-items: flex-start; background: var(--lilac); border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; }
.clue b { flex: none; font-family: var(--display); font-weight: 400; font-size: 1.35rem; line-height: 1; color: var(--pink); -webkit-text-stroke: 1px var(--ink); }
.clue.new { animation: pop .4s cubic-bezier(.2, 1.5, .4, 1); }
.clue.locked { background: transparent; border-style: dashed; color: var(--muted-ink); }
.clues.done { margin: 0 0 12px; }
.quipts { margin-top: 10px; font-weight: 900; color: #d0215f; min-height: 1.4em; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.choices.long { grid-template-columns: 1fr; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.choices.long .choice { min-height: 64px; }
.choice:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.choice:disabled { opacity: .22; filter: grayscale(.8); cursor: not-allowed; }
.choice .shape { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .6); border: 2px solid var(--ink); font-size: 15px; }
.k0 { background: var(--pink); }
.k1 { background: var(--teal); }
.k2 { background: var(--yellow); }
.k3 { background: var(--violet); }
.choices.n2 .choice, .choices.n3 .choice { flex-direction: column; justify-content: center; text-align: center; font-family: var(--display); font-weight: 400; letter-spacing: 1px; }
.choices.n2 .choice { min-height: 124px; font-size: 2.2rem; }
.choices.n3 { grid-template-columns: repeat(3, 1fr); }
.choices.n3 .choice { min-height: 104px; font-size: 1.55rem; padding: 10px 6px; }
.choices.n2 .shape, .choices.n3 .shape { display: none; }
.choices.static .choice { cursor: default; }

.estim { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.estim input[type="text"] { font-size: 1.7rem; text-align: center; }
.unit { flex: none; font-weight: 900; color: var(--muted); }

.order { display: grid; gap: 10px; margin-top: 16px; }
.oitem { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 800; text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.oitem.on { background: var(--yellow); }
.onum { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 2px dashed var(--ink); font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.oitem.on .onum { border-style: solid; background: var(--ink); color: var(--yellow); }
.order.static .oitem { cursor: default; }

.jokers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.joker { flex: 1 1 140px; min-height: 46px; border: 2px dashed rgba(255, 255, 255, .6); border-radius: 12px; background: transparent; color: #fff; font-weight: 800; cursor: pointer; }
.joker.on { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--shadow); }

.locked { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); animation: pop .3s ease-out; }
.lock-ico { font-size: 34px; }
.locked + p { margin-top: 12px; }

.answered { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.ans-count { width: 100%; color: var(--muted); font-size: .88rem; }
.answered .a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; background: var(--night-2); border: 2px solid rgba(255, 255, 255, .18); opacity: .45; transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), opacity .2s, border-color .2s; }
.answered .a.yes { opacity: 1; border-color: var(--good); transform: scale(1.12); }

.bets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.btn.bet { min-height: 78px; font-family: var(--display); font-weight: 400; font-size: 2.2rem; letter-spacing: 1px; background: var(--yellow); }
.big-note { font-size: 1.15rem; margin-top: 20px; }

/* ---------- Révélation ---------- */
.stamp {
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 16vw, 96px);
  line-height: 1;
  text-align: center;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-6deg);
  animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.stamp.good { color: var(--good); }
.stamp.bad { color: var(--bad); }
.stamp.neutral { color: var(--yellow); font-size: clamp(40px, 11vw, 64px); }
.stamp.shake { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both, shake .4s .45s; }
.pts { margin-top: 6px; text-align: center; font-family: var(--display); font-weight: 400; font-size: 2.3rem; color: var(--yellow); -webkit-text-stroke: 1px var(--ink); text-shadow: 3px 3px 0 var(--ink); animation: rise-in .4s .25s both; }
.pts.minus { color: var(--bad); }
.streak, .x2tag { display: inline-block; vertical-align: middle; font-family: var(--body); font-size: .95rem; font-weight: 900; color: var(--ink); background: var(--orange); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; -webkit-text-stroke: 0; text-shadow: none; }
.x2tag { background: var(--yellow); }
.rchoices { display: grid; gap: 8px; }
.rchoice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--lilac); }
.rchoice .shape { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 13px; }
.rchoice .ctext { flex: 1; font-weight: 800; }
.rchoice .ctext small { color: var(--muted-ink); }
.rchoice .who { font-size: 18px; letter-spacing: 2px; }
.rchoice.correct { background: #c9f7dc; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); }
.rchoice.correct .shape { background: var(--good); }
.rchoice.wrong { opacity: .72; }
.rchoice.wrong.mine { opacity: 1; background: #ffd6da; }
.answer-big { font-family: var(--display); font-weight: 400; font-size: 3rem; line-height: 1; text-align: center; }
.rorder { margin: 0; padding-left: 24px; font-weight: 800; display: grid; gap: 4px; }
.fact { margin-top: 12px; padding-top: 12px; border-top: 2px dashed #ddd6f7; color: var(--muted-ink); font-size: .95rem; }
.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 2px dashed #e6e0fa; }
.results li:last-child { border-bottom: 0; }
.results li.me { background: linear-gradient(90deg, rgba(255, 210, 63, .38), transparent); border-radius: 10px; }
.results .av { font-size: 24px; text-align: center; }
.who-n { display: flex; flex-direction: column; min-width: 0; }
.who-n small { color: var(--muted-ink); overflow-wrap: anywhere; }
.results .p { font-weight: 900; white-space: nowrap; }
.results .p.plus { color: #0f8f4d; }
.results .p.minus { color: #c81d36; }

/* ---------- Classements ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board li {
  position: relative;
  display: grid;
  grid-template-columns: 34px 36px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise-in .35s var(--d, 0ms) both;
}
.board li::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(255, 210, 63, .55); transform-origin: left center; animation: grow .9s calc(var(--d, 0ms) + 150ms) ease-out both; }
.board li > * { position: relative; }
.board li.me { outline: 3px solid var(--teal); outline-offset: 2px; }
.board .rank { font-size: 1.3rem; text-align: center; font-weight: 900; }
.board .av { font-size: 24px; }
.board .nm { font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-family: var(--display); font-weight: 400; font-size: 1.6rem; }
.tscores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tscore { display: flex; flex-direction: column; align-items: center; padding: 12px; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); color: var(--ink); }
.tscore.tA { background: var(--pink); }
.tscore.tB { background: var(--teal); }
.tscore .te { font-size: 32px; }
.tscore .tn { font-weight: 900; }
.tscore .ts { font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1; }
.next { text-align: center; margin-top: 18px; color: var(--muted); font-weight: 800; }

/* ---------- Fin de partie ---------- */
.final-title { color: #fff; }
.team-win { margin-bottom: 14px; padding: 12px; text-align: center; font-weight: 900; font-size: 1.25rem; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); animation: stamp .5s .2s cubic-bezier(.2, 1.6, .4, 1) both; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; margin: 26px 0 10px; }
.pod { text-align: center; min-width: 0; }
.pod .av { font-size: 46px; line-height: 1.1; animation: bob 1.6s ease-in-out infinite; }
.pod.p2 .av { animation-delay: .2s; }
.pod.p3 .av { animation-delay: .4s; }
.pod .name { margin: 4px 0 6px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .block { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: var(--shadow); color: var(--ink); transform-origin: bottom center; animation: grow-up .7s cubic-bezier(.2, 1.2, .4, 1) both; }
.pod .block span { font-family: var(--display); font-weight: 400; font-size: 2.4rem; line-height: 1; }
.pod .block small { font-weight: 900; }
.pod.p1 .block { height: 140px; background: var(--yellow); animation-delay: .5s; }
.pod.p2 .block { height: 104px; background: var(--lilac); animation-delay: .25s; }
.pod.p3 .block { height: 78px; background: var(--orange); }
.you-win { margin: 6px 0 4px; font-size: 1.2rem; font-weight: 900; color: var(--yellow); }
.awards .award { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 2px dashed #e6e0fa; }
.awards .award:last-child { border-bottom: 0; }
.aw-e { font-size: 30px; }
.award small { color: var(--muted-ink); }

/* ---------- Éléments flottants ---------- */
.hostbar { position: fixed; left: 14px; bottom: calc(14px + var(--safe-b)); z-index: 20; display: flex; gap: 6px; padding: 6px; background: var(--ink); border: 2px solid rgba(255, 255, 255, .25); border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.hostbar:empty { display: none; }
.hostbar button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--night-2); font-size: 20px; cursor: pointer; }
.react-btn { position: fixed; right: 14px; bottom: calc(14px + var(--safe-b)); z-index: 20; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); background: var(--yellow); font-size: 28px; box-shadow: var(--shadow); cursor: pointer; }
.react-pal { position: fixed; right: 14px; bottom: calc(84px + var(--safe-b)); z-index: 20; display: grid; grid-template-columns: repeat(4, 50px); gap: 6px; padding: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); animation: pop .2s ease-out; }
.react-pal button { width: 50px; height: 50px; font-size: 26px; border: 0; border-radius: 12px; background: var(--lilac); cursor: pointer; }
.paused { position: fixed; left: 0; right: 0; bottom: calc(84px + var(--safe-b)); width: max-content; margin: 0 auto; z-index: 21; padding: 8px 18px; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; font-weight: 900; box-shadow: var(--shadow); }
.stale { position: fixed; left: 14px; right: 14px; top: calc(10px + var(--safe-t)); z-index: 30; padding: 10px 14px; background: var(--bad); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; font-weight: 800; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); z-index: 70; max-width: calc(100vw - 32px); padding: 10px 16px; transform: translateX(-50%); background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; font-weight: 800; box-shadow: var(--shadow); animation: toast-in .25s ease-out; overflow-wrap: anywhere; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(12, 6, 34, .72); }
.modal .panel { width: 100%; max-width: 520px; max-height: 88vh; max-height: 88dvh; margin: 0; overflow-y: auto; }
.modal .panel::after { display: none; }
.modal h3 { margin: 14px 0 6px; font-size: 1.05rem; font-weight: 900; }
.modal p { margin: 6px 0; }
.rules-steps { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.rules-rounds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules-rounds li { display: flex; gap: 10px; align-items: flex-start; }
.rules-rounds li > span { flex: none; font-size: 24px; }

.fx { position: fixed; z-index: 50; pointer-events: none; line-height: 1; }
.fx.burst { left: 50%; top: 38%; font-size: 32px; animation: burst 1.2s cubic-bezier(.15, .8, .3, 1) forwards; }
.fx.rain { top: -48px; animation: fall 2.6s linear forwards; }
.fx.react { bottom: calc(90px + var(--safe-b)); font-size: 40px; animation: float-up 2.6s ease-out forwards; }

/* ---------- Écran arbitre (ordi, tablette) ---------- */
body.wide .qtext { font-size: clamp(1.4rem, 3vw, 2.4rem); }
body.wide .choice { min-height: 110px; font-size: clamp(1.1rem, 2vw, 1.6rem); }
body.wide .rebus { font-size: clamp(60px, 10vw, 120px); }
body.wide .clue { font-size: clamp(1rem, 1.8vw, 1.4rem); }
body.wide .code { font-size: clamp(90px, 14vw, 180px); }
body.wide .qr { width: 230px; }
body.wide .choices.long { grid-template-columns: 1fr 1fr; }

@media (max-width: 370px) {
  .choice { min-height: 74px; font-size: .95rem; }
  .qtext { font-size: 1.18rem; }
  .choices { gap: 10px; }
  .avatars { grid-template-columns: repeat(6, 1fr); }
  .choices.n3 .choice { font-size: 1.25rem; }
}

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes zoom { from { transform: scale(0) rotate(-25deg); } to { transform: scale(1) rotate(0deg); } }
@keyframes slam { from { transform: scale(2.2) rotate(-10deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }
@keyframes stamp { from { transform: scale(2.4) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(-6deg); opacity: 1; } }
@keyframes rise-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes shake { 0%, 100% { translate: 0 0; } 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(1.15); opacity: 0; }
}
@keyframes fall { to { transform: translateY(calc(100vh + 80px)) rotate(400deg); } }
@keyframes float-up {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  15% { transform: translateY(-30px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-62vh) scale(1); opacity: 0; }
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .logo-burst, .speedlines { animation: none !important; }
}
