/* ═══════════════════════════════════════════════════
   REAL OR SPIN — styles
   Theme color is set by JS via --primary / --primary-light
═══════════════════════════════════════════════════ */

:root {
  --primary:       #1A7A7A;
  --primary-light: #2AB5B5;
  --primary-dark:  #0F5C5C;
  --primary-dim:   rgba(26, 122, 122, 0.15);

  --bg:            #0D1117;
  --surface:       #161B22;
  --surface-2:     #21262D;
  --border:        #30363D;

  --text:          #E6EDF3;
  --text-muted:    #8B949E;
  --text-dark:     #0D1117;

  --success:       #2EA043;
  --success-bg:    rgba(46, 160, 67, 0.15);
  --danger:        #F85149;
  --danger-bg:     rgba(248, 81, 73, 0.15);
  --warning:       #D29922;
  --warning-bg:    rgba(210, 153, 34, 0.15);

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --transition:    0.18s ease;

  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

/* ─── Screen management ─── */
.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
}
.screen.active { display: flex; flex-direction: column; }

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

.center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 20px;
}

/* ─── Spinner ─── */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--text-muted); font-size: 0.95rem; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-large { padding: 16px 36px; font-size: 1.1rem; }

/* ─── Stats row (shared by resume + scoreboard) ─── */
.stats-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 100px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-light);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.stat-block--large .stat-value { font-size: 2.5rem; }


/* ══════════════════════════════════════════════════
   ERROR SCREEN
══════════════════════════════════════════════════ */
.error-icon { font-size: 3rem; }

#screen-error h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.error-body {
  color: var(--text-muted);
  max-width: 380px;
}


/* ══════════════════════════════════════════════════
   START SCREEN
══════════════════════════════════════════════════ */
#screen-start {
  align-items: center;
  padding: 32px 16px 48px;
}

.start-wrap {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.game-title-block h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.epic-meaning {
  background: var(--primary-dim);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: #F0B429;
  font-style: italic;
  line-height: 1.6;
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.form-group input,
.form-group select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color var(--transition);
  width: 100%;
}

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

.form-group select option { background: var(--surface-2); }

/* Custom select arrow */
.select-wrapper {
  position: relative;
}
.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  width: 100%;
}
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-light);
  font-size: 1.2rem;
  pointer-events: none;
  line-height: 1;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-btn {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: var(--transition);
  text-align: center;
}

.mode-btn strong { font-size: 0.95rem; }
.mode-btn span   { font-size: 0.75rem; color: var(--text-muted); }

.mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary-light);
}
.mode-btn.active span { color: var(--primary-light); opacity: 0.75; }

.mode-btn:hover:not(.active) { border-color: var(--text-muted); }


/* ══════════════════════════════════════════════════
   RESUME SCREEN
══════════════════════════════════════════════════ */
.resume-content { gap: 24px; }

.resume-content h2 { font-size: 1.8rem; }

.resume-name {
  font-size: 1.2rem;
  color: var(--primary-light);
  font-weight: 700;
}

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


/* ══════════════════════════════════════════════════
   CARD SCREEN
══════════════════════════════════════════════════ */
#screen-card {
  display: none; /* overridden by .active */
  flex-direction: column;
  padding: 0;
  position: relative; /* anchor for pause overlay */
}
#screen-card.active { display: flex; }

/* HUD */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.hud-left  { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Round + difficulty on the left */
.hud-round { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; white-space: nowrap; }

/* Team name + score in the centre — prominent */
.hud-center-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  justify-content: center;
  overflow: hidden;
}
.hud-team-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.hud-team-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.hud-team-sep {
  color: var(--border);
  font-size: 1rem;
  flex-shrink: 0;
}
.hud-score {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* HUD buttons */
.hud-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 11px;
  transition: var(--transition);
  white-space: nowrap;
}
.hud-btn--pause {
  color: #D4A017;
  border-color: rgba(212, 160, 23, 0.4);
}
.hud-btn--pause:hover {
  background: rgba(212, 160, 23, 0.12);
  border-color: #D4A017;
}
.hud-btn--quit {
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.4);
}
.hud-btn--quit:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* Credibility row */

/* Timer row */
.timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.timer-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.9s linear, background 0.9s ease;
  background: var(--success);
  width: 100%;
}

.timer-fill.warn   { background: var(--warning); }
.timer-fill.danger { background: var(--danger); }

.timer-num {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 26px;
  text-align: right;
  transition: color 0.3s;
}
.timer-num.danger { color: var(--danger); }

/* Wildcard banner */
.wildcard-banner {
  background: linear-gradient(135deg, #7A3A00, #B86A00);
  color: #FFE08A;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 10px;
  animation: pulse-bg 1.5s ease-in-out infinite alternate;
  flex-shrink: 0;
}

@keyframes pulse-bg {
  from { background: linear-gradient(135deg, #7A3A00, #B86A00); }
  to   { background: linear-gradient(135deg, #A05200, #D47A00); }
}

/* Card area */
.card-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card-display {
  width: 100%;
  max-width: 640px;
  background: #fff;
  color: var(--text-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: card-in 0.25s ease;
}

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

/* ── Card types ── */

/* Headline card */
.card-headline .card-source-bar {
  background: var(--primary);
  color: var(--source-bar-text-color, #fff);
  font-size: var(--source-bar-font-size, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-headline .card-source-bar::before {
  content: var(--source-bar-label, "SOURCE:");
  letter-spacing: 0.12em;
}

.card-headline .card-body {
  padding: 20px 20px 24px;
}

.card-headline .card-content-text {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
  color: #111;
}

/* Social post card */
.card-social .card-social-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.card-social .social-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-social .social-handle {
  font-size: 0.85rem;
  color: #555;
}

.card-social .social-handle strong {
  color: #111;
  font-weight: 700;
  display: block;
}

.card-social .card-body {
  padding: 12px 16px 16px;
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.55;
  color: #111;
}

.card-social .social-footer {
  border-top: 1px solid #eee;
  padding: 8px 16px;
  font-size: 0.78rem;
  color: #888;
}

/* Statistic card */
.card-statistic .card-stat-bar {
  background: #f1f3f4;
  color: #555;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 9px 16px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-statistic .card-stat-bar::before {
  content: "SOURCE:";
  font-size: 0.65rem;
  opacity: 0.6;
  letter-spacing: 0.12em;
}

.card-statistic .card-body {
  padding: 24px 20px;
  text-align: center;
  white-space: pre-line;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #111;
  font-weight: 600;
}

/* Quote card */
.card-quote .card-body {
  padding: 28px 24px 20px;
  text-align: center;
}

.card-quote .quote-mark {
  font-size: 4rem;
  color: var(--primary);
  line-height: 0.5;
  display: block;
  margin-bottom: 12px;
}

.card-quote .card-content-text {
  font-size: 1.1rem;
  font-style: italic;
  color: #111;
  line-height: 1.6;
}

.card-quote .quote-attribution {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

.card-quote .card-source-line {
  padding: 8px 16px 14px;
  font-size: 0.75rem;
  color: #999;
  text-align: center;
}

/* Image caption card */
.card-image-caption .card-img-placeholder {
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  font-size: 2.5rem;
  color: #aaa;
  border-bottom: 1px solid #ddd;
}

.card-image-caption .card-body {
  padding: 16px 20px 20px;
  font-size: 1rem;
  color: #111;
  white-space: pre-line;
  line-height: 1.55;
}

.card-image-caption .image-caption-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Video card */
.card-video .card-source-bar {
  background: var(--primary);
  color: var(--source-bar-text-color, #fff);
  font-size: var(--source-bar-font-size, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}

.card-video-wrapper iframe,
.card-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.card-video-placeholder {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 3rem;
  color: #555;
}

.card-video .card-body {
  padding: 12px 16px 16px;
}

.card-video-context {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Answer area */
.answer-area {
  flex-shrink: 0;
  padding: 14px 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.binary-question, .technique-question {
  font-size: 0.8rem;
  font-weight: 700;
  color: #F0B429;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  margin: 0;
}

.binary-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-btn {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
  color: var(--text);
}

.answer-btn--real:hover,
.answer-btn--real.selected {
  border-color: var(--success);
  background: var(--success-bg);
  color: #4ADE80;
}

.answer-btn--fake:hover,
.answer-btn--fake.selected {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: #FF6B6B;
}

/* Technique section */
.technique-section {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.technique-section.active {
  display: flex;
}

.technique-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.technique-btn {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

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

.technique-btn.selected {
  border-color: var(--primary-light);
  background: var(--primary-dim);
  color: var(--primary-light);
}

.btn-submit {
  width: 100%;
  margin-top: 4px;
}


/* ══════════════════════════════════════════════════
   REVEAL SCREEN
══════════════════════════════════════════════════ */
#screen-reveal {
  align-items: center;
}

.reveal-wrap {
  width: 100%;
  max-width: 640px;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Result banner */
.result-banner {
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.02em;
}

.result-banner.correct {
  background: var(--success-bg);
  border: 2px solid var(--success);
  color: #4ADE80;
}

.result-banner.incorrect {
  background: var(--danger-bg);
  border: 2px solid var(--danger);
  color: #FF6B6B;
}

.result-banner.partial {
  background: var(--warning-bg);
  border: 2px solid var(--warning);
  color: #FCD34D;
}

.result-banner.timeout {
  background: rgba(234, 120, 30, 0.12);
  border: 2px solid #EA781E;
  color: #EA781E;
}

/* Points */
.reveal-points {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-light);
}

.reveal-points.negative { color: var(--danger); }
.reveal-points.zero     { color: var(--text-muted); }

/* Answer block */
.reveal-answer-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reveal-answer-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.95rem;
}

.reveal-answer-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  min-width: 90px;
}

.reveal-answer-value { font-weight: 600; }

.reveal-answer-value.correct-val { color: #4ADE80; }
.reveal-answer-value.wrong-val   { color: #FF6B6B; }

/* Explanation */
.reveal-explanation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.reveal-explanation .explanation-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #F0B429;
  margin-bottom: 8px;
}

.reveal-explanation p { margin: 0; }

/* Discussion block */
.discussion-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
}

.discussion-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.discussion-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
}

/* Difficulty badge on reveal */
.difficulty-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 99px;
}

.difficulty-badge.easy   { background: var(--success-bg); color: #4ADE80; }
.difficulty-badge.medium { background: var(--warning-bg); color: #FCD34D; }
.difficulty-badge.hard   { background: var(--danger-bg);  color: #FF6B6B; }

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


/* ══════════════════════════════════════════════════
   SCOREBOARD SCREEN
══════════════════════════════════════════════════ */
#screen-scoreboard {
  align-items: center;
}

.scoreboard-wrap {
  width: 100%;
  max-width: 640px;
  padding: 32px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.scoreboard-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-light);
  text-align: center;
}

.scoreboard-group {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
}

/* Verdict */
.verdict-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-align: center;
  width: 100%;
}

.verdict-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.verdict-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Round history */
.round-history {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.round-history-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 4px 4px;
  border-bottom: 1px solid var(--border);
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}

.history-num {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 20px;
}

.history-card-type {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.history-card-snippet {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-result {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: right;
}

.history-result.correct   { color: #4ADE80; }
.history-result.incorrect { color: #FF6B6B; }
.history-result.partial   { color: #FCD34D; }
.history-result.timeout   { color: var(--text-muted); }

.scoreboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}


/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .technique-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .answer-area {
    padding: 16px 24px 24px;
  }
}

/* Wide screens: stay vertical, just increase padding and max-width */
@media (min-width: 900px) {
  .card-area {
    padding: 20px;
    align-items: flex-start;
  }

  .answer-area {
    padding: 16px 24px 24px;
    max-height: none;
  }

  .card-display {
    max-width: 680px;
  }
}


/* Reveal screen — repeated card at top */
.reveal-card-display {
  box-shadow: none;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}

/* ── Tooltips ── */
.has-tooltip {
  position: relative;
  cursor: default;
}

.tooltip-icon {
  font-size: 0.7rem;
  opacity: 0.5;
  vertical-align: super;
  line-height: 0;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E1E2E;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  width: 220px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.has-tooltip:hover::after {
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   REVIEW OVERLAY (scoreboard card review)
══════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay.hidden { display: none; }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.overlay-panel {
  position: relative;
  z-index: 101;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slide-up 0.22s ease;
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.overlay-close {
  align-self: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.overlay-close:hover { background: var(--border); color: var(--text); }

.review-card {
  /* same as .card-display but inside overlay */
  box-shadow: none;
  border: 1px solid #ddd;
}

/* ── Pause overlay ── */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.pause-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.pause-icon { font-size: 2.5rem; }
.pause-box h2 { font-size: 1.6rem; }
.pause-box p  { color: var(--text-muted); max-width: 300px; line-height: 1.55; }

.quit-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* ── Card images ── */
.card-social-image {
  overflow: hidden;
  max-height: 240px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  position: relative;
}

.img-credit-overlay {
  position: absolute;
  bottom: 4px;
  right: 6px;
  z-index: 1;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
}

.card-social-image img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.card-img-real {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #ddd;
}

/* ── Image credit on reveal ── */
.image-credit {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* Clickable history rows */
.history-row {
  cursor: pointer;
  transition: background var(--transition);
}
.history-row:hover { background: var(--surface-2); }
.round-history-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0 4px;
  font-style: italic;
}


/* ══════════════════════════════════════════════════
   TECHNIQUE GLOSSARY SCREEN
══════════════════════════════════════════════════ */
#screen-glossary {
  align-items: center;
}

.glossary-wrap {
  width: 100%;
  max-width: 720px;
  padding: 28px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glossary-header { text-align: center; }
.glossary-header h2 { font-size: 1.8rem; font-weight: 800; color: var(--primary-light); }
.glossary-header p  { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; }

.glossary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Accordion grid: always single column */
.glossary-grid--accordion {
  grid-template-columns: 1fr;
}

/* Two-column layout only for the flat (overlay) version */
@media (min-width: 560px) {
  .glossary-grid:not(.glossary-grid--accordion) { grid-template-columns: 1fr 1fr; }
}

.glossary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Accordion card ───────────────────────────────────────── */
.glossary-card--accordion {
  cursor: pointer;
  user-select: none;
  gap: 0;
  padding: 12px 16px;
}

.glossary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.glossary-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.8;
}

.glossary-card--accordion:hover .glossary-toggle-btn {
  opacity: 1;
}

/* Body collapses by default; expands when .open is toggled */
.glossary-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding-top 0.28s ease;
  padding-top: 0;
}

.glossary-card--accordion.open .glossary-card-body {
  max-height: 240px; /* generous ceiling for any technique desc */
  padding-top: 10px;
}

/* ── Shared text styles ───────────────────────────────────── */
.glossary-card-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.glossary-card-desc {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.glossary-card-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

.glossary-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Compact version for the in-game overlay */
.glossary-grid--compact .glossary-card { padding: 10px 14px; }
.glossary-grid--compact .glossary-card-desc { font-size: 0.82rem; }
.glossary-grid--compact .glossary-card-hint { display: none; }

/* ? Techniques button in answer area */
.technique-question-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.technique-ref-btn {
  position: absolute;
  right: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #F0B429;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.technique-ref-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-dim);
}


/* ══════════════════════════════════════════════════
   PROGRESS STRIP
══════════════════════════════════════════════════ */
.progress-strip {
  display: flex;
  gap: 4px;
  padding: 6px 16px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
  flex-shrink: 0;
}

.progress-dot.current {
  background: var(--primary);
  border-color: var(--primary-light);
  transform: scale(1.3);
  box-shadow: 0 0 6px var(--primary);
}

.progress-dot.correct {
  background: var(--success);
  border-color: var(--success);
}

.progress-dot.partial {
  background: var(--warning);
  border-color: var(--warning);
}

.progress-dot.incorrect,
.progress-dot.timeout {
  background: var(--danger);
  border-color: var(--danger);
}


/* ══════════════════════════════════════════════════
   TECHNIQUE WIN CALLOUT
══════════════════════════════════════════════════ */
.technique-win {
  background: rgba(46, 160, 67, 0.15);
  border: 1.5px solid var(--success);
  border-radius: var(--radius);
  color: #4ADE80;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 16px;
  animation: pop-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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


/* ══════════════════════════════════════════════════
   WILDCARD IMPROVED ENTRANCE
══════════════════════════════════════════════════ */
.wildcard-banner {
  background: linear-gradient(135deg, #7A3A00, #B86A00);
  color: #FFE08A;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 10px;
  flex-shrink: 0;
  transform-origin: top;
}

.wildcard-banner.entering {
  animation: wildcard-drop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
             pulse-bg 1.5s ease-in-out 0.45s infinite alternate;
}

.wildcard-banner.settled {
  animation: pulse-bg 1.5s ease-in-out infinite alternate;
}

@keyframes wildcard-drop {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}


/* ══════════════════════════════════════════════════
   SCOREBOARD — SHOW TO CLASS BUTTON
══════════════════════════════════════════════════ */
.btn-show-class {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: var(--transition);
  display: block;
  margin: 0 auto;
}
.btn-show-class:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-dim);
}


/* ══════════════════════════════════════════════════
   PRESENTER / FULL-SCREEN MODE
══════════════════════════════════════════════════ */
.presenter-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
}
.presenter-overlay.hidden { display: none; }

.presenter-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  transition: var(--transition);
}
.presenter-close:hover { background: var(--surface-2); color: var(--text); }

.presenter-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.presenter-team {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.presenter-score {
  font-size: clamp(4rem, 16vw, 10rem);
  font-weight: 900;
  color: var(--primary-light);
  line-height: 1;
  letter-spacing: -0.03em;
}


.presenter-verdict {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
}


/* ══════════════════════════════════════════════════
   GRADE BAND SELECTOR — reuse mode-toggle styles,
   just needs data-grade attribute targeting
══════════════════════════════════════════════════ */
.mode-btn[data-grade].active {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary-light);
}


/* ══════════════════════════════════════════════════
   BRANDING — Graphene's Edu Area
══════════════════════════════════════════════════ */
.game-branding {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.brand-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
.brand-link:hover { color: var(--text); text-decoration: underline; }

.scoreboard-branding {
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}


/* ══════════════════════════════════════════════════
   DEMO BANNER (card screen)
══════════════════════════════════════════════════ */
.demo-banner {
  background: rgba(26, 122, 122, 0.12);
  border-bottom: 1px solid var(--primary-dark);
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 16px;
  text-align: center;
}

.demo-banner a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.demo-banner a:hover { color: var(--text); }


/* ══════════════════════════════════════════════════
   DEMO UPSELL BLOCK (scoreboard)
══════════════════════════════════════════════════ */
.upsell-block {
  background: linear-gradient(135deg, rgba(26, 122, 122, 0.18), rgba(26, 122, 122, 0.06));
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upsell-icon { font-size: 2.2rem; }

.upsell-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: -0.01em;
}

.upsell-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.55;
}

.upsell-cta {
  margin-top: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}
.upsell-cta:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 122, 122, 0.4);
}
.mode-btn[data-grade].active span { color: var(--primary-light); opacity: 0.75; }

/* Demo grade selector: full-version options greyed out, non-interactive */
.grade-toggle--demo .mode-btn[data-grade]:not(.demo-grade-btn) {
  opacity: 0.32;
  pointer-events: none;
  cursor: default;
  border-color: var(--border);
  background: transparent;
  transform: none;
  box-shadow: none;
}
/* Demo slot uses the orange accent so it reads as "different / preview" */
.demo-grade-btn.active {
  background: var(--warning, #D4600A) !important;
  border-color: var(--warning, #D4600A) !important;
  color: #fff !important;
}
.demo-grade-btn.active strong { color: #fff; }
.demo-grade-btn.active span   { color: rgba(255,255,255,0.8) !important; opacity: 1 !important; }
