/* The web demo, laid out like the iPhone app (Buzzkill/Views). Colours are the app's own (ContentView.swift). */
:root {
  color-scheme: dark;
  --board: #0f0d1f; --card: #2b2445; --buzzkill: #f2404d; --good: #40cc73; --spark: #ffcc38;
  --violet: #734dd9; --trivia: #2985f2; --agents: #1aada0; --orange: #f28c33;
  --fg: #fff; --muted: rgba(235, 235, 245, .6);
  --font: ui-rounded, "SF Pro Rounded", Nunito, -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07060f; }
body { font: 500 17px/1.3 var(--font); color: var(--fg); overflow: hidden; display: flex; align-items: center; justify-content: center; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
svg.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }

#phone { --ph: 100dvh; position: relative; width: 100%; height: 100dvh; max-width: 440px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(440px 440px at 0% 0%, rgba(242,64,77,.30), transparent 100%),
    radial-gradient(400px 400px at 100% 100%, rgba(255,204,56,.10), transparent 100%),
    linear-gradient(180deg, #2e1452, var(--board)); }
@media (min-width: 560px) and (min-height: 700px) {
  #phone { --ph: calc(min(100dvh - 32px, 900px) - 18px); height: min(calc(100dvh - 32px), 900px); border-radius: 46px; border: 9px solid #17142a; box-shadow: 0 0 0 2px #342d57, 0 30px 80px rgba(0,0,0,.6); }
}

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); gap: 16px; overflow-y: auto; scrollbar-width: none; animation: fadein .25s ease-out; }
.screen::-webkit-scrollbar { display: none; }
@keyframes fadein { from { opacity: 0; } }
.grow { flex: 1 1 0; min-height: 0; }
.center { text-align: center; }

/* Chunky buttons (BigButtonStyle) */
.btn { --c: var(--buzzkill); --d: color-mix(in srgb, var(--c) 60%, #000); display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 18px 16px; border-radius: 18px; font-size: 20px; font-weight: 700; color: #fff; text-align: left; position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 50%), var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 5px 0 var(--d); margin-bottom: 5px;
  transition: transform .15s cubic-bezier(.3,1.6,.5,1), box-shadow .15s; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 0 0 var(--d); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.card { --c: var(--card); --d: #1a152c; }
.btn.red { --c: var(--buzzkill); } .btn.good { --c: var(--good); } .btn.violet { --c: var(--violet); } .btn.trivia { --c: var(--trivia); }
.btn.agents { --c: var(--agents); } .btn.orange { --c: var(--orange); } .btn.spark { --c: var(--spark); color: #1c1500; }
.btn.big { font-size: 28px; font-weight: 900; padding: 24px 16px; }
.btn .t { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.btn .t b { font-size: 20px; font-weight: 900; }
.btn .t small { font-size: 13px; font-weight: 600; opacity: .85; line-height: 1.25; }
.btn .ic { font-size: 24px; width: 34px; display: flex; justify-content: center; }
.btn.row { justify-content: flex-start; padding: 16px 12px; }
.btn.center-t { justify-content: center; }
.btn.sm { width: auto; padding: 10px 16px; font-size: 15px; border-radius: 14px; }

/* Home */
.home { gap: 20px; }
.home .top { display: flex; justify-content: space-between; align-items: center; }
.demo-pill { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--spark); background: rgba(255,204,56,.12); padding: 6px 10px; border-radius: 99px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.mascot { height: clamp(110px, 24dvh, 190px); width: auto; filter: drop-shadow(0 10px 12px rgba(0,0,0,.35)); animation: bob 2.4s ease-in-out infinite; cursor: pointer; }
.mascot.jump { animation: jump .7s ease-out; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes jump { 0%,100% { transform: none; } 30% { transform: translateY(-34px) scale(.94,1.08); } 55% { transform: translateY(0) scale(1.08,.92); } 75% { transform: translateY(-8px); } }
.logo { margin-top: -34px; display: flex; flex-direction: column; align-items: center; animation: wobble 3.2s ease-in-out infinite alternate; cursor: pointer; }
.logo.shake { animation: shake .4s linear; }
@keyframes wobble { from { transform: rotate(-1.5deg) scale(.98); } to { transform: rotate(1.5deg) scale(1.03); } }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(10px); } 40% { transform: translateX(-10px); } 60% { transform: translateX(8px); } 80% { transform: translateX(-6px); } }
.logo .buzz { display: flex; align-items: center; gap: 6px; transform: rotate(-6deg); }
.logo .word { font-size: 80px; font-weight: 900; line-height: 1; letter-spacing: .01em; background: linear-gradient(180deg, var(--spark), var(--buzzkill)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(242,64,77,.55)) drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.logo .bolt { font-size: 30px; color: var(--spark); filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.logo .bolt.l { transform: rotate(-20deg); } .logo .bolt.r { transform: rotate(20deg); }
.logo .sticker { margin-top: -4px; transform: rotate(4deg); font-size: 26px; font-weight: 900; letter-spacing: 4px; color: var(--board); background: #fff; padding: 4px 12px 4px 22px; border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.4); }
.tagline { text-align: center; color: var(--muted); padding: 0 24px; font-size: 17px; }
.tagline-demo { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.tagline-demo a { color: var(--spark); text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* Popups (GamePopup) */
#layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 15; }
#layer > * { pointer-events: auto; }
.dim { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 0 16px; animation: dimin .2s ease-out; }
.dim.out { opacity: 0; transition: opacity .16s ease-in; }
@keyframes dimin { from { opacity: 0; } }
.popup { position: relative; width: 100%; max-height: calc(100% - 120px); display: flex; flex-direction: column; background: var(--card); border-radius: 26px; border: 4px solid rgba(255,255,255,.9); box-shadow: 0 12px 24px rgba(0,0,0,.5); animation: popin .42s cubic-bezier(.3,1.5,.5,1); margin-top: 40px; }
.dim.out .popup { transform: scale(.55) rotate(-6deg); opacity: 0; transition: all .16s ease-in; }
.popup.tall { height: calc(100% - 100px); margin-top: 60px; }
@keyframes popin { from { transform: scale(.55) rotate(-6deg); opacity: 0; } }
.popup .band { display: flex; align-items: center; gap: 10px; padding: 18px 64px 18px 20px; border-radius: 22px 22px 0 0; background: var(--accent, var(--buzzkill)); min-height: 66px; }
.popup .band h2 { margin: 0; font-size: 28px; font-weight: 900; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup .band .back { font-size: 20px; display: flex; }
.popup .x { position: absolute; top: 15px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.popup .host { position: absolute; top: -58px; right: 58px; height: 84px; width: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); transform-origin: bottom center; animation: peek .5s cubic-bezier(.3,1.5,.5,1); pointer-events: none; }
@keyframes peek { from { transform: rotate(-20deg); } }
.popup .body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .wide { grid-column: span 2; }
.tile { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; padding: 16px 14px; height: auto; }
.tile .head { display: flex; align-items: center; gap: 10px; }
.tile .head .sp { flex: 1; }
.tile b { font-size: 20px; font-weight: 900; }
.tile small { font-size: 13px; font-weight: 600; opacity: .85; line-height: 1.25; }
.tile .ic { width: auto; }
.pcount { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 99px; background: rgba(0,0,0,.22); }
.field { background: rgba(255,255,255,.07); border: 0; border-radius: 12px; padding: 13px 14px; width: 100%; outline: none; }
.field:focus { box-shadow: 0 0 0 2px var(--trivia); }
.sect { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; background: rgba(255,255,255,.06); border-radius: 14px; }
.toggle small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.switch { width: 52px; height: 32px; border-radius: 99px; background: #54506a; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.switch.on { background: var(--good); } .switch.on::after { transform: translateX(20px); }
.alert { background: #2a2540; border-radius: 22px; padding: 20px; width: 100%; max-width: 330px; text-align: center; animation: popin .3s cubic-bezier(.3,1.5,.5,1); display: flex; flex-direction: column; gap: 10px; }
.alert h3 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.alert .btn { font-size: 17px; padding: 14px; }

/* Game header */
.hdr { display: flex; align-items: center; gap: 4px; position: relative; min-height: 44px; flex: none; }
.hdr .ib { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: var(--muted); border-radius: 50%; }
.hdr .ib.off { opacity: .45; }
.hdr .mid { position: absolute; left: 100px; right: 100px; text-align: center; pointer-events: none; }
.hdr .mid b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr .mid small { color: var(--muted); font-size: 12px; font-weight: 500; }
.hdr .sp { flex: 1; }
.pill { min-width: 28px; padding: 4px 10px; text-align: center; border-radius: 99px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.pill.good { color: var(--good); background: rgba(64,204,115,.15); } .pill.bad { color: var(--buzzkill); background: rgba(242,64,77,.15); }
.stats { display: flex; gap: 8px; }

/* Timer */
.timer { display: flex; flex-direction: column; gap: 6px; flex: none; }
.timer .num { text-align: center; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; position: relative; }
.timer .num.hurry { color: var(--buzzkill); }
.timer .num.dim { opacity: .4; }
.timer .pause { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.timer .pause.on { background: var(--trivia); }
.bar { height: 8px; border-radius: 99px; background: var(--card); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: var(--spark); border-radius: 99px; transform-origin: left; }
.bar.t > i { background: var(--trivia); }
.bar.hurry > i { background: var(--buzzkill); }

/* Word card */
.cardslot { position: relative; flex: none; }
.wcard { border-radius: 24px; overflow: hidden; box-shadow: 0 8px 16px rgba(0,0,0,.4); animation: cardin .35s cubic-bezier(.3,1.3,.5,1); }
@keyframes cardin { from { transform: translateX(60px); opacity: 0; } }
.wcard .target { background: var(--buzzkill); text-align: center; padding: 22px 12px; font-size: 38px; font-weight: 900; line-height: 1.1; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.wcard .words { background: var(--card); padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wcard .words span { font-size: 26px; font-weight: 600; color: rgba(255,255,255,.9); }
.wcard.hidden .target { background: var(--violet); }
.wcard.hidden .words { padding: 34px 20px; gap: 6px; }
.wcard.hidden .words .q { font-size: 56px; font-weight: 900; line-height: 1; }
.wcard.hidden .words span { font-size: 17px; color: var(--muted); }
.cardslot.dimmed .wcard { opacity: .6; }
.cardslot.shake { animation: shake .4s linear; }
.stamp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.stamp > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 22px; border-radius: 18px; color: #fff; transform: rotate(-8deg); box-shadow: 0 8px 20px rgba(0,0,0,.5); border: 4px solid #fff; animation: stamp .3s cubic-bezier(.3,1.6,.5,1); text-align: center; }
.stamp .st { display: flex; align-items: center; gap: 10px; font-size: 40px; font-weight: 900; line-height: 1; }
.stamp small { font-size: 16px; font-weight: 700; opacity: .95; }
@keyframes stamp { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } }
.flashbg { position: absolute; inset: 0; pointer-events: none; opacity: .22; animation: fadein .15s; z-index: 0; }
.screen > * { position: relative; z-index: 1; }

/* Host bubble (BuzzSays) */
.says { display: flex; align-items: flex-end; gap: 4px; animation: slideup .25s ease-out; flex: none; }
@keyframes slideup { from { transform: translateY(24px); opacity: 0; } }
.says img { width: 62px; height: auto; margin-bottom: -2px; transform-origin: bottom; animation: peek .45s cubic-bezier(.3,1.5,.5,1); }
.says .b { flex: 1; background: var(--card); border: 1px solid color-mix(in srgb, var(--hc, var(--buzzkill)) 50%, transparent); border-radius: 12px; padding: 12px; margin-bottom: 24px; min-width: 0; }
.says .b .n { font-size: 12px; font-weight: 700; color: var(--hc, var(--buzzkill)); }
.says .b .tx { font-size: 15px; font-weight: 500; }
.says.partner { --hc: var(--violet); }
.says.partner .av { width: 50px; height: 50px; border-radius: 50%; background: var(--violet); display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 6px 22px 0; flex: none; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%,60%,100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Listening strip */
.strip { display: flex; align-items: center; gap: 8px; background: rgba(43,36,69,.6); border-radius: 12px; padding: 10px 14px; font-size: 15px; color: var(--muted); flex: none; min-height: 42px; }
.strip .tx { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; flex: 1; }
.strip .tx.tail { direction: rtl; }
.strip .tx.tail > span { direction: ltr; unicode-bidi: plaintext; }
.strip .wf { color: var(--good); display: flex; gap: 2px; align-items: center; height: 16px; }
.strip .wf i { width: 3px; background: var(--good); border-radius: 2px; animation: wf 1s ease-in-out infinite; height: 100%; }
.strip .wf i:nth-child(2) { animation-delay: .1s; } .strip .wf i:nth-child(3) { animation-delay: .2s; } .strip .wf i:nth-child(4) { animation-delay: .3s; }
@keyframes wf { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.strip.off .wf { display: none; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

.typebox { display: flex; gap: 10px; flex: none; }
.typebox input { flex: 1; min-width: 0; background: var(--card); border: 0; border-radius: 14px; padding: 12px 14px; outline: none; }
.typebox input:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.typebox button { width: 48px; height: 46px; border-radius: 14px; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.typebox button.ready { background: var(--trivia); }
.typebox.red button.ready { background: var(--buzzkill); }
.actions { display: flex; gap: 12px; flex: none; }
.actions .btn { padding: 16px 8px; font-size: 19px; }
.pillbtn { align-self: center; display: inline-flex; align-items: center; gap: 8px; background: var(--card); padding: 10px 16px; border-radius: 99px; font-size: 15px; font-weight: 600; flex: none; }

/* Trivia */
.title-big { font-size: 34px; font-weight: 900; text-align: center; margin: 8px 0 0; line-height: 1.1; }
.cat { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: 18px; padding: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); width: 100%; text-align: left; font-size: 22px; font-weight: 900; transition: transform .2s; }
.cat .ic { font-size: 24px; width: 36px; display: flex; justify-content: center; }
.cat.chosen { background: var(--good); }
.cat:active { transform: scale(1.02); }
.qcard { border-radius: 24px; overflow: hidden; box-shadow: 0 8px 16px rgba(0,0,0,.4); animation: cardin .35s cubic-bezier(.3,1.3,.5,1); flex: none; }
.qcard .cat-band { display: flex; justify-content: space-between; align-items: center; background: var(--trivia); padding: 14px 20px; font-size: 15px; font-weight: 900; text-transform: uppercase; }
.qcard .dots3 { display: flex; gap: 3px; } .qcard .dots3 i { width: 7px; height: 7px; border-radius: 50%; background: #fff; } .qcard .dots3 i.o { opacity: .3; }
.qcard .q { background: var(--card); padding: 28px 20px; text-align: center; font-size: 26px; font-weight: 600; }
.qcard.miss { animation: shake .35s linear; }
.handoff { align-items: center; text-align: center; gap: 24px; }
.handoff .big-ic { font-size: 64px; color: var(--trivia); }
.handoff h1 { margin: 0; font-size: 40px; font-weight: 800; }
.handoff .sub { font-size: 22px; color: var(--muted); }
.handoff .rec { color: var(--spark); font-weight: 700; }
.verdict { align-self: center; display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 16px; font-size: 38px; font-weight: 900; transform: rotate(-3deg); color: #fff; animation: stamp .3s cubic-bezier(.3,1.6,.5,1); white-space: nowrap; }
.verdict.good { background: var(--good); } .verdict.bad { background: var(--buzzkill); } .verdict.neutral { background: var(--card); }
.answerbox { background: var(--card); border-radius: 24px; padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.answerbox small { color: var(--muted); font-weight: 600; font-size: 12px; }
.answerbox .a { font-size: 34px; font-weight: 900; line-height: 1.1; }
.answerbox .h { font-size: 15px; } .answerbox .h span { color: var(--muted); }
.qsmall { font-size: 13px; color: var(--muted); text-align: center; }
.advance { height: 4px; border-radius: 99px; background: var(--card); overflow: hidden; margin: 0 4px; flex: none; }
.advance i { display: block; height: 100%; background: var(--trivia); width: 0; }
.results { background: var(--card); border-radius: 16px; overflow: hidden; }
.results .r { display: flex; gap: 10px; padding: 12px 16px; align-items: flex-start; border-top: 1px solid rgba(255,255,255,.08); }
.results .r:first-child { border-top: 0; }
.results .r .ic { font-size: 18px; margin-top: 2px; } .results .r .ic.ok { color: var(--good); } .results .r .ic.no { color: var(--buzzkill); }
.results .r b { display: block; font-size: 17px; font-weight: 700; } .results .r small { color: var(--muted); font-size: 12px; font-weight: 500; }
.results .r .said { color: #fff; font-size: 14px; margin-top: 4px; }
.results .r.no { cursor: pointer; }
.endhead { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.endhead .star { font-size: 70px; color: var(--spark); animation: bounce 1s ease-out 2; }
@keyframes bounce { 40% { transform: translateY(-14px); } 70% { transform: translateY(0); } 85% { transform: translateY(-5px); } }
.endhead h1 { margin: 0; font-size: 38px; font-weight: 900; text-align: center; line-height: 1.1; }
.endwrap { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scrollbar-width: none; }

/* Round summary */
.sumhead { text-align: center; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sumhead h1 { margin: 0; font-size: 32px; font-weight: 900; }
.sumhead .delta { font-size: 64px; font-weight: 900; line-height: 1; color: var(--spark); }
.sumhead .delta.neg { color: var(--buzzkill); }
.countdown { pointer-events: auto; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,13,31,.85); z-index: 10; font-size: 150px; font-weight: 900; color: var(--spark); }
.countdown span { animation: stamp .5s cubic-bezier(.3,1.6,.5,1); }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 25; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(var(--h)) rotate(var(--r)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .mascot, .logo, .confetti i { animation: none; } }

/* Short phones: the round's card and bubbles shrink so the buttons stay in view. */
@media (max-height: 860px) {
  .screen { gap: 12px; }
  .timer .num { font-size: 38px; }
  .wcard .target { padding: 16px 12px; font-size: 34px; }
  .wcard .words { padding: 14px 12px; gap: 6px; }
  .wcard .words span { font-size: 22px; }
  .wcard.hidden .words { padding: 22px 20px; }
  .says img { width: 50px; }
  .says .b { margin-bottom: 10px; padding: 10px; }
  .says.partner .av { margin-bottom: 8px; width: 42px; height: 42px; }
  .qcard .q { padding: 22px 20px; font-size: 24px; }
}

/* Secret Agents */
.screen.agents { gap: 10px; }
.screen.agents .hdr .mid { left: 110px; right: 110px; }
.agfound { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(26,173,160,.15); color: var(--agents); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tokens { display: flex; justify-content: center; gap: 4px; padding: 6px 0 4px; }
.tokens i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.15); transition: background .3s; }
.tokens i.on { background: var(--spark); }
.agbanner { background: var(--card); border-radius: 18px; padding: 10px 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; min-height: 104px; justify-content: center; }
.agbanner .bl, .bl { font-size: 12px; font-weight: 900; color: var(--muted); letter-spacing: .02em; }
.agbanner .bt { font-size: 20px; font-weight: 700; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.agbanner .bh { font-size: 13px; color: var(--muted); }
.agbanner .link { color: var(--agents); font-weight: 700; font-size: 15px; }
.cluetext { display: flex; align-items: center; gap: 10px; height: 40px; animation: stamp .3s cubic-bezier(.3,1.6,.5,1); }
.cluetext span { font-size: 30px; font-weight: 900; line-height: 1; }
.cluetext b { width: 36px; height: 36px; border-radius: 50%; background: var(--agents); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; }
.agrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; flex: none; }
.agrid.shake { animation: shake .35s linear; }
.atile { position: relative; height: 56px; padding: 0 3px; border-radius: 10px; background: var(--card); border: 1px solid rgba(255,255,255,.08); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 14px; font-weight: 700; transition: transform .25s cubic-bezier(.3,1.5,.5,1), box-shadow .25s, opacity .25s; min-width: 0; }
.atile .w { max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.atile small { font-size: 9px; font-weight: 600; color: rgba(255,255,255,.7); white-space: nowrap; }
.atile .ck { font-size: 11px; stroke-width: 3; }
.atile.agent { border: 2.5px solid var(--agents); }
.atile.assassin { background: #0f0f0f; border-color: rgba(255,255,255,.12); }
.atile.found { background: transparent; border-color: transparent; color: rgba(255,255,255,.75); }
.atile.found .ck { color: var(--agents); }
.atile.hit { background: #000; border-color: rgba(255,255,255,.25); }
.atile.nobody { opacity: .45; }
.atile.back { opacity: .5; }
.atile.target { background: rgba(26,173,160,.3); border: 3px solid var(--agents); animation: glow 2.2s ease-in-out infinite; z-index: 1; }
@keyframes glow { 0%,100% { box-shadow: 0 0 6px var(--agents); } 50% { box-shadow: 0 0 14px var(--agents); } }
.atile.rv { background: rgba(26,173,160,.35); }
.atile.pk { box-shadow: inset 0 0 0 2px #4d8cff, 0 0 6px #4d8cff; z-index: 1; }
.atile.pk-ass { background: #000; border: 2.5px solid #4d8cff; box-shadow: 0 0 6px #4d8cff; z-index: 1; }
.atile.sel { border-color: var(--spark); border-width: 3px; transform: scale(1.08); box-shadow: 0 0 8px rgba(255,204,56,.6); z-index: 2; }
.atile.ppick { border-color: var(--violet); border-width: 3px; transform: scale(1.08); box-shadow: 0 0 10px rgba(115,77,217,.8); z-index: 2; }
.aglegend { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.aglegend .sp { flex: 1; }
.aglegend span { display: inline-flex; align-items: center; gap: 4px; }
.aglegend .sw { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--agents); display: inline-block; }
.aglegend .sw.dark { background: #000; border-color: rgba(255,255,255,.3); }
.aglegend .sw.rvsw { background: rgba(26,173,160,.35); }
.aglegend .sw.pk { border-color: #4d8cff; box-shadow: 0 0 4px #4d8cff; background: var(--card); }
.aglegend .sw.pkb { border-color: #4d8cff; box-shadow: 0 0 4px #4d8cff; }
.aglegend .chip { padding: 3px 8px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(26,173,160,.4); }
.aglegend .chip b { color: var(--agents); font-variant-numeric: tabular-nums; }
.aglegend.both { justify-content: center; flex-wrap: wrap; font-size: 12px; }
.agspeech { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.says.comp { flex: none; }
.says.comp .b { margin: 0 0 14px; }
.says.comp img { width: 62px; margin: 0 0 -2px 2px; }
.asking { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px rgba(26,173,160,.6); }
.asking b { display: block; font-size: 13px; font-weight: 700; } .asking small { color: var(--muted); font-size: 11px; }
.asking > div { flex: 1; }
.asking .ring { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--agents); animation: rot 2.5s linear forwards; flex: none; }
.chipbtn { padding: 7px 12px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); font-weight: 700; font-size: 13px; }
#ag-controls { display: flex; flex-direction: column; gap: 10px; flex: none; }
#ag-controls .actions { min-height: 0; }
.clueform { display: flex; flex-direction: column; gap: 10px; }
.clueform .row { display: flex; gap: 10px; }
.field.big { font-size: 20px; font-weight: 700; background: var(--card); padding: 11px 14px; border-radius: 14px; min-width: 0; flex: 1; }
.nums { display: flex; gap: 4px; }
.nums button { width: 30px; height: 44px; border-radius: 10px; background: var(--card); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.nums button.on { background: var(--agents); }
.problem { color: var(--buzzkill); font-size: 13px; font-weight: 600; min-height: 0; }
.problem:empty { display: none; }
.why, .recap { background: var(--card); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
.why > div { flex: 1; } .why .wt { font-size: 15px; margin-top: 4px; } .why .bl { color: var(--agents); }
.why img { height: 64px; width: auto; }
.recap { flex-direction: column; align-items: stretch; gap: 8px; } .recap .bl { color: var(--agents); }
.recap .rr { display: flex; gap: 8px; font-size: 14px; } .recap .rr span { color: var(--muted); }
.endhead .star.bad { color: var(--buzzkill); }
.endhead .star svg { width: 1em; height: 1em; }
.endhead .star:not(.bad) svg { stroke: none; }
.screen.agents.over { gap: 12px; }
.partner-pick { display: flex; gap: 8px; }
.partner-pick button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 2px transparent; }
.partner-pick button.on { box-shadow: inset 0 0 0 2px var(--agents); background: rgba(26,173,160,.15); }
.partner-pick img { height: 56px; width: auto; }
@media (max-height: 760px) { .agbanner { min-height: 88px; } .agbanner .bt { min-height: 32px; font-size: 18px; } .atile { height: 50px; } }

/* The host's line in a round floats just above the listening strip, so it can't push the buttons off a short window. */
.screen.round #ref { position: relative; height: 0; flex: none; z-index: 6; }
.screen.round #ref .says { position: absolute; left: 0; right: 0; bottom: 6px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.screen.round #ref .says .b { margin-bottom: 8px; background: #342b54; }
.says.compact { align-items: center; gap: 8px; background: var(--card); border: 1px solid color-mix(in srgb, var(--hc) 50%, transparent); border-radius: 12px; padding: 6px 10px; }
.says.compact img { width: 38px; height: 38px; margin: 0; object-fit: contain; }
.says.compact .b { background: none; border: 0; padding: 0; margin: 0; }
.says.compact .tx { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Secret Agents' board shrinks to leave the speakers a room of their own. */
.atile { height: clamp(40px, calc((var(--ph) - 520px) / 5), 56px); }
.agspeech { min-height: 64px; }
@media (max-height: 820px) {
  .screen.round { gap: 10px; }
  .screen.round .wcard .target { padding: 12px; font-size: 30px; }
  .screen.round .wcard .words { padding: 10px; gap: 4px; }
  .screen.round .wcard .words span { font-size: 20px; }
  .screen.round .wcard.hidden .words { padding: 16px; }
  .screen.round .wcard.hidden .words .q { font-size: 40px; }
  .screen.round .timer .num { font-size: 34px; }
  .screen.round .actions .btn { padding: 13px 8px; }
  .qcard .q { font-size: 22px; padding: 18px 16px; }
}
@media (max-height: 700px) {
  .screen.round .wcard .words span { font-size: 17px; }
  .screen.round .wcard .target { font-size: 26px; padding: 9px; }
  .agbanner { min-height: 76px; padding: 6px 10px; }
  .cluetext span { font-size: 24px; } .cluetext { height: 32px; }
}
