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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #475569;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.btn-success:hover {
  background: #16a34a;
}

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

.btn-danger:hover {
  background: #dc2626;
}

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

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

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

/* Forms */
input, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  min-height: 200px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Landing page */
.landing-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 700px;
  margin: 40px auto;
}

.landing-card {
  text-align: center;
  padding: 40px;
}

.landing-card h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.landing-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-info {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

/* Participant list */
.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.participant-chip {
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* Quiz controls */
.quiz-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Question display */
.question-container {
  text-align: center;
}

.question-meta {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.question-text {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.timer {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
}

.timer.urgent {
  color: var(--danger);
  animation: pulse 0.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Options grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.option-btn {
  padding: 20px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.option-btn.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.2);
}

.option-btn.incorrect {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.2);
}

.option-btn:disabled {
  cursor: default;
}

/* Result Summary */
.result-summary {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-of-type {
  border-bottom: none;
}

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

.result-value {
  font-size: 1.125rem;
  font-weight: 600;
}

.your-answer-row .result-value {
  color: var(--primary);
}

.correct-answer-row .result-value {
  color: var(--success);
}

.result-value.no-answer {
  color: var(--text-muted);
  font-style: italic;
}

/* Stats/Results */
.stats-container {
  margin-top: 20px;
}

.stat-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.stat-label {
  width: 150px;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-bar-outer {
  flex: 1;
  height: 32px;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 12px;
}

.stat-bar-inner {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-weight: 600;
}

.stat-bar-inner.correct {
  background: var(--success);
}

.stat-count {
  width: 40px;
  text-align: right;
  font-weight: 600;
}

/* Waiting screen */
.waiting-screen {
  text-align: center;
  padding: 60px 20px;
}

.waiting-screen h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.waiting-screen .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-input);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results table */
.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.results-table tr:first-child td {
  font-weight: 600;
  color: var(--warning);
}

/* Rank trophies & pass badges */
.rank-trophy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.rank-trophy .trophy-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
}

.rank-gold { color: #fbbf24; }
.rank-silver { color: #d1d5db; }
.rank-bronze { color: #d97706; }
.rank-top5 { color: #a78bfa; }

.pass-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pass-badge-passed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.pass-badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Utility */
.hidden {
  display: none !important;
}

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

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

.mt-4 {
  margin-top: 24px;
}

.mt-2 {
  margin-top: 12px;
}

.mb-4 {
  margin-bottom: 24px;
}

/* Session code display */
.session-code-display {
  margin-top: 16px;
}

.session-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary);
  background: var(--bg-input);
  padding: 8px 20px;
  border-radius: 8px;
  font-family: monospace;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .header h1 {
    font-size: 1.75rem;
  }

  .question-text {
    font-size: 1.25rem;
  }

  .timer {
    font-size: 2.5rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .landing-options {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   COMPACT PARTICIPANT VIEW
   ============================================ */

.container.compact {
  max-width: 500px;
  padding: 10px;
}

.logo {
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.waiting-screen.compact {
  padding: 30px 15px;
}

/* Question header with score */
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.score-badge {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.question-text.compact {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.timer.compact {
  font-size: 2rem;
  margin-bottom: 12px;
}

.options-grid.compact {
  gap: 8px;
}

.options-grid.compact .option-btn {
  padding: 14px 16px;
  font-size: 1rem;
}

/* Compact results */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.result-icon {
  font-size: 2.5rem;
}

.result-icon.correct::before {
  content: "✓";
  color: var(--success);
}

.result-icon.incorrect::before {
  content: "✗";
  color: var(--danger);
}

.result-icon.timeout::before {
  content: none;
  color: var(--warning);
}

.result-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.result-answers {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.result-answer-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.result-answer-row .label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.result-answer-row .value {
  font-weight: 600;
  font-size: 0.875rem;
}

.result-answer-row.correct .value {
  color: var(--success);
}

.chart-container.compact {
  height: 120px;
  margin-bottom: 12px;
}

/* Final results screen */
.final-results {
  text-align: center;
  padding: 20px;
}

.final-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

.final-icon.passed::before {
  content: none;
}

.final-icon.failed::before {
  content: none;
}

.final-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}

.final-score-total {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 400;
}

.final-percentage {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.final-percentage.passed {
  color: var(--success);
}

.final-percentage.failed {
  color: var(--warning);
}

.final-message {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.5;
}

.final-status.passed {
  color: var(--success);
}

.final-status.failed {
  color: var(--warning);
}

/* ============================================
   PRESENTER VIEW (for screen sharing)
   ============================================ */

.presenter-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
}

.presenter-container {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vw, 40px);
}

.presenter-section {
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

#results-section,
.finale-section {
  max-width: 1400px;
}

.presenter-logo {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
}

/* Waiting Section */
.presenter-waiting h1 {
  font-size: 3rem;
  margin-bottom: 40px;
  color: var(--text);
}

.participant-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.participant-counter span:first-child {
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

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

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

.presenter-url {
  background: var(--bg-card);
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.5rem;
  font-family: monospace;
  color: var(--primary);
  display: inline-block;
}

/* Get Ready Section */
.getready-text {
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary);
  animation: pulse 1s infinite;
}

.getready-sub {
  font-size: 2rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* Question Section */
.presenter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.presenter-qnum {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.presenter-answered {
  font-size: 1.25rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 8px 20px;
  border-radius: 20px;
}

.presenter-timer-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 30px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-progress.urgent {
  stroke: var(--danger);
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: 700;
  color: var(--text);
}

.timer-text.urgent {
  color: var(--danger);
  animation: pulse 0.5s infinite;
}

.presenter-question {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 40px;
  line-height: 1.3;
  padding: 0 20px;
}

.presenter-question.smaller {
  font-size: 1.75rem;
  margin-bottom: 30px;
}

.presenter-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.presenter-option {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
}

.presenter-option .option-letter {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
}

.presenter-option .option-text {
  font-size: 1.25rem;
  color: var(--text);
}

.presenter-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.15);
}

.presenter-option.correct .option-letter {
  background: var(--success);
}

/* Results Section */
.presenter-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.presenter-stats > span:first-child {
  color: var(--success);
}

.presenter-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.answer-distribution {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  padding: clamp(18px, 2vw, 28px);
  text-align: left;
  box-shadow: 0 24px 55px rgba(2, 6, 23, 0.24);
}

.answer-bar-row {
  display: grid;
  gap: 8px;
}

.answer-bar-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: clamp(0.98rem, 1.25vw, 1.15rem);
  line-height: 1.35;
}

.answer-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  font-weight: 800;
}

.answer-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.answer-copy p {
  margin: 0;
}

.answer-check {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--success);
}

.answer-bar-track {
  position: relative;
  height: 32px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.answer-bar-fill {
  width: var(--bar-width);
  min-width: 4px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transform-origin: left;
  animation: answerBarGrow 650ms cubic-bezier(.2, .8, .2, 1) both;
}

.answer-bar-row.correct .answer-bar-track {
  border-color: rgba(34, 197, 94, 0.55);
}

.answer-bar-row.correct .answer-bar-fill {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.answer-bar-value {
  position: absolute;
  inset: 0 10px 0 auto;
  display: flex;
  align-items: center;
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

@keyframes answerBarGrow {
  from { transform: scaleX(0); opacity: 0.4; }
  to { transform: scaleX(1); opacity: 1; }
}

.results-sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 22px;
}

.result-insight-card {
  border-radius: 20px;
  padding: 24px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.86);
  box-shadow: 0 24px 55px rgba(2, 6, 23, 0.2);
}

.insight-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.insight-heading h3 {
  font-size: 1.25rem;
}

.insight-icon {
  width: 42px;
  height: 42px;
  color: var(--success);
}

.insight-eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.correct-responders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: flex-start;
  gap: 9px;
  max-height: 120px;
  overflow: hidden;
}

.responder-chip {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.responder-chip.more {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.responders-empty {
  color: var(--text-muted);
  font-size: 1rem;
}

.moment-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 126px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(30, 41, 59, 0.95));
}

.moment-card.moment-enter {
  animation: momentEnter 450ms ease both;
}

@keyframes momentEnter {
  from { opacity: 0.45; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.moment-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.18);
}

.moment-icon {
  width: 34px;
  height: 34px;
  color: #a5b4fc;
}

.moment-card.streak .moment-icon,
.moment-card.speed .moment-icon {
  color: #fb923c;
}

.moment-card.rising .moment-icon {
  color: #4ade80;
}

.moment-card.tied .moment-icon {
  color: #c4b5fd;
}

.moment-card p {
  margin-top: 4px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.35;
}

/* Finale */
.finale-section {
  position: relative;
  min-height: min(780px, calc(100dvh - 48px));
}

.finale-scene {
  position: relative;
  width: 100%;
  animation: finaleSceneIn 500ms ease both;
}

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

.finale-kicker {
  margin-bottom: 6px;
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.finale-title {
  color: var(--text);
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.05;
}

.finale-subtitle {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 1.15rem;
}

.podium-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: clamp(10px, 2vw, 24px);
  width: min(900px, 100%);
  min-height: 385px;
  margin: 20px auto 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(50px) scale(0.92);
  pointer-events: none;
}

.podium-place.absent {
  visibility: hidden;
}

.podium-place.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 500ms ease, transform 700ms cubic-bezier(.2, .85, .25, 1.15);
}

.podium-medal,
.podium-trophy {
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.podium-second .podium-medal {
  color: #cbd5e1;
}

.podium-third .podium-medal {
  color: #d97706;
}

.podium-trophy {
  width: 86px;
  height: 86px;
  color: #facc15;
}

.podium-first.revealed .podium-trophy {
  animation: trophyGlow 1.4s ease-in-out infinite alternate;
}

@keyframes trophyGlow {
  from { filter: drop-shadow(0 8px 16px rgba(250, 204, 21, 0.25)); }
  to { filter: drop-shadow(0 8px 30px rgba(250, 204, 21, 0.72)); }
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  min-height: 24px;
  margin: 3px 0 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.podium-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 -18px 45px rgba(2, 6, 23, 0.2);
}

.podium-block span {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 950;
}

.podium-first .podium-block {
  height: 210px;
  background: linear-gradient(160deg, #eab308, #a16207);
}

.podium-second .podium-block {
  height: 158px;
  background: linear-gradient(160deg, #94a3b8, #475569);
}

.podium-third .podium-block {
  height: 118px;
  background: linear-gradient(160deg, #d97706, #92400e);
}

.runners-up {
  display: flex;
  justify-content: center;
  gap: 14px;
  min-height: 66px;
  margin: 12px auto 60px;
  opacity: 0;
  transform: translateY(12px);
}

.runners-up.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 450ms ease, transform 450ms ease;
}

.runner-up-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 11px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.88);
  text-align: left;
}

.runner-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  font-size: 1.1rem;
  font-weight: 900;
}

.runner-up-card div {
  display: flex;
  flex-direction: column;
}

.runner-up-card strong {
  color: var(--text);
}

.runner-up-card div span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.confetti-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

.confetti-field span {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  background: #818cf8;
}

.confetti-field span[data-color="2"] { background: #facc15; }
.confetti-field span[data-color="3"] { background: #4ade80; }
.confetti-field span[data-color="4"] { background: #f472b6; }
.confetti-field span[data-color="5"] { background: #38bdf8; }

.confetti-field.active span {
  animation: confettiFall var(--fall) var(--delay) ease-in both;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0); }
  100% { opacity: 0.9; transform: translate3d(40px, 105vh, 0) rotate(var(--spin)); }
}

.hardest-questions {
  display: grid;
  gap: 16px;
  width: min(1100px, 100%);
  margin: 36px auto 90px;
}

.hard-question-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.88);
  text-align: left;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.18);
  animation: hardCardIn 500ms ease both;
}

.hard-question-card:nth-child(2) { animation-delay: 120ms; }
.hard-question-card:nth-child(3) { animation-delay: 240ms; }

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

.hard-question-rank {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  color: #f59e0b;
}

.hard-question-rank svg {
  width: 54px;
  height: 54px;
}

.hard-question-rank span {
  position: absolute;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
}

.hard-question-label {
  margin-bottom: 3px;
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hard-question-copy h3 {
  color: var(--text);
  font-size: clamp(1rem, 1.65vw, 1.25rem);
  line-height: 1.35;
}

.hard-question-copy h3 p {
  margin: 0;
}

.common-wrong {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.common-wrong span {
  margin-right: 8px;
  color: #fda4af;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.common-wrong p {
  display: inline;
}

.difficulty-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #1e293b 58%, transparent 60%),
    conic-gradient(#f59e0b calc(var(--difficulty) * 1%), rgba(71, 85, 105, 0.55) 0);
}

.difficulty-ring strong {
  color: var(--text);
  font-size: 1.15rem;
}

.difficulty-ring span {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.finale-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 5;
}

.finale-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.88);
  color: var(--text-muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.finale-control.primary {
  border-color: rgba(99, 102, 241, 0.65);
  color: #c7d2fe;
}

.finale-control:hover {
  color: white;
  transform: translateY(-1px);
}

.finale-control svg {
  width: 18px;
  height: 18px;
}

.finale-progress {
  min-width: 110px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
  .presenter-options {
    grid-template-columns: 1fr;
  }

  .presenter-question {
    font-size: 1.75rem;
  }

  .presenter-waiting h1 {
    font-size: 2rem;
  }

  .participant-counter span:first-child {
    font-size: 4rem;
  }

  .presenter-results-layout {
    grid-template-columns: 1fr;
  }

  .results-sidebar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .podium-stage {
    min-height: 360px;
  }

  .podium-first .podium-block { height: 190px; }
  .podium-second .podium-block { height: 145px; }
  .podium-third .podium-block { height: 105px; }

  .hard-question-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .difficulty-ring {
    display: none;
  }
}

@media (max-width: 620px) {
  .presenter-header,
  .presenter-stats,
  .results-sidebar,
  .runners-up {
    flex-direction: column;
  }

  .presenter-header {
    gap: 10px;
  }

  .results-sidebar {
    display: flex;
  }

  .podium-medal,
  .podium-trophy {
    width: 46px;
    height: 46px;
  }

  .podium-score {
    font-size: 0.72rem;
  }

  .runner-up-card {
    min-width: min(100%, 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-bar-fill,
  .moment-card,
  .finale-scene,
  .podium-place,
  .podium-trophy,
  .confetti-field span,
  .hard-question-card {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .confetti-field {
    display: none;
  }
}

/* ============================================
   PLAYER VIEW (for participants)
   ============================================ */

.player-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
}

.player-container {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.player-section {
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.player-logo {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
}

/* Join Section */
.join-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.join-card h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: var(--text);
}

.error-text {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 12px;
}

/* Waiting Section */
.waiting-content {
  padding: 40px 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--bg-card);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 30px;
}

.waiting-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--text);
}

.quiz-title {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.waiting-text {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Question Section */
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.player-qnum {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.player-score {
  font-size: 1.25rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 8px 20px;
  border-radius: 20px;
}

.player-score span {
  color: var(--primary);
  font-weight: 700;
}

.player-timer-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 30px;
}

.player-question {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 40px;
  line-height: 1.3;
  padding: 0 20px;
}

.player-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.player-option {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.player-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}

.player-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
}

.player-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.player-option .option-letter {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
}

.player-option .option-text {
  font-size: 1.25rem;
  color: var(--text);
}

.answer-status {
  margin-top: 30px;
  font-size: 1.25rem;
  color: var(--success);
  font-weight: 600;
}

/* Results Section */
.result-display {
  margin-bottom: 40px;
}

.result-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.result-icon.correct::before {
  content: "✓";
  color: var(--success);
}

.result-icon.incorrect::before {
  content: "✗";
  color: var(--danger);
}

.result-icon.timeout::before {
  content: none;
  color: var(--warning);
}

.result-display h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--text);
}

.result-score-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 30px;
}

.result-details {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  margin: 0 auto 30px;
}

.result-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.result-detail-row:last-child {
  border-bottom: none;
}

.result-detail-row .label {
  color: var(--text-muted);
  font-size: 1rem;
}

.result-detail-row .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.result-detail-row.correct .value {
  color: var(--success);
}

/* Player Results Chart */
.player-chart-container {
  height: 350px;
  max-width: 900px;
  margin: 0 auto 30px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px;
}

/* Final Results Section */
.final-display {
  padding: 40px 20px;
}

.final-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.final-icon.passed::before {
  content: none;
}

.final-icon.failed::before {
  content: none;
}

.final-display h2 {
  font-size: 3rem;
  margin-bottom: 30px;
  color: var(--text);
}

.final-score-big {
  font-size: 4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.final-score-big .final-score-max {
  font-size: 2rem;
  color: var(--text-muted);
  font-weight: 400;
}

.final-pct {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.final-pct.passed {
  color: var(--success);
}

.final-pct.failed {
  color: var(--warning);
}

.final-msg {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 30px;
  line-height: 1.5;
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
  .player-options {
    grid-template-columns: 1fr;
  }

  .player-question {
    font-size: 1.75rem;
  }

  .player-container {
    padding: 15px;
  }

  .join-card {
    padding: 30px 20px;
  }

  .final-score-big {
    font-size: 3rem;
  }

  .result-display h2 {
    font-size: 2rem;
  }
}

/* Mobile optimization for participant view */
@media (max-width: 768px) {
  /* Make player logo smaller on mobile */
  .player-logo {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  /* Scale down header and timer for mobile */
  .player-header {
    margin-bottom: 16px;
    padding: 0 10px;
  }

  .player-qnum {
    font-size: 1.1rem;
  }

  .player-score {
    font-size: 1rem;
    padding: 6px 14px;
  }

  .player-timer-ring {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
  }

  .timer-text {
    font-size: 2.5rem;
  }

  .player-question {
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding: 0 10px;
  }

  /* Stack options in single column for easy tapping */
  .player-options {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 500px;
    padding: 0 10px;
  }

  .player-option {
    padding: 14px 16px;
    min-height: 50px;
  }

  .player-option .option-letter {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    margin-right: 12px;
  }

  .player-option .option-text {
    font-size: 1rem;
  }

  /* Make selected state very obvious */
  .player-option.selected {
    border-width: 3px;
    background: rgba(99, 102, 241, 0.3);
  }

  /* Answer status adjustment */
  .answer-status {
    font-size: 1rem;
    margin-top: 20px;
  }

  /* Smaller chart on mobile */
  .player-chart-container {
    height: 220px;
    padding: 16px;
  }

  /* Scale down results display */
  .result-display h2 {
    font-size: 1.75rem;
  }

  .result-icon {
    font-size: 3.5rem;
  }

  .result-score-display {
    font-size: 1.5rem;
  }

  .result-details {
    padding: 16px;
  }

  /* Scale down final score display */
  .final-display {
    padding: 20px 15px;
  }

  .final-display h2 {
    font-size: 2rem;
  }

  .final-score-big {
    font-size: 2.5rem;
  }

  .final-score-big .final-score-max {
    font-size: 1.25rem;
  }

  .final-pct {
    font-size: 1.5rem;
  }
}

/* ============================================
   ANALYTICS SECTION
   ============================================ */

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.analytics-header h2 {
  margin-bottom: 4px;
}

.analytics-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.analytics-tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

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

/* Detail Card */
.detail-card {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 24px;
}

.detail-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.125rem;
}

/* Session Detail Header */
.session-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.session-detail-header h2 {
  flex: 1;
  margin: 0;
}

/* Difficulty Badges */
.difficulty-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.difficulty-easy {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.difficulty-medium {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.difficulty-hard {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Chart Wrapper */
.chart-wrapper {
  position: relative;
  height: 280px;
}

/* Stat Note (for engagement drop-off) */
.stat-note {
  display: block;
  font-size: 0.75rem;
  color: var(--warning);
  margin-top: 4px;
  line-height: 1.3;
}

/* Tricky Question Alert */
.tricky-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.tricky-alert:last-child {
  margin-bottom: 0;
}

.tricky-alert-header {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.tricky-alert-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tricky-alert-detail .wrong-pick {
  color: var(--danger);
  font-weight: 500;
}

.tricky-alert-detail .correct-pick {
  color: var(--success);
  font-weight: 500;
}

/* Streak badge */
.streak-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.streak-badge.high {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

/* Pass count badge next to section header */
.pass-count-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

/* Question text cell in table */
.question-text-cell {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Button Variants */
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 0.875rem;
}

/* Code display in tables */
.results-table code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
  color: var(--primary);
}

/* Header button placement */
.header {
  position: relative;
}

.header .btn {
  position: absolute;
  top: 40px;
  right: 0;
}

@media (max-width: 600px) {
  .header .btn {
    position: static;
    margin-top: 16px;
  }

  .analytics-header {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-tabs {
    order: 2;
  }

  .session-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .session-detail-header h2 {
    order: -1;
    margin-bottom: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .question-text-cell {
    max-width: 150px;
  }
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.settings-tab {
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.settings-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.settings-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.settings-tab-content {
  animation: fadeIn 0.2s ease;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Status Messages */
.status-message {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.875rem;
}

.status-message.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Recovery Questions */
.recovery-question {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.header-actions .btn {
  position: static;
}

/* Participant Chip with Kick Button */
.participant-chip {
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.participant-chip .kick-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.5;
  transition: all 0.2s;
}

.participant-chip .kick-btn:hover {
  color: var(--danger);
  opacity: 1;
}

/* Select dropdown option styling */
select option {
  background: var(--bg-input);
  color: var(--text);
}

@media (max-width: 600px) {
  .modal-content {
    max-height: 85vh;
  }

  .settings-tabs {
    flex-direction: column;
  }

  .header-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Filter button active styles */
.filter-btn {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.filter-btn:hover {
  background: var(--border) !important;
}

.filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* ============================================
   MARKDOWN MASH PRODUCT SHELL
   ============================================ */

:root {
  --primary: #7c5cff;
  --primary-dark: #6846ee;
  --primary-soft: rgba(124, 92, 255, 0.14);
  --cyan: #2dd4ff;
  --yellow: #ffd84d;
  --navy-deep: #080d24;
  --navy: #0d1433;
  --surface-raised: #18203f;
  --surface-soft: #222b4d;
  --success: #3ddc97;
  --danger: #ff6577;
  --warning: #ffbe3d;
  --bg: #0d1433;
  --bg-card: #18203f;
  --bg-input: #222b4d;
  --text: #f7f8ff;
  --text-muted: #a7b0d0;
  --border: #303b63;
  --shadow-lg: 0 28px 70px rgba(2, 6, 23, 0.38);
  --shadow-card: 0 16px 40px rgba(2, 6, 23, 0.24);
}

html {
  min-height: 100%;
  background: var(--navy-deep);
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(45, 212, 255, 0.55);
  outline-offset: 3px;
}

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

.btn-icon {
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.55rem;
  flex: 0 0 auto;
}

.banner-icon {
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.35rem;
  vertical-align: -0.18em;
}

.btn .btn-icon:first-child {
  margin-left: 0;
  margin-right: 0.55rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--text);
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.brand-mark {
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: linear-gradient(145deg, #7357ff, #5438d8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.9rem;
  box-shadow: 0 10px 28px rgba(91, 62, 224, 0.38);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 1.55rem;
  height: 1.55rem;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand-name strong {
  color: var(--yellow);
  font-weight: 850;
}

.brand-lockup-compact .brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 0.75rem;
}

.brand-lockup-compact .brand-mark svg {
  width: 1.3rem;
  height: 1.3rem;
}

.brand-kicker,
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-kicker svg {
  width: 1rem;
  height: 1rem;
}

/* Projector-ready presenter lobby */
.presenter-body {
  position: relative;
  background:
    radial-gradient(circle at 12% 12%, rgba(124, 92, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 88%, rgba(45, 212, 255, 0.1), transparent 26rem),
    var(--navy-deep);
}

.presenter-brand-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.presenter-brand-pattern::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  top: -285px;
  right: -230px;
  background: repeating-conic-gradient(
    from 5deg,
    rgba(124, 92, 255, 0.1) 0deg 4deg,
    transparent 4deg 15deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0 46%, transparent 72%);
  mask-image: radial-gradient(circle, #000 0 46%, transparent 72%);
}

.presenter-brand-pattern::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  left: -125px;
  bottom: -160px;
  border: 1px solid rgba(45, 212, 255, 0.16);
  border-radius: 50%;
}

.presenter-container {
  position: relative;
  z-index: 1;
}

.presenter-brand {
  flex: 0 0 auto;
}

.presenter-lobby-section {
  min-height: calc(100vh - clamp(40px, 6vw, 80px));
  min-height: calc(100dvh - clamp(40px, 6vw, 80px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 2.2vh, 24px);
  max-width: 1400px;
  text-align: left;
}

.presenter-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.presenter-display-status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  color: var(--text-muted);
  background: rgba(24, 32, 63, 0.76);
  border: 1px solid rgba(124, 144, 199, 0.22);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
  backdrop-filter: blur(14px);
}

.presenter-lobby-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: clamp(18px, 2.4vw, 32px);
}

.presenter-lobby-copy,
.presenter-join-card {
  min-height: 0;
  border: 1px solid rgba(124, 144, 199, 0.24);
  border-radius: clamp(1.2rem, 2vw, 1.75rem);
  box-shadow: var(--shadow-lg);
}

.presenter-lobby-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  padding: clamp(28px, 4vw, 58px);
  background:
    linear-gradient(125deg, rgba(30, 40, 78, 0.98), rgba(20, 31, 65, 0.94)),
    var(--surface-raised);
}

.presenter-lobby-copy::after {
  content: "";
  position: absolute;
  width: min(30vw, 390px);
  height: min(30vw, 390px);
  right: -18%;
  bottom: -45%;
  background: radial-gradient(circle, rgba(45, 212, 255, 0.12), transparent 68%);
  border: 1px solid rgba(45, 212, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.presenter-lobby-copy > * {
  position: relative;
  z-index: 1;
}

.presenter-lobby-copy .brand-kicker {
  margin-bottom: clamp(12px, 2vh, 20px);
}

.presenter-lobby-copy h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.4rem, 4.8vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.presenter-lobby-lede {
  max-width: 42rem;
  margin-top: clamp(12px, 1.8vh, 20px);
  color: var(--text-muted);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
}

.presenter-code-panel {
  min-width: min(100%, 380px);
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: clamp(20px, 3vh, 34px);
  padding: clamp(14px, 2vh, 20px) clamp(18px, 2.5vw, 28px);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.26), rgba(124, 92, 255, 0.12));
  border: 1px solid rgba(151, 128, 255, 0.42);
  border-radius: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.presenter-code-panel > span {
  color: #c4bbff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.presenter-code-panel strong {
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(2.2rem, 4.3vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.14em;
}

.presenter-lobby-section .participant-counter {
  min-height: 64px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
  margin: clamp(18px, 2.6vh, 28px) 0 0;
  padding: 0.65rem 1rem 0.65rem 0.72rem;
  color: var(--text);
  background: rgba(8, 13, 36, 0.48);
  border: 1px solid rgba(124, 144, 199, 0.22);
  border-radius: 999px;
}

.presenter-lobby-section .participant-counter span:first-child,
.participant-counter-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(45, 212, 255, 0.1);
  border: 1px solid rgba(45, 212, 255, 0.2);
  border-radius: 50%;
  font-size: inherit;
  line-height: 1;
}

.participant-counter-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.presenter-lobby-section #participant-count {
  width: auto;
  height: auto;
  display: inline;
  color: var(--text);
  background: none;
  border: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
  font-weight: 850;
  line-height: 1;
}

.presenter-lobby-section .counter-label {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.3vw, 1.12rem);
  font-weight: 650;
}

.participant-counter.participant-count-updated {
  animation: presenter-count-pop 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.presenter-join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 3vw, 40px);
  color: #18203f;
  background: #f7f8ff;
  border-color: rgba(255, 255, 255, 0.68);
}

.presenter-join-heading {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: clamp(14px, 2vh, 22px);
}

.presenter-join-icon {
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #795cff, #5d3fe3);
  border-radius: 0.95rem;
  box-shadow: 5px 5px 0 rgba(255, 216, 77, 0.82);
  transform: rotate(-3deg);
}

.presenter-join-icon svg {
  width: 1.55rem;
  height: 1.55rem;
}

.presenter-join-heading .section-eyebrow {
  margin-bottom: 0.25rem;
  color: #6c4cf0;
}

.presenter-join-heading h2 {
  margin: 0;
  color: #18203f;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.presenter-qr-frame {
  width: min(100%, clamp(190px, 19vw, 250px));
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 10px;
  background: white;
  border: 1px solid #dce1f1;
  border-radius: 1.15rem;
  box-shadow: 0 16px 34px rgba(32, 43, 85, 0.16);
}

.presenter-qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0.65rem;
}

.presenter-join-help {
  margin-top: clamp(12px, 1.8vh, 18px);
  color: #6b7491;
  font-size: clamp(0.85rem, 1.05vw, 0.98rem);
  text-align: center;
}

.presenter-lobby-section .presenter-url {
  max-width: 100%;
  margin-top: 0.55rem;
  padding: 0.65rem 1rem;
  overflow: hidden;
  color: #5d3fe3;
  background: #e9e8fa;
  border: 1px solid #dad7f7;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.82rem, 1.15vw, 1rem);
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presenter-lobby-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.waiting-live-dot {
  width: 0.58rem;
  height: 0.58rem;
  display: inline-block;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.38);
  animation: presenter-waiting-pulse 1.8s ease-out infinite;
}

.presenter-access-section {
  min-height: calc(100vh - clamp(40px, 6vw, 80px));
  min-height: calc(100dvh - clamp(40px, 6vw, 80px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.presenter-access-section .presenter-brand {
  margin-bottom: 2rem;
}

.presenter-access-card {
  width: min(100%, 620px);
  padding: clamp(28px, 4vw, 48px);
  text-align: left;
  background: linear-gradient(145deg, rgba(30, 40, 78, 0.98), rgba(20, 31, 65, 0.96));
  border: 1px solid rgba(124, 144, 199, 0.26);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.presenter-access-card h1 {
  margin: 0.55rem 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.presenter-access-card > p:not(.section-eyebrow, .form-message) {
  margin-bottom: 1.6rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.presenter-access-card .form-message {
  margin: 1rem 0 0;
}

@keyframes presenter-count-pop {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); border-color: rgba(45, 212, 255, 0.5); }
}

@keyframes presenter-waiting-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.38); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); }
}

@media (max-width: 900px) {
  .presenter-lobby-section {
    min-height: auto;
  }

  .presenter-lobby-grid {
    grid-template-columns: 1fr;
  }

  .presenter-lobby-copy h1 {
    max-width: 18ch;
  }

  .presenter-join-card {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    grid-template-rows: auto auto auto;
    justify-items: start;
    column-gap: 1.5rem;
  }

  .presenter-join-heading {
    grid-column: 2;
    margin: 0;
  }

  .presenter-qr-frame {
    grid-row: 1 / 4;
    width: 100%;
  }

  .presenter-join-help {
    grid-column: 2;
    margin-top: 0.8rem;
    text-align: left;
  }

  .presenter-lobby-section .presenter-url {
    grid-column: 2;
  }

  .presenter-lobby-footer {
    padding-bottom: 0.4rem;
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  .presenter-container {
    padding-block: 20px;
  }

  .presenter-lobby-section {
    min-height: calc(100dvh - 40px);
    gap: 14px;
  }

  .presenter-lobby-copy {
    padding: clamp(24px, 3vw, 42px);
  }

  .presenter-lobby-copy h1 {
    font-size: clamp(2.25rem, 4.2vw, 3.8rem);
  }

  .presenter-code-panel {
    margin-top: 18px;
  }

  .presenter-lobby-section .participant-counter {
    margin-top: 16px;
  }

  .presenter-join-card {
    padding: 22px 28px;
  }

  .presenter-join-heading {
    margin-bottom: 12px;
  }

  .presenter-qr-frame {
    width: min(100%, 210px);
  }

  .presenter-join-help {
    margin-top: 10px;
  }
}

@media (max-width: 620px) {
  .presenter-lobby-header {
    align-items: flex-start;
  }

  .presenter-display-status {
    padding: 0.55rem;
    font-size: 0;
  }

  .presenter-display-status .live-dot {
    margin: 0;
  }

  .presenter-lobby-copy {
    padding: 1.5rem;
  }

  .presenter-code-panel strong {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .presenter-join-card {
    display: flex;
    align-items: center;
  }

  .presenter-join-heading {
    width: 100%;
  }

  .presenter-join-help {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .participant-counter.participant-count-updated,
  .waiting-live-dot {
    animation: none;
  }
}

.panel-icon {
  width: 3.35rem;
  height: 3.35rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  color: var(--cyan);
  background: rgba(45, 212, 255, 0.1);
  border: 1px solid rgba(45, 212, 255, 0.2);
  border-radius: 1rem;
}

.panel-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.panel-icon-success {
  color: var(--success);
  background: rgba(61, 220, 151, 0.1);
  border-color: rgba(61, 220, 151, 0.2);
}

.card {
  border-color: rgba(124, 144, 199, 0.22);
  box-shadow: var(--shadow-card);
}

.btn {
  min-height: 44px;
  gap: 0.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #8568ff, #6846ee);
  box-shadow: 0 10px 24px rgba(104, 70, 238, 0.26);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9278ff, #7453f2);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #3ddc97, #22b979);
  color: #071b16;
  box-shadow: 0 10px 24px rgba(34, 185, 121, 0.2);
}

.btn-warning {
  background: rgba(255, 190, 61, 0.13);
  color: var(--warning);
  border: 1px solid rgba(255, 190, 61, 0.28);
}

.btn-danger {
  background: rgba(255, 101, 119, 0.12);
  color: #ff92a0;
  border: 1px solid rgba(255, 101, 119, 0.27);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(167, 176, 208, 0.24);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 176, 208, 0.42);
}

/* Landing */
.brand-body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 18%, rgba(124, 92, 255, 0.2), transparent 29rem),
    radial-gradient(circle at 83% 82%, rgba(45, 212, 255, 0.1), transparent 25rem),
    var(--navy-deep);
}

.landing-body {
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.landing-shell {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  min-height: min(760px, calc(100dvh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.78fr);
  align-items: stretch;
  margin: 28px auto;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(20, 29, 67, 0.98), rgba(10, 16, 43, 0.98));
  border: 1px solid rgba(149, 163, 219, 0.2);
  border-radius: 2rem;
  box-shadow: var(--shadow-lg);
}

.landing-shell::before {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  left: -180px;
  bottom: -330px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(124, 92, 255, 0.1) 0deg 4deg, transparent 4deg 14deg);
  mask-image: radial-gradient(circle, #000 0 48%, transparent 72%);
  pointer-events: none;
}

.landing-hero {
  position: relative;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
}

.landing-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin: auto 0;
  padding: 3.5rem 0 8rem;
}

.landing-copy h1 {
  max-width: 650px;
  margin: 0.8rem 0 1.25rem;
  font-size: clamp(3.35rem, 6.3vw, 6.3rem);
  line-height: 0.93;
  letter-spacing: -0.075em;
}

.landing-copy h1 span {
  display: block;
  color: var(--yellow);
  font-style: italic;
  text-shadow: 6px 7px 0 rgba(124, 92, 255, 0.35);
  transform: rotate(-1.5deg);
  transform-origin: left;
}

.landing-lede {
  max-width: 540px;
  color: #c3c9e3;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.landing-art span {
  position: absolute;
  z-index: 1;
}

.landing-art svg {
  width: 100%;
  height: 100%;
}

.art-bolt {
  width: 4.4rem;
  height: 4.4rem;
  right: 12%;
  top: 17%;
  color: var(--cyan);
  transform: rotate(14deg);
}

.art-play {
  width: 4.2rem;
  height: 4.2rem;
  left: 9%;
  bottom: 11%;
  color: #a78bfa;
  transform: rotate(-12deg);
}

.art-plus {
  right: 8%;
  bottom: 23%;
  color: var(--yellow);
  font-size: 5rem;
  font-weight: 300;
  transform: rotate(12deg);
}

.art-star {
  width: 2.6rem;
  height: 2.6rem;
  right: 30%;
  bottom: 9%;
  color: #ec61c9;
}

.mash-stamp {
  right: 7%;
  top: 43%;
  padding: 0.75rem 1.05rem;
  color: #111934;
  background: var(--yellow);
  border-radius: 0.75rem;
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.06em;
  transform: rotate(7deg);
  box-shadow: 7px 7px 0 #7858ff;
}

.brand-orbit {
  position: absolute;
  border: 1px solid rgba(45, 212, 255, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.brand-orbit-one {
  width: 320px;
  height: 320px;
  left: -140px;
  top: 12%;
}

.brand-orbit-two {
  width: 180px;
  height: 180px;
  right: 32%;
  bottom: -90px;
}

.landing-action-panel {
  position: relative;
  z-index: 3;
  align-self: center;
  margin-right: clamp(1.4rem, 4vw, 3.5rem);
  padding: clamp(2rem, 4vw, 3rem);
  background: rgba(247, 248, 255, 0.98);
  color: #17203f;
  border-radius: 1.5rem;
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.35);
}

.landing-action-panel .section-eyebrow {
  color: #6c4cf0;
}

.landing-action-panel h2 {
  margin: 0.45rem 0 0.4rem;
  color: #151d3b;
  font-size: 2.15rem;
  letter-spacing: -0.045em;
}

.landing-action-panel > p:not(.section-eyebrow) {
  color: #5f6885;
}

.landing-action-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.3rem;
  color: white;
  background: #7455f4;
  border-radius: 1rem;
  transform: rotate(-4deg);
  box-shadow: 6px 6px 0 rgba(255, 216, 77, 0.78);
}

.landing-action-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.landing-join-form {
  margin-top: 1.5rem;
}

.code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.landing-action-panel .code-input {
  height: 4rem;
  margin: 0;
  color: #18203f;
  background: #edf0f9;
  border: 2px solid #d9deef;
  font-size: 1.5rem;
}

.code-input::placeholder {
  color: #8b94b1;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.input-hint {
  display: block;
  margin: 0.45rem 0 1rem;
  color: #77809b;
  font-size: 0.78rem;
  text-align: center;
}

.host-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  color: #77809b;
  border-top: 1px solid #e0e4f0;
  font-size: 0.88rem;
}

.host-entry a {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: #6544e9;
  font-weight: 750;
  text-decoration: none;
}

.host-entry svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* Instructor shell */
.admin-body {
  background:
    radial-gradient(circle at 15% 0%, rgba(124, 92, 255, 0.12), transparent 35rem),
    var(--navy-deep);
}

.admin-shell {
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  background: rgba(8, 13, 36, 0.9);
  border-bottom: 1px solid rgba(149, 163, 219, 0.15);
  backdrop-filter: blur(18px);
}

.admin-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  display: inline-block;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(61, 220, 151, 0.1);
}

.app-topbar .header-actions {
  justify-self: end;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.topbar-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.topbar-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.topbar-action svg {
  width: 1.05rem;
  height: 1.05rem;
}

.topbar-action-danger:hover {
  color: #ff9eaa;
  background: rgba(255, 101, 119, 0.08);
}

.admin-main {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.admin-login-wrap {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
  max-width: 1080px;
  margin: 0 auto;
}

.admin-login-intro h1 {
  max-width: 620px;
  margin: 0.85rem 0 1rem;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.admin-login-intro > p:last-child {
  max-width: 570px;
  color: #b5bdd8;
  font-size: 1.08rem;
}

.admin-login-card {
  margin: 0;
  padding: clamp(2rem, 4vw, 2.8rem);
  border-radius: 1.35rem;
}

.admin-login-card h2 {
  margin: 0.45rem 0 1.5rem;
  font-size: 1.8rem;
}

.admin-login-card input {
  height: 3.5rem;
}

.login-help {
  margin-top: 1.2rem;
  text-align: center;
}

.login-help a {
  color: var(--cyan);
  font-size: 0.9rem;
}

.trial-entry {
  margin-top: 1.35rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1rem;
  color: #8993b2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(150, 161, 197, 0.2);
}

.btn-trial {
  color: #111936;
  background: linear-gradient(135deg, var(--yellow), #ffea77);
  border: 1px solid rgba(255, 221, 61, 0.7);
  box-shadow: 0 14px 34px rgba(255, 207, 51, 0.18);
}

.btn-trial:hover {
  color: #111936;
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(255, 207, 51, 0.26);
}

.trial-entry > p {
  margin: 0.75rem 0 0;
  color: #8993b2;
  font-size: 0.82rem;
  text-align: center;
}

.form-message {
  margin-top: 1rem;
  text-align: center;
}

.trial-banner {
  max-width: 1320px;
  margin: 0 auto 1.4rem;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  color: #d9dded;
  background:
    linear-gradient(110deg, rgba(255, 211, 48, 0.13), rgba(124, 92, 255, 0.14)),
    rgba(18, 27, 59, 0.94);
  border: 1px solid rgba(255, 211, 48, 0.3);
  border-radius: 1rem;
  box-shadow: 0 16px 42px rgba(3, 7, 24, 0.18);
}

.trial-banner-copy,
.trial-time,
.trial-badge {
  display: flex;
  align-items: center;
}

.trial-banner-copy {
  gap: 0.85rem;
}

.trial-badge {
  flex: 0 0 auto;
  gap: 0.4rem;
  padding: 0.42rem 0.65rem;
  color: #171c36;
  background: var(--yellow);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trial-badge svg {
  width: 0.9rem;
  height: 0.9rem;
}

.trial-time {
  flex: 0 0 auto;
  gap: 0.65rem;
  color: #9da6c4;
  font-size: 0.82rem;
}

.trial-time strong {
  min-width: 4.4rem;
  color: var(--yellow);
  font-family: "Space Mono", monospace;
  font-size: 1.05rem;
  text-align: right;
}

.quiz-builder,
.analytics-workspace {
  max-width: 1320px;
  margin: 0 auto;
}

.workspace-heading,
.analytics-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.7rem;
}

.workspace-heading h1,
.analytics-header h1,
.session-detail-header h1 {
  margin: 0.3rem 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.workspace-heading > div > p:last-child {
  color: var(--text-muted);
}

.workspace-heading-mark {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: rgba(124, 92, 255, 0.17);
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 1.35rem;
  transform: rotate(5deg);
}

.workspace-heading-mark svg {
  width: 2.6rem;
  height: 2.6rem;
}

.builder-card {
  margin: 0;
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 1.25rem;
}

.builder-toolbar,
.builder-actions,
.card-heading-row,
.question-topline,
.response-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.builder-toolbar {
  align-items: flex-start;
  margin-bottom: 1rem;
}

.builder-toolbar h2 {
  margin-bottom: 0.2rem;
}

.course-name-input {
  max-width: 300px;
}

.builder-card textarea {
  min-height: min(48vh, 460px);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.builder-card textarea[readonly] {
  color: #dfe5f8;
  background:
    linear-gradient(rgba(10, 17, 43, 0.8), rgba(10, 17, 43, 0.8)),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(125, 145, 210, 0.07) 28px);
  border-color: rgba(255, 211, 48, 0.28);
  cursor: text;
}

.builder-actions {
  justify-content: flex-end;
}

.btn-preview {
  color: #c9f5ff;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.13), rgba(124, 92, 255, 0.11));
  border: 1px solid rgba(45, 212, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-preview:hover {
  color: white;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.2), rgba(124, 92, 255, 0.18));
  border-color: rgba(45, 212, 255, 0.52);
  transform: translateY(-1px);
}

.preview-modal {
  background: rgba(3, 7, 24, 0.84);
  backdrop-filter: blur(10px);
}

.preview-modal-content {
  width: min(100%, 720px);
  max-width: 720px;
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
}

.preview-device {
  height: min(720px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 212, 255, 0.08), transparent 20rem),
    #101936;
  border: 1px solid rgba(149, 163, 219, 0.26);
  border-radius: 1.5rem;
}

.preview-device-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  color: #eef2ff;
  background: rgba(7, 12, 33, 0.78);
  border-bottom: 1px solid rgba(149, 163, 219, 0.18);
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.preview-device-bar > div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.preview-device-status {
  width: 0.62rem;
  height: 0.62rem;
  display: inline-block;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(61, 220, 151, 0.1);
}

.preview-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 176, 208, 0.18);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(167, 176, 208, 0.36);
}

.preview-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.preview-device-screen {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow-y: auto;
}

.preview-player-header {
  margin-bottom: 1.4rem;
}

.preview-question {
  margin-bottom: 1.4rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.preview-question p {
  margin: 0;
}

.preview-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.preview-option {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  color: #e8ecf8;
  background: rgba(29, 40, 78, 0.72);
  border: 1px solid rgba(126, 145, 204, 0.28);
  border-radius: 0.9rem;
}

.preview-option-correct {
  color: #d8ffec;
  background: rgba(61, 220, 151, 0.13);
  border-color: rgba(61, 220, 151, 0.42);
}

.preview-option-letter {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: white;
  background: var(--purple);
  border-radius: 50%;
  font-weight: 850;
}

.preview-option-correct .preview-option-letter {
  color: #071b16;
  background: var(--success);
}

.preview-option > svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--success);
}

.preview-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.preview-footer-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.trial-completion-cta {
  margin-top: 1.5rem;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 1rem;
}

.trial-completion-cta h3 {
  margin: 0.25rem 0 0.35rem;
}

.trial-completion-cta p:last-child {
  margin: 0;
  color: var(--text-muted);
}

.live-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 1.25rem;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.live-main-column,
.live-side-column {
  min-width: 0;
}

.live-side-column {
  position: sticky;
  top: 92px;
}

.live-lobby-panel {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(45, 212, 255, 0.1), transparent 16rem),
    var(--bg-card);
}

.live-lobby-panel h1 {
  max-width: 680px;
  margin: 0.5rem 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.live-lobby-panel > p:last-child {
  max-width: 600px;
  color: var(--text-muted);
}

.control-dock {
  position: sticky;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(24, 32, 63, 0.94);
  border: 1px solid rgba(149, 163, 219, 0.25);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(16px);
}

.control-dock-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.6rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.control-dock .quiz-controls {
  justify-content: flex-end;
}

.session-command-card,
.participants-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: 1.1rem;
}

.card-heading-row {
  align-items: flex-start;
}

.card-heading-row h2,
.card-heading-row h3 {
  margin: 0.35rem 0 0;
}

.session-code-panel {
  position: relative;
  margin: 1.2rem 0;
  padding: 1rem;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.24);
  border-radius: 0.9rem;
}

.session-code-panel > span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.session-code-panel .session-code {
  display: block;
  padding: 0;
  color: var(--yellow);
  background: none;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  letter-spacing: 0.16em;
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 0.65rem;
  cursor: pointer;
}

.session-code-panel .icon-button {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
}

.icon-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.session-share-grid {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.85rem;
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: white;
  border-radius: 0.8rem;
}

.qr-wrap img {
  width: 96px;
  height: 96px;
  display: none;
  border-radius: 0.4rem;
}

.qr-wrap span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #48506c;
  font-size: 0.65rem;
  font-weight: 750;
}

.qr-wrap svg {
  width: 0.8rem;
  height: 0.8rem;
}

.session-actions {
  display: grid;
  gap: 0.45rem;
}

.icon-action {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 176, 208, 0.18);
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.icon-action:hover {
  border-color: rgba(45, 212, 255, 0.38);
  background: rgba(45, 212, 255, 0.06);
}

.icon-action-primary {
  color: #fff;
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(124, 92, 255, 0.34);
}

.icon-action svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.participant-count-badge {
  min-width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(45, 212, 255, 0.1);
  border: 1px solid rgba(45, 212, 255, 0.2);
  border-radius: 0.72rem;
  font-size: 1rem;
  font-weight: 800;
}

.participants-card .participant-list {
  max-height: 260px;
  overflow-y: auto;
}

.participant-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(167, 176, 208, 0.12);
}

.empty-state-copy {
  padding: 1.3rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(167, 176, 208, 0.2);
  border-radius: 0.75rem;
  font-size: 0.86rem;
}

.participants-card .empty-state-copy {
  margin-top: 1rem;
}

.live-question-card {
  min-height: 480px;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 1.25rem;
}

.question-topline {
  align-items: center;
  margin-bottom: 1.4rem;
}

.live-timer {
  min-width: 6rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 0.8rem;
  color: var(--cyan);
  background: rgba(45, 212, 255, 0.08);
  border: 1px solid rgba(45, 212, 255, 0.18);
  border-radius: 0.75rem;
  font-weight: 700;
}

.live-timer svg {
  width: 1rem;
  height: 1rem;
}

.live-timer #timer-display {
  font-size: 1.5rem;
  line-height: 1;
}

.live-timer #timer-display.urgent {
  color: var(--danger);
}

.admin-options-grid {
  margin: 2rem 0;
}

.response-progress {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(167, 176, 208, 0.14);
}

.response-progress-label {
  margin-bottom: 0.65rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.response-progress-label strong {
  color: var(--text);
}

.progress-track {
  height: 0.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.progress-track span {
  width: 0%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: inherit;
  transition: width 0.35s ease;
}

/* Analytics workspace */
.analytics-workspace {
  padding-bottom: 3rem;
}

.analytics-header {
  align-items: center;
}

.analytics-header > div {
  flex: 1;
}

.analytics-tabs {
  width: fit-content;
  margin-bottom: 1.25rem;
  padding: 0.28rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 176, 208, 0.14);
  border-radius: 0.8rem;
}

.tab-btn {
  min-width: 110px;
  border-color: transparent;
  border-radius: 0.6rem;
}

.analytics-stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.25rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid rgba(167, 176, 208, 0.16);
}

.stat-card > svg {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1.4rem;
  height: 1.4rem;
  color: rgba(167, 176, 208, 0.55);
}

.stat-card-highlight {
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 212, 255, 0.15), transparent 8rem),
    var(--bg-card);
  border-color: rgba(45, 212, 255, 0.22);
}

.stat-card-highlight .stat-value {
  color: var(--cyan);
}

.stat-value {
  font-size: 2.25rem;
  line-height: 1;
}

.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.chart-card,
.table-card {
  background: var(--bg-card);
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

.chart-card {
  min-width: 0;
  padding: 1.25rem;
}

.chart-card h3 {
  margin: 0.35rem 0 0.2rem;
}

.analytics-chart-canvas {
  position: relative;
  width: 100%;
  height: 290px;
  margin-top: 1rem;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.search-field svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.search-field input {
  margin: 0;
  padding-left: 2.5rem;
}

.analytics-toolbar select {
  width: auto;
  min-width: 170px;
  height: 46px;
  padding: 0 2.2rem 0 0.85rem;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.filter-pills {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(167, 176, 208, 0.12);
  border-radius: 0.75rem;
}

.filter-btn {
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-card {
  overflow: hidden;
}

.table-card .results-table {
  margin: 0;
}

.results-table th {
  color: #c4cae1;
  background: rgba(8, 13, 36, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.results-table th,
.results-table td {
  padding: 0.9rem 0.8rem;
}

.results-table tbody tr {
  transition: background 0.18s ease;
}

.results-table tbody tr:hover {
  background: rgba(124, 92, 255, 0.05);
}

.sessions-table code {
  color: var(--yellow);
  background: rgba(255, 216, 77, 0.08);
}

.session-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

.session-row-actions .btn {
  min-height: 34px;
}

.session-no-stats {
  min-width: 56px;
  font-size: 0.72rem;
  text-align: center;
}

.session-detail-header {
  align-items: center;
  margin-bottom: 1.7rem;
}

.session-detail-header > div {
  flex: 1;
}

.detail-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-chart-grid .chart-card {
  min-height: 390px;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

.ranking-table .pass-badge {
  white-space: nowrap;
}

/* Participant experience */
.player-body {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 92, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 90% 90%, rgba(45, 212, 255, 0.1), transparent 24rem),
    var(--navy-deep);
}

.player-brand-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.player-brand-pattern::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  right: -230px;
  top: -240px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(124, 92, 255, 0.1) 0deg 4deg, transparent 4deg 15deg);
  mask-image: radial-gradient(circle, #000 0 45%, transparent 70%);
}

.player-container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.brand-lockup.player-logo {
  width: fit-content;
  display: inline-flex;
  margin: 0 auto 2rem;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.brand-lockup.player-logo .brand-name strong {
  color: var(--yellow);
  -webkit-text-fill-color: var(--yellow);
}

.join-card {
  max-width: 440px;
  padding: 2.2rem;
  border-radius: 1.35rem;
  box-shadow: var(--shadow-lg);
}

.join-card .panel-icon {
  margin-left: auto;
  margin-right: auto;
}

.join-card .section-eyebrow {
  justify-content: center;
}

.join-card h2 {
  margin: 0.5rem 0 0.45rem;
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.join-card-lede {
  margin-bottom: 1.4rem;
  color: var(--text-muted);
}

.rejoin-panel {
  margin-bottom: 1.25rem;
  padding: 0.9rem;
  background: rgba(45, 212, 255, 0.055);
  border: 1px solid rgba(45, 212, 255, 0.18);
  border-radius: 0.9rem;
  text-align: left;
}

.rejoin-panel-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.rejoin-panel-heading > svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cyan);
}

.rejoin-panel-heading strong,
.rejoin-panel-heading span {
  display: block;
}

.rejoin-panel-heading strong {
  color: var(--text);
  font-size: 0.85rem;
}

.rejoin-panel-heading span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.rejoin-options {
  display: grid;
  gap: 0.45rem;
}

.rejoin-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(167, 176, 208, 0.14);
  border-radius: 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.rejoin-option:hover {
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.35);
}

.rejoin-option > svg {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.rejoin-option strong,
.rejoin-option small {
  display: block;
}

.rejoin-option strong {
  font-size: 0.82rem;
}

.rejoin-option small {
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.rejoin-avatar {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: rgba(124, 92, 255, 0.18);
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 850;
}

.join-different-btn {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.35rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.join-different-btn:hover {
  color: var(--cyan);
}

.join-card label {
  text-align: left;
}

.join-card .code-input {
  height: 3.8rem;
  font-size: 1.45rem;
}

.waiting-content {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem);
  background: rgba(24, 32, 63, 0.9);
  border: 1px solid rgba(167, 176, 208, 0.2);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.waiting-check {
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1.25rem;
  color: var(--success);
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.2);
  border-radius: 50%;
}

.waiting-check svg {
  width: 3rem;
  height: 3rem;
}

.waiting-content .section-eyebrow {
  justify-content: center;
}

.waiting-content h2 {
  margin: 0.55rem 0 0.3rem;
  font-size: clamp(2rem, 6vw, 3rem);
}

.waiting-room-code {
  width: fit-content;
  margin: 1.2rem auto;
  padding: 0.55rem 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 0.7rem;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.waiting-room-code strong {
  margin-left: 0.4rem;
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.12em;
}

.waiting-pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
}

.waiting-pulse > span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(45, 212, 255, 0.5);
  animation: waitingPulse 1.8s ease-out infinite;
}

@keyframes waitingPulse {
  70% { box-shadow: 0 0 0 10px rgba(45, 212, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 255, 0); }
}

.waiting-tip {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.answer-status {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.5rem auto 0;
  padding: 0.6rem 0.9rem;
  color: var(--success);
  background: rgba(61, 220, 151, 0.08);
  border: 1px solid rgba(61, 220, 151, 0.2);
  border-radius: 999px;
}

.answer-status svg {
  width: 1.1rem;
  height: 1.1rem;
}

.result-icon::before,
.final-icon::before {
  content: none !important;
}

.result-icon,
.final-icon {
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 1.4rem;
}

.result-icon svg,
.final-icon svg {
  width: 3rem;
  height: 3rem;
}

.result-icon.correct,
.final-icon.passed {
  color: var(--success);
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.22);
}

.result-icon.incorrect {
  color: var(--danger);
  background: rgba(255, 101, 119, 0.1);
  border: 1px solid rgba(255, 101, 119, 0.22);
}

.result-icon.timeout,
.final-icon.timeout,
.final-icon.failed {
  color: var(--warning);
  background: rgba(255, 190, 61, 0.1);
  border: 1px solid rgba(255, 190, 61, 0.22);
}

.result-display {
  margin-bottom: 1rem;
}

.personal-result-grid {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 auto 1rem;
}

.personal-result-card {
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.9rem;
  text-align: left;
  background: rgba(24, 32, 63, 0.88);
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 0.9rem;
}

.personal-result-card svg {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--cyan);
}

.personal-result-card span {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
}

.personal-result-card small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.player-chart-container {
  width: min(800px, 100%);
  height: auto;
  padding: 1.25rem;
  border: 1px solid rgba(167, 176, 208, 0.16);
  border-radius: 1rem;
}

.result-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.player-distribution {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 1.4fr) auto;
  align-items: center;
  gap: 0.8rem;
}

.distribution-answer {
  min-width: 0;
  color: #dfe3f4;
  font-size: 0.88rem;
  line-height: 1.3;
}

.distribution-answer strong {
  color: var(--text);
}

.distribution-track {
  height: 0.7rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.distribution-track span {
  min-width: 2px;
  height: 100%;
  display: block;
  background: var(--primary);
  border-radius: inherit;
}

.distribution-row.correct .distribution-track span {
  background: var(--success);
}

.distribution-count {
  min-width: 2.2rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  text-align: right;
}

.result-waiting {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.final-display {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem);
  background: rgba(24, 32, 63, 0.9);
  border: 1px solid rgba(167, 176, 208, 0.2);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.final-display .section-eyebrow {
  justify-content: center;
  margin-bottom: 0.5rem;
}

.final-display h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 6vw, 3rem);
}

.final-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.2rem 0;
}

.final-metrics > div {
  padding: 0.9rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 176, 208, 0.13);
  border-radius: 0.8rem;
}

.final-metrics strong,
.final-metrics span {
  display: block;
}

.final-metrics strong {
  color: var(--text);
  font-size: 1.2rem;
}

.final-metrics span {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .landing-shell {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 610px;
  }

  .landing-action-panel {
    width: min(520px, calc(100% - 40px));
    margin: -5rem auto 2rem;
  }

  .live-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .analytics-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-toolbar {
    flex-wrap: wrap;
  }

  .search-field {
    flex-basis: 100%;
  }
}

@media (max-width: 780px) {
  .landing-shell {
    width: min(100% - 20px, 680px);
    margin: 10px auto;
    border-radius: 1.25rem;
  }

  .landing-hero {
    min-height: 540px;
    padding: 1.5rem;
  }

  .landing-copy {
    padding: 3rem 0 7rem;
  }

  .landing-copy h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .landing-art .art-bolt {
    top: 20%;
  }

  .landing-action-panel {
    margin-top: -3.5rem;
  }

  .host-entry {
    flex-direction: column;
  }

  .app-topbar {
    grid-template-columns: 1fr auto;
    padding: 0 1rem;
  }

  .admin-title {
    display: none;
  }

  .topbar-action span {
    display: none;
  }

  .topbar-action {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .admin-main {
    width: min(100% - 24px, 700px);
    padding-top: 1.5rem;
  }

  .admin-login-wrap {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
  }

  .admin-login-intro {
    text-align: center;
  }

  .admin-login-intro .brand-kicker {
    justify-content: center;
  }

  .admin-login-intro h1 {
    font-size: clamp(2.8rem, 12vw, 4.4rem);
  }

  .admin-login-intro > p:last-child {
    margin: 0 auto;
  }

  .workspace-heading-mark {
    display: none;
  }

  .builder-toolbar {
    flex-direction: column;
  }

  .course-name-input {
    max-width: none;
  }

  .trial-banner,
  .trial-banner-copy,
  .trial-completion-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .trial-time {
    justify-content: space-between;
  }

  .live-workspace {
    display: flex;
    flex-direction: column;
  }

  .live-main-column,
  .live-side-column {
    width: 100%;
  }

  .live-side-column {
    position: static;
    order: -1;
  }

  .control-dock {
    flex-direction: column;
    align-items: stretch;
  }

  .control-dock-label {
    justify-content: center;
  }

  .control-dock .quiz-controls,
  .control-dock .btn {
    width: 100%;
  }

  .analytics-chart-grid,
  .detail-chart-grid {
    grid-template-columns: 1fr;
  }

  .analytics-stats-grid,
  .detail-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-header,
  .session-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-toolbar select {
    width: 100%;
  }

  .filter-pills {
    width: 100%;
    overflow-x: auto;
  }

  .brand-lockup.player-logo {
    margin-bottom: 1.25rem;
  }

  .player-section {
    max-width: 620px;
  }

  .player-header {
    position: sticky;
    top: 0.6rem;
    z-index: 5;
    padding: 0.55rem 0.7rem;
    background: rgba(13, 20, 51, 0.88);
    border: 1px solid rgba(167, 176, 208, 0.15);
    border-radius: 0.8rem;
    backdrop-filter: blur(12px);
  }

  .personal-result-grid {
    gap: 0.5rem;
  }

  .distribution-row {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 0.7rem;
  }

  .distribution-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 480px) {
  .landing-action-panel {
    width: calc(100% - 24px);
    padding: 1.5rem;
  }

  .art-plus,
  .art-star,
  .mash-stamp {
    display: none;
  }

  .app-topbar .brand-name {
    display: none;
  }

  .app-topbar .brand-mark {
    width: 2.15rem;
    height: 2.15rem;
  }

  .builder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .builder-actions .btn {
    padding-inline: 0.9rem;
  }

  .preview-modal {
    padding: 0;
  }

  .preview-device {
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .preview-options {
    grid-template-columns: 1fr;
  }

  .preview-footer {
    grid-template-columns: 1fr 1fr;
  }

  .preview-footer-hint {
    display: none;
  }

  .session-share-grid {
    grid-template-columns: 1fr;
  }

  .qr-wrap {
    width: 130px;
    margin: 0 auto;
  }

  .analytics-stats-grid,
  .detail-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .stat-card {
    min-height: 112px;
  }

  .session-detail-header .btn {
    width: 100%;
  }

  .join-card {
    padding: 1.5rem;
  }

  .player-container {
    align-items: flex-start;
    padding: 1rem;
  }

  #join-section,
  #waiting-section,
  #session-ended-section {
    margin: auto 0;
  }

  .personal-result-card {
    min-height: 88px;
    padding: 0.7rem;
  }

  .personal-result-card span {
    font-size: 1.2rem;
  }

  .personal-result-card small {
    font-size: 0.6rem;
  }

  .result-details {
    text-align: left;
  }

  .result-detail-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .final-metrics {
    gap: 0.4rem;
  }

  .final-metrics > div {
    padding: 0.75rem 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .waiting-pulse > span,
  .spinner {
    animation: none !important;
  }

  .progress-track span {
    transition: none;
  }
}
