:root {
  --page: #080e18;
  --panel: #111c2a;
  --field: #091321;
  --line: #2d4056;
  --orange: #ffad66;
  --ice: #a9dff5;
  --green: #8fe0b5;
  --violet: #c9b8ff;
  --gold: #f5d284;
  --rail: 232px;
}
body {
  background: var(--page);
}
body[data-mode="trivia"] { --accent: #a9dff5; }
body[data-mode="blitz"] { --accent: #ffad66; }
body[data-mode="teams"] { --accent: #8fe0b5; }
.studio-main {
  background-image: radial-gradient(ellipse at 84% 0%, #24446255, transparent 48%), linear-gradient(#8da8c008 1px, transparent 1px), linear-gradient(90deg, #8da8c008 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}
.studio-rail {
  background: linear-gradient(160deg, #15253a, #0b1421 58%, #080f19);
  box-shadow: 12px 0 50px #0002;
}
.mode-switch { scrollbar-width: thin; scrollbar-color: #38516b transparent; }
.mode-switch a { padding-right: 7px; }
.mode-switch a[aria-current] {
  border-color: color-mix(in srgb, var(--accent) 34%, #2d4056);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 15%, #172231), #182231);
  color: var(--text);
}
.mode-switch a[aria-current]::before { background: var(--accent); }
.mode-switch a[aria-current] .icon { color: var(--accent); background: transparent; }
.nav-badge {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid #47617d;
  border-radius: 3px;
  color: #bfd0e0;
  font: 600 .58rem/1.2 var(--mono);
  letter-spacing: .03em;
}
.nav-badge.new { border-color: #72553e; color: #ffc18f; background: #ffad660c; }
.rail-roster { padding-bottom: 3px; }
.utilities button { border-radius: 4px; padding-inline: 8px; }
.utilities button:hover { background: #182638; }
#sound-toggle.is-muted { color: #8192a6; }
.hero {
  min-height: clamp(250px, 20vw, 322px);
  border-color: #3c5068;
  box-shadow: 0 22px 65px #0003, inset 0 1px #ffffff08;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #b9d7ef06 3px 4px);
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: 2;
  width: 38px;
  height: 38px;
  right: 15px;
  top: 15px;
  border-top: 1px solid #b8d6ec70;
  border-right: 1px solid #b8d6ec70;
  pointer-events: none;
}
.hero-copy { width: 68%; }
.hero h1 { text-shadow: 0 3px 30px #0007; }
.round-label { text-shadow: 0 1px 12px #000; }
.panel {
  box-shadow: inset 0 1px #ffffff05, 0 12px 36px #00000012;
}
.primary {
  position: relative;
  box-shadow: inset 0 1px #ffffff35, 0 4px 18px #ffad6612;
}
.primary:active { transform: translateY(1px) scale(.99); }
.answer-option, .rank-pick { box-shadow: inset 0 1px #ffffff06; }
.answer-option:not(:disabled):active, .rank-pick:active { transform: scale(.985); }
.answer-option.is-right { box-shadow: inset 3px 0 #8fe0b5; }
.answer-option.is-wrong { box-shadow: inset 3px 0 #ff9c96; }
.question-card { overflow: hidden; }
.question-card::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 2px;
  background: var(--accent);
  opacity: .55;
}
.gallery-card { box-shadow: inset 0 1px #ffffff07; }
.cover-trivia { --cover: url("assets/arena-night.webp"); }
.cover-blitz { --cover: url("assets/mystery-stage.webp"); }
.cover-teams { --cover: url("assets/broadcast-cup.webp"); }

.extra-lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .7fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}
.extra-setup { min-width: 0; border-top: 2px solid var(--accent); }
.setup-intro { max-width: 650px; }
.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font: 650 .68rem/1.3 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.setup-intro h2 { font: 900 clamp(1.8rem, 3.1vw, 2.9rem)/1.03 var(--display); }
.setup-intro p { margin-top: 10px; max-width: 56ch; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.setup-options { display: flex; flex-wrap: wrap; align-items: end; gap: 18px; }
.setup-option { margin-top: 24px; }
.setup-label { display: block; margin-bottom: 8px; color: #b9cadb; font-size: .77rem; font-weight: 600; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid #3b5068; border-radius: 5px; background: #091321; }
.segmented button {
  min-width: 54px;
  min-height: 39px;
  padding: 0 13px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #aebdce;
  font: 650 .82rem var(--mono);
}
.segmented button:hover { color: white; background: #1b2b3e; }
.segmented button.selected { color: #101820; background: var(--accent); }
.category-select { display: block; min-width: 175px; margin-top: 24px; }
.category-select select {
  width: 100%;
  min-height: 47px;
  padding: 0 35px 0 12px;
  border: 1px solid #3b5068;
  border-radius: 4px;
  background: #0a1523;
  color: var(--text);
}
.extra-setup > .primary { margin-top: 24px; }
.setup-aside {
  padding: 9px 0;
  border-block: 1px solid #30445a;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.feature-list { width: 100%; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: 12px; padding: 17px 5px; }
.feature-list li + li { border-top: 1px solid #2b3e52; }
.feature-list .icon { width: 21px; height: 21px; margin-top: 1px; color: var(--accent); }
.feature-list strong, .feature-list span { display: block; }
.feature-list strong { font-size: .9rem; font-weight: 650; }
.feature-list span { margin-top: 4px; color: #9fb0c3; font-size: .77rem; line-height: 1.45; }
.team-name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.team-name-field { display: grid; gap: 7px; padding: 11px; border: 1px solid #344a61; border-left: 3px solid var(--team-color); border-radius: 4px; background: #0a1523; }
.team-name-field > span { color: #9fb2c5; font-size: .7rem; }
.team-name-field input { width: 100%; padding: 4px 0; border: 0; border-bottom: 1px solid #344a61; outline: 0; background: transparent; color: var(--text); font-weight: 650; }
.team-name-field input:focus { border-color: var(--team-color); }
.orange { --team-color: #ffad66; }
.ice { --team-color: #a9dff5; }
.violet { --team-color: #c9b8ff; }
.green { --team-color: #8fe0b5; }
.check-setting { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-top: 12px; color: #c3d0dc; font-size: .85rem; cursor: pointer; }
.check-setting input { width: 18px; height: 18px; accent-color: var(--accent); }
.team-names > .primary { margin-top: 10px; }
.timer-box { margin: 16px 0 4px; padding: 11px 13px 9px; border: 1px solid #425a74; border-left: 3px solid var(--accent); background: #081321; }
.timer-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.timer-readout span { color: #aebfd0; font: 650 .67rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.timer-readout strong { color: var(--accent); font: 900 1.8rem/1 var(--display); font-variant-numeric: tabular-nums; }
.timer-track { height: 3px; margin-top: 9px; overflow: hidden; background: #2c4055; }
.timer-fill { display: block; width: 100%; height: 100%; transform-origin: left; background: var(--accent); }
.timer-box.urgent { border-color: #aa5757; }
.timer-box.urgent .timer-readout strong { color: #ff9c96; }
.timer-box.urgent .timer-fill { background: #ff8f87; }
.linear-progress { height: 5px; margin: 0 0 15px; overflow: hidden; border-radius: 1px; background: #2b3b50; }
.linear-progress i { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }
.streak-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid #354960; color: #b8c8d7; font-size: .76rem; }
.current-team { margin: 6px 0 15px; color: var(--team-color); font: 900 1.55rem/1.05 var(--display); overflow-wrap: anywhere; }
.team-scoreboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.team-score { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 14px; border: 1px solid #354a60; border-top: 3px solid var(--team-color); border-radius: 4px; background: #101e2e; }
.team-score.active { border-color: var(--team-color); background: color-mix(in srgb, var(--team-color) 8%, #101e2e); }
.team-score span { min-width: 0; overflow-wrap: anywhere; color: #d0dae4; font-size: .82rem; font-weight: 600; }
.team-score strong { color: var(--team-color); font: 900 2rem/1 var(--display); }
.team-scoreboard.compact { grid-template-columns: 1fr; gap: 5px; margin: 0; }
.team-scoreboard.compact .team-score { padding: 7px 9px; border-width: 1px 1px 1px 2px; }
.team-scoreboard.compact .team-score strong { font-size: 1.1rem; }
.team-scoreboard.compact .team-score span { font-size: .7rem; }
.handoff-panel { display: flex; flex-direction: column; align-items: center; max-width: 760px; margin: 16px auto 0; padding-block: clamp(28px, 5vw, 58px); text-align: center; }
.handoff-badge { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 20px; border: 1px solid var(--team-color); border-radius: 50%; color: var(--team-color); background: color-mix(in srgb, var(--team-color) 8%, #101b29); }
.handoff-badge .icon { width: 27px; height: 27px; }
.handoff-panel h2 { color: var(--team-color, var(--text)); font: 900 clamp(2rem, 5vw, 4rem)/1 var(--display); }
.handoff-panel > p { max-width: 47ch; margin: 12px 0 23px; color: var(--muted); line-height: 1.55; }
.handoff-panel + .team-scoreboard { max-width: 900px; margin-inline: auto; }
.extra-result { overflow: hidden; }
.extra-result > .finish-title { margin: 7px 0 20px; }
.extra-result > .primary { margin-top: 20px; }
.extra-result > .text-action { margin-left: 13px; }
.extra-result .result-actions { margin-top: 20px; }
.extra-result .result-actions .primary { margin: 0; }
.trivia-final-score { display: flex; align-items: baseline; gap: 12px; }
.trivia-final-score strong { color: var(--accent); font: 900 clamp(4rem, 9vw, 7rem)/1 var(--display); }
.trivia-final-score span { color: #d4dee7; font-size: 1rem; }
.blitz-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 760px; }
.blitz-result-grid > div { display: grid; gap: 5px; padding: 15px; border: 1px solid #43576c; background: #0d1a29e8; }
.blitz-result-grid strong { color: var(--accent); font: 900 2.3rem/1 var(--display); }
.blitz-result-grid span { color: #b6c4d2; font-size: .75rem; }
.result { position: relative; }
.fx-burst { position: absolute; z-index: 5; left: 50%; top: 42%; width: 1px; height: 1px; pointer-events: none; }
.fx-burst i { position: absolute; width: 6px; height: 11px; animation: fx-piece .85s cubic-bezier(.15,.7,.3,1) var(--delay) both; }

@media (max-width: 1050px) {
  .extra-lobby-grid { grid-template-columns: minmax(0, 1.35fr) minmax(190px, .65fr); }
  .team-scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 749px) {
  .extra-lobby-grid { grid-template-columns: 1fr; gap: 12px; }
  .setup-aside { padding: 0 15px; }
  .feature-list { display: grid; grid-template-columns: repeat(3, 1fr); }
  .feature-list li { padding: 13px 8px; }
  .feature-list li + li { border-top: 0; border-left: 1px solid #2b3e52; }
  .feature-list li { display: block; }
  .feature-list .icon { margin-bottom: 8px; }
  [data-stage="handoff"] .arcade-hero { display: none; }
  .handoff-panel { margin-top: 0; }
}
@media (max-width: 560px) {
  .utilities { gap: 0; }
  .utilities button { padding-inline: 2px; }
  .bread strong { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-copy { width: 88%; }
  .setup-options { display: block; }
  .category-select { margin-top: 16px; }
  .feature-list { grid-template-columns: 1fr; }
  .feature-list li { display: flex; padding: 10px 0; }
  .feature-list li + li { border-left: 0; border-top: 1px solid #2b3e52; }
  .feature-list .icon { margin: 0; }
  .team-name-grid { grid-template-columns: 1fr; }
  .team-scoreboard { gap: 6px; }
  .team-score { padding: 10px; }
  .team-score strong { font-size: 1.55rem; }
  .blitz-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .extra-result > .text-action { margin-left: 0; }
  .nav-badge { font-size: .55rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: copy-enter .38s ease-out both; }
  .question-card, .extra-setup, .handoff-panel { animation: panel-enter .22s ease-out both; }
  .answer-option.is-right .option-verdict { animation: verdict-pop .28s cubic-bezier(.2,.8,.3,1.25) both; }
  .answer-pop { animation: correct-pop .18s ease-out; }
  .answer-nudge { animation: wrong-nudge .16s ease-out; }
  .timer-box.urgent .timer-readout strong { animation: timer-pulse 1s ease-in-out infinite; }
  .primary, .segmented button, .utilities button { transition: background-color .15s, color .15s, transform .15s, border-color .15s; }
  @keyframes copy-enter { from { transform: translateX(-9px); } to { transform: none; } }
  @keyframes panel-enter { from { transform: translateY(5px); } to { transform: none; } }
  @keyframes verdict-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
  @keyframes correct-pop { 50% { transform: scale(1.006); } }
  @keyframes wrong-nudge { 33% { transform: translateX(-2px); } 66% { transform: translateX(2px); } }
  @keyframes timer-pulse { 50% { opacity: .55; } }
  @keyframes fx-piece { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }
}
@media (prefers-reduced-motion: reduce) {
  .linear-progress i { transition: none; }
  .fx-burst { display: none; }
}
