:root {
  --paper: #f6efe2;
  --ink: #1b1a17;
  --muted: #6b6457;
  --red: #e8452c;
  --gold: #f2b134;
  --teal: #1f8a7a;
  --card: #fffaf0;
  --line: #1b1a17;
  --shadow: 4px 4px 0 var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #17150f; --ink: #f6efe2; --muted: #b3aa98; --card: #24211a; --line: #f6efe2; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font: 17px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 16px; min-height: calc(100dvh - 48px); }
.screen[hidden] { display: none; }
.center { align-items: center; justify-content: center; text-align: center; }
h1, h2, h3, .score, .name { font-family: "Archivo Black", Inter, sans-serif; font-weight: 400; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 64px; line-height: 0.92; }
h2 { font-size: 30px; line-height: 1.05; }
h3 { font-size: 18px; margin-top: 8px; }

.marquee { margin-top: 12vh; display: flex; flex-direction: column; gap: 14px; }
.badge { align-self: flex-start; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 0.12em; padding: 6px 10px; border-radius: 6px; transform: rotate(-3deg); }
.tag { font-size: 20px; color: var(--muted); margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.fine, .hint { color: var(--muted); font-size: 14px; margin: 0; }
.fine { text-align: center; }
.fine a { color: inherit; }

.btn {
  appearance: none; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  font: 700 17px Inter, system-ui, sans-serif; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.primary { background: var(--gold); color: #1b1a17; }
.btn.big { font-size: 20px; padding: 18px; width: 100%; }
.back { align-self: flex-start; background: none; border: 0; color: var(--muted); font: 600 16px Inter, sans-serif; padding: 4px 0; cursor: pointer; }

.players { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.players li button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.add { display: flex; gap: 8px; }
.add input { flex: 1; min-width: 0; font: 17px Inter, sans-serif; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; font: 700 18px Inter, sans-serif; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }
#packs { flex-wrap: wrap; }
#packs button { flex: 1 1 40%; font-size: 15px; }
.grid h3 { grid-column: 1 / -1; margin: 10px 0 0; }
#start-party { margin-top: auto; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid button { display: flex; align-items: center; gap: 8px; text-align: left; font: 700 15px Inter, sans-serif; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.grid button span { font-size: 24px; }

.round-tag { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0; }
.pass-to { font-size: 20px; margin: 0; color: var(--muted); }
.name { font-size: 48px; word-break: break-word; }

.card { width: 100%; background: var(--card); border: 3px solid var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--red); padding: 22px 20px; }
.card .emoji { font-size: 56px; line-height: 1; }
.card h2 { margin: 8px 0 12px; }
.say { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.line { font-size: 21px; font-weight: 600; margin: 6px 0 0; }
.loud { font-weight: 800; margin: 4px 0 0; }

.rec { position: relative; width: 150px; height: 150px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font: 800 16px Inter, sans-serif; cursor: pointer; box-shadow: 0 6px 0 #a42a17; }
.rec:active { transform: translateY(3px); box-shadow: 0 3px 0 #a42a17; }
.rec svg { position: absolute; inset: -10px; width: 170px; height: 170px; transform: rotate(-90deg); }
.rec .track { fill: none; stroke: transparent; stroke-width: 6; }
.rec .ring { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.rec.live { animation: pulse 1s infinite; }
.rec.live .ring { transition: stroke-dashoffset 10s linear; stroke-dashoffset: 0; }
.rec span { position: relative; padding: 0 16px; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 #a42a17, 0 0 0 14px rgba(232, 69, 44, .18); } }

.gavel { font-size: 80px; animation: bang 0.9s infinite; }
@keyframes bang { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-18deg); } 60% { transform: rotate(8deg); } }

.score { font-size: 120px; line-height: 0.9; }
.score small { font-size: 32px; color: var(--muted); }
.heard { margin: 0; color: var(--muted); }
.heard b { color: var(--ink); }
blockquote { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.bars { width: 100%; display: grid; gap: 8px; }
.bars div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; text-align: left; }
.bars i { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.bars b { display: block; height: 100%; width: 0; background: var(--teal); transition: width .8s ease-out; }
.row { display: flex; gap: 10px; }
.tip { margin: 0; font-weight: 700; color: var(--red); }
.tip[hidden] { display: none; }

.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: place; }
.board li { counter-increment: place; display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.board li::before { content: counter(place); font-family: "Archivo Black", sans-serif; font-size: 22px; width: 28px; }
.board li:first-child { background: var(--gold); color: #1b1a17; box-shadow: var(--shadow); }
.board li .pts { margin-left: auto; font-family: "Archivo Black", sans-serif; font-size: 20px; }
.board li .sub { display: block; font-weight: 400; font-size: 13px; opacity: .75; }
#board-next { margin-top: auto; }
.mark { width: 88px; height: 88px; border-radius: 20px; }
