/* Quiz Bee Presenter — Futuristic Math Theme */

:root {
  /* Don Severino Math Royale — dark arena palette */
  --bg-dark: #020309;
  /* Event poster background: set to match event.jpg so it covers the full display with no seam */
  --event-poster-bg: #020309;
  --bg-card: rgba(10, 6, 18, 0.98);
  --bg-elevated: #141020;
  --bg-panel: rgba(5, 4, 12, 0.92);

  /* Primary crimson + ember accents (from poster chess piece) */
  --primary: #ff1744;
  --primary-dim: rgba(255, 23, 68, 0.18);
  --primary-glow: rgba(255, 23, 68, 0.5);
  --accent: #f4511e;
  --accent-math: #ff8a80;

  /* Gold highlights for scores / crowns */
  --gold: #ffc928;
  --gold-glow: rgba(255, 201, 40, 0.4);

  /* Status colors */
  --success: #22c55e;
  --danger: #ff5252;
  --warning: #ffb74d;

  --text: #f5f5f7;
  --text-muted: #9ca3af;
  --grid-line: rgba(255, 255, 255, 0.04);

  /* Chessboard overlay (high contrast) */
  --chess-light: rgba(255, 255, 255, 0.16);
  --chess-dark: rgba(0, 0, 0, 0.85);

  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Exo 2', sans-serif;

  --radius: 8px;
  --radius-lg: 16px;
  --radius-sharp: 4px;
  --shadow-glow: 0 0 70px rgba(0, 0, 0, 0.85),
                  0 0 60px rgba(255, 23, 68, 0.25);
  --border-glow: 1px solid rgba(255, 23, 68, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global hidden utility — used by JS to toggle visibility */
.hidden {
  display: none !important;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* Chessboard arena background */
.math-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--chess-dark);
  background-image:
    linear-gradient(45deg,
      var(--chess-light) 25%,
      transparent 25%,
      transparent 75%,
      var(--chess-light) 75%,
      var(--chess-light) 100%
    ),
    linear-gradient(45deg,
      var(--chess-light) 25%,
      transparent 25%,
      transparent 75%,
      var(--chess-light) 75%,
      var(--chess-light) 100%
    );
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
}

.math-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Vertical moving strips + vignette */
  background:
    radial-gradient(ellipse 90% 60% at 50% 10%, rgba(255, 255, 255, 0.05), transparent 55%),
    radial-gradient(ellipse 120% 80% at 50% 120%, rgba(0, 0, 0, 0.85), transparent 70%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 2px,
      transparent 2px,
      transparent 16px
    );
  mix-blend-mode: screen;
}

.math-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Horizontal moving crimson strips */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 23, 68, 0.08) 0px,
      rgba(255, 23, 68, 0.08) 3px,
      transparent 3px,
      transparent 18px
    );
  mix-blend-mode: screen;
}

@keyframes nexus-strips-x-slow {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 120px 0, 0 0; }
}

@keyframes nexus-strips-x-medium {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 220px 0, 0 0; }
}

@keyframes nexus-strips-x-fast {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 320px 0, 0 0; }
}

@keyframes nexus-strips-y-slow {
  0% { background-position: 0 0; }
  100% { background-position: 0 140px; }
}

@keyframes nexus-strips-y-medium {
  0% { background-position: 0 0; }
  100% { background-position: 0 260px; }
}

@keyframes nexus-strips-y-fast {
  0% { background-position: 0 0; }
  100% { background-position: 0 380px; }
}

/* Background motion — speed/intensity depends on round */
.presenter.round-easy .math-bg::before {
  animation: nexus-strips-x-slow 40s linear infinite;
}

.presenter.round-average .math-bg::before {
  animation: nexus-strips-x-medium 26s linear infinite;
}

.presenter.round-difficult .math-bg::before {
  animation: nexus-strips-x-fast 16s linear infinite;
}

.presenter.round-easy .math-bg::after {
  animation: nexus-strips-y-slow 45s linear infinite;
}

.presenter.round-average .math-bg::after {
  animation: nexus-strips-y-medium 30s linear infinite;
}

.presenter.round-difficult .math-bg::after {
  animation: nexus-strips-y-fast 18s linear infinite;
}

.presenter {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Game setup gate: quiz hidden until admin closes Settings */
.setup-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5, 5, 16, 0.95);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body.setup-required .setup-gate {
  display: flex;
}

body.setup-required .stage {
  display: none;
}

body.setup-required .score-strip {
  display: none;
}

.setup-gate-content {
  text-align: center;
  max-width: 400px;
}

.setup-gate-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.setup-gate-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Control bar — sci-fi panel */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-panel);
  border-bottom: var(--border-glow);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  /* Keep header height stable even as labels change */
  min-height: 64px;
}

.control-left,
.control-center,
.control-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.presenter.championship-mode .control-center {
  display: none;
}

/* Arena mode (admin only): show only arena-relevant header controls */
body:not(.audience-view) .presenter.arena-mode #roundBadge,
body:not(.audience-view) .presenter.arena-mode #roundSelect,
body:not(.audience-view) .presenter.arena-mode #scoreSelect,
body:not(.audience-view) .presenter.arena-mode #quizModeBadge,
body:not(.audience-view) .presenter.arena-mode #btnPrev,
body:not(.audience-view) .presenter.arena-mode #slideIndicator,
body:not(.audience-view) .presenter.arena-mode #btnNext,
body:not(.audience-view) .presenter.arena-mode #btnResetScores,
body:not(.audience-view) .presenter.arena-mode #btnChampionship,
body:not(.audience-view) .presenter.arena-mode #btnAddQuestion {
  display: none !important;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.08em;
  text-shadow: 0 0 26px rgba(0, 0, 0, 0.85),
               0 0 30px var(--primary-glow);
  text-transform: uppercase;
}

.logo-symbol {
  margin-right: 6px;
  color: var(--primary);
  font-weight: 900;
}

.logo-tagline {
  display: inline-block;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.round-badge {
  font-size: 0.7rem;
  padding: 5px 12px;
  background: var(--primary-dim);
  color: var(--primary);
  border-radius: var(--radius-sharp);
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.round-select,
.difficulty-select {
  min-width: 120px;
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
}

.quiz-mode-badge {
  font-size: 0.7rem;
  padding: 5px 10px;
  background: rgba(251, 191, 36, 0.15);
  color: transparent; /* keep layout space but hide text */
  border-radius: var(--radius-sharp);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid rgba(251, 191, 36, 0.35);
  white-space: nowrap;
  visibility: hidden; /* keep badge size/space but hide it completely */
}

.presenter.championship-mode .round-select,
.presenter.championship-mode .difficulty-select,
.presenter.championship-mode .quiz-mode-badge {
  display: none;
}

.btn-nav {
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-nav:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.slide-indicator {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 80px;
  text-align: center;
  letter-spacing: 0.05em;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  color: var(--primary);
  background: var(--primary-dim);
}

.btn-buzzer {
  position: relative;
}

.buzzer-count-badge {
  display: inline-block;
  min-width: 1.25em;
  margin-left: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary);
  color: var(--bg-dark);
  border-radius: 999px;
}

.btn-admin {
  color: var(--primary);
  font-weight: 500;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* Stage — min-height: 0 so it can shrink; overflow-y: auto so footer stays visible */
.stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}

.view {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* .hidden handled globally above */

/* Question view */
.view-question {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 48px;
}

.view-question.animate-in {
  animation: question-slide-in 0.24s ease-out;
}

@keyframes question-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Transition when entering question from championship board (after confirming block) */
.view-question.from-championship {
  animation: champ-to-question 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes champ-to-question {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Championship view — final round, grand presentation; no scroll, maximize space */
.stage:has(.view-championship:not(.hidden)) {
  overflow: hidden;
  padding: 12px 16px;
  align-items: stretch;
}

.view-championship {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0 8px 8px;
}

.view-championship .champ-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 1 1320px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  align-self: stretch;
}

.champ-card {
  width: 100%;
  max-width: 1320px;
  padding: 20px 24px 20px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: var(--shadow-glow), 0 0 60px rgba(0, 229, 255, 0.08);
}

.view-championship .champ-card {
  padding: 16px 20px 16px;
}

.champ-header {
  margin-bottom: 12px;
  text-align: center;
  flex-shrink: 0;
}

.view-championship .champ-header {
  margin-bottom: 10px;
}

.champ-header-top {
  display: flex;
  align-items: center;
  justify-content: center;
}

.champ-header-content {
  width: 100%;
  max-width: 900px;
}

.champ-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
  text-shadow: 0 0 32px rgba(0, 229, 255, 0.35);
}

.view-championship .champ-title {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.champ-subtitle {
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.9);
  line-height: 1.6;
  margin: 0 auto;
}

.view-championship .champ-subtitle {
  font-size: 0.9rem;
  line-height: 1.4;
}

.champ-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.champ-info-left {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}

.champ-info-center {
  flex: 0 0 auto;
  text-align: center;
}

.champ-info-right {
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
}

.champ-progress {
  font-size: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.champ-info-row .champ-progress {
  margin-top: 0;
}

.champ-next-selector {
  font-size: 1rem;
  color: #e5e7eb;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.champ-info-row .champ-next-selector {
  margin-top: 0;
}

.champ-power-ownership-strip {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-info-row .champ-power-ownership-strip {
  margin-top: 0;
}

.champ-selected {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sharp);
  background: rgba(15, 23, 42, 0.95);
  border: 1px dashed rgba(0, 229, 255, 0.4);
  font-size: 1rem;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.view-championship .champ-selected {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.champ-grid {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sharp);
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.25);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  flex: 1;
}

.view-championship .champ-grid {
  margin-top: 8px;
  padding: 10px 12px;
}

.champ-grid-row {
  display: grid;
  grid-template-columns: minmax(280px, 2.2fr) repeat(3, minmax(180px, 1fr));
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}

.view-championship .champ-grid .champ-grid-row:not(.champ-grid-header) {
  flex: 1;
  min-height: 0;
}

.view-championship .champ-grid .champ-grid-row {
  gap: 8px;
}

.champ-grid-header {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.champ-grid-corner {
  /* empty top-left corner cell */
}

.champ-grid-col {
  text-align: center;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 12px 8px;
  font-weight: 600;
  font-family: var(--font-display);
}

.view-championship .champ-grid-col {
  font-size: 0.95rem;
  padding: 6px 6px;
}

.champ-grid-topic {
  font-size: 1.1rem;
  color: var(--text);
  padding: 12px 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.view-championship .champ-grid-topic {
  font-size: 0.95rem;
  padding: 6px 10px;
}

.champ-cell {
  position: relative;
  border-radius: var(--radius-sharp);
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: radial-gradient(circle at 30% -20%, rgba(0, 229, 255, 0.28), transparent 55%),
              rgba(15, 23, 42, 0.95);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  min-height: 72px;
  transition: transform 0.1s, box-shadow 0.2s, border-color 0.2s, background 0.2s, opacity 0.2s;
}

.view-championship .champ-cell {
  padding: 12px 10px;
  min-height: 0;
}

.champ-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.45);
  border-color: var(--primary);
}

.champ-cell-label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.view-championship .champ-cell-label {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
}

.champ-cell.used {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

.champ-cell.used .champ-cell-label::after {
  content: none;
}

.champ-cell-check {
  margin-left: 6px;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.champ-cell-second {
  margin-left: 2px;
  font-size: 0.85rem;
  font-weight: 600;
}

.champ-cell-second.correct {
  color: var(--gold);
}

.champ-cell-second.incorrect {
  color: var(--danger, #ef4444);
}

.champ-cell-flash {
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.55);
  transform: translateY(-1px) scale(1.02);
}

.champ-back {
  /* kept for any legacy refs; button removed from DOM */
  display: none !important;
}

.timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Timer — digital / orbital style */
.timer-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid var(--bg-elevated);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), 0 0 40px var(--shadow-glow);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.timer-ring.running {
  border-color: var(--primary);
  box-shadow: inset 0 0 40px rgba(0, 229, 255, 0.1), 0 0 50px var(--primary-glow);
  animation: pulse-ring 1.5s ease-in-out infinite;
}

.timer-ring.warning {
  border-color: var(--warning);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
}

.timer-ring.danger {
  border-color: var(--danger);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

.timer-value {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
  letter-spacing: 0.02em;
}

.timer-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--font-display);
}

.btn-timer {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--bg-dark);
  border: none;
  padding: 10px 26px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-timer:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
  box-shadow: 0 0 24px var(--primary-glow);
}

/* .hidden handled globally above */

/* Question panel — math terminal style */
.question-block {
  flex: 1;
  min-width: 280px;
  max-width: 640px;
  padding: 36px 36px 36px 40px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  position: relative;
}

.question-block::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.question-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 14px;
}

.q-symbol {
  color: var(--accent-math);
  font-weight: 700;
  margin-right: 4px;
}

.question-text {
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* KaTeX math styling overrides */
.question-text .katex,
.answer-value .katex,
.solution-display .katex {
  font-size: 1em;
  color: inherit;
}

.question-text .katex-display,
.solution-display .katex-display {
  margin: 8px 0;
  overflow-x: auto;
}

.solution-display .sol-line .katex {
  font-size: 0.95em;
}

.question-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.meta-difficulty {
  text-transform: capitalize;
}

.meta-coverage {
  border-left: 1px solid rgba(148, 163, 184, 0.5);
  padding-left: 12px;
  font-size: 0.8rem;
}

/* Quiz Bowl buzzer callout */
.buzzer-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

/* .hidden handled globally above */

.buzzer-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--success);
}

.buzzer-name {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.btn-clear-buzz {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: var(--radius-sharp);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s, border-color 0.2s;
}

.btn-clear-buzz:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-hint strong {
  word-break: break-all;
  font-weight: 500;
}

/* Copy invite link (JustBuzz-style) */
.btn-invite {
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-invite:hover {
  filter: brightness(1.1);
}

/* JustBuzz-style Buzzer panel: Info, Settings, Player Board, Buzzer Board */
.buzzer-panel {
  width: 280px;
  max-height: 420px;
  padding: 16px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.25s, opacity 0.25s, padding 0.25s;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.buzzer-panel.collapsed {
  width: 48px;
  max-height: 48px;
  padding: 12px;
}

.buzzer-panel.collapsed .buzzer-info,
.buzzer-panel.collapsed .buzzer-settings,
.buzzer-panel.collapsed .buzzer-board-section {
  display: none;
}

.buzzer-info {
  display: flex;
  gap: 20px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.buzzer-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buzzer-info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.buzzer-info-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.buzzer-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.buzzer-setting {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.buzzer-setting input {
  accent-color: var(--primary);
}

.buzzer-board-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.buzzer-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.buzzer-board-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.btn-clear-all {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: var(--radius-sharp);
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-clear-all:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.buzzer-board {
  min-height: 60px;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.players-board {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.buzzers-board {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.buzzer-board-item {
  font-size: 0.9rem;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  color: var(--text);
}

/* Answer view — full-width card layout (large for visibility from distance) */
.view-answer {
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding: 0 32px 32px;
}

.answer-card {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.answer-header {
  padding: 36px 48px;
  background: linear-gradient(135deg, var(--primary) 0%, #c62828 45%, #1b1520 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 45px rgba(255, 23, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  text-align: center;
}

.answer-label {
  display: block;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.answer-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.25);
  letter-spacing: 0.02em;
  line-height: 1.35;
  word-break: break-word;
}

.answer-columns {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .answer-columns {
    grid-template-columns: 1fr;
  }
}

.answer-col-left {
  min-width: 0;
}

.answer-col-right {
  min-width: 0;
}

.solution-block {
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  padding: 28px 36px;
}

.solution-block h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}

.solution-display {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 55vh;
  overflow-y: auto;
  padding: 8px 0;
}

.solution-display .sol-line {
  padding: 4px 0;
}

.solution-display .sol-answer {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--bg-dark);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 24px var(--primary-glow);
}

.solution-text {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--text);
  padding: 18px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
  resize: vertical;
  min-height: 120px;
}

.solution-text::placeholder {
  color: var(--text-muted);
}

/* Settings sections */
.settings-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}

.settings-section-title {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.radio-label input {
  accent-color: var(--primary);
}

/* Buzzer panel on question view (who buzzed?) */
.view-question .buzzer-panel {
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  display: block;
}

/* .hidden handled globally above */

.buzzer-panel-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.buzzer-panel-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.buzzer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buzzer-buttons .btn-buzz {
  padding: 10px 18px;
  font-size: 0.95rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--text);
  border-radius: var(--radius-sharp);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.buzzer-buttons .btn-buzz:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

.buzzer-buttons .btn-buzz:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(0, 229, 255, 0.1);
}

.buzzer-verify {
  margin-top: 16px;
  padding: 16px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius);
}

.buzzer-verify-who {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.buzzer-verify-prompt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.buzzer-verify-actions {
  display: flex;
  gap: 10px;
}

.team-checks,
.collective-check-wrap,
.buzzer-result-wrap {
  margin-bottom: 14px;
}

/* .hidden handled globally above */

.team-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  margin-right: 16px;
}

.buzzer-result-wrap p {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1.05rem;
}

.buzzer-result-wrap #buzzerResultWho {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--primary);
}

.buzzer-result-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.buzzer-result-buttons .btn-primary,
.buzzer-result-buttons .btn-ghost {
  font-size: 1.05rem;
  padding: 12px 20px;
}

/* Who got it right — REVIEW block (larger for visibility from distance) */
.who-got-it-block {
  padding: 26px 28px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
}

.who-got-it-block h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-display);
}

.who-got-it-hint {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-add-score {
  width: 100%;
  margin-top: 14px;
  text-align: center;
  font-size: 1.05rem;
  padding: 12px 20px;
}

.participant-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 16px;
}

.participant-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}

.participant-checks input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.scoreboard-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.scoreboard-strip .participant-score {
  color: var(--text);
}

.scoreboard-strip .participant-score span {
  color: var(--gold);
  font-weight: 700;
  margin-left: 4px;
}

.scoreboard-strip .no-participants {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Score strip — digital readout */
.score-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 28px;
  background: rgba(0, 0, 0, 0.94); /* solid panel above chessboard */
  border-top: var(--border-glow);
  flex-shrink: 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 20;
}

.presenter.championship-mode .score-strip {
  justify-content: flex-start;
}

/* Arena rounds (admin only): hide unrelated footer strip */
body:not(.audience-view) .presenter.arena-mode .score-strip {
  display: none !important;
}

.presenter.championship-mode .score-strip .score-label,
.presenter.championship-mode .score-strip .score-value,
.presenter.championship-mode .score-strip .score-sep {
  display: none;
}

.semi-target {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.champ-power-footer {
  margin-left: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presenter.championship-mode .champ-power-footer {
  display: block;
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-display);
}

.score-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 24px var(--gold-glow);
  letter-spacing: 0.05em;
}

.score-value.small {
  font-size: 1.1rem;
  color: var(--text);
}

.score-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, var(--primary-dim), transparent);
  margin: 0 6px;
}

.score-sep {
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-mono);
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 90vw;
}

/* Fallback when dialog is opened without showModal() (e.g. older browsers) */
.modal[open] {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 1000;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: var(--border-glow);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 229, 255, 0.08);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.admin-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bg-dark);
  background: var(--gold);
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.settings-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 16px;
}

.solution-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.questions-list-group {
  margin-top: 8px;
}

.questions-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 8px;
}

.questions-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--bg-card);
  font-size: 0.9rem;
}

.questions-list li:last-child {
  margin-bottom: 0;
}

.questions-list .q-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.questions-list .q-preview {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.questions-list .q-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.questions-list .q-actions {
  display: flex;
  gap: 6px;
}

.questions-list .q-actions button {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.questions-list .q-actions .edit-btn {
  background: var(--primary-dim);
  color: var(--primary);
}

.questions-list .q-actions .edit-btn:hover {
  background: rgba(0, 212, 255, 0.35);
}

.questions-list .q-actions .del-btn {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
}

.questions-list .q-actions .del-btn:hover {
  background: var(--danger);
  color: white;
}

.modal-question .modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.modal-actions-fill {
  flex: 1;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted, rgba(255,255,255,0.6));
  margin-top: 6px;
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.form-group textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: vertical;
  min-height: 100px;
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.25s ease-out;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.warning { border-color: var(--warning); color: var(--warning); }
.toast.danger { border-color: var(--danger); color: var(--danger); }
.toast.info { border-color: var(--primary); color: var(--primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shortcuts */
.shortcuts-btn {
  position: fixed;
  bottom: 72px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sharp);
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 100;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(6px);
}

.shortcuts-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 20px var(--primary-glow);
}

.modal-shortcuts .modal-content {
  color: var(--text);
}

.modal-shortcuts .modal-content h2 {
  color: var(--text);
}

.modal-shortcuts .shortcuts-list {
  list-style: none;
  margin: 16px 0;
}

.modal-shortcuts .shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
  color: var(--text);
}

.modal-shortcuts .shortcuts-list li:last-child {
  border-bottom: none;
}

.modal-shortcuts kbd {
  display: inline-block;
  min-width: 28px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  flex-shrink: 0;
}

.modal-shortcuts .modal-actions .btn-ghost {
  color: var(--text);
}

.modal-shortcuts .modal-actions .btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.form-group-checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

/* Championship confirm modal tweaks */
.modal-champ-confirm .modal-content {
  max-width: 480px;
}

/* Initial round selection modal tweaks */
.modal-round-select .modal-content {
  max-width: 520px;
}

.modal-round-select .modal-actions {
  justify-content: space-between;
}

.modal-round-select #btnRoundSemifinal {
  min-width: 180px;
}

.modal-round-select #btnRoundChampionship {
  min-width: 200px;
  border-radius: var(--radius-sharp);
  border: 1px solid rgba(251, 191, 36, 0.9);
  color: var(--bg-dark);
  background: linear-gradient(135deg, #ffe082 0%, #ffc928 35%, #ffb300 70%, #ff8f00 100%);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.modal-round-select #btnRoundChampionship:hover {
  border-color: #ffe082;
  box-shadow: 0 0 28px var(--gold-glow);
  filter: brightness(1.06);
}

.modal-round-select #btnRoundResetEvent {
  width: 100%;
  margin-top: 8px;
}

/* Championship power-up table in settings */
.champ-power-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.8rem;
}

.champ-power-table th,
.champ-power-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 6px 8px;
  text-align: center;
}

.champ-power-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
}

.champ-power-table td:first-child {
  color: var(--text);
  font-weight: 500;
}

/* Championship power-up ownership (who has what) */
.champ-power-ownership {
  margin-top: 8px;
}

.champ-ownership-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.champ-ownership-table th,
.champ-ownership-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 8px 10px;
  text-align: center;
  vertical-align: top;
}

.champ-ownership-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.champ-owner-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.champ-owner-list {
  color: var(--text);
}

.champ-owner-actions {
  white-space: nowrap;
}

.powerup-owned-tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.powerup-owned-tag .powerup-owned-icon {
  margin-right: 4px;
}

.btn-use-powerup {
  font-size: 0.75rem;
  padding: 4px 10px;
}

.powerup-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.powerup-tag .powerup-emoji {
  margin-right: 4px;
}

.powerup-tag.none {
  color: var(--text-muted);
  background: rgba(31, 41, 55, 0.7);
}

.powerup-easy {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.powerup-average {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.powerup-difficult {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Power-Up reveal modal visuals */
.powerup-reveal-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px;
}

.powerup-icon-pill {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
  border: 2px solid rgba(0, 212, 255, 0.8);
  background: radial-gradient(circle at 30% 0%, rgba(0, 212, 255, 0.2), transparent 60%),
              rgba(5, 5, 20, 0.98);
  animation: powerup-pop 0.4s ease-out;
}

.powerup-icon-utility {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.6);
}

.powerup-icon-offensive {
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.6);
}

.powerup-icon-defensive {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 26px rgba(59, 130, 246, 0.6);
}

@keyframes powerup-pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.powerup-effect-preview {
  margin-top: 16px;
}

/* Power-up effect viewer modal shell */
.powerup-modal-shell {
  position: relative;
  text-align: center;
}

.powerup-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 23, 68, 0.6);
  background: rgba(10, 6, 18, 0.9);
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font-display);
}

.powerup-modal-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: radial-gradient(circle at 30% 0%, rgba(0, 229, 255, 0.18), transparent 60%),
              rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.25);
  font-size: 2rem;
}

.powerup-modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 10px;
}

.powerup-modal-effect {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 auto 14px;
  max-width: 520px;
}

.powerup-modal-effect-container {
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 229, 255, 0.18);
  margin-bottom: 14px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.powerup-modal-timing {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #e5f6ff;
  font-weight: 600;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
  margin-bottom: 6px;
}

/* Effect modal card (mirrors mechanics overlay layout) */
.effect-modal-card {
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.9) 0%, rgba(13, 2, 33, 0.98) 100%);
  border-radius: 16px;
  padding: 20px 18px 16px;
  border: 1px solid rgba(123, 44, 191, 0.5);
  text-align: center;
  font-size: 0.8rem;
}

.effect-icon-top {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  background: radial-gradient(circle at 30% 0%, rgba(0, 212, 255, 0.25), transparent 60%),
              rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 26px rgba(0, 212, 255, 0.45);
  font-size: 1.7rem;
}

.effect-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 6px;
}

.effect-desc {
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 14px;
}

.effect-hero {
  background: rgba(5, 7, 24, 0.96);
  border-radius: 12px;
  padding: 14px 12px;
  margin-bottom: 14px;
}

.effect-multiplier-main {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.effect-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.effect-hero-box {
  min-width: 90px;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.effect-hero-box.muted {
  background: rgba(31, 41, 55, 0.9);
  color: rgba(148, 163, 184, 0.95);
}

.effect-hero-box.highlight {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.effect-hero-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.effect-hero-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 4px;
}

.effect-hero-arrow {
  font-size: 1rem;
  color: var(--secondary);
}

.effect-timing-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--secondary);
  border: 1px solid rgba(0, 212, 255, 0.6);
  background: rgba(0, 212, 255, 0.08);
}

/* end power-up header section; effect preview below uses custom layouts per power-up */

/* Double Down animated effect (adapted from mechanics HTML) */
.doubledown-effect {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 8px;
}

.doubledown-effect .multiplier {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: multiplierPop 0.5s ease;
}

@keyframes multiplierPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.doubledown-effect .points-display {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 4px;
}

.doubledown-effect .points-box {
  padding: 10px 16px;
  border-radius: 10px;
  text-align: center;
}

.doubledown-effect .points-box.original {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(148, 163, 184, 0.95);
}

.doubledown-effect .points-box.doubled {
  background: rgba(34, 197, 94, 0.2);
  color: #6ee7b7;
  animation: doublePulse 1s ease infinite;
}

@keyframes doublePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 22px rgba(34, 197, 94, 0.8); }
}

.doubledown-effect .points-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.doubledown-effect .points-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  margin-top: 4px;
}

.doubledown-effect .points-arrow {
  font-size: 1.4rem;
  color: var(--secondary);
}

/* Checkmate effect preview (chess-board layout) */
.checkmate-effect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.checkmate-effect .chess-board {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checkmate-effect .chess-piece.you {
  font-size: 2.5rem;
  animation: pieceSlide 0.7s ease-out forwards;
}

.checkmate-effect .chess-target {
  font-size: 2.3rem;
  opacity: 0;
  animation: targetPop 0.6s ease 0.4s forwards;
}

.checkmate-effect .chess-arrow {
  font-size: 2rem;
  color: var(--secondary);
  animation: arrowPulse 1s ease-in-out infinite;
}

.checkmate-effect .checkmate-text {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.8s forwards;
}

@keyframes pieceSlide {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(5px); opacity: 1; }
}

@keyframes targetPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Freeze effect */
.freeze-effect {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.freeze-target {
  font-size: 3rem;
  animation: freezeShake 0.5s ease, freezeFade 2s ease 0.5s forwards;
}

.ice-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ice-particle {
  position: absolute;
  font-size: 1.5rem;
  animation: iceFloat 2s ease infinite;
}

@keyframes freezeShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes freezeFade {
  0% { filter: hue-rotate(0deg) brightness(1); }
  100% { filter: hue-rotate(180deg) brightness(0.5); opacity: 0.5; }
}

@keyframes iceFloat {
  0% { transform: translateY(80px) rotate(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(-80px) rotate(360deg); opacity: 0; }
}

/* Point Steal effect */
.steal-effect {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  padding: 20px;
  position: relative;
}

.steal-player {
  text-align: center;
}

.steal-player-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.steal-score {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

.steal-score.increase {
  color: #4ade80;
  animation: scoreIncrease 1s ease forwards;
}

.steal-score.decrease {
  color: #f87171;
  animation: scoreDecrease 1s ease forwards;
}

.steal-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.flying-coins {
  position: absolute;
  display: flex;
  gap: 10px;
}

.flying-coin {
  font-size: 1.5rem;
  animation: coinFly 1s ease forwards;
}

@keyframes scoreDecrease {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes scoreIncrease {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes coinFly {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-150px); opacity: 0; }
}

/* Shield effect */
.shield-effect {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-barrier {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--secondary);
  animation: barrierExpand 1.5s ease infinite;
}

.shield-barrier.delay {
  animation-delay: 0.5s;
}

@keyframes barrierExpand {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.shield-icon {
  font-size: 4rem;
  z-index: 2;
  animation: shieldPulse 1s ease infinite;
}

@keyframes shieldPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--secondary)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 30px var(--secondary)); }
}

.attack-blocked {
  position: absolute;
  font-size: 1.5rem;
  animation: attackBlock 1s ease forwards;
}

@keyframes attackBlock {
  0% { transform: translateX(100px) scale(1); opacity: 1; }
  50% { transform: translateX(20px) scale(1.2); }
  100% { transform: translateX(-50px) scale(0); opacity: 0; }
}

/* Second Chance effect */
.secondchance-effect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.secondchance-effect .wrong-answer {
  font-size: 2rem;
  color: var(--danger);
  animation: wrongShake 0.5s ease;
}

.secondchance-effect .retry-icon {
  font-size: 3rem;
  animation: retrySpinReverse 1s ease forwards;
}

.secondchance-effect .new-chance {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #4ade80;
  animation: fadeInUp 0.5s ease 1s forwards;
  opacity: 0;
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-15px); }
  75% { transform: translateX(15px); }
}

@keyframes retrySpinReverse {
  0% { transform: rotate(0deg); opacity: 0; }
  100% { transform: rotate(-360deg); opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Score Swap effect */
.scoreswap-effect {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.swap-player {
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  min-width: 80px;
}

.swap-face {
  font-size: 1.6rem;
}

.swap-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.swap-score {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.swap-score.you-score {
  color: var(--danger);
}

.swap-score.opp-score {
  color: #22c55e;
}

.swap-arrow {
  font-size: 1.6rem;
  color: var(--secondary);
}

/* Match mechanics motion: score swap slide + arrow pulse */
.scoreswap-effect .swap-player.you {
  animation: swapSlideRight 1s ease forwards;
}

.scoreswap-effect .swap-player.opponent {
  animation: swapSlideLeft 1s ease forwards;
}

@keyframes swapSlideRight {
  0%, 30% { transform: translateX(0); }
  50% { transform: translateX(60px) scale(0.9); }
  100% { transform: translateX(0); }
}

@keyframes swapSlideLeft {
  0%, 30% { transform: translateX(0); }
  50% { transform: translateX(-60px) scale(0.9); }
  100% { transform: translateX(0); }
}

.scoreswap-effect .swap-arrow {
  animation: swapArrowPulse 1s ease infinite;
}

@keyframes swapArrowPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(180deg); }
}

/* Reroll effect */
.reroll-effect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dice-container {
  font-size: 2.2rem;
  animation: diceRoll 1s ease;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg); }
}

.question-cards {
  display: flex;
  gap: 10px;
}

.q-card {
  width: 40px;
  height: 56px;
  background: linear-gradient(135deg, #3d1a5c, #1a0a2e);
  border: 2px solid var(--accent);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

.q-card.old {
  animation: cardFadeOut 0.5s ease forwards;
}

.q-card.new {
  opacity: 0;
  animation: cardFadeIn 0.5s ease 0.5s forwards;
}

@keyframes cardFadeOut {
  to { transform: translateY(-20px) rotateY(90deg); opacity: 0; }
}

@keyframes cardFadeIn {
  from { transform: translateY(20px) rotateY(-90deg); opacity: 0; }
  to { transform: translateY(0) rotateY(0); opacity: 1; }
}

.q-card.new {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.reroll-text {
  font-size: 0.78rem;
  color: #4ade80;
}

/* Peek effect */
.peek-effect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.eye-icon {
  font-size: 2.4rem;
  animation: eyeBlink 2s ease infinite;
}

@keyframes eyeBlink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

.hidden-question {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  font-family: var(--font-mono);
  color: #9ca3af;
  position: relative;
  overflow: hidden;
}

.hidden-question.revealed {
  animation: revealQuestion 1s ease forwards;
}

@keyframes revealQuestion {
  0% { color: #9ca3af; }
  100% { color: #4ade80; background: rgba(34, 197, 94, 0.1); }
}

.reveal-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
  animation: scanLine 1s ease forwards;
}

@keyframes scanLine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.timer-display {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--secondary);
}

/* Mirror effect */
.mirror-effect {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mirror-center {
  font-size: 3.5rem;
  animation: mirrorPulse 1.2s ease-in-out infinite;
}

.mirror-attack {
  position: absolute;
  font-size: 2rem;
  opacity: 0;
}

.mirror-attack.incoming {
  left: 10%;
  animation: mirrorIncoming 0.6s ease-out forwards;
}

.mirror-attack.reflected {
  right: 10%;
  transform: scaleX(-1);
}

.mirror-attack.incoming.fade-out {
  animation: mirrorFadeOut 0.4s ease forwards;
}

.mirror-attack.reflected.fade-in {
  animation: mirrorFadeIn 0.5s ease forwards;
}

@keyframes mirrorFadeOut {
  to { transform: translateX(-40px); opacity: 0; }
}

@keyframes mirrorFadeIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.mirror-label {
  position: absolute;
  bottom: 12px;
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #4ade80;
  opacity: 0;
  animation: fadeInUp 0.5s ease 0.7s forwards;
}

@keyframes mirrorPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px #a855f7); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px #a855f7); }
}

@keyframes mirrorIncoming {
  0% { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 5-second transition overlay: event poster before correct answer */
/* Poster overlay covers entire display including header; hide header when overlay is visible */
#app:has(.poster-transition-overlay.visible) .control-bar {
  display: none !important;
}
.poster-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background-image: url(eventbg.jpg);
  background-repeat: repeat;
  background-position: 0 0;
  padding: 0;
  min-width: 100vw;
  min-height: 100vh;
}
.poster-transition-overlay.visible {
  display: flex !important;
}
.poster-transition-overlay .poster-transition-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Arena rounds: Elimination / Math Royale / Individual Agility */
.view-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.arena-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: var(--border-glow);
  padding: 24px;
  max-width: 900px;
  width: 100%;
}
.arena-header {
  margin-bottom: 20px;
}
.arena-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--text);
}
.arena-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.arena-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.arena-tab {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--grid-line);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.arena-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.arena-tab.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}
.arena-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.arena-scoreboard-wrap {
  overflow-x: auto;
}
.arena-scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.arena-scoreboard th,
.arena-scoreboard td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--grid-line);
}
.arena-scoreboard th {
  color: var(--text-muted);
  font-weight: 600;
}
.arena-scoreboard .arena-rank {
  width: 3rem;
  font-variant-numeric: tabular-nums;
}
.arena-scoreboard .arena-trend-cell {
  width: 2.5rem;
  text-align: center;
}
.arena-trend-up {
  color: var(--success);
  font-weight: bold;
}
.arena-trend-down {
  color: var(--danger);
  font-weight: bold;
}
.arena-score-cell-zero {
  position: relative;
}
.arena-score-cell-zero .arena-score-zero {
  display: inline-block;
  min-width: 1.5em;
  cursor: pointer;
  color: var(--text-muted);
}
.arena-score-cell-zero .arena-score-input[data-zero="true"] {
  position: absolute;
  left: 0;
  width: 2.5em;
  opacity: 0;
  pointer-events: none;
}
.arena-score-cell-zero.arena-score-cell-editing .arena-score-zero {
  display: none;
}
.arena-score-cell-zero.arena-score-cell-editing .arena-score-input {
  position: static;
  opacity: 1;
  pointer-events: auto;
}
.arena-score-input {
  width: 4rem;
  padding: 4px 8px;
  border-radius: var(--radius-sharp);
  border: 1px solid var(--grid-line);
  background: var(--bg-dark);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.arena-time-input {
  width: 6rem;
  padding: 4px 8px;
  border-radius: var(--radius-sharp);
  border: 1px solid var(--grid-line);
  background: var(--bg-dark);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.arena-status-select {
  padding: 4px 8px;
  border-radius: var(--radius-sharp);
  border: 1px solid var(--grid-line);
  background: var(--bg-dark);
  color: var(--text);
  min-width: 100px;
}
.arena-row.arena-status-eliminated {
  opacity: 0.7;
}
.arena-row.arena-status-eliminated .arena-name {
  text-decoration: line-through;
}
.arena-advance-wrap {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--grid-line);
}
.arena-advance-wrap.hidden {
  display: none !important;
}
.arena-upload-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grid-line);
}
.arena-upload-wrap .arena-upload-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.arena-upload-wrap .arena-names-textarea {
  width: 100%;
  max-width: 400px;
  min-height: 72px;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  resize: vertical;
  margin-bottom: 8px;
}
.arena-upload-wrap .arena-names-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
#btnArenaApplyAdvancement {
  font-size: 0.9rem;
  white-space: normal;
  text-align: left;
}

/* Arena round settings modal (names, scores, time finished) */
.arena-settings-names {
  width: 100%;
  min-height: 100px;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  resize: vertical;
  margin-bottom: 8px;
}
.arena-settings-scores-wrap {
  margin-top: 16px;
}
.arena-settings-table-scroll {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
}
.arena-settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.arena-settings-table th,
.arena-settings-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--grid-line);
  color: var(--text);
}
.arena-settings-table th {
  background: var(--bg-panel);
  font-weight: 600;
}
.arena-settings-name-cell {
  max-width: 200px;
  color: var(--text);
}
.arena-settings-score-input,
.arena-settings-time-input {
  width: 100%;
  max-width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  background: rgba(8, 14, 32, 0.95);
  color: var(--text);
}
.arena-settings-members-input {
  width: 100%;
  min-width: 260px;
  padding: 4px 8px;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  background: rgba(8, 14, 32, 0.95);
  color: var(--text);
}
.arena-settings-score-input::placeholder,
.arena-settings-time-input::placeholder,
.arena-settings-members-input::placeholder {
  color: var(--text-muted);
}
.arena-settings-time-col {
  min-width: 100px;
}

.modal-actions-round-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.modal-actions-round-select .btn-arena {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--grid-line);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-actions-round-select .btn-arena:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-dim);
}
.modal-actions-round-select .btn-arena-elimination {
  border-color: rgba(255, 23, 68, 0.4);
  color: var(--primary);
}
.modal-actions-round-select .btn-arena-mathroyale {
  border-color: rgba(255, 201, 40, 0.4);
  color: var(--gold);
}
.modal-actions-round-select .btn-arena-agility {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--success);
}

/* Device-profile responsive tweaks (set by app.js) */
body.device-mobile:not(.audience-view) .control-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px;
  position: sticky;
  top: 0;
  z-index: 80;
}

body.device-mobile:not(.audience-view) .control-left,
body.device-mobile:not(.audience-view) .control-center,
body.device-mobile:not(.audience-view) .control-right {
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

body.device-mobile:not(.audience-view) .logo {
  font-size: 0.82rem;
}

body.device-mobile:not(.audience-view) .stage {
  padding: 10px 10px 14px;
}

body.device-mobile:not(.audience-view) .question-text {
  font-size: clamp(1.15rem, 4.8vw, 1.8rem);
}

body.device-mobile:not(.audience-view) .score-strip {
  padding: 8px 10px;
}

body.device-mobile:not(.audience-view) .round-select,
body.device-mobile:not(.audience-view) .difficulty-select,
body.device-mobile:not(.audience-view) .btn-nav,
body.device-mobile:not(.audience-view) .btn-ghost,
body.device-mobile:not(.audience-view) .btn-danger,
body.device-mobile:not(.audience-view) .btn-primary {
  min-height: 40px;
  font-size: 0.88rem;
}

body.device-mobile:not(.audience-view) .slide-indicator {
  min-width: 72px;
  font-size: 0.8rem;
}

/* Mobile viewport safety: avoid content clipping behind browser UI bars */
body.device-mobile .presenter {
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
}
