/* Daytime TV game show: warm cream set, sunny yellow, tomato red, sky blue, fresh green, navy ink */
:root {
  --bg: #fff6e3;
  --ink: #1b2a4a;
  --muted: #5d6b86;
  --card: #ffffff;
  --line: #1b2a4a;
  --soft: #f1e6cf;
  --yellow: #ffc928;
  --red: #ff5a3c;
  --sky: #38a8f2;
  --green: #2fbf6b;
  --yes: #22b35e;
  --no: #ef4632;
  --maybe: #f59e0b;
  --slate: #64748b;
  --win: #22b35e;
  --display: "Lilita One", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --pop: 0 4px 0 var(--ink);
  --stage-w: min(1100px, 100vw - 24px, (100dvh - 196px) * 1000 / 560);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(circle at 1px 1px, rgba(27, 42, 74, .07) 1.5px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(1100px 520px at 50% -12%, #ffe49a 0%, transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
#app { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 12px 12px 16px; gap: 12px; }
.main { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------------- stage ---------------- */
.stage-wrap { width: max(var(--stage-w), min(560px, 100vw - 24px)); }
.stage {
  position: relative; width: 100%; aspect-ratio: 1000 / 560;
  border-radius: 22px; overflow: hidden; background: #fff4dc;
  border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), 0 22px 40px -18px rgba(27, 42, 74, .45);
  isolation: isolate;
}
.stage-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sign-text { font: 400 40px var(--display); letter-spacing: 1px; fill: var(--yellow); stroke: var(--ink); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
html[data-lang="id"] .sign-text { font-size: 33px; letter-spacing: .5px; }
.sign-sub { font: 900 12.5px var(--body); letter-spacing: 4px; fill: #fff; }
.bulb { fill: #fff3b0; stroke: #e0a400; stroke-width: 1; animation: twinkle 1.2s ease-in-out infinite; }
.bulb:nth-child(2n) { animation-delay: .6s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.pod-name { font: 400 34px var(--display); letter-spacing: 2px; fill: var(--ink); }
.jersey-no { font: 400 30px var(--display); }
.beam { opacity: .55; }
.conf { animation: drift 6s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(-5px); } to { transform: translateY(6px); } }

/* characters (local coords: 0,0 = podium top centre) */
.char .body { animation: breathe 3.4s ease-in-out infinite; }
#jev .body { animation-delay: -1.2s; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.char .head { transform-origin: 0 -168px; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.char .eyes { animation: blink 4.6s infinite; }
#jev .eyes { animation-delay: -2s; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.char .pupils { transition: transform .3s; }
.mouth > * { display: none; }
.char[data-mouth="smile"] .m-smile, .char[data-mouth="open"] .m-open, .char[data-mouth="frown"] .m-frown, .char[data-mouth="grin"] .m-grin,
.char[data-mouth="flat"] .m-flat, .char[data-mouth="o"] .m-o, .char[data-mouth="wavy"] .m-wavy { display: inline; }
.char .brow { transition: transform .3s; }

/* one arm set per pose; the matching set pops in */
.char .arms { display: none; }
#player .a-hold, #jev .a-rest { display: inline; }
#player.pose-correct .a-hold { display: none; }
#player.pose-correct .a-cheer { display: inline; }
#jev:is(.pose-think, .pose-yes, .pose-no, .pose-maybe, .pose-invalid, .pose-correct) .a-rest { display: none; }
#jev.pose-think .a-think, #jev.pose-yes .a-yes, #jev.pose-no .a-no, #jev.pose-maybe .a-maybe,
#jev.pose-invalid .a-invalid, #jev.pose-correct .a-correct { display: inline; }
#jev .arms:not(.a-rest), #player .a-cheer { transform-origin: 0 -140px; animation: armpop .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes armpop { from { transform: scale(.88) translateY(8px); } }
.hand { transform-origin: 0 0; }
#jev.pose-yes .pump { animation: pump .5s ease-in-out 2 .1s; }
#jev.pose-invalid .wag, #jev.pose-no .head { animation: wag .45s ease-in-out 3; }
#jev.pose-correct .hi5, #player.pose-correct .hi5 { animation: pump .35s ease-in-out 3; }
@keyframes pump { 50% { transform: translateY(-9px) scale(1.08); } }
@keyframes wag { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 75% { transform: rotate(16deg); } }

/* Jev: thinking, yes, no, maybe, yes-or-no-only, correct */
#jev.pose-think .head { transform: rotate(-6deg); }
#jev.pose-think .pupils { transform: translate(-3px, -5px); }
#jev.pose-think .brow-r { transform: translateY(-5px) rotate(8deg); }
#jev.pose-yes .head { animation: nod .7s ease-in-out 1; }
#jev.pose-yes .brow { transform: translateY(-4px); }
#jev.pose-no .head { animation: shake .7s ease-in-out 1; }
#jev.pose-no .brow-l { transform: translateY(2px) rotate(12deg); }
#jev.pose-no .brow-r { transform: translateY(2px) rotate(-12deg); }
#jev.pose-maybe .head { transform: translateY(7px) rotate(8deg); }
#jev.pose-maybe .brow-l { transform: translateY(-6px) rotate(-6deg); }
#jev.pose-maybe .brow-r { transform: translateY(1px) rotate(6deg); }
#jev.pose-maybe .pupils { transform: translate(3px, -3px); }
#jev.pose-invalid .head { transform: rotate(-5deg); }
#jev.pose-invalid .brow-l { transform: translateY(-4px) rotate(-8deg); }
.char.pose-correct .brow { transform: translateY(-6px); }
.char.pose-correct .body { animation: jump .55s cubic-bezier(.3, .7, .4, 1) 2; }
#jev.pose-correct .body { animation-delay: .08s; }

/* you: talk bob, frown, puzzled, celebrate */
#player.pose-ask .body { animation: talk .3s ease-in-out 2; }
#player.pose-no .head { transform: translateY(3px) rotate(-4deg); }
#player.pose-no .brow-l { transform: translateY(3px) rotate(14deg); }
#player.pose-no .brow-r { transform: translateY(3px) rotate(-14deg); }
#player.pose-maybe .head { transform: rotate(-6deg); }
#player.pose-maybe .brow-r { transform: translateY(-5px); }
#player.pose-pass .head { transform: translateY(4px) rotate(5deg); }
#player.pose-pass .brow-l { transform: rotate(-12deg); }
#player.pose-pass .brow-r { transform: rotate(12deg); }

@keyframes nod { 0%, 100% { transform: none; } 25%, 75% { transform: translateY(8px) rotate(2deg); } 50% { transform: translateY(-2px); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: rotate(-9deg); } 40%, 80% { transform: rotate(9deg); } }
@keyframes jump { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(4px) scaleY(.97); } 50% { transform: translateY(-34px) scaleY(1.02); } }
@keyframes talk { 50% { transform: translateY(-5px); } }

.phone-flip { transform-origin: 0 -290px; }
.phone-flip.flip { animation: flip .5s ease-in-out; }
@keyframes flip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0); } }
.phone-q { font: 400 44px var(--display); fill: #fff; stroke: var(--ink); stroke-width: 4px; paint-order: stroke; }
.phone-word { font-family: var(--display); fill: #fff; stroke: var(--ink); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; dominant-baseline: middle; }
.phone-q.pulse { animation: qpulse 1.6s ease-in-out infinite; }
@keyframes qpulse { 50% { opacity: .6; } }
.spark { animation: sparkle 1s ease-out forwards; stroke: var(--ink); stroke-width: 1.5px; }
@keyframes sparkle { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.6) rotate(45deg); } }

/* HUD */
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 16px 12px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.timer { position: relative; width: 60px; height: 60px; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.t-bg { fill: #fff; stroke: #f1e4c6; stroke-width: 4; }
.timer { background: #fff; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.t-fg { fill: none; stroke: var(--sky); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer span { position: relative; font: 400 16px var(--display); letter-spacing: .3px; font-variant-numeric: tabular-nums; color: var(--ink); }
.cat-pill { display: none; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 17px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.score { display: flex; align-items: center; gap: 5px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); padding: 5px 14px 5px 10px; border-radius: 999px; font: 400 22px var(--display); }
.score small { font: 800 13px var(--body); color: var(--muted); margin-left: -2px; }
.score.low b { color: var(--no); }
.score.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.3); background: var(--yellow); } }

/* speech bubbles: desktop = beside each contestant, phone = above their heads */
.bubble {
  position: absolute; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; padding: 10px 14px;
  box-shadow: 0 4px 0 var(--ink); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .35s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none; z-index: 2;
}
.bubble.show { opacity: 1; transform: scale(1); }
.bubble::after { content: ""; position: absolute; width: 16px; height: 16px; background: inherit; border: 3px solid var(--ink); border-radius: 0 0 4px 0; }
.bubble-q { left: 2.4%; top: 27%; width: 20%; transform-origin: right center; font: 800 clamp(12px, 1.4vw, 17px) / 1.3 var(--body); }
.bubble-q::after { right: -11px; top: calc(50% - 10px); transform: rotate(-45deg); border-width: 0 3px 3px 0; }
.bubble-a { left: 77.5%; top: 16%; width: 20.5%; transform-origin: left center; text-align: center; padding: 12px 10px; }
.bubble-a::after { left: -11px; top: calc(50% - 10px); transform: rotate(135deg); border-width: 0 3px 3px 0; }
.bubble-a b { display: block; font: 400 clamp(22px, 3.4vw, 42px) / 1 var(--display); letter-spacing: .5px; }
.bubble-a small { display: block; margin-top: 4px; font: 800 clamp(10px, 1.1vw, 13px) var(--body); opacity: .8; }
.bubble-a.yes { background: var(--yes); color: #fff; }
.bubble-a.no { background: var(--no); color: #fff; }
.bubble-a.maybe { background: var(--yellow); }
.bubble-a.invalid { background: #e2e8f0; } .bubble-a.invalid b { color: #334155; font-size: clamp(15px, 2.1vw, 25px); }
.bubble-a.correct { background: linear-gradient(135deg, #ffd84a, #6fe39b); } .bubble-a.correct b { font-size: clamp(16px, 2.2vw, 26px); }
.bubble-a.yes b, .bubble-a.no b { text-shadow: 0 2px 0 rgba(27, 42, 74, .35); }
.bubble-a.think b { color: var(--sky); letter-spacing: 4px; }

.reveal {
  position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%) scale(.4); opacity: 0;
  background: var(--green); color: #fff; text-align: center; padding: 10px 26px 14px; border: 3px solid var(--ink);
  border-radius: 18px; box-shadow: 0 5px 0 var(--ink); transition: opacity .25s, transform .45s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; z-index: 3;
  max-width: 34%;
}
.reveal.pass { background: var(--red); }
.reveal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.reveal small { display: block; font: 900 11px var(--body); letter-spacing: 2px; text-transform: uppercase; }
.reveal b { display: block; font: 400 clamp(20px, 3.4vw, 40px) / 1.05 var(--display); text-shadow: 0 2px 0 rgba(27, 42, 74, .4); }

/* ---------------- panel ---------------- */
.panel { width: max(var(--stage-w), min(560px, 100vw - 24px)); background: var(--card); border: 3px solid var(--ink); box-shadow: var(--pop); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ask-row { display: flex; flex-direction: column; gap: 6px; }
.ask-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px; font: 800 15px var(--body); color: var(--ink); }
.ask-hint { color: var(--muted); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-field {
  display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 6px 6px 6px 18px;
  background: #fffaf0; border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--pop); transition: box-shadow .2s, background .2s;
}
.ask-field:focus-within { background: #fff; box-shadow: var(--pop), 0 0 0 5px rgba(56, 168, 242, .3); }
.ask-field input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; background: transparent; color: var(--ink); font: 700 18px var(--body); }
.ask-field input::placeholder { color: #8a93a6; font-weight: 600; }
.mic { width: 46px; height: 46px; border-radius: 14px; background: transparent; border: 0; font-size: 22px; flex: none; opacity: .75; transition: background .15s, opacity .15s; }
.mic:hover { background: var(--soft); opacity: 1; }
.mic.live { background: var(--red); opacity: 1; animation: qpulse 1s infinite; }
.ask-btn {
  height: 50px; padding: 0 20px; border-radius: 15px; background: var(--red); opacity: .45; color: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  font: 400 19px var(--display); letter-spacing: .5px; flex: none; display: flex; align-items: center; gap: 6px; transition: opacity .15s, transform .1s, box-shadow .1s;
}
.ask-btn i { font-style: normal; }
.ask-row.has-text .ask-btn { opacity: 1; text-shadow: 0 2px 0 rgba(27, 42, 74, .35); }
.ask-btn:not(:disabled):active, .go-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ask-btn:disabled, .pass-btn:disabled { opacity: .5; cursor: default; }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 5px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; background: #e9f6ff; border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); font: 800 13.5px var(--body); color: var(--ink); transition: background .15s, transform .1s; }
.chip:nth-child(4n + 2) { background: #fff3c4; } .chip:nth-child(4n + 3) { background: #e3f9ea; } .chip:nth-child(4n + 4) { background: #ffe6e0; }
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: translateY(2px); box-shadow: none; }
/* question log */
.qlog { width: max(var(--stage-w), min(560px, 100vw - 24px)); background: var(--card); border: 3px solid var(--ink); box-shadow: var(--pop); border-radius: 22px; padding: 14px 14px 10px; display: flex; flex-direction: column; min-height: 0; }
.qlog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 4px 10px; }
.qlog-head b { font: 400 21px var(--display); letter-spacing: .3px; }
.qlog-count { color: var(--muted); font-size: 14px; font-weight: 800; }
.history { flex: 1; min-height: 0; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(27, 42, 74, .25) transparent; }
.history::-webkit-scrollbar { width: 6px; }
.history::-webkit-scrollbar-thumb { background: rgba(27, 42, 74, .25); border-radius: 3px; }
.history::-webkit-scrollbar-track { background: transparent; }
.history .empty { color: var(--muted); font-size: 16px; font-weight: 600; line-height: 1.5; padding: 6px 4px; }
.h-item { display: flex; align-items: center; gap: 10px; font: 700 16.5px / 1.3 var(--body); padding: 10px 10px 10px 14px; border-radius: 14px; background: #fbf6ea; border: 2px solid #eadfc6; border-left: 6px solid transparent; animation: slidein .25s ease-out; }
.h-item .q { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.h-item .tagA { flex: none; font: 400 14px var(--display); letter-spacing: .8px; padding: 5px 11px 4px; border-radius: 999px; border: 2px solid var(--ink); }
.h-item.yes { border-left-color: var(--yes); } .h-item.no { border-left-color: var(--no); }
.h-item.maybe { border-left-color: var(--maybe); } .h-item.invalid { border-left-color: var(--slate); }
.h-item.correct { border-left-color: var(--win); background: #e3f9ea; border-color: #9fe2b7; border-left-color: var(--win); }
.h-item.latest { background: #fff; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.h-item.yes.latest { border-left-color: var(--yes); } .h-item.no.latest { border-left-color: var(--no); }
.h-item.maybe.latest { border-left-color: var(--maybe); } .h-item.invalid.latest { border-left-color: var(--slate); } .h-item.correct.latest { border-left-color: var(--win); background: #e3f9ea; }
.h-item.sep { background: none; border: 0; box-shadow: none; color: var(--muted); font-size: 14px; font-weight: 800; justify-content: center; padding: 6px 2px 2px; }
.tagA.yes { background: var(--yes); color: #fff; }
.tagA.no { background: var(--no); color: #fff; }
.tagA.maybe { background: var(--maybe); color: var(--ink); }
.tagA.correct { background: linear-gradient(135deg, #ffd84a, #6fe39b); color: var(--ink); }
.tagA.invalid { background: #cbd5e1; color: #1e293b; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
/* small, right-aligned and set apart from the chips so it isn't hit by accident */
.side-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 2px dashed #e3d6ba; }
.pass-btn { flex: none; height: 38px; padding: 0 16px; border-radius: 12px; background: #fff1ec; border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); color: #c2321c; font: 400 15px var(--display); letter-spacing: .3px; }
.side-actions .ghost-btn { flex: none; height: 38px; padding: 0 14px; }
.ghost-btn { padding: 10px 14px; border-radius: 12px; border: 2.5px solid #d9ccb0; color: var(--muted); font: 800 13.5px var(--body); background: #fff; }
.ghost-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------- overlays ---------------- */
.overlay { position: fixed; inset: 0; display: grid; justify-items: center; padding: 16px; background: rgba(255, 240, 210, .72); backdrop-filter: blur(6px); z-index: 10; overflow-y: auto; transition: opacity .3s; }
.overlay.hidden { opacity: 0; pointer-events: none; }
.card { position: relative; margin: auto 0; width: min(560px, 100%); background: #fff; border: 3px solid var(--ink); border-radius: 28px; padding: 30px 26px 24px; box-shadow: 0 7px 0 var(--ink), 0 30px 60px -20px rgba(27, 42, 74, .45); text-align: center; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--yellow) 40px 80px, var(--sky) 80px 120px, var(--green) 120px 160px); border-bottom: 3px solid var(--ink); }
.logo {
  font: 400 clamp(54px, 13vw, 84px) / .95 var(--display); letter-spacing: 1.5px; color: var(--yellow);
  -webkit-text-stroke: 0; paint-order: stroke fill;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 7px 0 var(--ink), 2px 7px 0 var(--ink), -2px 7px 0 var(--ink);
}
html[data-lang="id"] .logo { font-size: clamp(42px, 10.5vw, 68px); }
html[data-lang="en"] .logo { font-size: clamp(50px, 12vw, 76px); }
.logo span { color: var(--red); }
.tag { color: var(--muted); line-height: 1.5; margin: 12px 0 18px; font-size: 15px; font-weight: 600; }
.tag b { color: var(--ink); font-weight: 800; }
.label { font: 900 11.5px var(--body); letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; text-align: left; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.cat { position: relative; padding: 12px 6px 10px; border-radius: 16px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .12s, background .15s; overflow: hidden; }
.cat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--sky); }
.cat:nth-child(4n + 2)::before { background: var(--red); } .cat:nth-child(4n + 3)::before { background: var(--yellow); } .cat:nth-child(4n + 4)::before { background: var(--green); }
.cat:hover { transform: translateY(-2px); background: #fffbef; }
.cat:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.cat .e { font-size: 26px; display: block; margin-top: 2px; }
.cat b { display: block; font: 400 16.5px / 1.15 var(--display); letter-spacing: .3px; margin-top: 4px; }
.cat small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-top: 2px; }
.cats-easy { grid-template-columns: repeat(4, 1fr); gap: 7px; }
.cats-easy .cat { padding: 9px 4px 7px; border-radius: 14px; }
.cats-easy .cat .e { font-size: 21px; }
.cats-easy .cat b { font-size: 13.5px; line-height: 1.12; margin-top: 3px; }
.cats-easy .cat small { font-size: 10.5px; line-height: 1.2; }
.start-card { width: min(640px, 100%); }
.go-btn { width: 100%; height: 58px; border-radius: 18px; background: var(--green); color: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); font: 400 22px var(--display); letter-spacing: .5px; text-shadow: 0 2px 0 rgba(27, 42, 74, .35); transition: transform .12s; }
.go-btn:hover { transform: translateY(-1px); }
.go-btn i { font-style: normal; }
.best { margin-top: 4px; color: var(--muted); font-size: 13.5px; font-weight: 800; min-height: 1em; }
.daily-badge { display: inline-block; margin-top: 14px; padding: 5px 16px 4px; border-radius: 999px; background: var(--sky); color: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 400 17px var(--display); letter-spacing: 1px; text-shadow: 0 2px 0 rgba(27, 42, 74, .3); }
.start-card .tag { margin-top: 12px; }
.cat.going { background: #fff6d6; }
.cat.going small { color: #a86b00; }
.cat.won { background: #e3f9ea; }
.cat.won small { color: #15803d; }
.cat.lost { background: #ffece7; }
.cat.lost small { color: #c2321c; }

/* daily result card */
.result-card { width: min(460px, 100%); padding-top: 26px; }
.res-meta { display: inline-block; padding: 5px 14px; border-radius: 999px; background: #fff6d6; border: 2.5px solid var(--ink); color: var(--ink); font: 800 13.5px var(--body); }
.res-title { font: 400 36px / 1.1 var(--display); letter-spacing: .5px; margin: 12px 0 10px; }
.res-word { margin: 0 auto 10px; padding: 10px 18px 12px; border-radius: 18px; background: var(--green); color: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); max-width: 100%; display: inline-block; min-width: 60%; }
.lost .res-word { background: var(--red); }
.res-word small { display: block; font: 900 11px var(--body); letter-spacing: 2px; text-transform: uppercase; }
.res-word b { display: block; font: 400 clamp(28px, 7vw, 40px) / 1.05 var(--display); letter-spacing: .5px; overflow-wrap: anywhere; text-shadow: 0 2px 0 rgba(27, 42, 74, .4); }
.res-line { color: var(--ink); font-weight: 800; font-size: 15px; margin: 6px 0 10px; }
.res-grid { font-size: 22px; line-height: 1.25; letter-spacing: 2px; margin-bottom: 16px; min-height: 1em; }
.share-row { display: flex; gap: 8px; margin: 12px 0 18px; }
.share-btn { flex: 1; height: 42px; border-radius: 14px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 800 14px var(--body); transition: background .15s; }
.share-btn:hover { background: #e9f6ff; }
.share-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 0; border-top: 2px dashed #e3d6ba; }
.stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stats b { font: 400 30px / 1 var(--display); }
.stats span { color: var(--muted); font-size: 11.5px; font-weight: 800; line-height: 1.2; }
.dist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.dist .label { margin-bottom: 4px; }
.bar { display: flex; align-items: center; gap: 8px; font: 800 12px var(--body); color: var(--muted); }
.bar span { width: 42px; flex: none; text-align: right; }
.bar i { font-style: normal; text-align: right; padding: 2px 7px; border-radius: 6px; background: #e6dcc6; color: var(--ink); min-width: 22px; }
.bar.me i { background: var(--sky); color: #fff; }
.lost .bar.me i { background: var(--no); }
.next-in { color: var(--muted); font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.next-in b { color: var(--ink); font: 400 19px var(--display); font-variant-numeric: tabular-nums; margin-left: 4px; letter-spacing: .5px; }
.ghost-btn.wide { width: 100%; font-size: 14.5px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 30; background: var(--ink); color: #fff; font: 800 15px var(--body); padding: 12px 18px; border-radius: 14px; border: 3px solid var(--yellow); box-shadow: 0 10px 30px rgba(27, 42, 74, .35); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { width: max-content; max-width: calc(100vw - 32px); white-space: normal; text-align: center; line-height: 1.35; }

/* ---------------- 20 questions / beat the clock modes ---------------- */
.mode-pick { margin: 0 auto 20px; max-width: 420px; }
.seg { display: flex; background: #f6eedb; border: 2.5px solid var(--ink); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 44px; border-radius: 11px; font: 400 18px var(--display); letter-spacing: .4px; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--sky); color: #fff; box-shadow: 0 0 0 2.5px var(--ink) inset, 0 3px 0 var(--ink); text-shadow: 0 2px 0 rgba(27, 42, 74, .3); }
.seg button[data-mode="clock"].on { background: var(--red); }
.mode-hint { margin: 10px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.45; text-wrap: balance; }
.mode-hint b { font-weight: 900; }
.start-card.clock .mode-hint b { color: #c2321c; }
.mode-hint span { display: block; color: var(--muted); font-size: 12.5px; }
.timer.clock .t-fg { stroke: var(--red); }
/* 20 questions: the stopwatch is just info, so it sits smaller and quieter than the countdown */
.timer:not(.clock) { transform: scale(.82); transform-origin: 50% 0; }
.timer:not(.clock) .t-fg { stroke: #9fd3f6; }
.timer:not(.clock) span { color: var(--muted); }
.timer.low .t-bg { fill: #ffe1da; }
.timer.low .t-fg { stroke: var(--no); }
.timer.low span { color: #c2321c; animation: qpulse .5s infinite; }
.timer.clock.low { animation: bump .5s; }
.res-top { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.mode-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font: 400 14px var(--display); letter-spacing: .4px; background: var(--sky); color: #fff; border: 2.5px solid var(--ink); }
.mode-badge.clock { background: var(--red); }
.mode-badge:empty { display: none; }
.bests { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; color: var(--ink); font-size: 13.5px; font-weight: 800; margin: -6px 0 12px; }
.bests b { font: 400 16px var(--display); letter-spacing: .3px; }
.bests:empty { display: none; }
.score small:empty { display: none; }
.hud-left { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mode-tag { display: none; padding: 3px 9px 2px; border-radius: 999px; font: 400 12px var(--display); letter-spacing: 1.5px; color: #fff; background: var(--red); border: 2.5px solid var(--ink); }
.mode-tag.show { display: inline-block; }

/* ---------------- phones ---------------- */
@media (max-width: 680px) {
  #app { padding: 8px 8px 12px; gap: 10px; }
  .stage-wrap, .panel, .qlog, .main { width: 100%; }
  .stage { aspect-ratio: 1 / 1; border-radius: 18px; }
  /* shrink the contestants a little so the bubbles fit above their heads */
  #cast { transform: translate(500px, 560px) scale(.8) translate(-500px, -560px); }
  .sign { transform: translate(500px, 0) scale(.86) translate(-500px, 0); }
  .hud { padding: 8px; }
  .timer { width: 46px; height: 46px; }
  .timer span { font-size: 13px; }
  .timer { border-width: 2.5px; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; border-width: 2.5px; }
  .score { font-size: 17px; padding: 3px 9px 3px 7px; gap: 2px; border-width: 2.5px; }
  .score > span { font-size: 13px; }
  .score small { font-size: 11px; }
  .hud-right { gap: 5px; }
  .seg button { font-size: 15.5px; white-space: nowrap; letter-spacing: .2px; }
  .mode-tag { font-size: 9.5px; letter-spacing: 1px; padding: 2px 6px 1px; border-width: 2px; }
  .bubble { border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  .bubble::after { width: 12px; height: 12px; border-width: 0 2.5px 2.5px 0; }
  .bubble-q { left: 2%; top: 20%; width: 47%; font-size: 13px; padding: 6px 9px; border-radius: 14px; text-align: center; transform-origin: 50% 100%; }
  .bubble-q::after { right: auto; left: calc(50% - 8px); top: auto; bottom: -9px; transform: rotate(45deg); }
  .bubble-a { left: auto; right: 2%; top: 20%; width: 47%; padding: 6px 6px 5px; border-radius: 14px; transform-origin: 50% 100%; }
  .bubble-a::after { left: calc(50% - 8px); top: auto; bottom: -9px; transform: rotate(45deg); }
  .bubble-a b { font-size: 24px; }
  .bubble-a.correct b, .bubble-a.invalid b { font-size: 16px; }
  .bubble-a small { font-size: 10.5px; margin-top: 2px; }
  .bubble-a.invalid small { font-size: 9.5px; line-height: 1.2; }
  .reveal { max-width: 74%; top: 84%; padding: 7px 16px 9px; }
  .reveal b { font-size: 24px; }
  .panel { padding: 10px; border-radius: 18px; }
  .ask-field { min-height: 60px; padding-left: 14px; }
  .ask-field input { font-size: 17px; }
  .ask-btn { width: 50px; padding: 0; justify-content: center; border-radius: 14px; }
  .ask-btn i { display: none; }
  .ask-btn span { font-size: 20px; }
  .ask-hint { font-size: 12.5px; }
  .history { max-height: 260px; }
  .h-item { font-size: 15px; padding: 8px 8px 8px 11px; }
  .h-item .tagA { font-size: 12.5px; padding: 4px 9px 3px; }
  .cats-easy { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 26px 14px 18px; }
}

/* wide screens: question log becomes a full-height sidebar next to the stage */
@media (min-width: 1000px) {
  :root { --stage-w: min(1400px, 100vw - 24px - 372px, (100dvh - 204px) * 1000 / 560); }
  .chip { font-size: 14.5px; padding: 8px 14px; }
  #app { flex-direction: row; align-items: stretch; justify-content: center; }
  .qlog { width: 360px; flex: none; max-height: calc(100dvh - 32px); position: sticky; top: 12px; }
  .history { max-height: none; }
  .main { width: var(--stage-w); }
  .stage-wrap, .panel { width: 100%; }
}

/* ---------------- Jev is resting (TypeSafe out of credit) ---------------- */
.overlay#restScreen { z-index: 20; }
.rest-card { width: min(440px, 100%); padding-top: 34px; }
.rest-zz { position: absolute; top: 16px; right: 18px; font: 400 18px var(--display); color: var(--sky); }
.rest-zz span { display: inline-block; animation: zz 2.4s ease-in-out infinite; }
.rest-zz span:nth-child(2) { font-size: .8em; animation-delay: .4s; }
.rest-zz span:nth-child(3) { font-size: .6em; animation-delay: .8s; }
@keyframes zz { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-6px); opacity: 1; } }
.rest-title { font: 400 clamp(28px, 7vw, 36px) / 1.1 var(--display); letter-spacing: .5px; margin: 4px 0 12px; }
.rest-body { color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0 0 16px; text-wrap: pretty; }
.rest-paused { display: none; margin: 0 0 16px; padding: 5px 14px; border-radius: 999px; background: #fff6d6; border: 2.5px solid var(--ink); font: 800 13.5px var(--body); }
.rest-card.clock .rest-paused { display: inline-block; }
.rest-card .go-btn { margin-bottom: 10px; background: var(--sky); }
.rest-card .go-btn:disabled { opacity: .6; }
.rest-banner { display: none; margin: 4px 0 14px; padding: 9px 14px; border-radius: 14px; background: #e9f6ff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.4; text-align: left; }
.rest-banner b { font-weight: 900; }
.rest-banner.show { display: block; }
.rest-banner.flash { animation: nudge .45s; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.bubble-a.huh { background: #e9f6ff; }
.timer.paused .t-fg { stroke: var(--slate); }
.timer.paused span { color: var(--slate); }
