/* ==========================================================================
   CASE ME IF YOU CAN! — Responsive Multi-Device Courtroom Arcade Theme
   Mobile (320px+) · Tablet · Laptop · Desktop · Big Monitors & 4K TVs
   UNO-Recoletos School of Law · University Week 2026
   ========================================================================== */

:root {
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  --bg-base: light-dark(#f4f2ec, #0b0d13);
  --bg-surface: light-dark(#ffffff, #131722);
  --bg-elevated: light-dark(#ebe7dd, #1a2030);
  --bg-hover: light-dark(#f1ede4, #1e2538);
  --bg-inset: light-dark(#e5e0d4, #0f131d);

  --text-primary: light-dark(#121622, #eef1f7);
  --text-secondary: light-dark(#3b4358, #b7c0d6);
  --text-muted: light-dark(#646d82, #7e889f);

  --border-subtle: light-dark(rgba(18, 22, 34, 0.11), rgba(238, 241, 247, 0.09));
  --border-strong: light-dark(rgba(18, 22, 34, 0.24), rgba(238, 241, 247, 0.2));

  --gold: light-dark(#a9730e, #f0c45a);
  --crimson: light-dark(#c6283d, #e84855);
  --royal: light-dark(#2a57c9, #5887f8);
  --teal: light-dark(#0f8277, #2ec4b6);
  --amber: light-dark(#bd5c08, #f59e0b);
  --green: light-dark(#157a44, #34d399);

  --target-size: 24px;
  --header-h: 62px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-inline-size: 100%;
  overflow-x: clip;
}

body {
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--royal) 9%, transparent), transparent);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  text-align: start;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg,
canvas {
  max-inline-size: 100%;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li,
blockquote {
  text-wrap: pretty;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  width: auto;
  height: auto;
  clip: auto;
  padding: 8px 14px;
  background: var(--gold);
  color: #0b0d13;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

@media (pointer: coarse) {
  .lobby-shortcut-note,
  .verdict-btn kbd {
    display: none;
  }
}

/* ==================== TOP MASTHEAD ==================== */
.site-header {
  min-block-size: var(--header-h);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-block-start: env(safe-area-inset-top, 0px);
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}

.header-inner {
  max-inline-size: min(94dvw, 2200px);
  min-block-size: var(--header-h);
  margin: 0 auto;
  padding: 8px clamp(14px, 2dvw, 32px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.brand-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  min-inline-size: 0;
}

.brand-crest {
  width: 42px;
  height: 42px;
  padding: 2px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-inline-size: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(0.84rem, 0.78rem + 0.28dvw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.brand-eyebrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.track-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  gap: 2px;
}

.mode-pill {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.mode-pill:hover {
  color: var(--text-primary);
}

.mode-pill.is-active {
  background: var(--gold);
  color: #0b0d13;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.api-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.api-sync-btn:hover {
  border-color: var(--teal);
  color: var(--text-primary);
}

.api-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--amber);
}

.api-sync-btn.is-online .api-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.api-sync-btn.is-offline .api-dot {
  background: var(--text-muted);
}

.util-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: max(34px, var(--target-size));
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.util-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.util-btn--subtle {
  color: var(--text-muted);
}

.icon-cluster {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn {
  min-inline-size: max(34px, var(--target-size));
  padding: 4px 8px;
  justify-content: center;
}

/* Audio Toggle SVG States */
.sound-svg--off {
  display: none;
}

#btn-sound-toggle[aria-pressed="true"] .sound-svg--on {
  display: none;
}

#btn-sound-toggle[aria-pressed="true"] .sound-svg--off {
  display: block;
  color: var(--crimson);
}

/* Color-Scheme Adaptive Toggle Icons (dark-mode-toggle rule) */
.theme-opt {
  display: inline-flex;
}

.theme-opt--to-dark {
  display: none;
}

.theme-opt--to-light {
  display: inline-flex;
}

@media (prefers-color-scheme: light) {
  .theme-opt--to-light {
    display: none;
  }
  .theme-opt--to-dark {
    display: inline-flex;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-opt--to-light {
  display: inline-flex;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-opt--to-dark {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-opt--to-light {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-opt--to-dark {
  display: inline-flex;
}

/* ==================== MAIN SLIDE STAGE ==================== */
.main-shell {
  width: 100%;
  max-inline-size: min(94dvw, 2200px);
  margin: 0 auto;
  padding: 18px clamp(14px, 2dvw, 36px) max(20px, env(safe-area-inset-bottom, 0px));
  flex: 1;
}

.view-panel {
  min-inline-size: 0;
  max-inline-size: 100%;
}

[hidden],
.view-panel[hidden] {
  display: none !important;
}

@media (min-width: 1024px) and (min-height: 720px) {
  .main-shell {
    block-size: calc(100dvh - var(--header-h));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: clamp(14px, 1.8dvh, 26px) clamp(20px, 2.5dvw, 44px);
  }

  .view-panel:not([hidden]) {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
}

@media (min-width: 1024px) and (max-height: 719px) {
  .main-shell {
    min-block-size: calc(100dvh - var(--header-h));
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding: 16px 24px 24px;
  }

  .view-panel:not([hidden]) {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* ==================== SLIDE 1: 3-GAME DECK ==================== */
.view-lobby {
  justify-content: space-between;
  gap: clamp(12px, 1.8dvh, 24px);
}

.lobby-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  flex-shrink: 0;
}

.lobby-brand-lockup {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2dvw, 18px);
  min-inline-size: 0;
}

.lobby-seal-img {
  width: clamp(42px, 3.6dvw, 64px);
  height: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.print-logo-img {
  width: 56px;
  height: auto;
  object-fit: contain;
  display: block;
}

.lobby-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.05rem + 1.4dvw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  width: fit-content;
}

.lobby-sub {
  margin: 3px 0 0;
  font-size: clamp(0.84rem, 0.78rem + 0.25dvw, 1.05rem);
  color: var(--text-muted);
}

.lobby-shortcut-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.three-game-deck {
  flex: 1;
  min-height: 0;
  container: lobby-deck / inline-size;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8dvw, 28px);
  max-inline-size: min(1360px, 100%);
  inline-size: 100%;
  margin: 0 auto;
}

.three-game-deck .deck-card {
  padding: clamp(16px, 1.9dvw, 30px);
}

.three-game-deck .deck-portrait .char-svg {
  max-inline-size: clamp(145px, 13.5dvw, 225px);
  max-block-size: min(210px, 25dvh);
}

.two-game-deck,
.five-game-deck {
  flex: 1;
  min-height: 0;
  container: lobby-deck / inline-size;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2dvw, 34px);
  max-inline-size: min(1140px, 100%);
  inline-size: 100%;
  margin: 0 auto;
}

.two-game-deck .deck-card {
  padding: clamp(18px, 2.2dvw, 34px);
}

.two-game-deck .deck-portrait .char-svg {
  max-inline-size: clamp(160px, 16dvw, 250px);
  max-block-size: min(230px, 28dvh);
}

.deck-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-inline-size: 0;
  padding: clamp(12px, 1.3dvw, 24px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.deck-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--card-accent, var(--gold));
}

.deck-card--gold { --card-accent: var(--gold); }
.deck-card--royal { --card-accent: var(--royal); }
.deck-card--crimson { --card-accent: var(--crimson); }
.deck-card--amber { --card-accent: var(--amber); }
.deck-card--teal { --card-accent: var(--teal); }

.deck-card:hover {
  transform: translateY(-4px);
  background: var(--bg-hover);
  border-color: color-mix(in srgb, var(--card-accent) 55%, var(--border-strong));
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.45);
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deck-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--card-accent);
}

.deck-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent) 13%, var(--bg-elevated));
  color: var(--card-accent);
}

.deck-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  flex: 1;
  min-height: 0;
}

.deck-portrait .char-svg {
  inline-size: 100%;
  max-inline-size: clamp(130px, 11dvw, 220px);
  block-size: auto;
  max-block-size: min(175px, 22dvh);
  display: block;
}

.deck-body {
  min-inline-size: 0;
}

.deck-body h2 {
  margin: 0;
  font-size: clamp(0.95rem, 0.72rem + 0.55dvw, 1.38rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.deck-body p {
  margin: 5px 0 0;
  font-size: clamp(0.78rem, 0.7rem + 0.25dvw, 1rem);
  color: var(--text-muted);
  line-height: 1.38;
}

.deck-cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(0.78rem, 0.72rem + 0.2dvw, 0.96rem);
  font-weight: 700;
  color: var(--card-accent);
}

.lobby-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: clamp(0.76rem, 0.72rem + 0.16dvw, 0.92rem);
  color: var(--text-muted);
}

.footer-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.footer-stats strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.footer-stats .sep {
  opacity: 0.35;
}

.footer-prizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: clamp(0.74rem, 0.7rem + 0.14dvw, 0.88rem);
}

/* ==================== SHARED GAME HUD & STAGE CARDS ==================== */
.view-game {
  gap: 14px;
}

.game-hud {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.back-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.hud-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-inline-size: 0;
}

.hud-title-wrap h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 0.9rem + 0.65dvw, 1.75rem);
  font-weight: 800;
  width: fit-content;
}

.source-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.source-pill.is-live-api {
  background: color-mix(in srgb, var(--teal) 15%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--teal) 50%, transparent);
  color: var(--teal);
}

.hud-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hud-pill strong {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.hud-pill--gold strong {
  color: var(--gold);
}

.hud-pill.is-urgent {
  border-color: var(--crimson);
}

.hud-pill.is-urgent strong {
  color: var(--crimson);
}

.stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 1.5dvw, 24px);
  min-inline-size: 0;
}

.stage-host-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-avatar {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}

.mini-avatar .char-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.host-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
}

.kicker-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--gold);
}

.kicker-tag--crimson {
  background: color-mix(in srgb, var(--crimson) 15%, var(--bg-elevated));
  color: var(--crimson);
}

.muted-copy {
  color: var(--text-secondary);
  font-size: clamp(0.88rem, 0.82rem + 0.25dvw, 1.06rem);
}

.primary-action-btn {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--gold);
  color: #0b0d13;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: filter 140ms ease, transform 120ms ease;
}

.primary-action-btn:hover {
  filter: brightness(1.08);
}

.primary-action-btn:active {
  transform: scale(0.985);
}

.secondary-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.secondary-btn:hover {
  border-color: var(--gold);
}

.secondary-btn--sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.danger-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--crimson) 55%, transparent);
  background: color-mix(in srgb, var(--crimson) 14%, var(--bg-elevated));
  color: var(--crimson);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.citation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.citation-mono {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 0.68rem + 0.14dvw, 0.88rem);
  color: var(--text-muted);
}

.ext-source-link {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal);
}

.ext-source-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.fuse-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
  margin: 10px 0 12px;
}

.fuse-track--lg {
  height: 8px;
}

.fuse-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--crimson));
  transition: width 220ms linear;
}

.hint-banner {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-elevated));
  border-left: 3px solid var(--gold);
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* ==================== GAME 1: WHEEL OF CERTIORARI ==================== */
.wheel-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(320px, 31dvw, 520px) minmax(0, 1fr);
  gap: clamp(14px, 1.5dvw, 24px);
  align-items: stretch;
}

.wheel-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-inline-size: 0;
}

.wheel-stage {
  position: relative;
  width: min(370px, 44dvh, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.wheel-center-btn {
  position: absolute;
  width: 70px;
  min-block-size: 70px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #131722;
  color: #f0c45a;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.wheel-center-btn:hover:not(:disabled) {
  transform: scale(1.06);
}

.wheel-center-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wheel-status-banner {
  margin: 0;
  font-size: 0.84rem;
  text-align: center;
  color: var(--text-secondary);
}

.docket-column {
  container: stage-panel / inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.case-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--gold);
}

.multiplier-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--crimson) 20%, var(--bg-elevated));
  color: var(--crimson);
}

.timer-chip {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold);
}

.case-headline {
  margin: 8px 0 6px;
  font-size: clamp(1.02rem, 0.86rem + 0.9dvw, 1.65rem);
  font-weight: 800;
}

.case-prompt {
  margin: 0 0 12px;
  font-size: clamp(0.9rem, 0.82rem + 0.45dvw, 1.24rem);
  color: var(--text-secondary);
}

.options-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-inline-size: 0;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: clamp(0.86rem, 0.8rem + 0.25dvw, 1.06rem);
  line-height: 1.35;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--bg-hover);
}

.option-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--bg-surface);
  color: var(--gold);
}

.lifelines-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.lifeline-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lifeline-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.lifeline-btn:disabled {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: not-allowed;
}

.wager-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.wager-btn {
  flex: 1 1 110px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.wager-btn strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--gold);
}

.wager-btn--bold strong {
  color: var(--crimson);
}

.wager-btn:hover {
  border-color: var(--gold);
}

.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--green) 16%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  margin-bottom: 12px;
}

.verdict-banner.is-wrong {
  background: color-mix(in srgb, var(--crimson) 16%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--crimson) 45%, transparent);
}

.points-delta {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
}

.reveal-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.doctrine-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.doctrine-box p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

/* ==================== GAME 2: MILLIONAIRE JURIST ==================== */
.millionaire-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 20dvw, 370px);
  gap: clamp(14px, 1.4dvw, 24px);
}

.mill-main {
  container: stage-panel / inline-size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.mill-host-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 14px;
  flex-wrap: wrap;
}

.mill-host-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  min-inline-size: 0;
}

.host-bubble p {
  margin: 2px 0 0;
  font-size: clamp(0.84rem, 0.78rem + 0.25dvw, 1.02rem);
  color: var(--text-secondary);
}

.mill-lifelines {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.lifeline-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--royal) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--royal) 12%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lifeline-pill:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.lifeline-pill:disabled {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: not-allowed;
}

.lifeline-pill--walk {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, var(--bg-elevated));
  color: var(--amber);
}

.mill-aid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.poll-chart-box,
.counsel-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.poll-bars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 76px;
}

.poll-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}

.poll-bar-fill {
  width: 26px;
  border-radius: 4px 4px 0 0;
  background: var(--royal);
  min-height: 4px;
}

.poll-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
}

.poll-lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.counsel-box p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.mill-question-box {
  padding: clamp(12px, 1.4dvw, 22px) clamp(14px, 1.8dvw, 26px);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid color-mix(in srgb, var(--royal) 40%, var(--border-subtle));
}

.mill-question-box h2 {
  margin: 8px 0 0;
  font-size: clamp(1rem, 0.86rem + 0.75dvw, 1.55rem);
  line-height: 1.42;
}

.mill-pods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mill-pod {
  display: flex;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
  padding: clamp(11px, 1dvw, 18px) clamp(16px, 1.6dvw, 28px);
  border: 1.5px solid color-mix(in srgb, var(--royal) 55%, var(--border-subtle));
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-align: left;
  font-size: clamp(0.86rem, 0.78rem + 0.3dvw, 1.15rem);
  font-weight: 600;
  cursor: pointer;
  clip-path: polygon(14px 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0% 50%);
  transition: background-color 140ms ease, transform 120ms ease;
}

.mill-pod:hover:not(:disabled) {
  background: color-mix(in srgb, var(--royal) 20%, var(--bg-elevated));
}

.mill-pod.is-locked {
  background: linear-gradient(180deg, #b45309, #92400e);
  color: #fffbeb;
  border-color: #fbbf24;
}

.mill-pod.is-locked .pod-key {
  color: #fef3c7;
}

.mill-pod.is-correct {
  background: linear-gradient(180deg, #15803d, #166534);
  color: #ecfdf5;
}

.mill-pod.is-wrong {
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  color: #fff1f2;
}

.mill-pod.is-eliminated,
.mill-pod:disabled.is-eliminated {
  opacity: 0.2;
  cursor: not-allowed;
}

.pod-key {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}

.mill-action-bar,
.mill-explain-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.confirm-prompt {
  font-weight: 700;
  color: var(--amber);
}

.confirm-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mill-explain-banner p {
  margin: 3px 0 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.mill-ladder-panel {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.ladder-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

.mill-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  flex: 1;
}

.ladder-rung {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.74rem, 0.7rem + 0.16dvw, 0.92rem);
  color: var(--text-muted);
}

.ladder-rung.is-safe {
  color: var(--text-primary);
  font-weight: 700;
}

.ladder-rung.is-current {
  background: var(--gold);
  color: #0b0d13;
  font-weight: 800;
}

.ladder-rung.is-cleared {
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  color: var(--teal);
}

/* ==================== GAME 3: OBJECTION! WITNESS STAND ==================== */
.witness-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(300px, 24dvw, 430px) minmax(0, 1fr);
  gap: clamp(14px, 1.5dvw, 24px);
}

.witness-booth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.witness-portrait-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.portrait-lg .char-svg {
  width: 158px;
  height: 158px;
  display: block;
}

.burst-overlay {
  position: absolute;
  bottom: -10px;
  right: 0;
  pointer-events: none;
  z-index: 4;
}

.witness-meta h2 {
  margin: 4px 0 2px;
  font-size: clamp(1rem, 0.9rem + 0.45dvw, 1.4rem);
}

.suspect-role {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dossier-brief {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.witness-exhibits-col {
  container: stage-panel / inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.exhibits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exhibit-card {
  width: 100%;
  min-inline-size: 0;
  text-align: left;
  padding: clamp(12px, 1.2dvw, 20px) clamp(14px, 1.4dvw, 24px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.exhibit-card:hover:not(:disabled) {
  border-color: var(--crimson);
  background: var(--bg-hover);
}

.exhibit-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.exhibit-text {
  font-size: clamp(0.9rem, 0.82rem + 0.35dvw, 1.18rem);
  line-height: 1.42;
}

.exhibit-card.is-impostor {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, var(--bg-surface));
}

.exhibit-card.is-wrong-pick {
  border-color: var(--crimson);
  background: color-mix(in srgb, var(--crimson) 14%, var(--bg-surface));
}

.impostor-debrief {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.debrief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

/* ==================== GAME 4: GAVEL BLITZ ==================== */
.blitz-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  min-inline-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blitz-intro,
.blitz-active {
  width: 100%;
  max-inline-size: clamp(720px, 60dvw, 1100px);
  min-inline-size: 0;
}

.blitz-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.streak-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.streak-bar-bg {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
}

.streak-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  transition: width 160ms ease;
}

.streak-status {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.petitioner-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pet-avatar-frame {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.pet-avatar-frame .char-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pet-case {
  font-size: clamp(0.96rem, 0.88rem + 0.35dvw, 1.28rem);
  font-weight: 800;
  margin-top: 2px;
}

.pet-statement {
  margin: 14px 0 8px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: clamp(0.95rem, 0.85rem + 0.45dvw, 1.3rem);
}

.pet-question {
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--gold);
}

.blitz-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: color-mix(in srgb, var(--green) 16%, var(--bg-elevated));
}

.blitz-feedback.is-wrong {
  background: color-mix(in srgb, var(--crimson) 16%, var(--bg-elevated));
}

.gavel-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.verdict-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-inline-size: 0;
  gap: 4px;
  padding: clamp(12px, 1.2dvw, 22px);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  cursor: pointer;
}

.verdict-btn--sustained:hover {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, var(--bg-elevated));
}

.verdict-btn--overruled:hover {
  border-color: var(--crimson);
  background: color-mix(in srgb, var(--crimson) 14%, var(--bg-elevated));
}

.verdict-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gavel-stamp-visual {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
}

.gavel-stamp-visual.is-slam {
  animation: stamp-pop 220ms ease;
}

@keyframes stamp-pop {
  0% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.blitz-bottom-row {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ==================== GAME 5: BAIL OR JAIL ==================== */
.bail-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(300px, 24dvw, 430px) minmax(0, 1fr);
  gap: clamp(14px, 1.5dvw, 24px);
}

.bail-cell-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.jail-frame {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  flex-shrink: 0;
}

.jail-frame .char-svg,
.jail-overlay .jail-bars-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.jail-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bail-clue {
  margin: 0;
  font-size: clamp(0.88rem, 0.82rem + 0.25dvw, 1.06rem);
  color: var(--text-secondary);
}

.bail-board-col {
  container: stage-panel / inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 0;
  min-inline-size: 0;
  overflow-y: auto;
}

.word-slots-area {
  width: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.4dvw, 22px);
}

.word-group {
  max-inline-size: 100%;
  display: inline-flex;
  gap: clamp(4px, 0.5dvw, 8px);
  flex-wrap: wrap;
  justify-content: center;
}

.letter-tile {
  min-inline-size: clamp(28px, 3dvw, 56px);
  min-block-size: clamp(36px, 3.8dvw, 68px);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-inset);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 0.9rem + 0.9dvw, 1.95rem);
  font-weight: 800;
  color: var(--gold);
}

.letter-tile.is-revealed {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 15%, var(--bg-elevated));
  color: var(--text-primary);
}

.letter-tile.is-missed-reveal {
  border-color: var(--crimson);
  color: var(--crimson);
}

.alpha-keyboard {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(5px, 0.6dvw, 9px);
  max-inline-size: min(100%, 840px);
  margin: 0 auto;
}

.key-cap {
  min-inline-size: max(var(--target-size), clamp(32px, 3.1dvw, 56px));
  min-block-size: max(var(--target-size), clamp(36px, 3.1dvw, 56px));
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.84rem, 0.78rem + 0.3dvw, 1.2rem);
  cursor: pointer;
}

.key-cap:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.key-cap.is-hit {
  background: color-mix(in srgb, var(--green) 26%, var(--bg-elevated));
  border-color: var(--green);
  color: var(--green);
}

.key-cap.is-miss {
  opacity: 0.3;
  text-decoration: line-through;
  border-color: var(--crimson);
  color: var(--crimson);
}

/* ==================== CONTAINER QUERIES FOR NESTED STAGE COMPONENTS ==================== */
@supports (font-size: 1cqi) {
  .deck-body h2 {
    font-size: clamp(0.95rem, 0.8rem + 1.1cqi, 1.38rem);
  }
  .case-headline,
  .mill-question-box h2 {
    font-size: clamp(1rem, 0.85rem + 1.15cqi, 1.65rem);
  }
  .case-prompt,
  .exhibit-text {
    font-size: clamp(0.9rem, 0.8rem + 0.55cqi, 1.24rem);
  }
}

@container stage-panel (inline-size < 460px) {
  .options-grid-2x2,
  .mill-pods-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==================== GAME 3: THE BLINDFOLD ==================== */
.blindfold-prep-wrap:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.blindfold-prep-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.prep-top-copy h2 {
  margin: 4px 0 2px;
  font-size: clamp(1.05rem, 0.9rem + 0.6dvw, 1.45rem);
}

.study-timer-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--border-subtle));
}

.study-timer-lbl {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.study-timer-val {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 1rem + 0.5dvw, 1.55rem);
  font-weight: 800;
  color: var(--gold);
  min-width: 58px;
}

.study-timer-val.is-done {
  color: var(--crimson);
}

.study-timer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blindfold-prep-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.blindfold-study-card {
  overflow-y: auto;
  max-block-size: min(56dvh, 520px);
}

.blindfold-ready-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  border-top: 3px solid var(--crimson);
}

.blindfold-ready-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.blindfold-steps-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.prep-cam-notice {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.prep-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blindfold-active-grid:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  width: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  min-height: 0;
  align-items: start;
}

.blindfold-cam-col,
.blindfold-prof-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}

.cam-viewport {
  position: relative;
  width: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  aspect-ratio: 4 / 3;
  contain: layout inline-size paint;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0b0e17;
  border: 2px solid color-mix(in srgb, var(--gold) 45%, var(--border-strong));
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.6);
}

.cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.cam-fallback:not([hidden]) {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle at 50% 42%, #1b2236 0%, #0b0e17 75%);
  padding: 16px;
  text-align: center;
}

.cam-silhouette-svg {
  max-width: 100%;
  height: auto;
}

.cam-fallback-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(11, 13, 19, 0.78);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 196, 90, 0.35);
}

.cam-damage-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-damage-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cam-spank-fx:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 72, 85, 0.22);
  animation: spankBurstPop 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.spank-burst-svg {
  width: min(88%, 340px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75));
}

.cam-viewport.is-spanked {
  border-color: var(--crimson);
  animation: camSpankShake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes camSpankShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-10px, 4px, 0) rotate(-1.5deg); }
  36% { transform: translate3d(10px, -4px, 0) rotate(1.5deg); }
  54% { transform: translate3d(-8px, -2px, 0) rotate(-1deg); }
  72% { transform: translate3d(6px, 3px, 0) rotate(0.8deg); }
}

@keyframes spankBurstPop {
  0% { opacity: 0; transform: scale(0.55) rotate(-6deg); }
  65% { opacity: 1; transform: scale(1.06) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.cam-hud-top {
  position: absolute;
  inset: 8px 8px auto 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 5;
}

.cam-status-pill,
.cam-bruise-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11, 13, 19, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
}

.cam-bruise-pill.is-bruised {
  border-color: var(--crimson);
  color: #ffd7db;
  background: rgba(198, 40, 61, 0.86);
}

.cam-controls-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cam-controls-bar button {
  min-block-size: max(var(--target-size), 40px);
}

#btn-g3-voice-mic.is-listening {
  background: color-mix(in srgb, var(--crimson) 22%, var(--bg-elevated));
  border-color: var(--crimson);
  color: var(--crimson);
}

.voice-status-line {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}

.prof-stage-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid color-mix(in srgb, var(--crimson) 35%, var(--border-subtle));
}

.prof-bubble-wrap {
  flex: 1;
  min-inline-size: 0;
}

.prof-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.tts-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.tts-pill.is-speaking {
  border-color: var(--gold);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, var(--bg-surface));
}

.prof-speech-copy {
  margin: 5px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}

.blindfold-q-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-inline-size: 0;
  max-inline-size: 100%;
  container: stage-panel / inline-size;
}

.option-btn--blindfold {
  min-block-size: max(var(--target-size), 54px);
}

.option-btn--blindfold .opt-letter {
  width: auto;
  min-inline-size: 40px;
  padding: 0 7px;
}

.blindfold-select-wrap:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blindfold-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.select-case-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  min-inline-size: 0;
}

.select-case-card:hover,
.select-case-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.select-case-card--all {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-surface));
}

.select-case-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.select-case-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.select-case-cit {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.select-case-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.select-case-hook {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.select-case-cta {
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--gold);
}

.voice-recog-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.voice-recog-banner.is-listening {
  border-color: var(--crimson);
  background: color-mix(in srgb, var(--crimson) 12%, var(--bg-inset));
}

.voice-recog-banner.is-prof-speaking {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-inset));
}

.voice-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.voice-recog-banner.is-listening .voice-dot {
  background: var(--crimson);
  box-shadow: 0 0 0 0 rgba(232, 72, 85, 0.7);
  animation: voicePulse 1.2s infinite;
}

.voice-recog-banner.is-prof-speaking .voice-dot {
  background: var(--gold);
}

@keyframes voicePulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 72, 85, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(232, 72, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 72, 85, 0); }
}

.voice-banner-copy {
  flex: 1;
  min-inline-size: 0;
}

.voice-banner-copy strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.voice-recog-banner .voice-status-line {
  padding: 0;
  border: 0;
  background: transparent;
}

.voice-sim-row:not([hidden]) {
  display: flex;
  gap: 8px;
  align-items: center;
}

.voice-sim-row input {
  flex: 1;
  min-inline-size: 0;
  min-block-size: 38px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text-primary);
  font-size: 0.84rem;
}

.voice-only-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, var(--bg-inset));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border-subtle));
}

.option-btn--voice-only {
  cursor: not-allowed;
}

.option-btn--voice-only:not(.is-correct):not(.is-wrong):hover {
  transform: none;
  border-color: var(--border-subtle);
}

.option-btn--voice-only.is-voice-nudge {
  border-color: var(--crimson);
  animation: camSpankShake 360ms ease;
}

.voice-heard-note:not([hidden]) {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
}

.prof-roast-copy {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--crimson) 12%, var(--bg-inset));
  border-left: 3px solid var(--crimson);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==================== BIG MONITORS & 4K EXHIBIT DISPLAYS ==================== */
@media (min-width: 1600px) {
  :root {
    --header-h: 70px;
  }

  .wheel-stage {
    width: min(490px, 50dvh, 100%);
  }

  .wheel-center-btn {
    width: 84px;
    min-block-size: 84px;
    font-size: 1.05rem;
  }
}

@media (min-width: 1800px) {
  .three-game-deck,
  .two-game-deck {
    max-inline-size: 1580px;
  }

  .deck-portrait .char-svg {
    max-inline-size: clamp(180px, 14dvw, 260px);
    max-block-size: min(250px, 27dvh);
  }
}

/* ==================== TABLET & MEDIUM SCREEN ADAPTATION ==================== */
@media (max-width: 1023px) {
  .header-inner,
  .main-shell {
    max-inline-size: 100%;
  }

  .three-game-deck,
  .two-game-deck,
  .five-game-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-game-deck > :nth-child(3):last-child {
    grid-column: 1 / -1;
  }

  .blindfold-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wheel-layout,
  .millionaire-layout,
  .blindfold-prep-grid,
  .blindfold-active-grid,
  .blindfold-active-grid:not([hidden]),
  .guide-two-col,
  .sync-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .blindfold-study-card {
    max-block-size: none;
  }

  .wheel-stage {
    width: min(320px, 68dvw);
  }

  .mill-ladder {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .ladder-rung {
    min-inline-size: 0;
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .lobby-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==================== CELLPHONE & SMALL SCREEN ADAPTATION (320px–640px) ==================== */
@media (max-width: 640px) {
  .header-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-crest {
    width: 36px;
    height: 36px;
  }

  .lobby-seal-img {
    width: 38px;
  }

  .main-shell {
    padding: 12px max(12px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  }

  .lobby-shortcut-note {
    display: none;
  }

  /* Slide 1 becomes ergonomic compact horizontal cards */
  .three-game-deck,
  .two-game-deck,
  .five-game-deck,
  .blindfold-select-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .three-game-deck > :nth-child(3):last-child {
    grid-column: auto;
  }

  .deck-card,
  .three-game-deck .deck-card,
  .two-game-deck .deck-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    align-items: center;
    padding: 12px 14px;
  }

  .deck-card::before {
    inset: 0 auto 0 0;
    width: 4px;
    height: auto;
  }

  .deck-portrait {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .deck-portrait .char-svg,
  .three-game-deck .deck-portrait .char-svg,
  .two-game-deck .deck-portrait .char-svg {
    width: 64px;
    max-inline-size: 64px;
    max-block-size: 64px;
  }

  .deck-top {
    grid-column: 2 / span 2;
    grid-row: 1;
  }

  .deck-body {
    grid-column: 2;
    grid-row: 2;
  }

  .deck-cta {
    grid-column: 3;
    grid-row: 2;
    margin-top: 0;
    white-space: nowrap;
  }

  /* Game 1 compact roulette when question is active */
  .wheel-stage {
    width: min(220px, 62dvw);
  }

  .wheel-layout:has(#g1-state-question:not([hidden]), #g1-state-wager:not([hidden]), #g1-state-reveal:not([hidden])) .wheel-stage {
    width: 120px;
  }

  .wheel-layout:has(#g1-state-question:not([hidden]), #g1-state-wager:not([hidden]), #g1-state-reveal:not([hidden])) .wheel-center-btn {
    width: 44px;
    min-block-size: 44px;
    min-inline-size: 44px;
    font-size: 0.65rem;
  }

  .options-grid-2x2,
  .mill-pods-grid,
  .form-row-2,
  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .petitioner-head > div,
  .mill-host-left > div,
  .mill-explain-banner > div,
  .witness-booth > *,
  .bail-cell-panel > * {
    min-inline-size: 0;
  }

  /* Game 2 Millionaire mobile pods & confirmation */
  .mill-pod {
    clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
    padding: 12px 16px;
  }

  .mill-action-bar,
  .mill-explain-banner {
    flex-direction: column;
    align-items: stretch;
  }

  /* Game 3 compact Witness header */
  .witness-booth {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: start;
  }

  .portrait-lg .char-svg {
    width: 84px;
    height: 84px;
  }

  .witness-booth .dossier-brief,
  .witness-booth #btn-g3-clue,
  .witness-booth #g3-clue-box {
    grid-column: 1 / -1;
  }

  /* Game 4 keeps Sustained & Overruled side-by-side for two-thumb mobile play */
  .gavel-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gavel-stamp-visual {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .verdict-btn {
    grid-row: 2;
    width: 100%;
    padding: clamp(10px, 2.5dvw, 14px) 6px;
    font-size: clamp(0.8rem, 0.75rem + 0.4dvw, 0.96rem);
  }

  /* Game 5 compact Jail cell & word board */
  .bail-cell-panel {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: center;
  }

  .jail-frame {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    margin: 0;
    grid-row: span 2;
  }

  .bail-cell-panel #btn-g5-hint {
    grid-column: 1 / -1;
  }

  .studio-case-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cam-controls-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .prof-stage-card {
    flex-wrap: wrap;
  }
}

@media (max-width: 519px) {
  .main-shell {
    padding: 10px max(10px, env(safe-area-inset-left, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-right, 0px));
  }

  .stage-card {
    padding: 12px;
  }

  .brand-eyebrow {
    display: none;
  }

  .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mill-ladder-panel {
    padding: 10px;
  }

  .mill-ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .ladder-rung {
    min-inline-size: 0;
    font-size: clamp(0.62rem, 2.7dvw, 0.74rem);
    padding: 5px 6px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .word-slots-area {
    gap: 8px;
  }

  .word-group {
    gap: 3px;
  }

  .letter-tile {
    min-inline-size: clamp(20px, 6.2dvw, 32px);
    min-block-size: clamp(30px, 8dvw, 42px);
    font-size: clamp(0.82rem, 3.6dvw, 1.15rem);
    padding: 1px 2px;
  }

  .alpha-keyboard {
    gap: 4px;
  }

  .key-cap {
    min-inline-size: max(var(--target-size), clamp(28px, 8dvw, 38px));
    min-block-size: max(var(--target-size), 34px);
    padding: 3px 4px;
    font-size: 0.8rem;
  }
}

/* ==================== DIALOGS (dialog & light-dismiss-a-dialog) ==================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(6, 8, 14, 0.76);
  backdrop-filter: blur(6px);
}

.court-dialog {
  width: min(580px, calc(100dvw - 24px));
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
}

.court-dialog--wide {
  width: min(920px, calc(100dvw - 24px));
}

.court-dialog[open] {
  display: block;
}

.dialog-shell {
  padding: clamp(14px, 2dvw, 24px);
  overflow-y: auto;
  max-height: 90dvh;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.95rem + 0.35dvw, 1.35rem);
}

.dialog-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.dialog-close {
  min-inline-size: max(32px, var(--target-size));
  min-block-size: max(32px, var(--target-size));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
}

.summons-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-seal {
  display: inline-block;
  margin: 0 auto;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--gold) 15%, var(--bg-elevated));
  color: var(--gold);
}

.final-score-num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.85rem, 1.5rem + 1dvw, 2.45rem);
  font-weight: 800;
  color: var(--gold);
}

.final-score-lbl {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.save-score-form,
.studio-form,
.case-editor-form {
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-2,
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-inline-size: 0;
}

.field-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.dialog-footer-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-filter-row,
.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip,
.studio-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active,
.studio-tab.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0d13;
}

.table-scroll {
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.lb-table caption {
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.lb-table th,
.lb-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.guide-two-col,
.sync-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.guide-qr-card,
.sync-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.qr-box svg {
  width: 150px;
  height: 150px;
  background: #fff;
  padding: 6px;
  border-radius: 8px;
}

.studio-case-list {
  margin-top: 12px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.studio-case-actions {
  display: flex;
  gap: 6px;
}

/* ==================== CASE VAULT, LEVEL SELECTOR & 5-OPTION SUPPORT ==================== */
.util-btn--vault {
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-elevated));
}

.util-btn--vault:hover {
  background: color-mix(in srgb, var(--gold) 18%, var(--bg-elevated));
}

.court-dialog--level {
  width: min(960px, calc(100dvw - 24px));
  max-width: 960px;
}

.active-mode-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold) 12%, var(--bg-inset));
  border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--border-subtle));
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.wizard-stepper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}

.wizard-step-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.wizard-step-pill.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0d13;
}

.wizard-step-pill.is-done {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--border-strong));
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, var(--bg-surface));
}

.wizard-step-pill.is-skipped {
  opacity: 0.52;
  text-decoration: line-through;
}

.wizard-step-sep {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.source-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.source-choice-card:hover,
.source-choice-card:focus-visible {
  transform: translateY(-2px);
  background: var(--bg-hover);
  border-color: var(--gold);
  outline: none;
}

.source-choice-card--vault {
  border-top: 4px solid var(--gold);
}

.source-choice-card--api {
  border-top: 4px solid var(--teal);
}

.source-choice-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.source-choice-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.source-choice-bullets {
  margin: 2px 0 4px;
  padding-left: 18px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex: 1;
}

.wizard-case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.wizard-subhead {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.wizard-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.wizard-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.wizard-case-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.wizard-case-btn:hover {
  border-color: var(--gold);
  background: var(--bg-hover);
}

.wizard-case-btn.is-active {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 15%, var(--bg-elevated));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent);
}

.wizard-case-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.wizard-case-btn strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.wizard-case-btn small {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.wizard-reader-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  max-height: min(44dvh, 380px);
  overflow-y: auto;
}

.wizard-reader-head h3 {
  margin: 6px 0 4px;
  font-size: 1.06rem;
}

.wizard-reader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wizard-all-cases-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}

.wizard-mini-digest {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-mini-digest strong {
  font-size: 0.84rem;
  color: var(--text-primary);
}

.wizard-mini-digest p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.42;
}

.wizard-footer-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.wizard-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--border-strong));
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
}

.level-pool-counts {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.level-game-desc,
.vault-intro-copy {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.docket-scope-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}

.scope-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}

.scope-pill {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.scope-pill.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0d13;
}

.level-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.level-card:hover,
.level-card:focus-visible {
  transform: translateY(-2px);
  background: var(--bg-hover);
  border-color: var(--gold);
  outline: none;
}

.level-card--hs {
  border-top: 3px solid var(--teal);
}

.level-card--adult {
  border-top: 3px solid var(--gold);
}

.level-card--law {
  border-top: 3px solid var(--crimson);
}

.level-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.level-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.level-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold);
}

.level-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.level-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  flex: 1;
}

.level-card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.level-card-cta {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold);
}

/* Collapsible Non-Spoiler Case File Drawer */
.case-file-drawer {
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--border-subtle));
  text-align: left;
}

.case-file-drawer summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  list-style-position: inside;
}

.case-file-drawer p {
  margin: 8px 0 2px;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.case-file-drawer--mill {
  margin-top: 10px;
}

/* Interactive Case Vault Modal */
.vault-files-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.vault-tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.vault-tab-btn.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0d13;
}

.vault-dossier-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.vault-card-head h3 {
  margin: 6px 0 4px;
  font-size: 1.12rem;
}

.vault-headline {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--gold);
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vault-section {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.vault-section h4 {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.vault-section p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.vault-section--ruling {
  border-left: 3px solid var(--teal);
}

.vault-section--doctrine {
  border-left: 3px solid var(--gold);
}

/* 5-option cross-case cards span cleanly on 2-column grids */
.options-grid-2x2 > :nth-child(5):last-child,
.mill-pods-grid > :nth-child(5):last-child {
  grid-column: 1 / -1;
}

@media (max-width: 780px) {
  .level-cards-grid,
  .vault-grid,
  .source-choice-grid,
  .wizard-reader-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 519px) {
  .mode-pill {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
  .level-card {
    padding: 12px;
  }
  .cam-controls-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 110ms;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*),
  .cam-viewport.is-spanked,
  .cam-spank-fx {
    animation: none !important;
  }
}

@media print {
  body > *:not(#guidelines-dialog),
  .no-print {
    display: none !important;
  }
  #guidelines-dialog {
    position: static;
    border: 0;
    box-shadow: none;
    width: 100%;
    max-height: none;
    background: #fff;
    color: #000;
  }
}
