/* =============================================================
   Commander Quest — style.css
   Dark fantasy aesthetic inspired by Magic: The Gathering.
   CSS custom properties used throughout for easy theming.

   TABLE OF CONTENTS
   ─────────────────────────────────────────────────────────────
   1.  Custom Properties (design tokens)
   2.  Reset & Base
   3.  Screen System (show/hide + fade transitions)
   4.  Landing Screen
   5.  Buttons
   6.  Quest Screen Layout (header, progress bar, main)
   7.  Step Header & Description
   8.  Step 1 — Color Wheel
   9.  Step 1 — Color Slots
   10. Step 1 — Result Area
   11. Steps 2 & 3 — Flip Cards
   12. Step 3 — Quest Complete Summary
   13. Step 4 — Crossroads Path System
   14. Responsive Overrides (≤ 600px)
   ─────────────────────────────────────────────────────────────
   To theme the app: edit the CSS variables in section 1.
   All colors, spacing, and fonts are defined there.
============================================================= */

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Colors */
  --ink:        #0a0a0f;
  --parchment:  #f5edd6;
  --gold:       #c9a84c;
  --gold-bright:#f0c96e;
  --gold-dark:  #8a6a20;
  --silver:     #9eaab8;
  --glow:       rgba(201, 168, 76, 0.35);
  --glow-soft:  rgba(201, 168, 76, 0.12);

  /* Mana colors */
  --mana-white: #f8f0d0;
  --mana-blue:  #1a5fa8;
  --mana-black: #1a1020;
  --mana-red:   #c0392b;
  --mana-green: #1a6b3a;

  /* Mana accent rings */
  --mana-white-ring: #e8d8a0;
  --mana-blue-ring:  #4a9fef;
  --mana-black-ring: #8855cc;
  --mana-red-ring:   #ff6644;
  --mana-green-ring: #44cc66;

  /* Surfaces */
  --surface:    #12111a;
  --surface-2:  #1c1b28;
  --surface-3:  #252438;
  --border:     rgba(201, 168, 76, 0.2);
  --border-bright: rgba(201, 168, 76, 0.55);

  /* Typography */
  --font-display: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body:    'Crimson Pro', Georgia, serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Screen System ────────────────────────────────────────── */
/*  Each "screen" is full-page. Only the `.active` one is shown.
    JS toggles the `active` class to navigate between screens. */

.screen {
  display: none;
  min-height: 100dvh;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.screen.fade-in {
  animation: screenFadeIn 0.6s var(--ease-out) forwards;
}

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

/* ── Landing Screen ───────────────────────────────────────── */
#screen-landing {
  position: relative;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  overflow: hidden;
}

/* Atmospheric background */
.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 65% at 50% 45%, rgba(45, 30, 85, 0.75) 0%, transparent 68%),
    radial-gradient(ellipse 45% 45% at 15% 85%, rgba(20, 10, 55, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse 35% 35% at 85% 10%, rgba(60, 25, 10, 0.3) 0%, transparent 60%);
  pointer-events: none;
}

/* Floating arcane rune decorations */
.rune {
  position: absolute;
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--gold);
  opacity: 0.04;
  animation: runeFloat 8s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
}
.rune-1 { top: 10%;  left: 5%;  animation-delay: 0s;    font-size: 5rem; }
.rune-2 { top: 15%;  right: 8%; animation-delay: 2.5s;  font-size: 7rem; opacity: 0.03; }
.rune-3 { bottom: 20%; left: 10%; animation-delay: 1.2s; font-size: 4rem; }
.rune-4 { bottom: 10%; right: 6%; animation-delay: 3.8s; font-size: 6rem; opacity: 0.03; }

@keyframes runeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-18px) rotate(5deg); }
}

/* Landing content */
.landing-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.sigil {
  font-size: 2.2rem;
  color: var(--gold);
  animation: sigilPulse 3s ease-in-out infinite;
  text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(201, 168, 76, 0.4);
}
.sigil-large { font-size: 3rem; }

@keyframes sigilPulse {
  0%, 100% { text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(201, 168, 76, 0.4); transform: scale(1); }
  50%       { text-shadow: 0 0 30px var(--gold), 0 0 60px rgba(201, 168, 76, 0.6); transform: scale(1.1); }
}

@keyframes landingSigilPulse {
  0%, 100% {
    text-shadow: 0 0 28px var(--gold), 0 0 60px rgba(201, 168, 76, 0.65), 0 0 100px rgba(201, 168, 76, 0.28);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 50px var(--gold-bright), 0 0 95px rgba(240, 201, 110, 0.85), 0 0 150px rgba(201, 168, 76, 0.45);
    transform: scale(1.18);
  }
}

#screen-landing .sigil {
  animation: landingSigilPulse 1.3s ease-in-out infinite;
  text-shadow: 0 0 28px var(--gold), 0 0 60px rgba(201, 168, 76, 0.65), 0 0 100px rgba(201, 168, 76, 0.28);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--parchment);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.title-accent {
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(240, 201, 110, 0.5);
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
}

.btn-lobby {
  position: relative;
  width: fit-content;
}

.btn-badge {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--silver);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-left: var(--space-sm);
  vertical-align: middle;
  opacity: 0.7;
}

.tagline {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: rgba(158, 170, 184, 0.9);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.9rem 2.8rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s var(--ease-out);
  box-shadow: 0 0 20px var(--glow), 0 4px 15px rgba(0,0,0,0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px var(--glow), 0 8px 25px rgba(0,0,0,0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.btn-secondary {
  padding: 0.85rem 2.4rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-bounce);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--glow-soft);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--silver);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover { opacity: 1; }

.btn-complete {
  font-size: 1rem;
  padding: 1rem 3rem;
  letter-spacing: 0.15em;
}

/* ── Quest Screen ─────────────────────────────────────────── */
#screen-quest {
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 65% at 50% 45%, rgba(45, 30, 85, 0.75) 0%, transparent 68%),
    radial-gradient(ellipse 45% 45% at 15% 85%, rgba(20, 10, 55, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse 35% 35% at 85% 10%, rgba(60, 25, 10, 0.3) 0%, transparent 60%),
    var(--ink);
}

/* Quest header / progress bar */
.quest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 20, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.quest-progress {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

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

.progress-group:not(:last-child) > .progress-step::after {
  content: '·';
  margin-left: var(--space-sm);
  color: var(--border-bright);
  opacity: 0.3;
}

.progress-step {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.35;
  transition: opacity 0.3s, color 0.3s;
}

.progress-step.active {
  color: var(--gold);
  opacity: 1;
}

.progress-step.complete {
  color: var(--gold-bright);
  opacity: 0.7;
}

.progress-children {
  display: flex;
  gap: 6px;
  padding-left: 2px;
}

.progress-child {
  font-family: var(--font-heading);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.3;
  transition: opacity 0.3s, color 0.3s;
}

.progress-child + .progress-child::before {
  content: '·';
  margin-right: 6px;
  color: var(--border-bright);
  opacity: 0.4;
}

.progress-child.active {
  color: var(--gold);
  opacity: 0.9;
}

.progress-child.complete {
  color: var(--gold-bright);
  opacity: 0.6;
}

/* ── Quest Main ───────────────────────────────────────────── */
.quest-main {
  flex: 1;
  padding: var(--space-xl) var(--space-md);
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ── Step Components ──────────────────────────────────────── */
/* Steps are hidden by default. `.active-step` is displayed. */
.step { display: none; }
.step.active-step {
  display: block;
  animation: screenFadeIn 0.5s var(--ease-out) forwards;
}

.step-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.step-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  padding: 0.3rem 1rem;
  border-radius: 999px;
}

.step-group-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.45;
  margin-bottom: 0.3rem;
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--parchment);
  margin: var(--space-md) 0 var(--space-sm);
  font-weight: 400;
}

.step-desc {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  color: rgba(245, 237, 214, 0.65);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Wheel of Fortune ─────────────────────────────────────── */
.wheel-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.wheel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -1.5rem;
}

.wheel-pointer {
  margin-bottom: -32px;
  z-index: 2;
  position: relative;
  animation: pointerPulse 2s ease-in-out infinite;
  line-height: 0;
}

@keyframes pointerPulse {
  0%, 100% { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)) drop-shadow(0 0 6px rgba(201,168,76,0.4)); }
  50%       { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)) drop-shadow(0 0 18px rgba(201,168,76,0.85)) drop-shadow(0 0 32px rgba(201,168,76,0.3)); }
}

/* The wheel itself — a CSS conic gradient circle */
.color-wheel {
  width: clamp(200px, 40vw, 280px);
  height: clamp(200px, 40vw, 280px);
  border-radius: 50%;
  position: relative;
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 6px rgba(0, 0, 0, 0.52),
    0 0 55px var(--glow),
    0 0 90px rgba(201, 168, 76, 0.12),
    inset 0 0 45px rgba(0, 0, 0, 0.6);
  transition: border-color 0.3s;
  /* Rotation is set inline by JS */
}

/* Outer decorative ring — floats just beyond the main border */
.color-wheel::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.38);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.1);
  pointer-events: none;
  z-index: 3;
}

/* Inner concentric ring */
.color-wheel::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.28);
  pointer-events: none;
  z-index: 3;
}

/* Segment divider lines */
.wheel-divider {
  position: absolute;
  top: 50%;
  left: calc(50% - 0.5px);
  width: 1px;
  height: 50%;
  transform-origin: top center;
  background: linear-gradient(to bottom, rgba(201, 168, 76, 0.55) 0%, rgba(201, 168, 76, 0.1) 72%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Inner hub */
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #2e2b45 0%, #16132a 55%, var(--gold-dark) 100%);
  border: 2px solid var(--gold-bright);
  box-shadow:
    0 0 0 3px rgba(10, 8, 20, 0.6),
    0 0 0 4px rgba(201, 168, 76, 0.18),
    0 0 22px var(--glow),
    0 0 42px rgba(201, 168, 76, 0.18),
    inset 0 0 16px rgba(10, 8, 24, 0.5);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-sigil {
  font-size: 1.05rem;
  color: var(--gold-bright);
  text-shadow: 0 0 10px var(--gold), 0 0 22px rgba(201, 168, 76, 0.5);
  animation: sigilPulse 3s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

/* Mana symbol pip on the wheel */
.wheel-symbol {
  position: absolute;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.wheel-symbol img {
  width:  clamp(36px, 9vw, 48px);
  height: clamp(36px, 9vw, 48px);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.7));
}

/* Clickable wheel — pointer cursor and magical hover glow */
.color-wheel:not(.wheel-spinning):not(.wheel-done) {
  cursor: pointer;
}

@keyframes wheelMagicHover {
  0%,100% { box-shadow: 0 0 0 6px rgba(0,0,0,0.52), 0 0 28px rgba(201,168,76,0.25), 0 0 55px rgba(201,168,76,0.08),  inset 0 0 45px rgba(0,0,0,0.6); }
  50%     { box-shadow: 0 0 0 6px rgba(0,0,0,0.52), 0 0 38px rgba(201,168,76,0.38), 0 0 70px rgba(201,168,76,0.13),  inset 0 0 45px rgba(0,0,0,0.6); }
}

.color-wheel:not(.wheel-spinning):not(.wheel-done):hover {
  animation: wheelMagicHover 2s ease-in-out infinite;
}

/* Winning flash when a color is selected — !important overrides hover animation */
.color-wheel.color-selected {
  animation: wheelFlash 0.8s ease-out !important;
}

@keyframes wheelFlash {
  0%   { box-shadow: 0 0 0 6px rgba(0,0,0,0.52), 0 0  40px var(--flash-color-dim), 0 0  80px transparent,             inset 0 0 45px rgba(0,0,0,0.6); }
  35%  { box-shadow: 0 0 0 4px rgba(0,0,0,0.20), 0 0 140px var(--flash-color),     0 0 240px var(--flash-color-dim),  inset 0 0 60px rgba(0,0,0,0.3); }
  100% { box-shadow: 0 0 0 6px rgba(0,0,0,0.52), 0 0  40px var(--flash-color-dim), 0 0  80px transparent,             inset 0 0 45px rgba(0,0,0,0.6); }
}

/* Wheel Controls */
.wheel-controls {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}


/* ── Rainbow Flash (triple-same result) ──────────────────── */
@keyframes rainbowCycle {
  0%   { border-color: #ff4444; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #ff4444; }
  17%  { border-color: #ff8800; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #ff8800; }
  33%  { border-color: #f5e600; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #f5e600; }
  50%  { border-color: #33cc55; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #33cc55; }
  67%  { border-color: #3388ff; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #3388ff; }
  83%  { border-color: #bb44ff; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #bb44ff; }
  100% { border-color: #ff4444; box-shadow: 0 0 0 6px rgba(0,0,0,0.3), 0 0 50px #ff4444; }
}

.color-wheel.rainbow-flash {
  animation: rainbowCycle 0.8s linear 5 !important;
}

.color-slot.rainbow-flash {
  animation: rainbowCycle 0.8s linear 5 !important;
}

/* ── Mercy Message ───────────────────────────────────────── */
.result-rainbow-msg {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: var(--space-xs);
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
}


/* ── Next-to-fill slot pulse ─────────────────────────────── */
@keyframes nextSlotPulse {
  0%, 100% { border-color: rgba(201, 168, 76, 0.25); box-shadow: none; }
  50%       { border-color: rgba(201, 168, 76, 0.7);  box-shadow: 0 0 14px rgba(201, 168, 76, 0.3); }
}

.color-slot.next-to-fill {
  animation: nextSlotPulse 1.6s ease-in-out infinite;
}

/* ── Mercy Reroll — slots become clickable ───────────────── */
@keyframes rerollPulse {
  0%, 100% { box-shadow: 0 0 12px var(--glow); }
  50%       { box-shadow: 0 0 28px var(--gold), 0 0 50px rgba(201, 168, 76, 0.3); }
}

.color-slot.rerollable {
  cursor: pointer;
  animation: rerollPulse 1.4s ease-in-out infinite;
  border-style: solid;
  border-color: var(--gold);
}

.color-slot.rerollable:hover {
  transform: scale(1.14);
  box-shadow: 0 0 30px var(--gold), 0 0 55px rgba(201, 168, 76, 0.4);
  border-color: var(--gold-bright);
  animation: none;
}

/* ── Selected Colors Display ──────────────────────────────── */
.selected-colors-area {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.selected-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.6;
  margin-bottom: var(--space-md);
}

.selected-colors {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Individual color slot — empty state */
.color-slot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.4s var(--ease-bounce);
  position: relative;
  overflow: hidden;
}

.color-slot.empty::after {
  content: '?';
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--border-bright);
  opacity: 0.3;
}

/* Filled slot — color set via JS inline style + this class */
.color-slot.filled {
  border-style: solid;
  border-width: 3px;
  box-shadow: 0 0 20px var(--slot-glow, var(--glow));
  animation: slotReveal 0.5s var(--ease-bounce) forwards;
}

.slot-img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.color-slot.filled::after { display: none; }

@keyframes slotReveal {
  0%   { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  70%  { transform: scale(1.1) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Color-specific slot styles (set via data attributes in JS) */
.color-slot[data-color="white"]  { background: radial-gradient(circle, #f5f0d8, #c8b87a); border-color: var(--mana-white-ring); --slot-glow: rgba(248,240,208,0.4); }
.color-slot[data-color="blue"]   { background: radial-gradient(circle, #1a5fa8, #0a2550); border-color: var(--mana-blue-ring);  --slot-glow: rgba(74,159,239,0.4); }
.color-slot[data-color="black"]  { background: radial-gradient(circle, #3a2050, #10081a); border-color: var(--mana-black-ring); --slot-glow: rgba(136,85,204,0.4); }
.color-slot[data-color="red"]    { background: radial-gradient(circle, #c0392b, #5a0f0a); border-color: var(--mana-red-ring);   --slot-glow: rgba(255,102,68,0.4); }
.color-slot[data-color="green"]  { background: radial-gradient(circle, #1a6b3a, #082010); border-color: var(--mana-green-ring); --slot-glow: rgba(68,204,102,0.4); }

/* ── Step Result Card ─────────────────────────────────────── */
.step-result {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.step-result.hidden { display: none; }

.step-result { margin-top: var(--space-md); }

.result-card {
  border: 1px solid var(--border-bright);
  background: var(--surface-2);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 0 40px var(--glow-soft), inset 0 1px 0 rgba(255,255,255,0.05);
  max-width: 500px;
  width: 100%;
}

.result-card::before,
.result-card::after {
  content: '✦';
  position: absolute;
  top: var(--space-md);
  color: var(--gold);
  opacity: 0.4;
  font-size: 0.7rem;
}
.result-card::before { left: var(--space-md); }
.result-card::after  { right: var(--space-md); }

.result-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-lg);
}

.result-colors {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

/* Result color pill */
.pill-img {
  width: 1.4em;
  height: 1.4em;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

.result-color-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid;
  animation: pillReveal 0.4s var(--ease-bounce) both;
}

.result-color-pill:nth-child(2) { animation-delay: 0.1s; }
.result-color-pill:nth-child(3) { animation-delay: 0.2s; }

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

.result-color-pill.white { background: rgba(248,240,208,0.12); border-color: var(--mana-white-ring); color: #f8f0d0; }
.result-color-pill.blue  { background: rgba(26, 95,168,0.25);  border-color: var(--mana-blue-ring);  color: #6bbfff; }
.result-color-pill.black { background: rgba(58, 32, 80,0.35);  border-color: var(--mana-black-ring); color: #cc99ff; }
.result-color-pill.red   { background: rgba(192,57, 43,0.25);  border-color: var(--mana-red-ring);   color: #ff8866; }
.result-color-pill.green { background: rgba(26,107, 58,0.25);  border-color: var(--mana-green-ring); color: #66dd88; }

.result-flavor {
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(245, 237, 214, 0.5);
  line-height: 1.6;
}

.result-constraint {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(245, 237, 214, 0.4);
  margin-top: var(--space-sm);
}

.result-combo-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 400;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(240, 201, 110, 0.5), 0 0 60px rgba(240, 201, 110, 0.2);
}

/* ── Placeholder Steps ────────────────────────────────────── */
.placeholder-content {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  border: 1px dashed var(--border);
  border-radius: 16px;
  margin-bottom: var(--space-xl);
  background: var(--surface-2);
}

.placeholder-icon { font-size: 2.5rem; margin-bottom: var(--space-lg); opacity: 0.5; }

.placeholder-text {
  font-size: 1rem;
  color: rgba(245,237,214,0.45);
  line-height: 1.8;
}

/* ── Quest Complete Screen ────────────────────────────────── */
#screen-complete {
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  background:
    radial-gradient(ellipse 60% 60% at 50% 40%, rgba(50, 30, 5, 0.6) 0%, transparent 65%),
    var(--ink);
}

.complete-content {
  max-width: 580px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.complete-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--gold-bright);
  font-weight: 400;
  text-shadow: 0 0 30px rgba(240,201,110,0.4);
}

.complete-subtitle {
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(245,237,214,0.6);
  max-width: 400px;
}

/* Quest summary card */
.quest-summary {
  width: 100%;
  border: 1px solid var(--border-bright);
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 40px var(--glow-soft);
}

.summary-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  gap: var(--space-md);
  animation: summarySlide 0.4s var(--ease-out) both;
}

@keyframes summarySlide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.summary-item:last-child { border-bottom: none; }

.summary-key {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
}

.summary-value {
  font-size: 1rem;
  color: var(--parchment);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.summary-placeholder {
  font-style: italic;
  color: rgba(245,237,214,0.3);
  font-size: 0.9rem;
}

/* ── Trial II — Card Deck ─────────────────────────────────── */
.card-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
}

/* Three-card row */
.drawn-cards-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.deck-stack {
  position: relative;
  width: clamp(190px, 46vw, 230px);
  height: clamp(266px, 65vw, 322px);
  cursor: pointer;
  transition: transform 0.2s var(--ease-bounce);
}

.deck-stack:hover { transform: translateY(-6px) scale(1.02); }
.deck-stack:active { transform: translateY(0) scale(0.98); }

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: url('../../files/designs/card_back_burden.png') center / cover no-repeat;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.75), 0 0 18px rgba(90, 20, 60, 0.4);
}

.deck-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 6px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  pointer-events: none;
}

.deck-card:nth-child(1) { transform: rotate(-4deg) translate(-7px, 8px); }
.deck-card:nth-child(2) { transform: rotate(2.5deg) translate(5px, 4px); }
.deck-card:nth-child(3) { transform: rotate(0deg); }

.deck-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--gold-bright);
  opacity: 0.35;
  text-shadow: 0 0 24px rgba(240, 201, 110, 0.6);
  pointer-events: none;
}

.deck-hint {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.65;
  text-align: center;
  animation: hintPulse 2.2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.85; }
}

@keyframes deckDeal {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.96) translateY(4px); }
  65%  { transform: scale(1.03) translateY(-10px); }
  100% { transform: scale(1); }
}

.deck-stack.deck-dealing {
  animation: deckDeal 0.42s var(--ease-bounce) forwards;
  cursor: default;
}

.deck-stack.deck-dealt {
  opacity: 0.08;
  transform: scale(0.9) translateY(4px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

/* Drawn quest card */
.quest-card {
  width: clamp(155px, 28vw, 185px);
  height: clamp(220px, 40vw, 265px);
  border-radius: 10px;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 1px rgba(138, 106, 32, 0.45),
    0 0 40px rgba(201, 168, 76, 0.22),
    0 12px 44px rgba(0, 0, 0, 0.75);
  background:
    radial-gradient(ellipse 65% 40% at 28% 14%, rgba(95, 65, 12, 0.38) 0%, transparent 55%),
    radial-gradient(ellipse 50% 55% at 72% 88%, rgba(38, 18, 82, 0.38) 0%, transparent 55%),
    linear-gradient(168deg, #1f1b2e 0%, #140f1e 55%, #0e0b18 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.quest-card::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 6px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  pointer-events: none;
  z-index: 0;
}

.quest-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.035) 0%, transparent 45%);
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
}

.card-ornament {
  font-size: 0.68rem;
  color: var(--gold);
  opacity: 0.55;
  letter-spacing: 0.45em;
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
}

.quest-card-title {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.8vw, 1.08rem);
  color: var(--gold-bright);
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-shadow: 0 0 18px rgba(240, 201, 110, 0.38);
  flex-shrink: 0;
  z-index: 1;
}

.card-divider {
  width: 72%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dark), transparent);
  flex-shrink: 0;
  z-index: 1;
}

.quest-card-text {
  font-family: var(--font-body);
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  color: rgba(245, 237, 214, 0.82);
  text-align: center;
  line-height: 1.55;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 0 0.2rem;
}

/* ── Flip Card System ─────────────────────────────────────── */

/* Outer wrapper — sets size and perspective */
.flip-card {
  width: clamp(155px, 28vw, 185px);
  height: clamp(220px, 40vw, 265px);
  perspective: 1000px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.25s var(--ease-bounce), opacity 0.35s var(--ease-out);
}

/* 3D rotating inner */
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

/* Shared face styles */
.flip-card-back,
.flip-card-front {
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* Card back — in normal flow so height:100% resolves reliably */
.flip-card-back {
  display: block;
  width: 100%;
  height: 100%;
  background: url('../files/designs/card_back_burden.png') center / 100% 100% no-repeat;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
  transition: box-shadow 0.2s;
}

.flip-card-back--lore {
  background-image: url('../files/designs/card_back_lore.png');
}

.flip-card-back--event {
  background-image: url('../files/designs/card_back_event.png');
}

/* Card front — absolutely positioned over the back, starts hidden */
.flip-card-front,
.flip-card-front.quest-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
}

/* Magical appear animation */
@keyframes cardAppear {
  0% {
    transform: translateY(35px) scale(0.78);
    opacity: 0;
    filter: brightness(2.8);
  }
  45% { filter: brightness(1.5); opacity: 1; }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: none;
  }
}

.flip-card.card-appear {
  animation: cardAppear 0.65s var(--ease-bounce) both;
}

/* ── Face-down hover glow ─────────────────────────────────── */
@keyframes faceDownGlow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(240, 201, 110, 0.5),
      0 0 22px rgba(201, 168, 76, 0.35),
      0 4px 18px rgba(0, 0, 0, 0.65);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 224, 110, 0.9),
      0 0 48px rgba(240, 201, 110, 0.6),
      0 0 85px rgba(201, 168, 76, 0.3),
      0 4px 18px rgba(0, 0, 0, 0.65);
  }
}

.flip-card:not(.card-revealed):hover {
  transform: translateY(-10px) scale(1.03);
}

.flip-card:not(.card-revealed):hover .flip-card-back {
  animation: faceDownGlow 1s ease-in-out infinite;
}

/* ── Selection phase (all cards revealed) ─────────────────── */
@keyframes cardChosenGlow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(240, 201, 110, 0.6),
      0 0 28px rgba(201, 168, 76, 0.4),
      0 12px 40px rgba(0, 0, 0, 0.75);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 224, 110, 0.9),
      0 0 50px rgba(240, 201, 110, 0.55),
      0 12px 40px rgba(0, 0, 0, 0.75);
  }
}

@keyframes cardHoverSparkle {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(240, 201, 110, 0.65),
      0 0 28px rgba(240, 201, 110, 0.5),
      0 0 55px rgba(201, 168, 76, 0.3),
      0 18px 54px rgba(0, 0, 0, 0.85);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 224, 110, 0.95),
      0 0 45px rgba(255, 210, 80, 0.75),
      0 0 90px rgba(201, 168, 76, 0.45),
      0 0 130px rgba(190, 110, 255, 0.18),
      0 18px 54px rgba(0, 0, 0, 0.85);
  }
}

/* Hover on selectable cards */
.flip-card.card-selectable:hover {
  transform: translateY(-14px) scale(1.06);
  opacity: 1;
}

.flip-card.card-selectable:hover .flip-card-front {
  border-color: var(--gold-bright);
  animation: cardHoverSparkle 1s ease-in-out infinite;
}

/* Chosen card — persistent breathing glow */
.flip-card.card-chosen {
  transform: translateY(-6px) scale(1.03);
}

.flip-card.card-chosen .flip-card-front {
  border-color: var(--gold-bright);
  animation: cardChosenGlow 2s ease-in-out infinite;
}

/* Hovering chosen card escalates to sparkle */
.flip-card.card-selectable.card-chosen:hover .flip-card-front {
  animation: cardHoverSparkle 1s ease-in-out infinite;
}

/* Unchosen cards fade back, hover restores them */
.flip-card.card-unchosen {
  opacity: 0.35;
  transform: scale(0.95);
}

.flip-card.card-selectable.card-unchosen:hover {
  opacity: 1;
  transform: translateY(-14px) scale(1.06);
}

/* ── Crossroads — Old Map Layout ─────────────────────────── */
.crossroads-journey {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  margin-bottom: var(--space-xl);
}

.map-corner { display: none; }

/* ── Dashed road SVG (mid-segment only) ───────────────────── */
.path-road-svg {
  width: 10px;
  overflow: visible;
  display: block;
}

.road-line {
  stroke: rgba(180, 140, 55, 0.6);
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.4));
}

.path-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ── Crosshair crossing marker ────────────────────────────── */
.path-crossing {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.crossing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

@keyframes markerGlowPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.07), 0 0 16px rgba(201, 168, 76, 0.28); }
  50%       { box-shadow: 0 0 0 6px rgba(201, 168, 76, 0.14), 0 0 32px rgba(201, 168, 76, 0.55), 0 0 55px rgba(201, 168, 76, 0.2); }
}

@keyframes markerRipple {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(2.8); opacity: 0; }
}

.crossing-map-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 168, 76, 0.75);
  background: radial-gradient(circle at 40% 38%, rgba(201, 168, 76, 0.14), var(--surface) 68%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: markerGlowPulse 2s ease-in-out infinite;
}

/* Two staggered ripple rings expanding outward */
.crossing-map-marker::before,
.crossing-map-marker::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.5);
  animation: markerRipple 2.2s ease-out infinite;
  pointer-events: none;
}

.crossing-map-marker::after {
  animation-delay: 1.1s;
}

/* Stop all pulsing once a decision is made */
.crossing-decided .crossing-map-marker {
  animation: none;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
}

.crossing-decided .crossing-map-marker::before,
.crossing-decided .crossing-map-marker::after {
  animation: none;
  opacity: 0;
}

/* Horizontal crosshair arm */
.crossing-map-marker-tick--h {
  position: absolute;
  width: 54px;
  height: 1px;
  background: linear-gradient(to right,
    transparent,
    rgba(180, 140, 55, 0.5) 20%,
    rgba(180, 140, 55, 0.5) 80%,
    transparent
  );
  left: 50%;
  transform: translateX(-50%);
}

/* Vertical crosshair arm */
.crossing-map-marker-tick--v {
  position: absolute;
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom,
    transparent,
    rgba(180, 140, 55, 0.5) 20%,
    rgba(180, 140, 55, 0.5) 80%,
    transparent
  );
  top: 50%;
  transform: translateY(-50%);
}

/* Center dot */
.crossing-map-marker-center {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold), 0 0 12px rgba(201, 168, 76, 0.4);
  position: relative;
  z-index: 1;
  animation: sigilPulse 3s ease-in-out infinite;
}

.crossing-label {
  font-family: var(--font-heading);
  font-size: 0.63rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.65);
}

/* ── Fork SVG — dashed Y-shape ────────────────────────────── */
.fork-svg {
  width: 100%;
  height: 58px;
  display: block;
  overflow: visible;
}

.fork-path-line {
  stroke: rgba(180, 140, 55, 0.55);
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.3));
}

.fork-end-dot {
  fill: rgba(180, 140, 55, 0.6);
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.5));
}

/* ── Fork card row ────────────────────────────────────────── */
.crossing-fork {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  flex-wrap: wrap;
  margin-top: -6px;
}

.crossing-or {
  align-self: center;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(180, 140, 55, 0.4);
  flex-shrink: 0;
  padding: 0 0.3rem;
  font-style: italic;
}


/* ── Hidden / reveal animations ──────────────────────────── */
.crossing-hidden {
  visibility: hidden;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  opacity: 0;
}

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

.path-mid.path-road-reveal {
  visibility: visible;
  pointer-events: auto;
  height: auto;
  overflow: visible;
  animation: pathRoadReveal 0.45s var(--ease-out) forwards;
}

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

.path-crossing.crossing-reveal {
  visibility: visible;
  pointer-events: auto;
  height: auto;
  overflow: visible;
  animation: crossingAppear 0.6s var(--ease-out) forwards;
}

/* ── Summary event entries ────────────────────────────────── */
.summary-event-entry {
  display: block;
  font-size: 0.95rem;
}

.summary-event-entry + .summary-event-entry {
  margin-top: 0.35rem;
}

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
  .crossroads-journey {
    padding: var(--space-xl) var(--space-sm) var(--space-lg);
  }

  .fork-svg { display: none; }

  .crossing-fork {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: var(--space-md);
  }

  .crossing-or {
    padding: 0.1rem 0;
  }

  .event-choice {
    width: min(82vw, 280px);
    min-height: auto;
    padding: 1rem 0.9rem;
  }
}

@media (max-width: 600px) {
  .quest-header {
    padding: var(--space-sm) var(--space-md);
  }

  .quest-progress {
    gap: var(--space-xs);
  }

  .progress-step {
    font-size: 0.6rem;
  }

  .progress-child {
    font-size: 0.52rem;
  }

  .quest-main {
    padding: var(--space-lg) var(--space-md);
  }

  .color-wheel {
    width: clamp(240px, 72vw, 320px);
    height: clamp(240px, 72vw, 320px);
  }



  .wheel-controls {
    flex-direction: column;
    align-items: center;
  }

  .result-card {
    padding: var(--space-lg) var(--space-lg);
  }

  .summary-item {
    grid-template-columns: 100px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
