/* quiz.css — 6-step recommendation quiz styles */
/* Board-game warmth: parchment, amber, forest green, terracotta */

:root {
  --q-bg: #faf6f0;
  --q-bg-card: #fff;
  --q-fg: #2c1f14;
  --q-fg-muted: #6b5344;
  --q-fg-faint: #a89580;
  --q-accent: #b85c2a;
  --q-accent-2: #3d6b4f;
  --q-accent-dim: rgba(184, 92, 42, 0.08);
  --q-border: rgba(44, 31, 20, 0.12);
  --q-font: 'DM Sans', system-ui, sans-serif;
  --q-font-display: 'Space Grotesk', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--q-bg);
  color: var(--q-fg);
  font-family: var(--q-font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Nav ── */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: var(--q-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--q-border);
}
.quiz-nav-logo {
  font-family: var(--q-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--q-fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.quiz-nav-logo span {
  color: var(--q-accent);
}

/* ── Quiz Container ── */
.quiz-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* ── Progress Bar ── */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
}
.quiz-progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--q-border);
  transition: background 0.3s ease;
}
.quiz-progress-step.active {
  background: var(--q-accent);
}
.quiz-progress-step.done {
  background: var(--q-accent-2);
}

/* ── Quiz Step ── */
.quiz-step {
  display: none;
}
.quiz-step.active {
  display: block;
  animation: fadeUp 0.35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-step-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--q-accent-2);
  margin-bottom: 12px;
}
.quiz-step-title {
  font-family: var(--q-font-display);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--q-fg);
  line-height: 1.2;
  margin-bottom: 8px;
}
.quiz-step-sub {
  font-size: 15px;
  color: var(--q-fg-muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* ── Option Grid ── */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Single-select cards (player count, age, time) */
.quiz-card {
  background: var(--q-bg-card);
  border: 2px solid var(--q-border);
  border-radius: 16px;
  padding: 20px 20px 18px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  user-select: none;
}
.quiz-card:hover {
  border-color: rgba(184, 92, 42, 0.35);
  box-shadow: 0 4px 16px rgba(44, 31, 20, 0.08);
  transform: translateY(-2px);
}
.quiz-card.selected {
  border-color: var(--q-accent);
  background: var(--q-accent-dim);
  box-shadow: 0 0 0 4px rgba(184, 92, 42, 0.08);
}
.quiz-card-icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}
.quiz-card-label {
  font-family: var(--q-font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--q-fg);
  line-height: 1.3;
}
.quiz-card-sub {
  font-size: 13px;
  color: var(--q-fg-muted);
  margin-top: 4px;
}

/* Multi-select chips (mechanics, themes, mood) */
.quiz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quiz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--q-bg-card);
  border: 2px solid var(--q-border);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--q-fg-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  user-select: none;
}
.quiz-chip:hover {
  border-color: rgba(184, 92, 42, 0.35);
  color: var(--q-fg);
}
.quiz-chip.selected {
  border-color: var(--q-accent);
  background: var(--q-accent-dim);
  color: var(--q-accent);
  font-weight: 600;
}
.quiz-chip-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
.quiz-chip.selected .quiz-chip-check { opacity: 1; }

/* ── Buttons ── */
.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  gap: 16px;
}
.quiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--q-font);
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  border: none;
}
.quiz-btn:active { transform: scale(0.98); }
.quiz-btn-primary {
  background: var(--q-accent);
  color: #fff;
}
.quiz-btn-primary:hover { background: #a04f22; }
.quiz-btn-secondary {
  background: var(--q-bg-card);
  color: var(--q-fg-muted);
  border: 2px solid var(--q-border);
}
.quiz-btn-secondary:hover { border-color: rgba(184, 92, 42, 0.3); color: var(--q-fg); }

/* ── Hidden select value tracker ── */
.quiz-selected-val {
  display: none;
}

/* ── Loading state ── */
.quiz-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 80px 24px;
  text-align: center;
}
.quiz-loading.active { display: flex; }
.quiz-loading-title {
  font-family: var(--q-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--q-fg);
}
.quiz-loading-sub { font-size: 15px; color: var(--q-fg-muted); }
.quiz-dots {
  display: flex;
  gap: 8px;
}
.quiz-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--q-accent);
  animation: dotBounce 0.6s ease infinite;
}
.quiz-dots span:nth-child(2) { animation-delay: 0.15s; }
.quiz-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Results from quiz ── */
.quiz-results {
  display: none;
}
.quiz-results.active { display: block; }
.quiz-results-header {
  text-align: center;
  margin-bottom: 40px;
}
.quiz-results-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--q-accent-2);
  margin-bottom: 8px;
}
.quiz-results-title {
  font-family: var(--q-font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--q-fg);
}
.quiz-results-count {
  font-size: 14px;
  color: var(--q-fg-muted);
  margin-top: 8px;
}
.quiz-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.quiz-result-card {
  background: var(--q-bg-card);
  border: 1px solid var(--q-border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.quiz-result-card:hover {
  box-shadow: 0 8px 24px rgba(44, 31, 20, 0.12);
  transform: translateY(-3px);
}
.quiz-result-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.quiz-result-body { padding: 18px; }
.quiz-result-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--q-accent-2);
  border: 1px solid rgba(61, 107, 79, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
  background: rgba(61, 107, 79, 0.06);
}
.quiz-result-title {
  font-family: var(--q-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--q-fg);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.quiz-result-desc {
  font-size: 13px;
  color: var(--q-fg-muted);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quiz-result-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.quiz-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--q-fg-muted);
  background: var(--q-bg);
  border: 1px solid var(--q-border);
  border-radius: 6px;
  padding: 4px 8px;
}
.quiz-result-reason {
  font-size: 12px;
  color: var(--q-fg-muted);
  font-style: italic;
  border-top: 1px solid var(--q-border);
  padding-top: 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.quiz-result-reason strong { font-style: normal; color: var(--q-accent-2); }
.quiz-result-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  background: var(--q-accent);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.quiz-result-link:hover { background: #a04f22; }

.quiz-results-cta {
  text-align: center;
  margin-top: 48px;
}
.quiz-results-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--q-bg-card);
  color: var(--q-fg-muted);
  border: 2px solid var(--q-border);
  border-radius: 12px;
  font-family: var(--q-font);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.quiz-results-back:hover { border-color: var(--q-accent); color: var(--q-fg); }
.quiz-retake {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--q-fg-muted);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 12px;
  font-family: var(--q-font);
}
.quiz-retake:hover { color: var(--q-fg); }

/* ── Shop buttons (inline quiz results) ── */
.quiz-result-shop {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.quiz-shop-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.quiz-shop-amazon {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid rgba(124,58,237,0.2);
}
.quiz-shop-amazon:hover { background: #ede9fe; }
.quiz-shop-bol {
  background: #fff3e0;
  color: #d97706;
  border: 1px solid rgba(217,119,6,0.2);
}
.quiz-shop-bol:hover { background: #fef3c7; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .quiz-nav { padding: 16px 20px; }
  .quiz-wrap { padding: 40px 16px 80px; }
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-results-grid { grid-template-columns: 1fr; }
  .quiz-actions { flex-wrap: wrap; }
  .quiz-btn { flex: 1; justify-content: center; }
}