/* ============================================================
   SICKGAME — Style cartoon / comic / fun
   Couleurs vives, bordures noires épaisses, ombres dures,
   polices rondes, animations bouncy. Mobile-first.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg-base: #ffeec9;
  --bg-pop: #ffe0ad;

  --pink: #ff3aae;
  --pink-soft: #ffc1e1;
  --yellow: #ffd23f;
  --yellow-soft: #fff2a8;
  --teal: #2dd4bf;
  --teal-soft: #b6f0ea;
  --coral: #ff6b6b;
  --coral-soft: #ffc1bd;
  --lavender: #a78bfa;
  --lavender-soft: #d9c9ff;
  --green: #7bd449;
  --green-soft: #d3f5b9;
  --blue: #4cc2ff;
  --blue-soft: #c5e9ff;
  --orange: #ff9a3d;

  --ink: #1a1320;
  --ink-soft: #3a2b46;
  --text-dim: #6b5b78;
  --paper: #fff8ec;

  --border: 3px solid var(--ink);
  --border-fat: 4px solid var(--ink);

  --shadow: 4px 4px 0 0 var(--ink);
  --shadow-lg: 6px 6px 0 0 var(--ink);
  --shadow-xl: 8px 8px 0 0 var(--ink);
  --shadow-soft: 0 6px 20px rgba(26, 19, 32, 0.12);

  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 32px;
  --r-xl: 44px;
  --r-pill: 999px;

  --font-display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-logo: "Luckiest Guy", "Bangers", "Fredoka", sans-serif;
  --font-hand: "Patrick Hand", "Caveat", cursive;
  --font-body: "Fredoka", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 88% -5%, var(--pink-soft) 0%, transparent 60%),
    radial-gradient(800px 500px at -5% 30%, var(--blue-soft) 0%, transparent 65%),
    radial-gradient(700px 700px at 50% 110%, var(--yellow-soft) 0%, transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--pink); text-decoration: none; font-weight: 600; }
img, svg { display: block; max-width: 100%; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; }
p { margin: 0; }
hr { border: none; height: 3px; background: var(--ink); border-radius: 3px; margin: 1rem 0; }
code { font-family: var(--font-mono); background: var(--yellow-soft); padding: 2px 6px; border-radius: 8px; border: 2px solid var(--ink); }

/* ---------- Confettis décoratifs en fond (CSS-only, légers) ---------- */
.bg-fx { display: none; } /* on remplace par .bg-shapes */
.bg-grid { display: none; }
.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-shapes::before,
.bg-shapes::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: var(--border-fat);
  opacity: 0.5;
}
.bg-shapes::before {
  top: 12%; left: -80px;
  background: var(--coral-soft);
  animation: floaty 14s ease-in-out infinite;
}
.bg-shapes::after {
  bottom: 8%; right: -100px;
  background: var(--lavender-soft);
  animation: floaty 18s ease-in-out infinite reverse;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(8deg); }
}

/* ---------- Layout ---------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: max(20px, var(--safe-top)) 20px max(20px, var(--safe-bottom));
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
}
.app.app--wide { max-width: 1200px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.topbar .brand-small {
  font-family: var(--font-logo);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--ink);
  transform: rotate(-2deg);
  display: inline-block;
}
.topbar .badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: var(--border);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.topbar .badge:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-lg); }
.topbar .badge:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--ink); }

/* ---------- Logo ---------- */
.logo {
  text-align: center;
  margin: 28px 0 32px;
  user-select: none;
}
.logo__pre {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: clamp(18px, 4vw, 22px);
  color: var(--ink);
  background: var(--yellow);
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: var(--border);
  transform: rotate(-3deg);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.logo__main {
  display: block;
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: clamp(54px, 13vw, 100px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow:
    5px 5px 0 var(--ink),
    -2px -2px 0 var(--pink),
    2px -2px 0 var(--pink),
    -2px 2px 0 var(--pink),
    2px 2px 0 var(--pink);
  animation: logoWiggle 4s ease-in-out infinite;
  display: inline-block;
}
.logo__main:hover { animation: logoBounce 0.4s ease-out; cursor: pointer; }
.logo__sub {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink);
  background: var(--teal-soft);
  border: var(--border);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  margin-top: 18px;
  transform: rotate(2deg);
  box-shadow: var(--shadow);
}
@keyframes logoWiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes logoBounce {
  0%, 100% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-4deg) scale(1.08); }
  60% { transform: rotate(4deg) scale(0.96); }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 16px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  border: var(--border-fat);
  box-shadow: var(--shadow-lg);
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  text-transform: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-xl); }
.btn:active { transform: translate(2px, 3px); box-shadow: 2px 2px 0 0 var(--ink); }
.btn[disabled], .btn.is-disabled {
  opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--shadow);
}

.btn--primary { background: var(--pink); color: white; }
.btn--secondary { background: var(--teal); color: white; }
.btn--solo { background: var(--yellow); color: var(--ink); }
.btn--danger { background: var(--coral); color: white; }
.btn--locked { background: var(--lavender-soft); color: var(--ink); }
.btn--locked::before {
  content: "🔒";
  margin-right: 4px;
  font-size: 18px;
}
.btn--ghost {
  background: var(--paper);
  color: var(--ink);
  min-height: 52px;
  font-size: 16px;
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-row .btn { flex: 1 1 0; min-width: 140px; }

.menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.menu .btn { transform: rotate(0deg); }
.menu .btn:nth-child(odd) { transform: rotate(-0.6deg); }
.menu .btn:nth-child(even) { transform: rotate(0.6deg); }
.menu .btn:hover { transform: rotate(0) translate(-2px, -2px); }
.menu .btn:active { transform: rotate(0) translate(2px, 3px); }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--paper);
  border: var(--border-fat);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 14px;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 14px;
  display: inline-block;
  background: var(--yellow);
  padding: 4px 14px;
  border-radius: var(--r-pill);
  border: var(--border);
  transform: rotate(-1deg);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}
.input, .select {
  width: 100%;
  padding: 16px 18px;
  font-size: 17px;
  font-family: var(--font-body);
  font-weight: 500;
  background: white;
  border: var(--border);
  border-radius: var(--r-md);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: 3px 3px 0 var(--ink);
}
.input:focus, .select:focus {
  border-color: var(--pink);
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.input--code {
  font-family: var(--font-logo);
  font-size: clamp(36px, 9vw, 56px);
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  background: var(--yellow-soft);
}

/* Chip selectors */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  --chip-bg: var(--paper);
  --chip-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  border: var(--border);
  color: var(--chip-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
  cursor: pointer;
  user-select: none;
}
.chip:hover { transform: translate(-1px, -1px) rotate(-2deg); box-shadow: 4px 4px 0 var(--ink); }
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chip.is-selected { --chip-bg: var(--pink); --chip-fg: white; transform: rotate(-2deg); }
.chip.is-selected:hover { transform: rotate(-3deg) translate(-1px, -1px); }
.chip[data-cat="ABSURDE"].is-selected { --chip-bg: var(--lavender); }
.chip[data-cat="ANIMAL_MUTATION"].is-selected { --chip-bg: var(--green); }
.chip[data-cat="HARD"].is-selected { --chip-bg: var(--orange); }
.chip[data-cat="PLUS18"].is-selected { --chip-bg: var(--coral); }
.chip.is-locked { opacity: 0.65; cursor: not-allowed; background: var(--lavender-soft); }
.chip.is-locked::after { content: " 🔒"; }
.chip.is-locked:hover { transform: none; box-shadow: 3px 3px 0 var(--ink); }

/* Radio cards */
.radio-cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .radio-cards { grid-template-columns: 1fr 1fr; } }
.radio-card {
  display: block;
  padding: 16px 18px;
  border: var(--border);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .2s;
}
.radio-card input { display: none; }
.radio-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.radio-card__sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.radio-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.radio-card.is-selected {
  background: var(--yellow);
  transform: rotate(-1deg);
  box-shadow: var(--shadow-lg);
}
.radio-card.is-selected:hover { transform: rotate(-1deg) translate(-2px, -2px); }

/* ---------- Room code display ---------- */
.room-code {
  text-align: center;
  padding: 24px 16px;
  border: var(--border-fat);
  border-radius: var(--r-lg);
  background: var(--yellow-soft);
  box-shadow: var(--shadow-xl);
  margin-bottom: 18px;
  transform: rotate(-0.6deg);
}
.room-code__label {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink);
}
.room-code__value {
  font-family: var(--font-logo);
  font-size: clamp(62px, 16vw, 120px);
  letter-spacing: 0.12em;
  line-height: 1;
  margin: 10px 0;
  color: var(--ink);
  text-shadow:
    4px 4px 0 var(--ink),
    8px 8px 0 var(--pink);
  animation: codePop 0.6s ease-out;
}
@keyframes codePop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.room-code__hint {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.room-code__qr {
  margin: 18px auto 0;
  padding: 10px;
  background: #fff;
  border-radius: var(--r-md);
  border: var(--border);
  width: max-content;
  box-shadow: var(--shadow);
}

/* ---------- Players list ---------- */
.players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}
.player {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  position: relative;
  animation: playerJoin .5s cubic-bezier(.34,1.56,.64,1);
  transition: transform .15s, box-shadow .15s;
}
.player:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: var(--shadow-lg); }
@keyframes playerJoin {
  0% { opacity: 0; transform: scale(0.4) rotate(-10deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.player.is-host { background: var(--yellow); }
.player.is-host::after {
  content: "👑 HOST";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--pink);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 2px solid var(--ink);
  letter-spacing: 0.05em;
}
.player.is-voted { background: var(--green-soft); }
.player.is-voted::before {
  content: "✓";
  position: absolute;
  top: -8px; right: -8px;
  width: 28px; height: 28px;
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: white;
  font-weight: 900;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
}
.player__avatar {
  width: 58px; height: 58px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-family: var(--font-logo);
  color: white;
  border: var(--border);
  box-shadow: 3px 3px 0 var(--ink);
}
.player__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}
.player__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--pink);
  margin-top: 2px;
}

/* ---------- Question screen ---------- */
.question-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}
.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.question-cat {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: var(--border);
  background: var(--teal-soft);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
  font-weight: 700;
}
.timer {
  position: relative;
  width: 68px;
  height: 68px;
  background: white;
  border-radius: 50%;
  border: var(--border);
  box-shadow: var(--shadow);
}
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.timer .timer__track { stroke: var(--bg-base); }
.timer .timer__bar { stroke: var(--teal); transition: stroke-dashoffset .9s linear, stroke .3s; }
.timer.is-warn .timer__bar { stroke: var(--yellow); }
.timer.is-danger .timer__bar { stroke: var(--coral); animation: timerPulse 0.6s ease-in-out infinite; }
.timer__num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-logo);
  font-size: 22px;
  color: var(--ink);
}
@keyframes timerPulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.3; }
}

.question-title {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(28px, 7vw, 42px);
  text-align: center;
  margin: 18px 0 8px;
  color: var(--ink);
  transform: rotate(-1deg);
  display: inline-block;
  align-self: center;
}
.host-view .question-title {
  font-size: clamp(40px, 7vw, 72px);
  margin: 28px 0;
}

.choices {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .choices { grid-template-columns: 1fr 1fr; gap: 22px; }
  .host-view .choices { gap: 32px; }
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  min-height: 170px;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: var(--border-fat);
  text-align: left;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(19px, 4.8vw, 24px);
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-lg);
  transition: transform .15s, box-shadow .15s, background .2s;
  user-select: none;
}
.host-view .choice {
  min-height: 260px;
  font-size: clamp(24px, 3vw, 36px);
  padding: 36px;
  cursor: default;
}
.choice__tag {
  font-family: var(--font-logo);
  font-size: 26px;
  width: 52px; height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--border);
  background: white;
  align-self: flex-start;
  box-shadow: 3px 3px 0 var(--ink);
}
.choice__text { flex: 1; display: flex; align-items: center; padding: 14px 0; }

.choice--A { background: var(--pink-soft); }
.choice--A .choice__tag { background: var(--pink); color: white; }
.choice--A:hover { transform: rotate(-1deg) translate(-2px, -3px); box-shadow: var(--shadow-xl); }
.choice--B { background: var(--blue-soft); }
.choice--B .choice__tag { background: var(--blue); color: white; }
.choice--B:hover { transform: rotate(1deg) translate(-2px, -3px); box-shadow: var(--shadow-xl); }

.choice:active { transform: translate(2px, 3px); box-shadow: 2px 2px 0 var(--ink); }

.choice.is-selected {
  background: var(--yellow);
  transform: rotate(-1.5deg);
}
.choice.is-selected.choice--A,
.choice.is-selected.choice--B { box-shadow: var(--shadow-xl); }
.choice.is-disabled { opacity: 0.55; cursor: not-allowed; }
.choice.is-disabled:hover { transform: none; box-shadow: var(--shadow-lg); }

.vote-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-burst span {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid var(--ink);
  animation: vote-burst 0.7s ease-out forwards;
}
.choice--B .vote-burst span { background: var(--blue); }
@keyframes vote-burst {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx,0), var(--dy,0)) scale(0); opacity: 0; }
}

.vote-status {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink);
  margin-top: 12px;
  min-height: 26px;
}
.vote-status.is-locked {
  color: var(--green);
  font-family: var(--font-display);
  font-weight: 700;
  background: var(--green-soft);
  border: var(--border);
  border-radius: var(--r-pill);
  padding: 6px 18px;
  display: inline-block;
  align-self: center;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}

/* ---------- Results bars ---------- */
.results { margin-top: 18px; }
.result-bar {
  display: grid;
  grid-template-columns: 60px 1fr 70px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.result-bar__label {
  font-family: var(--font-logo);
  font-size: 30px;
  text-align: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 3px 0 var(--ink);
}
.result-bar__label.A { background: var(--pink); color: white; }
.result-bar__label.B { background: var(--blue); color: white; }
.result-bar__track {
  height: 28px;
  background: white;
  border-radius: var(--r-pill);
  overflow: hidden;
  border: var(--border);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.08);
}
.result-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.result-bar__fill.A { background: repeating-linear-gradient(45deg, var(--pink), var(--pink) 12px, #ff5cbd 12px, #ff5cbd 24px); }
.result-bar__fill.B { background: repeating-linear-gradient(45deg, var(--blue), var(--blue) 12px, #6ed1ff 12px, #6ed1ff 24px); }
.result-bar__pct {
  font-family: var(--font-logo);
  font-size: 22px;
  text-align: right;
  color: var(--ink);
}
.result-quip {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--yellow);
  border: var(--border);
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--ink);
  text-align: center;
  transform: rotate(-1deg);
  box-shadow: var(--shadow);
}

.result-players {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.result-players__chip {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: white;
  border: var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 2px 2px 0 var(--ink);
}
.result-players__chip.A { background: var(--pink-soft); }
.result-players__chip.B { background: var(--blue-soft); }

/* ---------- Scoreboard / leaderboard ---------- */
.leaderboard { display: flex; flex-direction: column; gap: 10px; }
.leaderboard__row {
  display: grid;
  grid-template-columns: 50px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
}
.leaderboard__row.is-me { background: var(--yellow); }
.leaderboard__rank {
  font-family: var(--font-logo);
  font-size: 28px;
  color: var(--ink);
  text-align: center;
}
.leaderboard__row[data-rank="1"] .leaderboard__rank { color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
.leaderboard__row[data-rank="2"] .leaderboard__rank { color: #bcbccd; text-shadow: 2px 2px 0 var(--ink); }
.leaderboard__row[data-rank="3"] .leaderboard__rank { color: #d99060; text-shadow: 2px 2px 0 var(--ink); }
.leaderboard__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.leaderboard__delta { font-family: var(--font-display); font-weight: 700; color: var(--green); }
.leaderboard__delta.is-zero { color: var(--text-dim); }
.leaderboard__score { font-family: var(--font-logo); font-size: 22px; color: var(--ink); }

/* ---------- Podium ---------- */
.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 14px;
  margin: 36px 0;
}
.podium__step {
  text-align: center;
  border-radius: var(--r-lg);
  padding: 16px 8px;
  background: var(--paper);
  border: var(--border-fat);
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: podiumRise 0.9s cubic-bezier(.34,1.56,.64,1) both;
}
.podium__step--1 { height: 240px; order: 2; background: var(--yellow); animation-delay: 0.4s; transform: rotate(-2deg); }
.podium__step--2 { height: 190px; order: 1; background: var(--teal-soft); animation-delay: 0.2s; transform: rotate(1deg); }
.podium__step--3 { height: 150px; order: 3; background: var(--coral-soft); animation-delay: 0s; transform: rotate(-1deg); }
@keyframes podiumRise { 0% { transform: translateY(60px) scale(0.6); opacity: 0; } 100% { transform: translateY(0) scale(1) rotate(var(--rot,0)); opacity: 1; } }
.podium__step--1 { --rot: -2deg; }
.podium__step--2 { --rot: 1deg; }
.podium__step--3 { --rot: -1deg; }
.podium__rank {
  font-family: var(--font-logo);
  font-size: 38px;
  color: var(--ink);
}
.podium__title {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--ink);
  margin: 6px 4px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  display: inline-block;
}
.podium__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.podium__score { font-family: var(--font-logo); font-size: 22px; color: var(--ink); margin-top: 4px; }

/* ---------- Floating points / popup ---------- */
.points-popup {
  position: fixed;
  left: 50%;
  top: 35%;
  transform: translate(-50%, 0);
  z-index: 50;
  pointer-events: none;
  font-family: var(--font-logo);
  font-size: 64px;
  color: var(--green);
  text-shadow:
    4px 4px 0 var(--ink),
    -2px -2px 0 white;
  animation: pointsFloat 1.6s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes pointsFloat {
  0% { transform: translate(-50%, 30px) scale(0.4) rotate(-15deg); opacity: 0; }
  25% { transform: translate(-50%, -10px) scale(1.3) rotate(8deg); opacity: 1; }
  60% { transform: translate(-50%, -40px) scale(1) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -140px) scale(0.8) rotate(2deg); opacity: 0; }
}

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -10px;
  width: 12px; height: 18px;
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 30px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: white;
  border: 3px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 86vw;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 19, 32, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; }
.modal__card {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border: var(--border-fat);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-xl);
  animation: modalIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { 0% { opacity: 0; transform: scale(0.6) rotate(-3deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.modal__title { font-family: var(--font-logo); font-size: 26px; margin-bottom: 8px; }
.modal__text { color: var(--ink); margin-bottom: 18px; font-size: 15px; }

/* ---------- Page navigation ---------- */
.screens > .screen { display: none; }
.screens > .screen.is-active { display: flex; flex-direction: column; flex: 1; animation: screenIn .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes screenIn { 0% { opacity: 0; transform: translateY(20px) scale(0.95); } 100% { opacity: 1; transform: none; } }

/* ---------- Admin ---------- */
.admin-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 14px 0;
}
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-family: var(--font-body);
  font-size: 14px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 10px;
  vertical-align: middle;
}
.admin-table th {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--yellow-soft);
  border-top: var(--border);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
}
.admin-table tbody tr {
  background: var(--paper);
  border: var(--border);
}
.admin-table tbody tr td:first-child { border-left: var(--border); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.admin-table tbody tr td:last-child  { border-right: var(--border); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.admin-table tbody td { border-top: var(--border); border-bottom: var(--border); }
.admin-table input, .admin-table select {
  width: 100%;
  padding: 8px 10px;
  background: white;
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: 8px;
  font-family: var(--font-body);
}
.admin-table input:focus, .admin-table select:focus {
  outline: none;
  background: var(--yellow-soft);
}
.admin-table td.actions { white-space: nowrap; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: white;
  border: var(--border);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: all .12s;
}
.icon-btn:hover { background: var(--coral); color: white; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}
.stat__num {
  font-family: var(--font-logo);
  font-size: 32px;
  color: var(--ink);
}
.stat__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ---------- Paywall ---------- */
.paywall-hero {
  text-align: center;
  padding: 40px 0 20px;
}
.paywall-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}
@media (min-width: 720px) { .paywall-features { grid-template-columns: 1fr 1fr; } }
.paywall-feature {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.paywall-feature:hover { transform: rotate(-1deg) translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.paywall-feature__icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--pink);
  border: var(--border);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-logo);
  font-size: 18px;
}
.paywall-feature:nth-child(2) .paywall-feature__icon { background: var(--orange); }
.paywall-feature:nth-child(3) .paywall-feature__icon { background: var(--teal); }
.paywall-feature:nth-child(4) .paywall-feature__icon { background: var(--lavender); }

.price-tag {
  text-align: center;
  margin: 30px 0;
  animation: floaty 4s ease-in-out infinite;
}
.price-tag__amount {
  font-family: var(--font-logo);
  font-size: clamp(70px, 16vw, 120px);
  color: var(--pink);
  line-height: 1;
  text-shadow: 5px 5px 0 var(--ink);
}
.price-tag__period {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
}

/* ---------- Host TV view ---------- */
.host-view {
  text-align: center;
  flex: 1;
}
.host-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
}
.host-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.vote-counter {
  font-family: var(--font-logo);
  font-size: clamp(36px, 5vw, 56px);
  text-align: center;
  margin: 12px 0;
  color: var(--ink);
}
.vote-counter__num {
  background: var(--yellow);
  border: var(--border-fat);
  border-radius: var(--r-pill);
  padding: 8px 28px;
  box-shadow: var(--shadow-lg);
  display: inline-block;
  transform: rotate(-2deg);
}

/* ---------- Helpers ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--text-dim); }
.spaced { margin-top: 16px; }
.flex-row { display: flex; gap: 10px; align-items: center; }
.flex-grow { flex: 1; }
.space-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.divider { height: 3px; background: var(--ink); border-radius: 3px; margin: 18px 0; }

.glitch { /* on garde la classe pour ne pas casser le HTML, mais on désactive l'effet glitch en cartoon */
  display: inline-block;
  transform: rotate(-2deg);
}
.glitch::before, .glitch::after { content: none; }

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
  .app { padding-top: 40px; }
  .logo { margin-top: 50px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.05s !important; }
}
