/* Quiz Night — the show */
html, body.show { height: 100%; }
body.show { overflow: hidden; height: 100vh; height: 100dvh; overscroll-behavior: none; }
.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }

/* ------------------------------------------------ HUD */
.hud { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.spacer { flex: 1; }
.ribbon { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--paper); color: var(--paper-ink); font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.hud-score { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--edge) 70%, transparent); }
.hud-lbl { font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; opacity: 0.8; }
.hud-score b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--accent-l); font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.hud-score.bump b { animation: bump 0.45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.35); color: #fff; } }
.hud-streak { flex: none; white-space: nowrap; font-family: var(--display); font-size: 13px; padding: 3px 8px; border-radius: 8px; background: linear-gradient(180deg, #ffcf3a, #ff6a1a); color: #2a0e00; animation: bump 0.5s; }
.hud-prog { font-family: var(--display); font-size: 13px; padding: 0 10px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 12px; background: rgba(0, 0, 0, 0.35); }

/* ------------------------------------------------ scenes */
.screens { position: fixed; z-index: 10; left: 0; right: 0; top: calc(62px + var(--safe-t)); bottom: 0; }
.scene { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); }
.scene.enter { animation: scenein 0.5s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes scenein { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

/* the logo: two stacked words in the shaded face */
.logo { margin: 0; font-family: var(--shade); font-weight: 400; color: var(--accent); line-height: 0.92; letter-spacing: 0.02em; text-align: center; text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.logo span { display: block; font-size: clamp(46px, min(16vw, 10.5svh), 112px); }
.logo-n { color: var(--ink); }
.logo-sm span { font-size: clamp(42px, min(15vw, 9svh), 96px); }

/* ------------------------------------------------ cover */
.cover-in { min-height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 8px 0 12px; }
.onair { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border-radius: 10px; font-family: var(--display); font-size: 15px; letter-spacing: 0.1em; color: #fff; background: #d8142f; box-shadow: 0 0 0 3px #3a0710, 0 0 30px rgba(255, 30, 60, 0.6); animation: onair 1.6s ease-in-out infinite; }
.onair-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
@keyframes onair { 50% { box-shadow: 0 0 0 3px #3a0710, 0 0 8px rgba(255, 30, 60, 0.2); opacity: 0.85; } }
.cover-kicker { margin: 0; font-family: var(--display); font-size: clamp(13px, 3.6vw, 16px); letter-spacing: 0.06em; color: var(--accent-l); }
.cover-title { margin: 0; font-weight: 800; font-size: clamp(19px, 5.4vw, 26px); line-height: 1.2; }
.cover-line { margin: 0; max-width: 30em; color: var(--muted); font-size: 16px; }
.cover-note { margin: 0; color: var(--muted); font-size: 14px; }
.notice { margin: 0; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.4); font-size: 14px; }
.cover-in .btn-big { margin-top: 6px; }

/* ------------------------------------------------ show open */
.open-in { min-height: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 6px 0 12px; position: relative; }
.marquee { position: relative; padding: 26px 30px 28px; border-radius: 26px; background: var(--panel); box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 4px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 60px color-mix(in srgb, var(--accent) 30%, transparent); }
.marquee .logo span { font-size: clamp(40px, min(13.5vw, 8.6svh), 96px); }
.marquee-sub { margin: 6px 0 0; font-weight: 800; font-size: clamp(14px, 4vw, 18px); }
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff8dc; box-shadow: 0 0 6px 2px var(--accent-l), 0 0 14px var(--accent); animation: chase 0.9s steps(1) infinite; }
@keyframes chase { 50% { background: #6a5a3a; box-shadow: none; } }
.open-kicker { margin: 4px 0 0; font-family: var(--display); font-size: clamp(14px, 4vw, 18px); letter-spacing: 0.08em; color: var(--accent-l); }
.open-name { font-family: var(--display); font-weight: 400; font-size: clamp(40px, min(14vw, 9svh), 100px); line-height: 1; color: #fff; overflow-wrap: anywhere; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px var(--accent); }
.open-host { display: grid; grid-template-columns: clamp(78px, 22vw, 120px) 1fr; gap: 10px; align-items: center; width: 100%; max-width: 460px; text-align: left; }
.open-host .bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-left: 0; border-right-color: var(--paper); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rules li { padding: 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18); font-weight: 700; font-size: 14px; }
.skip { position: absolute; right: 0; bottom: 0; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }
.sc-open .row { min-height: 66px; }
/* sequence states */
.sc-open [data-seq] { opacity: 0; }
.sc-open [data-seq].in { opacity: 1; animation: seqin 0.6s cubic-bezier(.2, 1.5, .4, 1); }
.sc-open .open-name.in { animation: slam 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes seqin { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.4); filter: blur(6px); } 60% { transform: scale(0.94); filter: none; } 100% { opacity: 1; transform: scale(1); } }

/* ------------------------------------------------ question */
.q-wrap { max-width: 680px; margin: 0 auto; min-height: 100%; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 2px 0 6px; }
.q-top { display: grid; grid-template-columns: clamp(56px, 16vw, 84px) 1fr; gap: 8px; align-items: center; }
.bubble-q { min-height: 52px; display: flex; align-items: center; }
.bubble-q::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right-color: var(--paper); }
.bubble-q p { font-size: 14.5px; }
.q-stack { display: flex; flex-direction: column; gap: 10px; }
.q-stack.enter .q-card { animation: cardin 0.55s cubic-bezier(.2, 1.4, .4, 1); }
.q-stack.enter .tile, .q-stack.enter .sl-box, .q-stack.enter .fin-box { animation: tilein 0.45s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.q-stack.enter .tile:nth-child(2) { animation-delay: 0.07s; }
.q-stack.enter .tile:nth-child(3) { animation-delay: 0.14s; }
.q-stack.enter .tile:nth-child(4) { animation-delay: 0.21s; }
@keyframes cardin { from { opacity: 0; transform: perspective(700px) rotateX(-40deg) translateY(-20px); } }
@keyframes tilein { from { opacity: 0; transform: translateY(18px) scale(0.85); } }

.q-card { position: relative; padding: 12px 16px 16px; border-radius: 20px; background: var(--panel); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--edge) 85%, transparent), 0 0 0 3px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.q-card::after { content: ''; position: absolute; inset: 3px; border-radius: 17px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 40%); pointer-events: none; }
.q-card.is-final { box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 3px rgba(0, 0, 0, 0.45), 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent); }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-meta span { font-family: var(--display); font-size: 11.5px; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 8px; line-height: 1.1; }
.q-num { background: var(--accent); color: var(--on-accent); }
.q-type { background: rgba(255, 255, 255, 0.12); }
.q-final { background: #ff3b4e; color: #fff; animation: onair 1.2s ease-in-out infinite; }
.q-text { margin-top: 10px; font-family: var(--body); font-weight: 800; font-size: clamp(19px, min(5.3vw, 3.5svh), 30px); line-height: 1.22; text-wrap: balance; overflow-wrap: anywhere; }
.q-blank { margin: 10px 0 0; }
.q-blank span { display: block; width: 72%; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 22px); }

.q-answers { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.q-answers.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.q-answers.one-col { grid-template-columns: minmax(0, 1fr); }
.q-answers.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: clamp(58px, 7.4svh, 84px); padding: 10px 12px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  font-family: var(--body); font-weight: 800; font-size: clamp(15.5px, 4.2vw, 18px); line-height: 1.2; color: #170f1c;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 72%, #fff) 0%, var(--tc) 55%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 5px 0 color-mix(in srgb, var(--tc) 50%, #000), 0 10px 22px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s, opacity 0.25s, filter 0.25s, box-shadow 0.12s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; overflow-wrap: anywhere;
}
.tile:hover { filter: brightness(1.06); }
.tile:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 2px 0 color-mix(in srgb, var(--tc) 50%, #000); }
.tile-key { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.22); color: #fff; font-family: var(--display); font-size: 15px; }
.tile-text { min-width: 0; }
.tile:disabled { cursor: default; }
.tile.dim { opacity: 0.38; filter: saturate(0.4); }
.tile.picked { opacity: 1; filter: none; animation: picked 0.32s ease-in-out infinite alternate; box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 255, 255, 0.6), 0 5px 0 color-mix(in srgb, var(--tc) 50%, #000); }
@keyframes picked { to { transform: scale(1.03); } }
.tile.is-right { background: linear-gradient(180deg, #8ff0b8 0%, var(--ok) 55%); opacity: 1; filter: none; animation: right 0.6s cubic-bezier(.2, 1.7, .4, 1); box-shadow: 0 0 0 4px #fff, 0 0 40px var(--ok), 0 5px 0 #127a44; }
.tile.is-wrong { background: linear-gradient(180deg, #ff9aa5 0%, var(--bad) 55%); opacity: 1; filter: none; animation: wrong 0.5s; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 5px 0 #8a1020; }
.tile.is-right::after, .tile.is-key::after { content: '✓'; position: absolute; top: -9px; right: -6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #127a44; font-weight: 900; font-size: 17px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
.tile.is-wrong::after { content: '✗'; position: absolute; top: -9px; right: -6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #b0122a; font-weight: 900; font-size: 17px; }
.tile.gone { opacity: 0.12; transform: scale(0.94); pointer-events: none; filter: grayscale(1); }
@keyframes right { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes wrong { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.t-tf .tile { flex-direction: column; justify-content: center; text-align: center; min-height: clamp(84px, 19svh, 170px); font-family: var(--display); font-weight: 400; font-size: clamp(20px, 6vw, 30px); gap: 6px; }
.t-tf .tile-key { width: 40px; height: 40px; font-size: 22px; }
.t-who .tile { flex-direction: column; justify-content: center; text-align: center; gap: 6px; min-height: clamp(108px, 17svh, 160px); padding: 10px 6px; font-size: clamp(14px, 3.9vw, 17px); }
.t-who .tile-key { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; font-size: 12px; }
.av { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18); font-family: var(--display); font-size: 21px; color: #170f1c; }
.av-both { display: flex; width: auto; background: none; box-shadow: none; }
.av-both span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18); font-size: 17px; }
.av-both span + span { margin-left: -10px; }

/* slider */
.sl-box { padding: 12px 14px 14px; border-radius: 20px; background: var(--panel); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16), 0 10px 26px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 8px; }
.sl-read { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.sl-val { font-family: var(--display); font-size: clamp(44px, min(14vw, 8svh), 72px); line-height: 1; color: var(--accent-l); font-variant-numeric: tabular-nums; text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent); }
.sl-unit { font-weight: 800; font-size: 18px; color: var(--muted); }
.sl-row { display: grid; grid-template-columns: 48px 1fr 48px; gap: 10px; align-items: center; }
.sl-step { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24); font-size: 26px; font-weight: 800; line-height: 1; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sl-step:active { transform: scale(0.92); }
.sl-track { position: relative; }
.sl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 48px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; --p: 50%; }
.sl-range::-webkit-slider-runnable-track { height: 16px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), rgba(255, 255, 255, 0.16) var(--p)); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); }
.sl-range::-moz-range-track { height: 16px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), rgba(255, 255, 255, 0.16) var(--p)); }
.sl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 36px; height: 36px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--accent-l) 40%, var(--accent)); border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
.sl-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; }
.sl-range:disabled { cursor: default; }
.sl-answer { position: absolute; top: 4px; width: 0; height: 40px; pointer-events: none; animation: tilein 0.5s cubic-bezier(.2, 1.5, .4, 1); }
.sl-answer::before { content: ''; position: absolute; left: -2px; top: 0; width: 4px; height: 40px; border-radius: 2px; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.sl-answer-lbl { position: absolute; bottom: 42px; left: 0; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: var(--ok); color: #05210f; font-family: var(--display); font-size: 14px; white-space: nowrap; }
.sl-ends { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; color: var(--muted); padding: 0 58px; margin-top: -6px; }
.sl-box .lock { width: 100%; }
.sl-box.is-preview .sl-answer { animation: none; }

/* finish the sentence */
.fin-box { display: flex; flex-direction: column; gap: 8px; }
.fin-row { display: flex; gap: 8px; }
.fin-input { flex: 1; min-width: 0; min-height: 56px; padding: 0 14px; border-radius: 16px; border: 0; background: var(--paper); color: var(--paper-ink); font-weight: 700; font-size: 18px; box-shadow: inset 0 0 0 3px var(--edge), 0 8px 20px rgba(0, 0, 0, 0.3); }
.fin-input::placeholder { color: #8b8392; font-weight: 600; }
.fin-input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.fin-row .lock { flex: none; min-height: 56px; }
.fin-hint { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.4); font-weight: 700; font-size: 15px; text-align: center; letter-spacing: 0.03em; }
.fin-reveal { margin: 0; padding: 10px 14px; border-radius: 16px; background: var(--ok); color: #05210f; display: flex; flex-direction: column; animation: tilein 0.5s cubic-bezier(.2, 1.5, .4, 1); }
.fin-reveal-k { font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; }
.fin-reveal b { font-size: 20px; overflow-wrap: anywhere; }
.fin-input.is-right { box-shadow: inset 0 0 0 4px var(--ok); }
.fin-input.is-wrong { box-shadow: inset 0 0 0 4px var(--bad); animation: wrong 0.5s; }

/* timer + lifelines */
.q-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.timer { position: relative; height: 18px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); overflow: hidden; }
.timer-fill { position: absolute; inset: 0; transform-origin: left center; background: linear-gradient(90deg, var(--accent-l), var(--accent)); border-radius: 99px; }
.timer.urgent .timer-fill { background: linear-gradient(90deg, #ff9a9a, var(--bad)); animation: urgent 0.5s ease-in-out infinite alternate; }
@keyframes urgent { to { filter: brightness(1.4); } }
.timer-n { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.lifelines { display: flex; gap: 8px; }
.life { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; cursor: pointer; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--edge) 60%, transparent); font-weight: 800; font-size: 14.5px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.life-ic { font-family: var(--display); font-size: 15px; color: var(--accent-l); }
.life:disabled { opacity: 0.35; cursor: default; text-decoration: line-through; }
.life:not(:disabled):active { transform: scale(0.96); }

/* reaction lower-third */
.react { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; padding: 40px calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 40%, transparent); }
.react-in { max-width: 640px; margin: 0 auto; padding: 12px 14px 14px; border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 3px var(--edge), 0 0 0 3px rgba(0, 0, 0, 0.5), 0 -10px 40px rgba(0, 0, 0, 0.5); animation: reactin 0.5s cubic-bezier(.2, 1.3, .4, 1); display: flex; flex-direction: column; gap: 8px; max-height: calc(100svh - 120px); overflow-y: auto; }
.react.ok .react-in { box-shadow: inset 0 0 0 3px var(--ok), 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 40px color-mix(in srgb, var(--ok) 45%, transparent); }
.react.bad .react-in { box-shadow: inset 0 0 0 3px var(--bad), 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 40px color-mix(in srgb, var(--bad) 40%, transparent); }
@keyframes reactin { from { transform: translateY(110%); } }
.react-row { display: grid; grid-template-columns: clamp(70px, 20vw, 104px) 1fr; gap: 10px; align-items: end; }
.react-bubble { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 18px; padding: 10px 14px 12px; align-self: center; }
.react-bubble::before { content: ''; position: absolute; left: -9px; bottom: 18px; border: 9px solid transparent; border-left: 0; border-right-color: var(--paper); }
.react-who { margin: 0 0 2px; font-family: var(--display); font-size: 12px; letter-spacing: 0.05em; color: color-mix(in srgb, var(--accent-d) 80%, #000); }
.react-line { margin: 0; font-weight: 700; font-size: clamp(16px, 4.4vw, 19px); line-height: 1.3; min-height: 2.6em; overflow-wrap: anywhere; }
.react-answer { margin: 0; font-size: 15px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.react-answer .k { font-family: var(--display); font-size: 11px; letter-spacing: 0.06em; opacity: 0.8; }
.react-answer b { overflow-wrap: anywhere; }
.react-pts { margin: 0; font-family: var(--display); font-size: 15px; color: var(--accent-l); }
.react .row .btn { flex: 1; max-width: 340px; }
.react .row #b-appeal { flex: 0 1 auto; }

/* stamp, banner, flying points */
.stamp { position: fixed; z-index: 60; left: 50%; top: 38%; pointer-events: none; padding: 8px 22px; border-radius: 18px; border: 6px solid #fff; font-family: var(--display); font-size: clamp(40px, 13vw, 110px); line-height: 1; color: #fff; white-space: nowrap; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35), 0 20px 60px rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%) rotate(-8deg); animation: stampin 1.2s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.stamp.ok { background: var(--ok); }
.stamp.bad { background: var(--bad); }
.stamp.gold { background: linear-gradient(180deg, #ffe58a, #e9a80f); color: #3a2400; }
@keyframes stampin { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(3); } 18% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(0.92); } 26% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.05); } }
.banner { position: fixed; inset: 0; z-index: 55; display: grid; place-content: center; text-align: center; gap: 6px; padding: 20px; background: radial-gradient(circle, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.88)); }
.banner p { margin: 0; }
.banner-k { font-family: var(--display); font-size: clamp(14px, 4vw, 20px); letter-spacing: 0.1em; color: var(--accent-l); animation: seqin 0.6s 0.1s backwards; }
.banner-t { font-family: var(--shade); font-size: clamp(42px, min(13vw, 14svh), 128px); line-height: 0.95; color: var(--accent); animation: slam 0.7s 0.4s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.banner-s { font-family: var(--display); font-size: clamp(20px, 6vw, 34px); color: #fff; animation: seqin 0.6s 1.1s backwards; }
.fly { position: fixed; z-index: 65; pointer-events: none; font-family: var(--display); font-size: 28px; color: var(--accent-l); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 0 18px var(--accent); transform: translate(-50%, -50%); }

/* screen shake for wrong answers */
.shake { animation: shake 0.45s; }
@keyframes shake { 15% { transform: translate(-7px, 2px); } 30% { transform: translate(6px, -3px); } 45% { transform: translate(-5px, 1px); } 60% { transform: translate(4px, 2px); } 80% { transform: translate(-2px, -1px); } }

/* ------------------------------------------------ results */
.res-in { min-height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 4px 0 10px; }
.res-kicker { font-family: var(--display); font-weight: 400; font-size: clamp(15px, 4.4vw, 20px); letter-spacing: 0.08em; color: var(--accent-l); }
.res-score { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.res-score b { font-family: var(--display); font-weight: 400; font-size: clamp(60px, min(21vw, 13svh), 140px); color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 0 40px var(--accent); }
.res-score span { font-family: var(--display); font-size: 15px; letter-spacing: 0.1em; margin-top: 4px; }
.res-correct { margin: 0; font-weight: 800; font-size: 18px; }
.res-stars { display: flex; gap: 6px; font-size: 30px; line-height: 1; min-height: 30px; }
.res-stars span { filter: grayscale(1) brightness(0.5); transition: filter 0.3s, transform 0.3s; }
.res-stars span.on { filter: none; animation: hpop 0.5s cubic-bezier(.3, 1.8, .5, 1); }
.res-rank { display: flex; flex-direction: column; align-items: center; padding: 8px 20px 10px; border-radius: 16px; background: var(--accent); color: var(--on-accent); transform: rotate(-3deg); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), 0 6px 0 var(--accent-d), 0 14px 40px rgba(0, 0, 0, 0.45); opacity: 0; }
.res-rank.in { opacity: 1; animation: rankin 0.7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes rankin { 0% { opacity: 0; transform: rotate(-3deg) scale(2.6); } 60% { transform: rotate(-3deg) scale(0.94); } 100% { opacity: 1; transform: rotate(-3deg) scale(1); } }
.res-rank-k { font-family: var(--display); font-size: 11px; letter-spacing: 0.1em; opacity: 0.8; }
.res-rank b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 7vw, 40px); line-height: 1.05; overflow-wrap: anywhere; }
.res-host { display: grid; grid-template-columns: clamp(66px, 18vw, 96px) 1fr; gap: 10px; align-items: center; width: 100%; max-width: 460px; text-align: left; }
.res-host .bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-left: 0; border-right-color: var(--paper); }
.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 460px; }
.res-actions .btn { min-height: 52px; font-size: 15.5px; padding: 0 10px; }
.res-actions #b-msg { grid-column: 1 / -1; min-height: 56px; font-size: 17px; }
.res-links { margin: 2px 0 0; }
.res-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; color: var(--accent-l); }

/* ------------------------------------------------ modals */
.sheet { width: 100%; max-width: 440px; padding: 18px; border-radius: 24px; background: var(--panel); box-shadow: inset 0 0 0 3px var(--edge), 0 30px 80px rgba(0, 0, 0, 0.6); text-align: center; display: flex; flex-direction: column; gap: 10px; animation: seqin 0.4s cubic-bezier(.2, 1.4, .4, 1); }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 22px; }
.sheet-sub { margin: 0; color: var(--muted); font-size: 15px; }
.card-pv { position: relative; margin: 0 auto; height: min(56svh, 560px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 16px; overflow: hidden; background: rgba(0, 0, 0, 0.4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.card-pv img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-pv img:not([src]) { visibility: hidden; }
.card-wait { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 16px; color: var(--muted); }

.tv { width: 100%; max-width: 560px; padding: 16px 16px 14px; border-radius: 30px; background: linear-gradient(160deg, #6b4a2c, #3a2414 60%, #24160b); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12), inset 0 -8px 0 rgba(0, 0, 0, 0.3), 0 30px 80px rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; gap: 12px; animation: seqin 0.45s cubic-bezier(.2, 1.4, .4, 1); }
.tv-screen { position: relative; border-radius: 26px / 34px; background: #0b0f10; box-shadow: inset 0 0 0 6px #111, inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 0 4px #1a1a1a; overflow: hidden; max-height: calc(100svh - 190px); min-height: 220px; display: flex; }
.tv-static { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; z-index: 2; transition: opacity 0.3s; }
.tv-static.on { opacity: 1; }
.tv-body { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 22px 22px 24px; color: #effff6; text-shadow: 0 0 8px rgba(160, 255, 210, 0.45); }
.tv-body::after { content: ''; position: fixed; pointer-events: none; }
.tv-screen::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55)); }
.tv-k { margin: 0 0 12px; font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; color: var(--accent-l); }
.tv-text p { margin: 0 0 12px; font-weight: 600; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.polaroid { margin: 0 auto 14px; width: min(220px, 70%); padding: 8px 8px 22px; background: #fff; border-radius: 4px; transform: rotate(-3deg); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #ddd; }
.ticket { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 3px dashed var(--accent); background: rgba(255, 255, 255, 0.06); text-shadow: none; }
.ticket-k { font-family: var(--display); font-size: 11px; letter-spacing: 0.1em; color: var(--accent-l); }
.ticket b { font-size: 18px; overflow-wrap: anywhere; }
.tv-knobs { display: flex; justify-content: flex-end; gap: 10px; margin-top: -4px; }
.tv-knobs span { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #aaa, #333); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.nojs { position: fixed; inset: auto 16px 16px; z-index: 99; padding: 12px; border-radius: 12px; background: var(--paper); color: var(--paper-ink); }

/* ------------------------------------------------ bigger screens */
@media (min-width: 760px) {
  .q-top { grid-template-columns: 92px 1fr; }
  .bubble-q p { font-size: 16px; }
  .tile { min-height: 70px; }
  .react-row { grid-template-columns: 120px 1fr; }
}
@media (min-width: 1000px) and (min-height: 760px) {
  .q-wrap { max-width: 760px; gap: 14px; padding-top: 10px; }
  .q-text { font-size: 32px; }
  .tile { min-height: 78px; font-size: 20px; }
  .t-tf .tile { min-height: 140px; }
}

/* ------------------------------------------------ short screens (in-app browsers, landscape) */
@media (max-height: 700px) {
  .screens { top: calc(58px + var(--safe-t)); }
  .q-wrap { gap: 8px; }
  .q-stack { gap: 8px; }
  .q-answers { gap: 8px; }
  .tile { min-height: 52px; padding: 8px 10px; }
  .t-who .tile { min-height: 92px; }
  .q-card { padding: 10px 14px 12px; }
  .q-text { margin-top: 8px; }
  .open-in, .cover-in, .res-in { gap: 8px; }
  .open-host { grid-template-columns: 76px 1fr; }
  .res-host { grid-template-columns: 64px 1fr; }
}
@media (max-height: 620px) {
  .q-top { grid-template-columns: 50px 1fr; }
  .bubble-q { min-height: 44px; padding: 8px 12px; }
  .bubble-q p { font-size: 14px; }
  .q-text { font-size: clamp(17px, 4.8vw, 22px); }
  .tile { min-height: 48px; font-size: 15px; }
  .tile-key { width: 28px; height: 28px; font-size: 13px; }
  .t-tf .tile { min-height: 72px; }
  .t-who .tile { min-height: 84px; }
  .av { width: 38px; height: 38px; font-size: 18px; }
  .sl-val { font-size: 40px; }
  .marquee { padding: 16px 20px 12px; }
  .marquee .logo span { font-size: clamp(34px, 11vw, 60px); }
  .open-name { font-size: clamp(36px, 12vw, 64px); }
  .res-score b { font-size: clamp(54px, 18vw, 80px); }
  .res-actions .btn { min-height: 48px; }
  .react-row { grid-template-columns: 64px 1fr; }
  .react-line { font-size: 16px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .screens { top: calc(54px + var(--safe-t)); }
  .hud { padding-top: calc(6px + var(--safe-t)); padding-bottom: 4px; }
  .q-wrap { max-width: 920px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "top answers" "card answers" "card foot"; column-gap: 14px; row-gap: 8px; align-items: start; }
  .q-top { grid-area: top; grid-template-columns: 46px 1fr; }
  .q-stack { display: contents; }
  .q-card { grid-area: card; }
  .q-answers { grid-area: answers; align-self: start; }
  .q-foot { grid-area: foot; margin-top: 0; }
  .q-text { font-size: 19px; }
  .tile { min-height: 46px; font-size: 15px; }
  .t-tf .tile { min-height: 84px; }
  .t-who .tile { min-height: 84px; }
  .sl-box { gap: 4px; padding: 8px 12px 10px; }
  .sl-val { font-size: 36px; }
  .open-in { display: grid; grid-template-columns: 1fr 1fr; align-content: center; column-gap: 20px; row-gap: 8px; max-width: 820px; }
  .open-in .marquee { grid-column: 1; grid-row: 1 / span 3; }
  .open-in .open-kicker, .open-in .open-name, .open-in .open-host, .open-in .rules, .open-in .row { grid-column: 2; }
  .open-name { font-size: 40px; }
  .open-host { grid-template-columns: 64px 1fr; }
  .marquee .logo span { font-size: 54px; }
  .rules li { font-size: 13px; padding: 4px 10px; }
  .cover-in .logo-sm span { font-size: 40px; }
  .cover-in { gap: 6px; }
  .res-in { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: 6px; max-width: 860px; align-content: center; }
  .res-in > * { grid-column: 1; }
  .res-in .res-host, .res-in .res-actions, .res-in .res-links { grid-column: 2; }
  .res-in .res-host { grid-row: 1 / span 2; }
  .res-in .res-actions { grid-row: 3 / span 3; }
  .res-score b { font-size: 64px; }
  .react { padding-top: 12px; }
  .react-in { max-width: 760px; max-height: calc(100svh - 70px); }
  .react-row { grid-template-columns: 60px 1fr; }
  .card-pv { height: min(64svh, 320px); }
  .stamp { top: 50%; }
}
@media (max-width: 400px) {
  .hud { gap: 6px; }
  .hud-lbl { display: none; }
  .hud-score { padding: 0 10px; gap: 6px; }
  .hud-prog { padding: 0 8px; }
}
@media (max-height: 700px) {
  .res-in { gap: 6px; }
  .res-score b { font-size: clamp(52px, min(17vw, 11svh), 96px); }
  .res-stars { font-size: 22px; min-height: 22px; }
  .res-rank { padding: 6px 16px 8px; }
  .res-rank b { font-size: clamp(20px, 6vw, 30px); }
  .res-actions { gap: 8px; }
  .res-actions .btn { min-height: 46px; font-size: 14.5px; }
  .res-actions #b-msg { min-height: 48px; font-size: 16px; }
  .res-host .bubble { padding: 8px 12px; }
  .res-host .bubble p { font-size: 14px; }
  .res-links a { min-height: 44px; }
}
@media (max-width: 359px) {
  .q-answers.three { gap: 6px; }
  .t-who .tile { font-size: 13.5px; }
  .res-actions { grid-template-columns: 1fr; }
}
/* headings that receive focus programmatically (for screen readers) never show a ring */
.q-text:focus, .q-text:focus-visible, #res-title:focus, #res-title:focus-visible, .tv-body:focus, .tv-body:focus-visible { outline: none; box-shadow: none; }
/* the reaction sheet slides up inside its own box, so it never makes the scene scroll */
.react { overflow: hidden; }

/* tighter fits for short screens */
@media (max-height: 700px) {
  .sc-open .row { min-height: 60px; }
  .open-in { padding-bottom: 4px; }
}
@media (max-height: 620px) {
  .open-in { gap: 6px; }
  .open-kicker { margin-top: 0; }
  .rules li { padding: 4px 10px; font-size: 13px; }
  .res-stars { display: none; }
  .res-correct { font-size: 16px; }
  .res-host { grid-template-columns: 56px 1fr; }
  .res-host .bubble p { font-size: 13.5px; }
  .res-score span { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .cover-in .logo-sm span { display: inline; font-size: 36px; }
  .cover-in .logo-sm .logo-n { margin-left: 0.3em; }
  .onair { padding: 4px 12px; font-size: 13px; }
  .cover-line { font-size: 15px; }
  .cover-in .btn-big { min-height: 52px; margin-top: 2px; }
  .open-in .rules { display: none; }
  .res-in { row-gap: 4px; }
  .res-score b { font-size: 56px; }
  .res-actions .btn { min-height: 44px; }
  .res-actions #b-msg { min-height: 46px; }
}
@media (max-height: 660px) and (orientation: portrait) {
  .marquee { padding: 20px 24px 22px; }
  .marquee .logo span { font-size: clamp(36px, 12vw, 70px); }
  .open-in { gap: 6px; }
}
