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

:root {
  --bg:        #0d0d0d;
  --surface:   #1a1a1a;
  --surface2:  #222222;
  --red:       #cc0000;
  --red-dark:  #8b0000;
  --red-glow:  rgba(204, 0, 0, 0.25);
  --text:      #e8e8e8;
  --muted:     #888;
  --correct:   #2a7a2a;
  --wrong:     #7a1515;
  --radius:    10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 2px solid var(--red-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
}

.ghost-icon {
  margin-right: 6px;
}

#score-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* ── Main layout ───────────────────────────────────────────────── */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── Progress bar ──────────────────────────────────────────────── */
#progress-container {
  margin-bottom: 24px;
}

#progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

#progress-bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

#progress-bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Start screen ──────────────────────────────────────────────── */
#start-screen {
  text-align: center;
  padding: 40px 20px;
}

.knife-divider {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
  animation: wobble 3s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-5deg); }
  50%       { transform: rotate(5deg); }
}

#start-screen h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

#start-screen p {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.subtitle {
  font-size: 1rem !important;
  color: var(--red) !important;
  font-weight: 600;
  margin-bottom: 28px !important;
}

.options-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.option-group label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

select:focus { border-color: var(--red); }

/* ── Buttons ───────────────────────────────────────────────────── */
button {
  display: inline-block;
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

#start-btn, #restart-btn {
  background: var(--red);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 20px var(--red-glow);
}

#start-btn:hover, #restart-btn:hover {
  background: #e60000;
  box-shadow: 0 0 30px rgba(204, 0, 0, 0.5);
  transform: translateY(-1px);
}

#next-btn {
  margin-top: 20px;
  background: var(--surface2);
  color: #fff;
  border: 1px solid #444;
  width: 100%;
}

#next-btn:hover {
  background: #2a2a2a;
  border-color: var(--red);
  transform: translateY(-1px);
}

/* ── Loading ───────────────────────────────────────────────────── */
#loading-screen {
  text-align: center;
  padding: 80px 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

/* ── Question card ─────────────────────────────────────────────── */
#question-card {
  background: var(--surface);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 28px 24px;
}

#question-film {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 12px;
}

#question-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 24px;
  line-height: 1.45;
}

/* ── Options grid ──────────────────────────────────────────────── */
#options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 500px) {
  #options-grid { grid-template-columns: 1fr; }
}

.option-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  line-height: 1.35;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--red);
  background: #262626;
  transform: translateY(-1px);
}

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

.option-btn.correct {
  background: var(--correct);
  border-color: #3a9a3a;
  color: #fff;
}

.option-btn.wrong {
  background: var(--wrong);
  border-color: #9a2020;
  color: #fff;
}

.option-btn.reveal {
  background: var(--correct);
  border-color: #3a9a3a;
  color: #fff;
}

/* ── Feedback ──────────────────────────────────────────────────── */
#feedback {
  min-height: 28px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 8px;
}

#feedback.correct { color: #5cb85c; }
#feedback.wrong   { color: #e05252; }

/* ── Results ───────────────────────────────────────────────────── */
#results-screen {
  text-align: center;
  padding: 40px 20px;
}

#results-screen h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
}

#results-score {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 8px;
  text-shadow: 0 0 30px var(--red-glow);
}

#results-grade {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
}

#results-breakdown {
  background: var(--surface);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
  text-align: left;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #222;
  font-size: 0.9rem;
}

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

.breakdown-film { color: var(--muted); }
.breakdown-score { font-weight: 700; color: var(--text); }
