/* ── Variables ── */
:root {
  --bg: #110f1f;
  --bg-card: #1a1730;
  --bg-card-hover: #211e3a;
  --bg-card-active: #262244;
  --border: #2a2648;
  --border-hover: #3d3868;
  --text: #f0ece4;
  --text-secondary: #a8a2c0;
  --text-muted: #5c5680;
  --accent: #ff6347;
  --accent-dim: rgba(255, 99, 71, 0.1);
  --accent-yellow: #ffc940;
  --accent-teal: #4ecdc4;
  --correct: #22c55e;
  --correct-bg: rgba(34, 197, 94, 0.08);
  --correct-border: rgba(34, 197, 94, 0.4);
  --wrong: #ef4444;
  --wrong-bg: rgba(239, 68, 68, 0.08);
  --wrong-border: rgba(239, 68, 68, 0.4);
  --radius: 14px;
  --font-display: 'Abril Fatface', Georgia, serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  isolation: isolate; /* stacking context so z-index:-1 children stay visible */
}

/* Ambient glow — warm coral/purple blend */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 160%;
  height: 80%;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(255, 99, 71, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 50%, rgba(78, 205, 196, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Subtle film grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

/* ── Background Stars ── */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.stars::before,
.stars::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
}

.stars::before {
  box-shadow:
    45px 70px 0 0.5px rgba(255, 201, 64, 0.5),
    180px 140px 0 0.5px rgba(255, 255, 255, 0.25),
    310px 55px 0 1px rgba(78, 205, 196, 0.4),
    440px 190px 0 0.5px rgba(255, 99, 71, 0.35),
    90px 290px 0 0.5px rgba(255, 255, 255, 0.2),
    640px 110px 0 1px rgba(255, 201, 64, 0.4),
    210px 390px 0 0.5px rgba(255, 255, 255, 0.25),
    770px 340px 0 0.5px rgba(78, 205, 196, 0.3),
    890px 440px 0 1px rgba(255, 99, 71, 0.3),
    140px 490px 0 0.5px rgba(255, 255, 255, 0.2),
    1050px 290px 0 0.5px rgba(255, 201, 64, 0.35),
    70px 590px 0 1px rgba(78, 205, 196, 0.3),
    1210px 540px 0 0.5px rgba(255, 255, 255, 0.25),
    720px 240px 0 0.5px rgba(255, 99, 71, 0.2),
    1380px 170px 0 1px rgba(255, 201, 64, 0.3),
    960px 80px 0 0.5px rgba(255, 255, 255, 0.25),
    1520px 420px 0 1px rgba(78, 205, 196, 0.35),
    1150px 160px 0 0.5px rgba(255, 99, 71, 0.3),
    1680px 300px 0 0.5px rgba(255, 201, 64, 0.4),
    1800px 120px 0 1px rgba(255, 255, 255, 0.2),
    830px 520px 0 0.5px rgba(78, 205, 196, 0.3),
    1440px 580px 0 0.5px rgba(255, 99, 71, 0.25),
    500px 350px 0 1px rgba(255, 201, 64, 0.35),
    1600px 200px 0 0.5px rgba(255, 255, 255, 0.25);
  animation: twinkle 5s ease-in-out infinite alternate;
}

.stars::after {
  box-shadow:
    25px 110px 0 0.5px rgba(255, 255, 255, 0.25),
    240px 70px 0 1px rgba(255, 201, 64, 0.4),
    390px 170px 0 0.5px rgba(78, 205, 196, 0.35),
    110px 240px 0 0.5px rgba(255, 99, 71, 0.25),
    690px 50px 0 1px rgba(255, 255, 255, 0.2),
    540px 390px 0 0.5px rgba(255, 201, 64, 0.3),
    70px 440px 0 0.5px rgba(255, 255, 255, 0.25),
    840px 340px 0 1px rgba(78, 205, 196, 0.4),
    190px 540px 0 0.5px rgba(255, 99, 71, 0.25),
    1040px 490px 0 0.5px rgba(255, 255, 255, 0.2),
    750px 140px 0 1px rgba(255, 201, 64, 0.35),
    1200px 370px 0 0.5px rgba(78, 205, 196, 0.25),
    1100px 240px 0 0.5px rgba(255, 255, 255, 0.25),
    960px 90px 0 1px rgba(255, 99, 71, 0.2),
    1350px 390px 0 0.5px rgba(255, 201, 64, 0.3),
    1500px 150px 0 1px rgba(255, 255, 255, 0.25),
    1280px 530px 0 0.5px rgba(78, 205, 196, 0.35),
    1650px 260px 0 0.5px rgba(255, 99, 71, 0.3),
    470px 480px 0 1px rgba(255, 201, 64, 0.3),
    1750px 440px 0 0.5px rgba(255, 255, 255, 0.2),
    620px 560px 0 1px rgba(78, 205, 196, 0.3),
    1430px 80px 0 0.5px rgba(255, 99, 71, 0.25),
    1580px 520px 0 0.5px rgba(255, 201, 64, 0.35),
    340px 310px 0 1px rgba(255, 255, 255, 0.25);
  animation: twinkle 7s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.container {
  max-width: 640px;
  width: 100%;
  position: relative;
  z-index: 1;
  padding-top: 16px;
  padding-bottom: 48px;
}

/* ── Header ── */
.header {
  margin-bottom: 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.01em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clapper-icon {
  flex-shrink: 0;
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.icon-btn:active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ── Film Strip Decoration ── */
.film-strip {
  height: 26px;
  background: #15132a;
  border-radius: 4px;
  margin: 16px -4px 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 38, 72, 0.6);
}

/* Sprocket holes — top row */
.film-strip::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 3px;
  height: 5px;
  background: repeating-linear-gradient(
    to right,
    var(--bg) 0px,
    var(--bg) 10px,
    transparent 10px,
    transparent 20px
  );
  border-radius: 1.5px;
}

/* Sprocket holes — bottom row */
.film-strip::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 5px;
  background: repeating-linear-gradient(
    to right,
    var(--bg) 0px,
    var(--bg) 10px,
    transparent 10px,
    transparent 20px
  );
  border-radius: 1.5px;
}

/* ── Help Modal ── */
.help-body p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.help-body strong {
  color: var(--text);
}

.help-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.help-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.correct-swatch {
  background: var(--correct);
}

.wrong-swatch {
  background: var(--wrong);
}

.dimmed-swatch {
  background: var(--text-muted);
  opacity: 0.4;
}

/* ── Loading ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

/* Bouncing dots loader */
.spinner {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}

.dot-1 { background: var(--accent); animation-delay: 0s; }
.dot-2 { background: var(--accent-yellow); animation-delay: 0.2s; }
.dot-3 { background: var(--accent-teal); animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.5) translateY(0); opacity: 0.4; }
  40% { transform: scale(1) translateY(-10px); opacity: 1; }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.loading-dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ── Game ── */
.game {
  position: relative;
}

/* Spotlight cone behind the movie title */
.game::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 350px;
  height: 250px;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 201, 64, 0.07) 0%,
    rgba(255, 99, 71, 0.03) 35%,
    transparent 65%
  );
  pointer-events: none;
  z-index: -1;
}

.movie-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 4px;
}

.genre-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--accent-teal);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.game-prompt {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Option Cards ── */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transform: translateY(12px);
  animation: cardEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
}

/* Subtle film-frame left edge on cards */
.option-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-yellow);
  opacity: 0;
  transition: opacity 0.2s;
}

.option-card:hover::after {
  opacity: 0.6;
}

.option-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.option-card:active {
  transform: scale(0.985);
  background: var(--bg-card-active);
}

.option-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1a1730;
  background: var(--accent-yellow);
  border-radius: 8px;
  margin-top: 1px;
}

.option-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Card entrance stagger */
.option-card:nth-child(1) { animation-delay: 0ms; }
.option-card:nth-child(2) { animation-delay: 60ms; }
.option-card:nth-child(3) { animation-delay: 120ms; }
.option-card:nth-child(4) { animation-delay: 180ms; }
.option-card:nth-child(5) { animation-delay: 240ms; }
.option-card:nth-child(6) { animation-delay: 300ms; }

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Revealed States ── */
.option-card.revealed {
  cursor: default;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  animation: none;
  box-shadow: none;
}

.option-card.revealed::after {
  display: none;
}

.option-card.correct {
  border-color: var(--correct-border);
  background: var(--correct-bg);
  animation: correctPulse 2s ease-in-out 1;
}

.option-card.correct .option-num {
  background: var(--correct);
  color: #000;
}

.option-card.correct .option-text {
  color: var(--text);
}

.option-card.wrong {
  border-color: var(--wrong-border);
  background: var(--wrong-bg);
  animation: wrongShake 0.4s ease;
}

.option-card.wrong .option-num {
  background: var(--wrong);
  color: #fff;
}

.option-card.dimmed {
  opacity: 0.4;
  transition: opacity 0.4s ease;
}

.option-card.eliminated {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
  animation: none;
  transform: translateY(0);
  transition: opacity 0.3s ease;
  box-shadow: none;
}

.option-card.eliminated::after {
  display: none;
}

.option-card.eliminated .option-text {
  text-decoration: none;
}

.option-card.eliminated .option-num {
  background: var(--wrong);
  color: #fff;
}

@keyframes correctPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  30% { box-shadow: 0 0 28px 4px rgba(34, 197, 94, 0.15); }
  60% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

/* ── Result ── */
.result {
  margin-top: 24px;
  animation: slideUp 0.4s ease;
}

.result-banner {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.result-banner.win { color: var(--correct); }
.result-banner.lose { color: var(--wrong); }

/* ── Movie Reveal Card ── */
.movie-reveal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.reveal-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.poster {
  width: 90px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.reveal-info {
  min-width: 0;
}

.reveal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
}

.reveal-year {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.reveal-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 8px;
  line-height: 1.4;
}

.reveal-plot {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.reveal-details {
  padding-top: 12px;
}

.detail-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  min-width: 64px;
}

.imdb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f5c518;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 4px;
}

.reveal-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.imdb-link:hover {
  text-decoration: underline;
}

.share-movie-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.share-movie-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.share-movie-btn:active {
  opacity: 0.7;
}

.reveal-quip {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent);
  line-height: 1.5;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Feedback Form ── */
.feedback-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.feedback-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.feedback-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.feedback-input:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-input::placeholder {
  color: var(--text-muted);
}

.feedback-form .btn-sm {
  flex: none;
  width: auto;
}

.feedback-form.sent .feedback-input,
.feedback-form.sent .btn-sm {
  display: none;
}

.feedback-form.sent .feedback-label {
  color: var(--correct);
  margin-bottom: 0;
}

/* ── Result Actions ── */
.result-actions {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ── Share Card ── */
.share-card {
  margin-bottom: 12px;
  animation: slideUp 0.3s ease;
}

.share-card-inner {
  background: linear-gradient(145deg, #1e1b35 0%, #15132a 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.share-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-yellow), var(--accent-teal));
}

.share-card-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.share-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.share-result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.share-result-dash {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.share-grid {
  display: flex;
  gap: 8px;
}

.share-dot {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.share-dot.wrong {
  background: var(--wrong);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.share-dot.correct {
  background: var(--correct);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.share-dot.unused {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.share-tagline {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-yellow);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.share-movie {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.share-quip {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
}

.share-url {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent-teal);
  letter-spacing: 1px;
  opacity: 0.8;
}

.btn-sm {
  padding: 10px 12px;
  font-size: 0.8rem;
}

/* ── Error ── */
.error {
  text-align: center;
  padding: 48px 0;
}

.error p {
  color: var(--wrong);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ── Stats Modal / Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.overlay-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  background: #1a1730;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 24px 20px 32px;
  overflow-y: auto;
  animation: sheetUp 0.3s ease;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.overlay-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Stats grid */
.stats-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Distribution chart */
.dist-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dist-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 12px;
  text-align: right;
  flex-shrink: 0;
}

.dist-bar-track {
  flex: 1;
  height: 22px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  overflow: hidden;
}

.dist-bar {
  height: 100%;
  min-width: 24px;
  background: var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  transition: width 0.4s ease;
}

.dist-bar.highlight {
  background: var(--accent);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Utilities ── */
.hidden {
  display: none !important;
}

/* ── Desktop (640px+) ── */
@media (min-width: 640px) {
  body {
    padding: 0 24px;
  }

  .container {
    padding-top: 32px;
  }

  .header {
    margin-bottom: 0;
  }

  .logo {
    font-size: 2rem;
  }

  .movie-title {
    font-size: 1.75rem;
    margin-bottom: 6px;
  }

  .game-prompt {
    margin-bottom: 24px;
  }

  .options {
    gap: 10px;
  }

  .option-card {
    padding: 16px 20px;
  }

  .overlay {
    align-items: center;
  }

  .overlay-panel {
    border-radius: 18px;
    border-bottom: 1px solid var(--border);
    animation-name: fadeIn;
  }

  .poster {
    width: 110px;
  }
}
