/* ══════════════════════════════════════════════
   Act 2 — The Quiz
══════════════════════════════════════════════ */

#quiz {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  z-index: 3;
  background-color: transparent; /* body bg-deep shows through */
  opacity: 0;
}

/* ── Quiz card ── */
.quiz-card {
  background: var(--bg-warm);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), 0 0 60px var(--glow);
  max-width: var(--max-quiz);
  width: 100%;
  padding: clamp(2rem, 5vw, 3rem);
  position: relative;
  overflow: hidden;
}

/* HK dot overlay on card */
.quiz-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hk-dot-pattern);
  background-size: var(--hk-dot-size);
  opacity: 0.6;
  pointer-events: none;
  border-radius: inherit;
}

/* ── Progress bows ── */
.quiz-progress {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.progress-bow {
  opacity: 0.3;
  transition: opacity 0.4s var(--ease-default), transform 0.4s var(--ease-romantic);
}

.progress-bow.completed {
  opacity: 1;
  transform: scale(1.15);
}

.progress-bow.completed svg {
  fill: var(--pink);
}

/* ── Intro card ── */
.quiz-intro {
  text-align: center;
  padding: var(--space-xl) 0;
  position: relative;
  z-index: 1;
}

.quiz-intro-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-xl);
}

/* ── Question ── */
.quiz-question-wrap {
  position: relative;
  z-index: 1;
  opacity: 1; /* explicit — GSAP must never leave this invisible */
}

.quiz-question-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* ── Options grid ── */
.quiz-options {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

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

.quiz-options.two_option {
  grid-template-columns: 1fr 1fr;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Option button ── */
.option-btn {
  background: var(--bg-deep);
  color: var(--text-primary);
  border: 2px solid rgba(155, 127, 196, 0.2);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.25s var(--ease-default),
    background-color 0.25s var(--ease-default),
    transform 0.25s var(--ease-romantic),
    box-shadow 0.25s var(--ease-default);
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--purple-haze);
  opacity: 0;
  transition: opacity 0.2s var(--ease-default);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--glow);
}

.option-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.option-btn:focus-visible {
  outline: 2px solid var(--purple-soft);
  outline-offset: 2px;
}

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

/* ── Feedback states ── */
.option-btn.correct {
  border-color: var(--pink);
  background: rgba(232, 120, 168, 0.12);
  box-shadow: 0 0 30px var(--glow-pink), inset 0 0 20px rgba(232, 120, 168, 0.1);
  color: var(--pink-soft);
}

.option-btn.wrong {
  border-color: rgba(155, 127, 196, 0.4);
  background: rgba(26, 21, 32, 0.8);
  color: var(--text-secondary);
}

.option-btn.reveal-correct {
  border-color: var(--purple-soft);
  color: var(--purple-soft);
}

/* ── Commentary ── */
.quiz-commentary {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.5em;
  opacity: 0;
  transform: translateY(8px);
  position: relative;
  z-index: 1;
  margin-top: var(--space-sm);
}

/* ── Results screen ── */
.quiz-results {
  text-align: center;
  padding: var(--space-lg) 0;
  position: relative;
  z-index: 1;
  /* opacity managed by GSAP transform-only animation — no opacity:0 here */
}

.results-score {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  color: var(--purple-soft);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.results-message {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.results-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.results-bow {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .quiz-options.four_option {
    grid-template-columns: 1fr;
  }

  .quiz-options.two_option {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .quiz-card {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-lg);
  }

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