/* ============================================================
   WHO SAID THAT? — Movie Edition
   Full rewrite — Dark cinematic theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-base:        #0a0a0f;
  --bg-surface:     #13131a;
  --bg-card:        #1c1c26;
  --bg-card-hover:  #242433;
  --bg-elevated:    #2a2a3d;

  --text-primary:   #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted:     #606080;

  --gold:           #f5c518;
  --gold-dim:       #c9a010;
  --gold-glow:      rgba(245, 197, 24, 0.25);

  --red:            #e50914;
  --red-dim:        #b30710;
  --red-glow:       rgba(229, 9, 20, 0.3);

  --green:          #4ade80;
  --green-dim:      #22c55e;
  --green-glow:     rgba(74, 222, 128, 0.25);

  --wrong-red:      #ef4444;
  --wrong-glow:     rgba(239, 68, 68, 0.3);

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  --transition:     0.2s ease;
  --transition-slow:0.35s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  line-height: 1.5;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 80px rgba(0,0,0,0.6);
}

@media (min-width: 540px) {
  body { padding: 1.5rem 1rem; align-items: flex-start; }
  #app { min-height: auto; border-radius: var(--radius-xl); overflow: hidden; }
}

/* ============================================================
   SCREEN SYSTEM
   ============================================================ */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: screenIn 0.25s ease;
}

.screen.hidden {
  display: none !important;
}

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

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Section heading */
.section-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Pill badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3em 0.75em;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-red   { background: var(--red);  color: #fff; }
.badge-gold  { background: var(--gold); color: #000; }
.badge-green { background: var(--green); color: #000; }

/* Primary CTA button */
.btn-primary {
  width: 100%;
  background: var(--red);
  color: white;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  background: var(--red-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--red-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}

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

/* ============================================================
   FILMSTRIP HEADER DECORATION (CSS only)
   ============================================================ */
.filmstrip {
  height: 28px;
  background: #000;
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.filmstrip-hole {
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.filmstrip-gap {
  flex: 1;
}

/* ============================================================
   START SCREEN
   ============================================================ */
#screen-start {
  padding: 0;
}

.start-hero {
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.logo-clapperboard {
  width: 40px;
  height: 34px;
  position: relative;
  flex-shrink: 0;
}

/* CSS clapperboard */
.clapper-body {
  width: 40px;
  height: 24px;
  background: var(--bg-elevated);
  border-radius: 3px;
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 4px;
}

.clapper-stripe {
  width: 2px;
  height: 12px;
  background: var(--text-muted);
  border-radius: 1px;
}

.clapper-top {
  width: 40px;
  height: 12px;
  background: linear-gradient(90deg, #111 0%, #333 50%, #111 100%);
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  display: flex;
}

.clapper-top::before,
.clapper-top::after {
  content: '';
  flex: 1;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0, var(--red) 6px,
    #fff 6px, #fff 12px
  );
  height: 100%;
}

.logo-text-wrap {
  text-align: left;
}

.logo-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}

.logo-title span {
  color: var(--red);
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0 1.5rem 1.5rem;
}

.stat-chip {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.5rem;
  text-align: center;
}

.stat-chip .stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
  line-height: 1.2;
}

.stat-chip .stat-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
  display: block;
}

/* Mode cards */
.mode-section {
  padding: 0 1.5rem 2rem;
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mode-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1.125rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.mode-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.mode-card:hover::before { opacity: 1; }
.mode-card:active { transform: translateY(0); }

.mode-card.mode-daily { border-color: var(--gold-dim); }
.mode-card.mode-daily::before { background: linear-gradient(135deg, var(--gold-glow) 0%, transparent 60%); }

.mode-card.mode-quick::before { background: linear-gradient(135deg, var(--red-glow) 0%, transparent 60%); }

.mode-card.mode-category::before { background: linear-gradient(135deg, rgba(74,222,128,0.1) 0%, transparent 60%); }

.mode-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.mode-info {
  flex: 1;
  min-width: 0;
}

.mode-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.mode-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.mode-card:hover .mode-arrow { transform: translateX(4px); }

/* Footer */
.start-footer {
  margin-top: auto;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  border-top: 1px solid var(--bg-elevated);
}

.start-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition);
}

.start-footer a:hover { color: var(--text-secondary); }

/* ============================================================
   MODE SELECTION SCREEN (Difficulty picker for Quick Play)
   ============================================================ */
#screen-mode {
  padding: 0;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bg-elevated);
}

.btn-back {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

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

.screen-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}

.mode-screen-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Difficulty cards */
.diff-cards {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.diff-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-align: left;
}

.diff-card:hover { background: var(--bg-card-hover); }

.diff-card.active {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--gold-glow);
}

.diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.diff-card[data-diff="easy"]   .diff-dot { background: var(--green); }
.diff-card[data-diff="medium"] .diff-dot { background: var(--gold); }
.diff-card[data-diff="hard"]   .diff-dot { background: var(--red); }

.diff-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.diff-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* ============================================================
   CATEGORY SCREEN
   ============================================================ */
#screen-category {
  padding: 0;
}

.category-screen-body {
  padding: 1.25rem 1rem 2rem;
  flex: 1;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.125rem 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  min-height: 88px;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.category-card:active { transform: translateY(0); }

.cat-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.cat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.cat-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Game top bar */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem 0.75rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-elevated);
  flex-shrink: 0;
}

.q-counter {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.q-counter strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.score-display {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
  transition: transform 0.15s ease;
}

.score-display.score-bump {
  animation: scoreBump 0.3s ease;
}

@keyframes scoreBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); color: var(--green); }
  100% { transform: scale(1); }
}

/* Progress bar (question progress) */
.progress-track {
  height: 3px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
  transition: width 0.4s ease;
  width: 0%;
}

/* Timer */
.timer-wrap {
  padding: 0.625rem 1.25rem 0;
  flex-shrink: 0;
}

.timer-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  transition: width 0.9s linear, background-color 0.4s ease;
}

.timer-bar.timer-green  { background: var(--green); }
.timer-bar.timer-yellow { background: var(--gold); }
.timer-bar.timer-red    { background: var(--red); }

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

.timer-bar.timer-pulse { animation: timerPulse 0.6s ease-in-out infinite; }

.timer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
  display: block;
}

/* Question type label */
.question-type-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--red);
  text-transform: uppercase;
  padding: 0.875rem 1.25rem 0;
  flex-shrink: 0;
}

/* Quote card */
.quote-area {
  padding: 0.5rem 1.25rem 1rem;
  flex-shrink: 0;
}

.quote-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.375rem 1.375rem 2.25rem;
  position: relative;
  border-left: 3px solid var(--red);
}

.quote-card::before {
  content: '\201C';
  position: absolute;
  top: 0.5rem;
  left: 0.875rem;
  font-size: 2.25rem;
  color: var(--red);
  opacity: 0.5;
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

.quote-prompt {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#quote-text {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-primary);
}

.blank-placeholder {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
}

#quote-context {
  margin-top: 0.625rem;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  font-style: normal;
}

/* Answer grid */
.answer-grid-wrap {
  padding: 0 1.25rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  flex: 1;
}

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

.answer-grid.three-options .answer-card:last-child {
  grid-column: 1 / -1;
}

.answer-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.875rem 0.75rem;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
  border: 2px solid transparent;
  transition: all var(--transition);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  hyphens: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.answer-card:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.answer-card:active:not(:disabled) {
  transform: translateY(0);
}

.answer-card.correct {
  background: rgba(74, 222, 128, 0.15);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}

.answer-card.wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--wrong-red);
  color: var(--wrong-red);
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.answer-card.shake {
  animation: cardShake 0.4s ease;
}

.answer-card:disabled {
  cursor: default;
}

/* Streak bar */
.streak-bar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: transparent;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.streak-bar.streak-active {
  color: var(--gold);
  background: rgba(245, 197, 24, 0.08);
  border-top: 1px solid rgba(245, 197, 24, 0.15);
}

.streak-fire {
  margin-right: 0.35rem;
}

/* ============================================================
   PARTICLES & FLOATING SCORE
   ============================================================ */
.particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
}

.floating-score {
  position: fixed;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--green);
  pointer-events: none;
  z-index: 9999;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ============================================================
   STREAK POPUP
   ============================================================ */
.streak-popup {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1c1c26 0%, #2a2a3d 100%);
  border: 2px solid var(--gold);
  color: var(--gold);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-lg);
  font-size: 1.2rem;
  font-weight: 700;
  z-index: 9000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 40px var(--gold-glow);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
             fadeOut 0.4s ease 1.4s forwards;
  text-align: center;
  white-space: nowrap;
}

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translate(-50%, calc(-50% - 20px)) scale(0.9); }
}

/* ============================================================
   END SCREEN
   ============================================================ */
#screen-end {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.end-body {
  padding: 1.75rem 1.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

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

.end-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.end-rating {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.375rem;
}

.rating-gold   { color: var(--gold); }
.rating-silver { color: #b0b0c0; }
.rating-bronze { color: #cd7f32; }
.rating-default { color: var(--text-secondary); }

/* Score card */
.score-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  border: 1.5px solid var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.score-big {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.score-max {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.new-best-banner {
  background: linear-gradient(90deg, var(--gold) 0%, #fde047 100%);
  color: #000;
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* Stats row */
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}

.end-stat {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.875rem 0.625rem;
  text-align: center;
}

.end-stat .stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.end-stat .stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  display: block;
}

/* Type breakdown */
.breakdown-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.breakdown-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 130px;
  flex-shrink: 0;
}

.breakdown-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.33, 1, 0.68, 1);
}

.breakdown-stat {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}

/* Share section */
.share-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.share-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.share-preview {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

/* End action buttons */
.end-actions {
  padding: 0 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — mobile first tweaks
   ============================================================ */
@media (max-width: 380px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .answer-card { min-height: 56px; font-size: 0.75rem; }
  .score-big   { font-size: 2.75rem; }
  .end-stats   { grid-template-columns: repeat(3, 1fr); }
  .breakdown-label { min-width: 100px; font-size: 0.7rem; }
}

@media (min-width: 480px) {
  .answer-card { min-height: 72px; }
  .quote-card  { padding: 1.5rem 1.5rem 1.5rem 2.5rem; }
  #quote-text  { font-size: 1.2rem; }
}

/* ============================================================
   HOW TO PLAY MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-close {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.htp-row {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.htp-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.htp-row strong {
  font-size: 0.9rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.2rem;
}

.htp-row p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 2px; }
