:root {
  --bg-canvas: #070b14;
  --bg-surface: #0f1626;
  --bg-elevated: #172138;
  --bg-hover: #1e2b48;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.32);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-on-accent: #090d16;
  --text-on-success: #042f1e;
  --text-on-danger: #ffffff;

  --accent-solid: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-glow: rgba(245, 158, 11, 0.30);

  --success-solid: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --success-glow: rgba(16, 185, 129, 0.32);

  --danger-solid: #dc2626;
  --danger-text: #fca5a5;
  --danger-soft: rgba(220, 38, 38, 0.16);

  --info-text: #7dd3fc;
  --focus-ring: #38bdf8;

  --radius-card: 16px;
  --radius-control: 10px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #131d35 0%, var(--bg-canvas) 62%);
  color: var(--text-primary);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100dvh;
}

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

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

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

button {
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
  }
  .btn-primary:hover:not(:disabled) {
    background: #fbbf24;
    border-color: transparent;
  }
  .btn-success:hover:not(:disabled) {
    background: #6ee7b7;
    border-color: transparent;
  }
  .btn-danger:hover:not(:disabled) {
    background: #ef4444;
    border-color: transparent;
  }
}

button:not(:disabled):active {
  transform: scale(0.96);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--text-on-accent);
  font-weight: 700;
}

.btn-success {
  background: var(--success-solid);
  border-color: transparent;
  color: var(--text-on-success);
  font-weight: 700;
}

.btn-danger {
  background: var(--danger-solid);
  border-color: transparent;
  color: var(--text-on-danger);
  font-weight: 700;
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger-text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost.active {
  border-color: var(--accent-solid);
  color: var(--accent-solid);
  background: var(--accent-soft);
}

.btn-icon {
  min-width: 34px;
  min-height: 34px;
  padding: 6px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 8px;
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: inherit;
  opacity: 0.82;
}

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

.hidden {
  display: none !important;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  flex-shrink: 0;
}

.dot.live {
  background: var(--success-solid);
  box-shadow: 0 0 8px var(--success-glow);
}

.dot.amber {
  background: var(--accent-solid);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ---------- Segmented Control ---------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 0.86rem;
}

.segmented button.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* ---------- Host Studio ---------- */
.host-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 20px 36px;
  display: grid;
  gap: 18px;
}

.host-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 10px 14px;
}

.host-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.host-brand-name {
  color: var(--accent-solid);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.host-brand a {
  color: var(--info-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .host-brand a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.host-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.menu-wrap {
  position: relative;
}

.menu-popover {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: 270px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  z-index: 30;
  display: grid;
  gap: 6px;
  transform-origin: top right;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: no-preference) {
  .menu-popover {
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  }
  @starting-style {
    .menu-popover {
      opacity: 0;
      transform: scale(0.96) translateY(-4px);
    }
  }
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .menu-toggle:hover {
    background: var(--bg-elevated);
  }
}

.menu-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-solid);
  cursor: pointer;
}

.menu-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.host-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) {
  .host-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.stage-stack {
  display: grid;
  gap: 16px;
}

/* Host Lobby Stage */
.host-lobby {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

@media (max-width: 620px) {
  .host-lobby {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

.host-lobby-qr {
  width: 168px;
  height: 168px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  outline: 1px solid oklch(1 0 0 / 0.1);
  outline-offset: -1px;
}

.host-lobby-copy h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.host-lobby-copy p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.url-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--accent-solid);
  margin-bottom: 16px;
}

/* Shared-row CSS Grid Jeopardy Board (Host Live & Organize) */
.shared-board {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.board-cat-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  min-height: 54px;
}

.board-cat-name {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--info-text);
  text-wrap: balance;
}

.board-cat-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.host-tile {
  background: #13203d;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 10px;
  padding: 10px 8px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.host-tile-pts {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-solid);
  font-variant-numeric: tabular-nums;
}

.host-tile-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-tile-badge {
  font-size: 0.75rem;
  color: var(--success-solid);
  font-weight: 600;
}

.host-tile-badge.missing {
  color: var(--text-secondary);
  opacity: 0.7;
}

.host-tile.used {
  opacity: 0.34;
  background: rgba(15, 23, 42, 0.45);
}

.host-tile.used .host-tile-pts {
  text-decoration: line-through;
}

.host-tile.active {
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 2px var(--accent-solid);
}

/* Focused Active Clue Card */
.clue-stage-host {
  display: grid;
  gap: 16px;
}

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

.clue-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--info-text);
}

.clue-kicker-pts {
  color: var(--accent-solid);
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.status-badge.armed {
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

.status-badge.winner {
  background: var(--accent-soft);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.clue-prompt-host {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

.answer-card {
  background: var(--accent-soft);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 13px 15px;
}

.answer-card-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-solid);
  margin-bottom: 4px;
}

.answer-card-value {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.winner-decision {
  background: var(--bg-elevated);
  border: 2px solid var(--winner-color, var(--accent-solid));
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.winner-decision-who {
  display: grid;
  gap: 2px;
}

.winner-decision-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--winner-color, var(--accent-solid));
}

.winner-decision-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.winner-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.transport-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.transport-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Sidebar Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  text-align: start;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-cell-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Organize Mode & Slide-Over Clue Drawer */
.organize-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.organize-stats {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.cat-name-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--info-text);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 6px;
}

.cat-name-input:focus {
  background: var(--bg-canvas);
  border-color: var(--focus-ring);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(4px);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(460px, 100%);
  height: 100dvh;
  background: var(--bg-surface);
  border-inline-start: 1px solid var(--border-strong);
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  .drawer-panel {
    transition: transform 280ms var(--ease-drawer), opacity 200ms var(--ease-out);
  }
  @starting-style {
    .drawer-panel {
      transform: translateX(32px);
      opacity: 0;
    }
  }
}

.drawer-form {
  display: grid;
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  padding-inline-end: 4px;
  overscroll-behavior: contain;
}

.field {
  display: grid;
  gap: 6px;
}

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

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.4;
}

.field textarea {
  resize: vertical;
  min-height: 76px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-box {
  background: var(--bg-canvas);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.upload-box audio {
  width: 100%;
  height: 36px;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Native Confirmation Dialog */
dialog.confirm-dialog {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

dialog.confirm-dialog::backdrop {
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(4px);
}

dialog.confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

dialog.confirm-dialog p {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Status & Undo Toast */
.toast-region {
  position: fixed;
  inset-inline-end: 20px;
  inset-block-end: 20px;
  z-index: 60;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100% - 32px));
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 11px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: transform 220ms var(--ease-out), opacity 180ms ease;
  }
  @starting-style {
    .toast {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

/* ---------- Projector Board ---------- */
.board-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  padding: 20px 28px;
  gap: 18px;
  overflow: hidden;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.brand-title h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-solid);
}

.brand-title span {
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.on-air-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.lobby-view {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 0;
}

.qr-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.qr-card img {
  width: 100%;
  max-width: 280px;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  outline: 1px solid oklch(1 0 0 / 0.1);
  outline-offset: -1px;
}

.qr-url {
  margin-top: 16px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-solid);
  word-break: break-word;
}

.qr-hint {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.lobby-roster {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lobby-roster h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.roster-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  overflow: auto;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 2px solid var(--chip-color, var(--border-strong));
  font-size: 1.15rem;
  font-weight: 700;
}

.jeopardy-grid {
  display: grid;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.cat-header {
  background: linear-gradient(180deg, #1b2847 0%, #111a30 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: clamp(0.95rem, 1.45vw, 1.3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  text-wrap: balance;
}

.clue-tile {
  background: linear-gradient(180deg, #132245 0%, #0d1730 100%);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 2.8vw, 2.5rem);
  font-weight: 900;
  color: var(--accent-solid);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 16px var(--accent-glow);
}

.clue-tile.used {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.08);
  color: rgba(148, 163, 184, 0.16);
  text-shadow: none;
}

.clue-stage {
  background: radial-gradient(circle at center, #18274a 0%, #0d1426 80%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  min-height: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .clue-stage {
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  }
  @starting-style {
    .clue-stage {
      opacity: 0;
      transform: scale(0.98);
    }
  }
}

.clue-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--info-text);
}

.dd-badge {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
}

.clue-prompt {
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  font-weight: 800;
  max-width: 960px;
  line-height: 1.22;
  text-wrap: balance;
}

.clue-answer {
  font-size: clamp(1.7rem, 3.2vw, 2.8rem);
  font-weight: 900;
  color: var(--accent-solid);
  background: var(--accent-soft);
  border: 2px solid var(--accent-solid);
  border-radius: 18px;
  padding: 18px 28px;
  max-width: 960px;
  text-wrap: balance;
}

/* GPU-only equalizer bars using transform: scaleY */
.eq-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 52px;
}

.eq-bars span {
  width: 10px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--accent-solid);
  transform-origin: bottom center;
  transform: scaleY(0.24);
  opacity: 0.3;
  transition: transform 180ms var(--ease-out), opacity 180ms ease;
}

.eq-bars.playing span {
  opacity: 1;
  transform: scaleY(0.72);
}

@media (prefers-reduced-motion: no-preference) {
  .eq-bars.playing span {
    animation: eqScale 0.72s ease-in-out infinite alternate;
  }
  .eq-bars.playing span:nth-child(2) { animation-delay: 0.12s; }
  .eq-bars.playing span:nth-child(3) { animation-delay: 0.25s; }
  .eq-bars.playing span:nth-child(4) { animation-delay: 0.08s; }
  .eq-bars.playing span:nth-child(5) { animation-delay: 0.31s; }
  .eq-bars.playing span:nth-child(6) { animation-delay: 0.19s; }
  .eq-bars.playing span:nth-child(7) { animation-delay: 0.05s; }
}

@keyframes eqScale {
  from { transform: scaleY(0.22); }
  to { transform: scaleY(1); }
}

/* GPU-only progress bar using transform: scaleX */
.audio-progress {
  width: min(520px, 80%);
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--info-text), var(--accent-solid));
  transition: transform 150ms linear;
}

.buzzer-banner {
  padding: 16px 30px;
  border-radius: 18px;
  font-size: clamp(1.3rem, 2.4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.03em;
}

.buzzer-banner.armed {
  background: var(--success-soft);
  border: 2px solid var(--success-solid);
  color: #a7f3d0;
}

.buzzer-banner.winner {
  background: var(--winner-color, var(--accent-solid));
  color: var(--text-on-accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

.splits-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.split-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.scoreboard {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.score-card {
  flex: 1 1 160px;
  min-width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 4px solid var(--team-color, var(--accent-solid));
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-name {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-pts {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-solid);
  font-variant-numeric: tabular-nums;
}

.audio-gate {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.audio-gate-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-solid);
  border-radius: 22px;
  padding: 36px 40px;
  text-align: center;
  max-width: 480px;
  margin: 16px;
}

.audio-gate-card h2 {
  margin: 0 0 10px;
  color: var(--accent-solid);
}

.audio-gate-card p {
  margin: 0 0 22px;
  color: var(--text-secondary);
}

/* ---------- Mobile Phone Buzzer ---------- */
.player-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  gap: 14px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
}

.join-card {
  margin: auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 26px 22px;
  display: grid;
  gap: 14px;
}

.join-card h1 {
  margin: 0;
  font-size: 1.55rem;
  color: var(--accent-solid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.join-error {
  color: var(--danger-text);
  font-size: 0.9rem;
}

.buzzer-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.clue-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
}

.clue-pill-cat {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--info-text);
}

.clue-pill-text {
  margin-top: 4px;
  font-size: 1rem;
  color: var(--text-primary);
}

.giant-buzzer {
  flex: 1 1 auto;
  width: 100%;
  min-height: 220px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  font-size: clamp(1.5rem, 7vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  touch-action: manipulation;
  user-select: none;
  border: 3px solid transparent;
  transition: transform 150ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.giant-buzzer small {
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.92;
}

.giant-buzzer.standby {
  background: #131b2e;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.giant-buzzer.armed {
  background: radial-gradient(circle at center, #34d399 0%, #10b981 100%);
  border-color: #a7f3d0;
  color: var(--text-on-success);
  box-shadow: 0 0 42px var(--success-glow);
}

.giant-buzzer.winner {
  background: radial-gradient(circle at center, #fbbf24 0%, #f59e0b 100%);
  border-color: #fde68a;
  color: var(--text-on-accent);
  box-shadow: 0 0 48px var(--accent-glow);
}

.giant-buzzer.locked {
  background: #271a22;
  border-color: rgba(244, 114, 182, 0.45);
  color: #fbcfe8;
}

.giant-buzzer.wrong {
  background: #2c1215;
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.mini-scores {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mini-score {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
  display: flex;
  gap: 8px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
