/* Forehead — party-game-box look: cream paper, chunky ink outlines, hard
   drop shadows, and a full-bleed saturated card while playing. */

:root {
  --paper: #FFF3E0;
  --paper-2: #FFE6C2;
  --card: #FFFFFF;
  --ink: #1C1814;
  --ink-2: #5E554C;
  --ink-3: #9A8F84;
  --yellow: #FFD23F;
  --ok: #12B76A;
  --pass: #F79009;
  --bad: #F04438;
  --line: 2.5px solid var(--ink);
  --shadow: 0 4px 0 var(--ink);
  --radius: 18px;
  --font: 'Bricolage Grotesque', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────── layout ───────── */
.screen { max-width: 600px; margin: 0 auto; padding: 14px 16px 120px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.back { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.back:hover { color: var(--ink); }
.ghost-link { background: none; border: 0; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.stack > * + * { margin-top: 14px; }
h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); margin: 26px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
h2.section .aside { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ───────── primitives ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--line); border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); padding: 12px 18px; font-weight: 700; font-size: 17px;
  transition: transform .08s, box-shadow .08s; user-select: none; text-decoration: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.big { font-size: 21px; padding: 16px 22px; border-radius: 20px; width: 100%; }
.btn.small { font-size: 14px; padding: 7px 12px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.card { background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.sticky-cta .inner { max-width: 600px; margin: 0 auto; }
.cta-note { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 8px; min-height: 1em; }

/* ───────── home ───────── */
.hero { text-align: center; padding: 18px 0 6px; }
.wordmark {
  font-size: clamp(54px, 17vw, 96px); font-weight: 800; letter-spacing: -.04em; line-height: .9; margin: 6px 0 0;
}
.wordmark span { display: inline-block; }
.wordmark span:nth-child(odd) { transform: rotate(-3deg); }
.wordmark span:nth-child(even) { transform: rotate(2deg) translateY(2px); }
.tag {
  display: inline-block; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 14px;
  padding: 5px 12px; border-radius: 999px; transform: rotate(-2deg); margin-top: 14px;
}
.hero-img { display: block; width: min(100%, 520px); height: auto; margin: 18px auto 6px; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-6px) rotate(.6deg); } }
@keyframes bob { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

.how { display: grid; gap: 10px; margin-top: 22px; }
.how .step { display: flex; gap: 14px; align-items: center; }
.how .num {
  flex: none; width: 44px; height: 44px; border: var(--line); border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; background: var(--paper-2);
}
.how b { display: block; font-size: 17px; }
.how small { color: var(--ink-2); font-size: 14px; }
.resume-meta { font-weight: 600; font-size: 14px; opacity: .8; }

/* ───────── setup ───────── */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode {
  text-align: left; border: var(--line); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); padding: 14px; position: relative; transition: transform .1s, background .15s;
}
.mode:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.mode .em { font-size: 34px; line-height: 1; }
.mode b { display: block; font-size: 19px; margin-top: 8px; }
.mode small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.mode.on { background: var(--yellow); }
.mode.on::after {
  content: '✓'; position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-weight: 800; font-size: 15px;
}

.add-row { display: flex; gap: 8px; }
.add-row input {
  flex: 1; min-width: 0; border: var(--line); border-radius: 14px; padding: 12px 14px; font-size: 17px; font-weight: 600;
  background: var(--card); outline: none;
}
.add-row input:focus { box-shadow: 0 0 0 4px rgba(255, 210, 63, .7); }
.quick { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick .lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-right: 2px; }
.qchip {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 14px; font-weight: 600;
}
.qchip.added { background: var(--ink); color: var(--paper); }
.roster { margin-top: 10px; border: 2px dashed var(--ink-3); border-radius: 14px; padding: 10px; }
.roster .grp { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin: 8px 0 6px; display: flex; justify-content: space-between; }
.roster .grp:first-child { margin-top: 0; }
.roster .grp button { background: none; border: 0; font-size: 12px; font-weight: 700; text-decoration: underline; color: var(--ink); padding: 0; letter-spacing: 0; text-transform: none; }

.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.team {
  border: var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  overflow: hidden; min-height: 150px; display: flex; flex-direction: column;
}
.team-head { background: var(--tc); color: #fff; padding: 8px 10px; display: flex; align-items: center; gap: 6px; border-bottom: var(--line); }
.team-head b { flex: 1; font-weight: 800; font-size: 19px; }
.team-head .count { font-weight: 800; font-size: 14px; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 2px 8px; }
.team-body { padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; flex: 1; }
.team-empty { color: var(--ink-3); font-size: 13px; padding: 4px 2px; }
.pchip {
  display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); padding: 4px 4px 4px 10px; font-weight: 700; font-size: 15px; animation: pop .22s ease-out;
}
.pchip .mv { border: 0; background: var(--tc2); color: #fff; border-radius: 999px; width: 24px; height: 24px; font-size: 13px; font-weight: 800; display: grid; place-items: center; padding: 0; }
.pchip .x { border: 0; background: transparent; color: var(--ink-3); width: 22px; height: 24px; padding: 0; font-size: 16px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.team-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.deck {
  text-align: left; border: var(--line); border-radius: 16px; background: var(--card); padding: 10px 12px;
  box-shadow: 0 3px 0 var(--ink); display: flex; gap: 10px; align-items: center; transition: background .15s, transform .08s;
}
.deck:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.deck .em { font-size: 26px; filter: grayscale(1); opacity: .55; transition: filter .15s, opacity .15s; }
.deck b { display: block; font-size: 15px; line-height: 1.15; }
.deck small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.deck.on { background: var(--dc); color: #fff; }
.deck.on .em { filter: none; opacity: 1; }
.deck.on small { color: rgba(255, 255, 255, .8); }

.seg { display: flex; border: var(--line); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: 0 3px 0 var(--ink); }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 0; font-weight: 700; font-size: 16px; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
.opts { display: grid; gap: 14px; }
.opts label { display: block; font-weight: 700; margin-bottom: 6px; }

/* ───────── up next ───────── */
.upnext { min-height: 100dvh; background: var(--tc); color: #fff; }
.upnext .screen { padding-bottom: 140px; }
.upnext .back, .upnext .ghost-link { color: rgba(255, 255, 255, .85); }
.pill { display: inline-block; border: 2px solid currentColor; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 14px; }
.up-title { font-size: clamp(44px, 13vw, 76px); font-weight: 800; letter-spacing: -.03em; line-height: .95; margin: 14px 0 4px; }
.up-sub { font-size: 18px; font-weight: 600; opacity: .9; }
.guesser-card { background: #fff; color: var(--ink); border: var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); padding: 16px; margin-top: 18px; }
.guesser-card .who { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.guesser-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.guesser-card .rule { margin-top: 12px; padding-top: 12px; border-top: 2px dashed #ddd; font-size: 15px; color: var(--ink-2); }
.upnext h2.section { color: rgba(255, 255, 255, .85); }
.deck-pick { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.deck-pick::-webkit-scrollbar { display: none; }
.dp {
  flex: none; border: var(--line); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink);
  padding: 10px 12px; text-align: center; min-width: 92px; font-weight: 700; font-size: 13px;
}
.dp .em { font-size: 28px; display: block; }
.dp.on { background: var(--yellow); transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }
.ctrl { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; margin-top: 4px; }
.ctrl .seg { box-shadow: none; flex: 1; }
.ctrl .seg button { padding: 8px 0; font-size: 14px; color: var(--ink); }
.ctrl .seg button.on { color: var(--paper); }
.upnext .sticky-cta { background: linear-gradient(to top, var(--tc) 70%, transparent); }
.upnext .cta-note { color: rgba(255, 255, 255, .85); }
.mini-score { display: flex; gap: 8px; }
.mini-score span { color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 14px; }

/* ───────── play ───────── */
.play {
  position: fixed; inset: 0; background: var(--bg, var(--ink)); color: #fff; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; transition: background .25s;
}
.play .hud {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: center; z-index: 3;
}
.hud .timer, .hud .score {
  font-weight: 800; font-size: 26px; background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 4px 16px;
  font-variant-numeric: tabular-nums; min-width: 84px; text-align: center;
}
.hud .timer.hot { background: var(--bad); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.hud .deck-name { font-weight: 700; font-size: 15px; opacity: .85; }
.hold-pause {
  position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 3;
  background: rgba(0, 0, 0, .2); border: 0; color: rgba(255, 255, 255, .8); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 700; overflow: hidden;
}
.hold-pause i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, .3); }
.hold-pause.holding i { width: 100%; transition: width .6s linear; }
.word-wrap { position: absolute; inset: 64px 24px 56px; display: grid; place-items: center; }
.word {
  font-weight: 800; letter-spacing: -.02em; line-height: .98; text-align: center; word-break: keep-all; overflow-wrap: normal;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .18); max-width: 100%;
}
.word.enter { animation: wordIn .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wordIn { from { transform: scale(.6) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }

.tap-zones { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; z-index: 2; }
.tap-zones button {
  border: 0; background: transparent; color: rgba(255, 255, 255, .9); font-weight: 800; font-size: 18px;
  display: flex; align-items: flex-end; padding: 0 0 54px; justify-content: center;
}
.tap-zones button span { background: rgba(0, 0, 0, .22); border-radius: 999px; padding: 8px 16px; }
.tap-zones button:active span { background: rgba(0, 0, 0, .4); }

.flash {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; font-size: clamp(56px, 16vmin, 130px);
  font-weight: 800; letter-spacing: -.03em; animation: flashIn .55s ease-out forwards; pointer-events: none;
}
.flash.ok { background: var(--ok); }
.flash.pass { background: var(--pass); }
.flash.end { background: var(--bad); animation: none; }
.flash .big { animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { from { transform: scale(1.8) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flashIn { 0% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

.place { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: var(--ink); z-index: 3; }
.place h1 { font-size: clamp(30px, 7vmin, 52px); margin: 10px 0 6px; letter-spacing: -.02em; line-height: 1.05; }
.place p { margin: 0 auto; color: rgba(255, 255, 255, .75); font-size: 17px; max-width: 480px; }
.place .ph-icon { font-size: 64px; animation: lift 1.6s ease-in-out infinite; }
@keyframes lift { 0%, 100% { transform: translateY(8px) rotate(-8deg); } 50% { transform: translateY(-8px) rotate(0); } }
.place .row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.place .btn { color: var(--ink); }
.legend { display: flex; gap: 22px; justify-content: center; margin-top: 16px; font-weight: 700; font-size: 15px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.countdown { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: var(--ink); }
.countdown b { font-size: min(52vmin, 300px); font-weight: 800; animation: countPop .9s ease-out; line-height: 1; }
@keyframes countPop { from { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { transform: scale(.85); opacity: .2; } }
.paused { position: absolute; inset: 0; z-index: 6; background: rgba(28, 24, 20, .94); display: grid; place-items: center; text-align: center; }
.paused h1 { font-size: 44px; margin: 0 0 16px; }
.paused .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.paused .btn { color: var(--ink); }

/* ───────── review / scores ───────── */
.big-score { text-align: center; margin: 12px 0 4px; }
.big-score .n { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.big-score .l { font-weight: 700; color: var(--ink-2); }
.results { display: grid; gap: 8px; }
.res {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 2px solid var(--ink);
  border-radius: 14px; background: var(--card); padding: 8px 8px 8px 14px; font-weight: 700; font-size: 17px;
}
.res .t { min-width: 0; }
.res .t small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.res button { flex: none; border: 2px solid var(--ink); border-radius: 12px; width: 92px; padding: 7px 0; font-weight: 800; font-size: 14px; }
.res.ok button { background: var(--ok); color: #fff; }
.res.no button { background: var(--paper-2); color: var(--ink-2); }
.res.no .t { color: var(--ink-3); }
.res.no .wd { text-decoration: line-through; text-decoration-thickness: 2px; }
.empty-turn { text-align: center; color: var(--ink-2); padding: 20px; }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tpanel { border: var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); background: var(--tc); color: #fff; padding: 14px; text-align: center; position: relative; }
.tpanel .nm { font-weight: 800; font-size: 18px; }
.tpanel .tot { font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.04em; margin: 6px 0 2px; }
.tpanel .bump { position: absolute; top: 10px; right: 12px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; font-weight: 800; font-size: 14px; animation: pop .3s ease-out; }
.tpanel.lead::before { content: '👑'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 30px; }
table.rounds { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: var(--line); border-radius: 16px; overflow: hidden; margin-top: 12px; }
.rounds th, .rounds td { padding: 9px 10px; text-align: center; font-weight: 700; }
.rounds th { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); background: var(--paper-2); }
.rounds td:first-child, .rounds th:first-child { text-align: left; }
.rounds tr + tr td { border-top: 1.5px solid #eee; }
.rounds .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.rounds .pending { color: var(--ink-3); }

/* ───────── final ───────── */
.final { text-align: center; }
.final .crown { font-size: 76px; animation: bob 2.4s ease-in-out infinite; display: inline-block; }
.final h1 { font-size: clamp(40px, 12vw, 70px); line-height: .95; letter-spacing: -.03em; margin: 6px 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; text-align: left; }
.fact { border: var(--line); border-radius: 16px; background: var(--card); padding: 12px; box-shadow: 0 3px 0 var(--ink); }
.fact small { display: block; color: var(--ink-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.fact b { display: block; font-size: 20px; margin-top: 4px; line-height: 1.1; }
.btn-col { display: grid; gap: 10px; margin-top: 22px; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }

@media (min-width: 560px) {
  .screen { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ───────── rooms ───────── */
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; line-height: 1; }
.muted { color: var(--ink-2); margin: 6px 0 14px; }
.notice { background: var(--paper-2); border: 2px dashed var(--ink-3); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin-bottom: 14px; text-align: center; }
.join-card h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.join-card .muted { margin: 0 0 12px; font-size: 14px; }
.join-card input {
  display: block; width: 100%; border: var(--line); border-radius: 14px; padding: 12px 14px; font-size: 18px; font-weight: 600;
  background: var(--paper); outline: none; margin: 10px 0;
}
.join-card input:focus { box-shadow: 0 0 0 4px rgba(255, 210, 63, .7); }
.join-card .code-input { text-transform: uppercase; letter-spacing: .4em; font-size: 26px; font-weight: 800; text-align: center; }
.code-inline { background: var(--ink); color: var(--yellow); border-radius: 8px; padding: 0 8px; letter-spacing: .12em; }
.invite { text-align: center; }
.invite-row { display: flex; justify-content: space-between; align-items: center; text-align: left; }
.invite-row small { font-weight: 700; color: var(--ink-2); letter-spacing: .1em; font-size: 12px; }
.room-code { display: flex; gap: 6px; margin-top: 4px; }
.room-code span {
  width: 44px; height: 52px; border: var(--line); border-radius: 12px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; background: var(--yellow); box-shadow: 0 3px 0 var(--ink);
}
.qr { display: block; margin: 16px auto 8px; width: min(220px, 62vw); height: auto; aspect-ratio: 1; border: var(--line); border-radius: 16px; padding: 10px; background: #fff; }
.invite-link { font-weight: 700; color: var(--ink-2); font-size: 14px; margin-bottom: 10px; word-break: break-all; }
.pchip.me { background: var(--yellow); }
.pchip.away { opacity: .45; }
.pchip i { font-style: normal; font-size: 13px; margin-right: 1px; }
.pchip small { font-weight: 600; color: var(--ink-2); font-size: 12px; }
.pchip .mv { color: #fff; }
.team-badge { color: #fff; border: var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; text-align: center; font-weight: 800; font-size: 21px; }
.ghost-link.armed { color: var(--bad); font-weight: 800; }
.readonly .mode, .readonly .deck, .readonly .seg button { pointer-events: none; }
.readonly .mode:not(.on), .readonly .deck:not(.on) { opacity: .6; }
button[disabled].mode, button[disabled].deck { opacity: 1; }
.readonly .mode:not(.on), .readonly .deck:not(.on) { opacity: .55; }
.seg button[disabled] { color: inherit; }
.wait-card { background: rgba(0, 0, 0, .18); border-radius: 18px; padding: 14px 16px; margin: 18px 0 12px; font-size: 16px; line-height: 1.4; }
.upnext .btn.big:not(.primary) { background: #fff; }

.spectate .screen { text-align: center; }
.spectate .topbar { text-align: left; }
.spec-timer {
  font-size: min(42vw, 200px); font-weight: 800; line-height: 1; letter-spacing: -.05em; margin: 10px 0 4px;
  font-variant-numeric: tabular-nums; text-shadow: 0 5px 0 rgba(0, 0, 0, .18);
}
.spec-timer.hot { animation: pulse .5s ease-in-out infinite alternate; }
.spec-score { display: flex; justify-content: center; gap: 12px; }
.spec-score > div { background: #fff; color: var(--ink); border: var(--line); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); padding: 8px 18px; min-width: 110px; }
.spec-score b { display: block; font-size: 44px; line-height: 1; color: var(--ok); }
.spec-score .p b { color: var(--pass); }
.spec-score span { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.spec-status { min-height: 1.4em; margin-top: 14px; font-weight: 700; font-size: 17px; }
.spec-flash {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); font-size: 120px; font-weight: 800; z-index: 9;
  pointer-events: none; animation: specPop .8s ease-out forwards; text-shadow: 0 6px 0 rgba(0, 0, 0, .25);
}
.spec-flash.ok { color: var(--ok); }
.spec-flash.pass { color: var(--pass); font-size: 80px; }
@keyframes specPop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } to { transform: translate(-50%, -80%) scale(1); opacity: 0; } }

.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips span { border: 2px solid var(--ink); border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 14px; background: var(--card); }
.word-chips .ok { background: var(--ok); color: #fff; }
.word-chips .no { color: var(--ink-3); text-decoration: line-through; }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 30;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 14px; font-weight: 700; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.hero.compact { padding: 4px 0 18px; }
.hero.compact .wordmark { font-size: clamp(44px, 13vw, 64px); }

/* ───────── generated art ───────── */
.how .num img { width: 34px; height: 34px; object-fit: contain; }
img.em { width: 40px; height: 40px; object-fit: contain; flex: none; }
.deck img.em { width: 44px; height: 44px; }
.dp img.em { display: block; width: 48px; height: 48px; margin: 0 auto 2px; }
.mode .em { display: block; }
.badge { width: 30px; height: 30px; flex: none; object-fit: contain; }
.team-head .badge { margin: -2px 0; }
.up-title .badge.big { width: 64px; height: 64px; display: block; margin-bottom: 6px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.tpanel .badge.panel { width: 54px; height: 54px; display: block; margin: 0 auto 2px; }
.tpanel.lead::before { top: -22px; }
.hud-icon { width: 26px; height: 26px; vertical-align: -7px; margin-right: 6px; object-fit: contain; }
.hud .deck-name { display: flex; align-items: center; }
.mini-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; object-fit: contain; }
.res .t small .mini-icon { display: inline; }
.howto-img { display: block; height: min(32vh, 210px); width: auto; margin: 0 auto 4px; animation: floaty 2.4s ease-in-out infinite; }
.trophy-img { display: block; height: 150px; width: auto; margin: 6px auto 0; animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
