/* PartyBox: warm stage, cream cards, hard shadows, marquee bulbs. */
:root {
  --ink: #16120e;
  --stage: #1f1914;
  --stage-2: #2a221b;
  --stage-3: #3a3027;
  --paper: #f7f0e1;
  --paper-2: #eadfc6;
  --red: #ff4a2e;
  --gold: #ffc22e;
  --blue: #3d6bff;
  --green: #1fae6b;
  --muted: rgba(247, 240, 225, 0.62);
  --line: rgba(247, 240, 225, 0.14);
  --hard: 6px 6px 0 var(--ink);
  --hard-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--stage);
  color: var(--paper);
  font-family: var(--display);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ---------- shared pieces ---------- */

.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--gold);
  line-height: 0.9;
  text-transform: uppercase;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.7em 1.3em;
  border-radius: 999px;
  box-shadow: var(--hard-sm);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--hard-sm); }
.btn.red { background: var(--red); color: var(--paper); }
.btn.paper { background: var(--paper); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--paper); }
.btn.big { font-size: 1.4rem; padding: 0.75em 1.6em; }
.btn.block { width: 100%; }

.card {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--hard);
}

.kicker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.field { display: grid; gap: 6px; }
.field label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  background: var(--stage-2);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0.7em 0.85em;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--paper) 50%), linear-gradient(135deg, var(--paper) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.2em; }
.select option { background: var(--stage-2); }

/* Marquee bulbs strip */
.bulbs {
  height: 14px;
  background:
    radial-gradient(circle at 7px 7px, var(--gold) 0 3.5px, transparent 4.5px) 0 0 / 28px 14px repeat-x,
    radial-gradient(circle at 21px 7px, #6b4f1c 0 3.5px, transparent 4.5px) 0 0 / 28px 14px repeat-x;
  animation: chase 0.9s steps(1) infinite;
}
@keyframes chase {
  50% {
    background:
      radial-gradient(circle at 7px 7px, #6b4f1c 0 3.5px, transparent 4.5px) 0 0 / 28px 14px repeat-x,
      radial-gradient(circle at 21px 7px, var(--gold) 0 3.5px, transparent 4.5px) 0 0 / 28px 14px repeat-x;
  }
}

.player-chip {
  --c: var(--gold);
  display: inline-flex; align-items: center; gap: 0.45em;
  background: var(--c);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.25em 0.8em 0.25em 0.3em;
  font-weight: 800;
  box-shadow: var(--hard-sm);
  white-space: nowrap;
}
.player-chip .dot {
  width: 1.5em; height: 1.5em; border-radius: 50%;
  background: var(--ink); color: var(--c);
  display: grid; place-items: center; font-size: 0.75em;
}
.player-chip.off { opacity: 0.4; }
.player-chip.done { outline: 3px solid var(--paper); outline-offset: 2px; }

/* Trivia answer colours + shapes */
.opt-0 { --oc: var(--red); }
.opt-1 { --oc: var(--gold); }
.opt-2 { --oc: var(--blue); }
.opt-3 { --oc: var(--green); }
.shape { display: inline-block; width: 1em; height: 1em; background: var(--ink); flex: none; }
.shape-0 { clip-path: polygon(50% 5%, 95% 92%, 5% 92%); }
.shape-1 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape-2 { border-radius: 50%; }
.shape-3 { border-radius: 2px; transform: scale(0.85); }

/* ---------- HOST (big screen) ---------- */

/* Size from whichever is tighter, width or height, so short windows
   (laptops, TVs with browser bars) don't push content off the bottom. */
body.host { overflow: hidden; font-size: clamp(11px, min(1.15vw, 2vh), 26px); }
body.host::before {
  content: '';
  position: fixed; inset: -50vmax;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #241d17 0deg 7.5deg, #1b1612 7.5deg 15deg);
  animation: spin 160s linear infinite;
  z-index: -2;
}
body.host::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 20%, rgba(10, 8, 6, 0.85) 85%);
  z-index: -1;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  body.host::before, .bulbs { animation: none; }
}

.host-shell { height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 2em;
  padding: 1em 2em 0.8em;
  background: var(--ink);
}
.topbar .logo { font-size: 2.1em; }
.joinbox { display: flex; align-items: center; gap: 1em; font-weight: 700; }
.joinbox .where { color: var(--muted); font-size: 1.05em; }
.joinbox .where b { color: var(--paper); }
.codechip {
  font-family: var(--mono); font-weight: 700; font-size: 1.9em; letter-spacing: 0.15em;
  background: var(--gold); color: var(--ink);
  border: 3px solid var(--paper); border-radius: 10px; padding: 0.05em 0.45em 0.05em 0.6em;
}

#stage { position: relative; padding: 1.6em 6.8em 1.2em; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.screen { width: 100%; max-width: 1500px; animation: rise 0.45s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(0.98); } }

.dock {
  display: flex; flex-wrap: wrap; gap: 0.6em; justify-content: center;
  padding: 0.8em 2em 1.1em;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  min-height: 3.6em;
}
.dock .player-chip .pts { font-family: var(--mono); font-size: 0.85em; margin-left: 0.3em; opacity: 0.8; }

.controls { position: fixed; right: 1em; bottom: 1em; display: flex; gap: 0.5em; z-index: 5; }
.controls .btn.ghost { opacity: 0.4; transition: opacity 0.2s; }
.controls:hover .btn.ghost { opacity: 1; }
.controls .btn { font-size: 0.8rem; padding: 0.5em 0.9em; }

/* timer */
.timer {
  --p: 1;
  position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: var(--stage-3);
}
.timer::after {
  content: ''; position: absolute; inset: 0;
  transform-origin: left; transform: scaleX(var(--p));
  background: var(--gold);
  transition: transform 0.25s linear;
}
.timer.low::after { background: var(--red); }
.clock {
  position: absolute; top: 1.1em; right: 1em;
  width: 3.4em; height: 3.4em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); border: 3px solid var(--gold);
  font-family: var(--mono); font-weight: 700; font-size: 1.5em;
}
.clock.low { border-color: var(--red); color: var(--red); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.paused-banner {
  position: fixed; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(22, 18, 14, 0.88); z-index: 6;
}
.paused-banner .pause-title { font-size: 6em; font-weight: 800; letter-spacing: -0.04em; line-height: 1; text-shadow: 5px 5px 0 var(--red); }
.paused-banner p { color: var(--muted); font-size: 1.3em; margin: 0.8em 0 1.4em; line-height: 1.4; }
.paused-banner .pause-actions { display: flex; gap: 1em; justify-content: center; flex-wrap: wrap; }
.paused-banner .pause-title.confirm-title { font-size: 4.2em; }
.paused-banner.confirming { background: rgba(40, 10, 6, 0.93); }

/* lobby */
.lobby { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2.5em; align-items: start; }
.join-card { padding: 2em 2.2em; display: grid; grid-template-columns: 1fr auto; gap: 1.5em; align-items: center; }
.join-card h2 { margin: 0 0 0.3em; font-size: 2.6em; letter-spacing: -0.03em; line-height: 0.95; }
.join-card .url { font-size: 1.3em; font-weight: 700; }
.join-card .url b { background: var(--ink); color: var(--gold); padding: 0.05em 0.35em; border-radius: 6px; }
.join-card .bigcode { font-family: var(--mono); font-weight: 700; font-size: 5.5em; letter-spacing: 0.12em; line-height: 1; margin-top: 0.15em; color: var(--red); }
.qr { background: var(--paper); padding: 8px; border: 3px solid var(--ink); border-radius: 10px; }
.qr canvas, .qr img { display: block; width: 9em !important; height: 9em !important; }
.roster { margin-top: 1.6em; }
.roster h3 { margin: 0 0 0.7em; font-size: 1.1em; color: var(--muted); font-weight: 600; }
.roster .chips { display: flex; flex-wrap: wrap; gap: 0.7em; font-size: 1.3em; }
.roster .empty { color: var(--muted); font-style: italic; }
.roster .player-chip { animation: pop 0.4s cubic-bezier(.2,.9,.3,1.6) both; }
.roster .player-chip button { background: none; border: 0; padding: 0 0 0 0.3em; font-weight: 800; opacity: 0.5; }
.roster .player-chip button:hover { opacity: 1; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }

.settings { max-height: calc(100vh - 11em); overflow-y: auto; padding: 1.6em; display: grid; gap: 1.1em; background: var(--stage-2); border: 2px solid var(--line); border-radius: var(--radius); }
.settings h3 { margin: 0; font-size: 1.4em; }
.settings .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9em; }
.settings .hint { color: var(--muted); font-size: 0.9em; margin: 0; }
.settings a { color: var(--gold); }

.cat-toggles { display: flex; flex-wrap: wrap; gap: 0.45em; }
.cat {
  background: transparent; color: var(--muted);
  border: 2px dashed var(--line); border-radius: 999px;
  padding: 0.35em 0.85em; font-weight: 700; font-size: 0.9em;
  transition: background 0.15s, color 0.15s;
}
.cat small { font-family: var(--mono); font-size: 0.75em; opacity: 0.7; }
.cat:hover { border-color: var(--paper); color: var(--paper); }
.cat.on { background: var(--gold); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--hard-sm); }

/* round title card */
.titlecard { text-align: center; }
.titlecard .kicker { font-size: 1.2em; }
.titlecard h1 {
  margin: 0.2em 0 0.15em; font-size: 9em; line-height: 0.85; letter-spacing: -0.045em; font-weight: 800;
  color: var(--paper); text-shadow: 6px 6px 0 var(--red), 12px 12px 0 var(--ink);
  animation: slam 0.6s cubic-bezier(.2,.9,.3,1.4) both;
}
.titlecard p { font-size: 1.8em; color: var(--muted); margin: 0.5em auto 0; max-width: 30em; }
.titlecard .mult { display: inline-block; margin-top: 1em; background: var(--gold); color: var(--ink); font-weight: 800; padding: 0.3em 0.9em; border-radius: 999px; border: 3px solid var(--ink); font-size: 1.4em; transform: rotate(-3deg); }
@keyframes slam { from { transform: scale(2.4) rotate(-6deg); opacity: 0; } }

/* prompt card */
.prompt {
  padding: 1.2em 1.5em; font-size: 2.8em; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
  text-align: center; text-wrap: balance;
}
.waiting { text-align: center; }
.waiting h2 { font-size: 4em; letter-spacing: -0.03em; margin: 0 0 0.2em; line-height: 0.95; }
.waiting p { font-size: 1.5em; color: var(--muted); margin: 0 0 1.6em; }
.waiting .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8em; font-size: 1.4em; }

/* versus */
.versus { display: grid; gap: 2.4em; }
.versus .answers { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.5em; align-items: stretch; }
.vs { align-self: center; font-weight: 800; font-size: 2.6em; color: var(--gold); transform: rotate(-8deg); }
.answer {
  position: relative; padding: 1.9em 1.4em 1.2em; display: flex; flex-direction: column; justify-content: center;
  min-height: 9em; transition: transform 0.4s, opacity 0.4s;
}
.answer .text { font-size: 2.4em; font-weight: 700; line-height: 1.1; text-align: center; text-wrap: balance; }
.answer .text.none { color: #8a7d68; font-style: italic; font-weight: 500; }
.answer .who { margin-top: 0.9em; display: flex; justify-content: center; font-size: 1.2em; }
.answer .tally { position: absolute; top: -0.9em; left: 50%; transform: translateX(-50%); }
.answer .votes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4em; margin-top: 0.8em; font-size: 0.85em; }
.answer.win { transform: scale(1.04) rotate(-0.6deg); }
.answer.lose { opacity: 0.6; transform: scale(0.96); }
.stamp {
  display: inline-block; background: var(--red); color: var(--paper); font-weight: 800;
  border: 3px solid var(--ink); border-radius: 8px; padding: 0.15em 0.6em; font-size: 1.5em;
  box-shadow: var(--hard-sm); animation: pop 0.35s cubic-bezier(.2,.9,.3,1.6) both;
  white-space: nowrap;
}
.stamp.gold { background: var(--gold); color: var(--ink); }
.sweep-banner {
  text-align: center; font-size: 3.4em; font-weight: 800; letter-spacing: -0.02em; color: var(--gold);
  text-shadow: 4px 4px 0 var(--red); animation: slam 0.5s cubic-bezier(.2,.9,.3,1.4) both;
}

/* trivia */
.trivia { display: grid; gap: 2em; }
.trivia .count { font-family: var(--mono); color: var(--gold); font-weight: 700; text-align: center; font-size: 1.1em; letter-spacing: 0.1em; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; }
.option {
  display: flex; align-items: center; gap: 0.8em;
  background: var(--oc); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard);
  padding: 0.9em 1.2em; font-size: 2em; font-weight: 800; line-height: 1.1;
  transition: opacity 0.4s, transform 0.4s, filter 0.4s;
  min-height: 3.6em;
}
.opt-2.option { color: var(--paper); }
.opt-2 .shape { background: var(--paper); }
.option .label { flex: 1; }
.option .pickers { display: flex; flex-wrap: wrap; gap: 0.3em; justify-content: flex-end; font-size: 0.45em; max-width: 50%; }
.option.dim { opacity: 0.25; filter: grayscale(0.7); transform: scale(0.97); }
.option.right { transform: scale(1.03); outline: 5px solid var(--paper); outline-offset: 3px; }
.answered-count { text-align: center; color: var(--muted); font-size: 1.2em; }

/* free-for-all */
.lash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); gap: 1.2em; margin-top: 2em; }
.lash-grid .answer { min-height: 6em; padding: 1.9em 1.1em 1.1em; }
.lash-grid .answer .text { font-size: 1.6em; }
.lash-grid .letter { position: absolute; top: 0.5em; left: 0.7em; font-family: var(--mono); font-weight: 700; color: #8a7d68; }

/* drawing gallery */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5em; align-items: center; }
.art-frame { border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--ink); overflow: hidden; background: #fff; transform: rotate(-1deg); max-height: 62vh; aspect-ratio: 1; justify-self: center; width: 100%; max-width: 62vh; }
.art { display: block; width: 100%; height: 100%; }
.art polyline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ink 0.45s ease-out forwards; }
.art .dot { opacity: 0; animation: inkdot 0.2s forwards; }
@keyframes ink { to { stroke-dashoffset: 0; } }
@keyframes inkdot { to { opacity: 1; } }
.gallery-side h2 { font-size: 3.2em; margin: 0.1em 0 0.5em; letter-spacing: -0.03em; }
.guess-list { display: grid; gap: 0.7em; }
.guess { display: flex; align-items: center; gap: 0.8em; padding: 0.7em 1em; font-size: 1.5em; font-weight: 700; transition: opacity 0.4s, transform 0.4s; }
.guess .letter { font-family: var(--mono); color: #8a7d68; }
.guess .text { flex: 1; }
.guess .votes { display: flex; flex-wrap: wrap; gap: 0.3em; font-size: 0.55em; }
.guess.right { background: var(--green); transform: scale(1.03); }
.guess.dim { opacity: 0.35; }

/* would you rather */
.wyr { display: grid; gap: 1.6em; }
.wyr-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.5em; align-items: stretch; }
.wyr-side { position: relative; padding: 2em 1.5em 1.5em; display: flex; flex-direction: column; justify-content: center; gap: 1em; min-height: 12em; transition: transform 0.4s, opacity 0.4s; }
.wyr-side .text { font-size: 2.4em; font-weight: 800; text-align: center; line-height: 1.1; text-wrap: balance; }
.wyr-side .votes { display: flex; flex-wrap: wrap; gap: 0.4em; justify-content: center; }
.wyr-side.win { transform: scale(1.04) rotate(-0.6deg); background: var(--gold); }
.wyr-side.lose { opacity: 0.55; transform: scale(0.96); }
.ms { font-family: var(--mono); font-size: 0.8em; margin: 0 0.6em 0 0.25em; }

/* scoreboard */
.scores h2 { text-align: center; font-size: 4em; letter-spacing: -0.03em; margin: 0 0 0.5em; }
.score-rows { display: grid; gap: 0.6em; max-width: 1100px; margin: 0 auto; }
.score-row { display: grid; grid-template-columns: 2.5em 11em 1fr 6em; align-items: center; gap: 1em; font-size: 1.5em; animation: rise 0.5s both; }
.score-row .rank { font-family: var(--mono); font-weight: 700; color: var(--muted); text-align: right; }
.score-row .bar { height: 1.2em; background: var(--stage-3); border-radius: 999px; overflow: hidden; border: 2px solid var(--ink); }
.score-row .bar i { display: block; height: 100%; background: var(--c); width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); border-right: 2px solid var(--ink); }
.score-row .num { font-family: var(--mono); font-weight: 700; text-align: right; }
.score-row .gain { color: var(--gold); font-size: 0.7em; font-family: var(--mono); }

/* finale */
.finale { text-align: center; }
.finale h1 { font-size: 7em; margin: 0; letter-spacing: -0.045em; line-height: 0.9; text-shadow: 6px 6px 0 var(--red), 12px 12px 0 var(--ink); animation: slam 0.6s both; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1.5em; margin: 2em 0 1.5em; }
.podium .step { width: 13em; display: grid; gap: 0.6em; justify-items: center; animation: rise 0.7s both; }
.podium .block {
  width: 100%; background: var(--c); border: 3px solid var(--ink); border-radius: 12px 12px 0 0; box-shadow: var(--hard);
  color: var(--ink); font-weight: 800; display: grid; place-items: center; font-size: 3em;
}
.podium .name { font-size: 1.8em; font-weight: 800; }
.podium .pts { font-family: var(--mono); color: var(--muted); }
.finale .actions { display: flex; gap: 1em; justify-content: center; margin-top: 1.5em; }

.toast {
  position: fixed; left: 50%; top: 1.2em; transform: translateX(-50%);
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--hard-sm);
  border-radius: 999px; padding: 0.5em 1.2em; font-weight: 700; z-index: 20; animation: rise 0.3s both;
}

/* ---------- PHONE ---------- */

body.phone { min-height: 100dvh; display: flex; flex-direction: column; }
.phone-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ink); gap: 10px; }
.phone-top .logo { font-size: 1.4rem; text-shadow: 2px 2px 0 var(--gold); }
.phone-top .score { font-family: var(--mono); font-weight: 700; color: var(--gold); }
.phone-main { flex: 1; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 16px; max-width: 560px; width: 100%; margin: 0 auto; }
.phone-main h1 { font-size: 2.2rem; line-height: 1; letter-spacing: -0.03em; margin: 0; }
.phone-main .sub { color: var(--muted); margin: 0; font-size: 1.05rem; line-height: 1.4; }

.join { gap: 18px; justify-content: center; }
.join .logo { font-size: 3.4rem; text-align: center; text-shadow: 4px 4px 0 var(--gold); margin-bottom: 6px; }
.join .tag { text-align: center; color: var(--muted); margin: 0 0 8px; }
.join .input { font-size: 1.4rem; font-weight: 800; padding: 14px 16px; text-transform: uppercase; }
.join #code { font-family: var(--mono); letter-spacing: 0.3em; text-align: center; font-size: 2rem; }
.join .err { background: var(--red); color: var(--paper); border-radius: 10px; padding: 10px 14px; font-weight: 700; }
.join .host-link { text-align: center; margin-top: 18px; }
.join .host-link a { color: var(--muted); }

.phone-prompt { padding: 18px 18px; font-size: 1.45rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.phone-prompt .n { display: block; font-family: var(--mono); font-size: 0.75rem; color: #8a7d68; margin-bottom: 6px; letter-spacing: 0.08em; }
.textarea.answer-box { min-height: 110px; font-size: 1.25rem; font-weight: 600; resize: none; }
.charcount { text-align: right; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: -10px; }
.phone-row { display: flex; gap: 10px; }
.phone-row .btn { flex: 1; min-width: 0; white-space: normal; padding-left: 0.8em; padding-right: 0.8em; }

.vote-list { display: grid; gap: 12px; }
.vote-btn {
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--hard-sm); padding: 18px; font-size: 1.25rem; font-weight: 700; text-align: left; line-height: 1.2;
}
.vote-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.vote-btn.picked { background: var(--gold); }

.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 50vh; }
.pick {
  background: var(--oc); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard-sm);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px; font-size: 1.1rem; font-weight: 800; text-align: left; line-height: 1.15;
}
.pick .shape { width: 1.6rem; height: 1.6rem; }
.pick.opt-2 { color: var(--paper); }
.pick:active { transform: translate(3px, 3px); box-shadow: none; }
.trivia-q { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }

.pad-wrap { border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard-sm); overflow: hidden; background: #fff; }
#pad { display: block; width: 100%; aspect-ratio: 1; touch-action: none; cursor: crosshair; }
.draw-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--sw); border: 3px solid var(--stage-3); padding: 0; }
.swatch.on { border-color: var(--gold); transform: scale(1.15); }

.big-msg { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 12px; }
.big-msg h1 { font-size: 2.6rem; }
.big-msg .pts { font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--gold); }
.big-msg.good h1 { color: var(--green); }
.big-msg.bad h1 { color: var(--red); }
.avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 8px;
  background: var(--c); border: 3px solid var(--ink); box-shadow: var(--hard-sm);
  display: grid; place-items: center; color: var(--ink); font-weight: 800; font-size: 2.6rem;
}
.phone-timer { height: 8px; border-radius: 999px; background: var(--stage-3); overflow: hidden; }
.phone-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
.overlay {
  position: fixed; inset: 0; background: rgba(22, 18, 14, 0.92); display: grid; place-items: center; text-align: center; padding: 24px; z-index: 10;
}
.overlay h2 { font-size: 1.8rem; margin: 0 0 8px; }
.overlay p { color: var(--muted); margin: 0; }

/* ---------- EDITOR ---------- */

body.editor { min-height: 100vh; }
.ed-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--ink); flex-wrap: wrap; }
.ed-top .logo { font-size: 1.8rem; }
.ed-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-top .btn { font-size: 0.9rem; padding: 0.5em 1em; }
.ed-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 24px; max-width: 1300px; margin: 0 auto; }
.pack-list { display: grid; gap: 8px; align-content: start; }
.pack-item { text-align: left; background: var(--stage-2); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.pack-item.active { border-color: var(--gold); background: var(--stage-3); }
.pack-item b { display: block; }
.pack-item small { color: var(--muted); }
.ed-main { display: grid; gap: 22px; min-width: 0; }
.ed-section { background: var(--stage-2); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.ed-section > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-section h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.01em; }
.ed-section h2 small { font-size: 0.9rem; color: var(--muted); font-weight: 500; margin-left: 6px; }
.ed-section .hint { color: var(--muted); margin: 0; font-size: 0.95rem; line-height: 1.45; }
.ed-section .hint code { background: var(--stage-3); padding: 1px 6px; border-radius: 4px; color: var(--gold); }
.ed-section .btn { font-size: 0.85rem; padding: 0.45em 0.95em; }
.ed-section .textarea { min-height: 220px; line-height: 1.5; font-size: 0.98rem; resize: vertical; }
.round-row { display: grid; grid-template-columns: 32px 160px 1fr 120px auto; gap: 10px; align-items: center; }
.round-row .num { font-family: var(--mono); color: var(--muted); }
.icon-btn { background: var(--stage-3); border: 0; border-radius: 8px; width: 34px; height: 34px; font-weight: 800; }
.icon-btn:hover { background: var(--red); }
.row-actions { display: flex; gap: 4px; }
.trivia-card { display: grid; gap: 8px; padding: 14px; background: var(--stage); border-radius: 10px; border: 2px solid var(--line); }
.trivia-card .answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.trivia-card .answers .input:first-child { border-color: var(--green); }
.trivia-card .top { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.need { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.need b { color: var(--gold); }
.need.short b { color: var(--red); }
.library { max-height: 60vh; overflow: auto; display: grid; gap: 6px; }
.library label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--stage); border-radius: 8px; cursor: pointer; }
.library label:hover { background: var(--stage-3); }
dialog { background: var(--stage-2); color: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard); width: min(760px, 92vw); padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog { overflow-x: hidden; }
.library { overflow-x: hidden; }
dialog header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
dialog header .select, dialog header .input { min-width: 0; }
dialog h3 { margin: 0; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

@media (max-width: 820px) {
  .ed-layout { grid-template-columns: 1fr; padding: 16px; }
  .round-row { grid-template-columns: 24px 1fr 1fr; }
  .round-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .trivia-card .answers { grid-template-columns: 1fr 1fr; }
}
