/* ============================================================
   Chirag ❤ Krati — Neumorphic Romance
   Complete Style System
   ============================================================ */

/* ----- CSS Variables ----- */
:root {
  --bg-light: #e0daf0;
  --bg-dark: #1e1b2e;
  --bg-soft: #f0ecf8;
  --shadow-light-1: rgba(255,255,255,0.7);
  --shadow-light-2: rgba(0,0,0,0.15);
  --shadow-dark-1: rgba(255,255,255,0.05);
  --shadow-dark-2: rgba(0,0,0,0.5);
  --gold: #f0c040;
  --amber: #e8a030;
  --blush: #ff6b8a;
  --plum: #9b7fcf;
  --text-dark: #2a2040;
  --text-light: #e8e0f8;
  --font-display: 'Comfortaa', cursive;
  --font-body: 'Nunito', sans-serif;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 50px;
  --neu-light: 8px 8px 16px var(--shadow-light-2), -8px -8px 16px var(--shadow-light-1);
  --neu-light-sm: 4px 4px 8px var(--shadow-light-2), -4px -4px 8px var(--shadow-light-1);
  --neu-light-inset: inset 4px 4px 8px var(--shadow-light-2), inset -4px -4px 8px var(--shadow-light-1);
  --neu-dark: 8px 8px 16px var(--shadow-dark-2), -8px -8px 16px var(--shadow-dark-1);
  --neu-dark-sm: 4px 4px 8px var(--shadow-dark-2), -4px -4px 8px var(--shadow-dark-1);
  --neu-dark-inset: inset 4px 4px 8px var(--shadow-dark-2), inset -4px -4px 8px var(--shadow-dark-1);
}

/* ============================================================
   GLOBAL / RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (max-width: 767px) {
  html {
    scroll-snap-type: y mandatory;
  }
}

body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  background: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   PIN GATE — #pin-gate
   ============================================================ */
#pin-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#pin-gate.unlocked .pin-gate-content,
#pin-gate.unlocked .pin-gate-stars {
  opacity: 0;
  transition: opacity 0.4s ease;
}

#pin-gate.unlocked {
  pointer-events: none;
}

/* Star background inside PIN gate */
.pin-gate-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

/* PIN Gate content */
.pin-gate-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  transition: opacity 0.4s ease;
}

/* Mascots row above keypad */
#pin-mascots {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
}

#pin-mascots svg {
  width: 80px;
  height: auto;
}

@media (min-width: 768px) {
  #pin-mascots svg {
    width: 100px;
  }
}

/* PIN prompt text */
.pin-prompt {
  font-family: var(--font-display);
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* PIN dot display */
#pin-display {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.pin-dot.filled {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* PIN keypad */
#pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}

.pin-key {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--text-light);
  font-size: 1.5rem;
  font-family: var(--font-display);
  border: none;
  cursor: pointer;
  box-shadow: var(--neu-dark-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin: 0 auto;
}

.pin-key:active,
.pin-key.pressed {
  box-shadow: var(--neu-dark-inset);
  transform: scale(0.95);
}

.pin-key-action {
  font-size: 1.2rem;
}

/* PIN error */
#pin-error {
  color: var(--blush);
  font-size: 0.9rem;
  min-height: 2em;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 12px;
}

#pin-error.show {
  opacity: 1;
  animation: shake 0.4s ease;
}

/* Gate doors */
#pin-gate-doors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.gate-door {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  background: var(--bg-dark);
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gate-door-left {
  left: 0;
  transform-origin: left center;
}

.gate-door-right {
  right: 0;
  transform-origin: right center;
}

#pin-gate.unlocked .gate-door-left {
  transform: translateX(-100%);
}

#pin-gate.unlocked .gate-door-right {
  transform: translateX(100%);
}

/* ============================================================
   STAR / TWINKLE ANIMATION
   ============================================================ */
.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--size) * 1px);
  height: calc(var(--size) * 1px);
  animation: twinkle 3s ease-in-out infinite;
  animation-delay: calc(var(--delay) * 1s);
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

/* ============================================================
   JOURNEY WRAPPER — #journey
   ============================================================ */
#journey {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#journey.visible {
  opacity: 1;
}

/* ============================================================
   FLOATING UI
   ============================================================ */

/* Sound toggle */
#logout-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-light);
  box-shadow: var(--neu-light-sm);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#logout-btn:active {
  box-shadow: var(--neu-light-inset);
}

/* Progress indicator */
#progress-indicator {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-light);
  box-shadow: var(--neu-light-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  padding: 0;
}

.progress-dot.active {
  background: var(--plum);
  box-shadow: 0 0 8px var(--plum);
}

/* ============================================================
   CHAPTERS — .chapter
   ============================================================ */
.chapter {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.chapter-dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.chapter-light {
  background: var(--bg-light);
  color: var(--text-dark);
}

.chapter-soft {
  background: var(--bg-soft);
  color: var(--text-dark);
}

.chapter-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

.chapter-sub {
  font-size: 1rem;
  opacity: 0.8;
  text-align: center;
  margin-bottom: 20px;
}

/* ============================================================
   CHAPTER 1 — WELCOME
   ============================================================ */
.star-field {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.celestial-hero {
  position: relative;
  z-index: 1;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.moon-hero {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffeaa7, #f0c040);
  box-shadow: 0 0 40px rgba(240,192,64,0.4), 0 0 80px rgba(240,192,64,0.2);
  animation: moonGlow 4s ease-in-out infinite;
}

.jupiter-hero {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8a030, #c8802a);
  box-shadow: 0 0 20px rgba(232,160,48,0.3);
  position: relative;
  animation: jupiterOrbit 8s ease-in-out infinite;
  overflow: hidden;
}

.jupiter-hero::before {
  content: '';
  position: absolute;
  top: 35%;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

.jupiter-hero::after {
  content: '';
  position: absolute;
  top: 55%;
  left: 5%;
  width: 90%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

@keyframes moonGlow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(240,192,64,0.4), 0 0 80px rgba(240,192,64,0.2);
  }
  50% {
    box-shadow: 0 0 60px rgba(240,192,64,0.6), 0 0 120px rgba(240,192,64,0.3), 0 0 160px rgba(240,192,64,0.1);
  }
}

@keyframes jupiterOrbit {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(10px, -6px);
  }
  50% {
    transform: translate(16px, -3px);
  }
  75% {
    transform: translate(6px, -8px);
  }
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.chapter-subtitle {
  font-size: 1rem;
  opacity: 0.7;
  position: relative;
  z-index: 1;
  text-align: center;
}

/* Mascot peeks */
.mascot-peek {
  position: absolute;
  bottom: 20px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.mascot-vinny {
  left: 12px;
}

.mascot-scooby {
  right: 12px;
}

.mascot-peek svg {
  width: 60px;
  height: auto;
}

.speech-bubble {
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--text-light);
  max-width: 160px;
  box-shadow: var(--neu-dark-sm);
  line-height: 1.4;
}

.mascot-vinny .speech-bubble {
  border-bottom-left-radius: 4px;
}

.mascot-scooby .speech-bubble {
  border-bottom-right-radius: 4px;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  font-size: 0.85rem;
  opacity: 0.5;
  animation: bounce 2s infinite;
  z-index: 1;
  text-align: center;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ============================================================
   CHAPTER 2 — MEET OUR FAMILY
   ============================================================ */
.pet-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 400px;
}

.pet-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  box-shadow: var(--neu-light);
  text-align: center;
}

.pet-card-photo {
  margin-bottom: 16px;
}

.pet-card-photo svg {
  width: 100px;
  height: auto;
}

.pet-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--plum);
  margin: 0 0 4px 0;
}

.pet-title {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 12px;
}

.pet-traits {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.pet-traits li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

.pet-traits li:last-child {
  border-bottom: none;
}

@media (min-width: 768px) {
  .pet-cards {
    flex-direction: row;
    max-width: 700px;
  }

  .pet-card {
    flex: 1;
  }
}

/* ============================================================
   CHAPTER 3 — MOON & JUPITER
   ============================================================ */
#celestial-animation {
  width: 100%;
  max-width: 400px;
  height: 300px;
  position: relative;
  margin-bottom: 40px;
}

.celestial-body {
  position: absolute;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.the-moon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #ffeaa7, #f0c040);
  box-shadow: 0 0 50px rgba(240,192,64,0.5);
  left: 20%;
  top: 30%;
  animation: celestialDrift 6s ease-in-out infinite;
}

.the-jupiter {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #e8a030, #c8802a);
  box-shadow: 0 0 30px rgba(232,160,48,0.4);
  right: 20%;
  top: 40%;
  animation: celestialDrift 6s ease-in-out infinite reverse;
  overflow: hidden;
}

.the-jupiter::before {
  content: '';
  position: absolute;
  top: 38%;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

.the-jupiter::after {
  content: '';
  position: absolute;
  top: 58%;
  left: 8%;
  width: 84%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.celestial-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 8px;
}

.celestial-mulank {
  font-size: 0.7rem;
  opacity: 0.6;
  color: var(--text-light);
}

.orbit-trail {
  position: absolute;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 80%;
  height: 60%;
  top: 20%;
  left: 10%;
  pointer-events: none;
}

@keyframes celestialDrift {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(15px, -10px);
  }
}

.love-quotes {
  max-width: 380px;
  text-align: center;
}

.love-quote {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 24px;
  font-style: italic;
}

#mulank-toggle {
  margin-top: 20px;
  padding: 12px 24px;
  font-family: var(--font-display);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-dark);
  color: var(--text-light);
  box-shadow: var(--neu-dark-sm);
  cursor: pointer;
  font-size: 0.9rem;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

#mulank-toggle:active {
  box-shadow: var(--neu-dark-inset);
  transform: scale(0.97);
}

.mulank-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-top: 16px;
  background: var(--bg-dark);
}

.mulank-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mulank-col {
  flex: 1;
}

.mulank-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 12px;
  margin-top: 0;
}

.mulank-col:first-child h4 {
  color: var(--gold);
}

.mulank-col:last-child h4 {
  color: var(--amber);
}

.mulank-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mulank-col ul li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-light);
  opacity: 0.9;
}

.mulank-result {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.mulank-result p {
  font-size: 1rem;
  color: var(--gold);
  margin: 0;
}

@media (min-width: 768px) {
  .mulank-grid {
    flex-direction: row;
  }
}

/* ============================================================
   CHAPTER 4 — TIMELINE
   ============================================================ */
#timeline-container {
  width: 100%;
  overflow: hidden;
}

.timeline-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Thin themed scrollbar */
.timeline-track::-webkit-scrollbar {
  height: 6px;
}

.timeline-track::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 3px;
}

.timeline-track::-webkit-scrollbar-thumb {
  background: var(--plum);
  border-radius: 3px;
}

.timeline-item {
  flex: 0 0 280px;
  scroll-snap-align: center;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  box-shadow: var(--neu-light);
}

.timeline-date {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--plum);
  font-weight: 600;
  margin-bottom: 12px;
}

.timeline-photo {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 12px;
  box-shadow: var(--neu-light-inset);
  overflow: hidden;
}

.timeline-caption {
  font-size: 0.9rem;
  line-height: 1.5;
}

.mascot-float-container {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.mascot-float {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mascot-float svg {
  width: 50px;
  height: auto;
}

.mascot-float .speech-bubble {
  background: var(--bg-light);
  color: var(--text-dark);
  box-shadow: var(--neu-light-sm);
}

/* ============================================================
   CHAPTER 5 — MINI GAMES
   ============================================================ */
#games-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 350px;
}

.game-select-btn {
  padding: 16px 24px;
  font-family: var(--font-display);
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  box-shadow: var(--neu-light);
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.game-select-btn:active {
  box-shadow: var(--neu-light-inset);
  transform: scale(0.98);
}

.game-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  box-shadow: var(--neu-light);
}

.game-container h3 {
  font-family: var(--font-display);
  text-align: center;
  margin-bottom: 8px;
  margin-top: 0;
}

.game-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.game-back-btn {
  margin-top: 16px;
  padding: 10px 20px;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-light);
  box-shadow: var(--neu-light-sm);
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease;
}

.game-back-btn:active {
  box-shadow: var(--neu-light-inset);
}

/* ----- Game 1: Yarn ----- */
#yarn-canvas {
  width: 100%;
  height: 350px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  box-shadow: var(--neu-light-inset);
}

.yarn-ball {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
  animation: yarnFall linear forwards;
  -webkit-tap-highlight-color: transparent;
}

.yarn-ball:nth-child(3n+1) { background: var(--blush); }
.yarn-ball:nth-child(3n+2) { background: var(--plum); }
.yarn-ball:nth-child(3n)   { background: var(--gold); }

@keyframes yarnFall {
  from {
    top: -50px;
  }
  to {
    top: 400px;
  }
}

.yarn-ball:active,
.yarn-ball.caught {
  transform: scale(0) rotate(180deg);
}

/* ----- Game 2: Feed Scooby ----- */
#feed-scooby {
  width: 80px;
  margin: 0 auto 16px;
  text-align: center;
}

#feed-scooby svg {
  width: 80px;
  height: auto;
}

#feed-scooby.wiggle {
  animation: wiggle 0.4s ease;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.food-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  box-shadow: var(--neu-light-sm);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 70px;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.food-btn:active {
  box-shadow: var(--neu-light-inset);
}

.food-btn.correct {
  background: rgba(100,200,100,0.2);
  animation: pop 0.3s ease;
}

.food-btn.wrong {
  background: rgba(200,100,100,0.2);
  animation: shake 0.3s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-10deg); }
  75%      { transform: rotate(10deg); }
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ----- Game 3: Quiz ----- */
#quiz-question {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 20px;
  min-height: 3em;
  line-height: 1.5;
}

#quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  box-shadow: var(--neu-light-sm);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-dark);
}

.quiz-option:active {
  box-shadow: var(--neu-light-inset);
}

.quiz-option.correct {
  background: rgba(100,200,100,0.2);
}

.quiz-option.wrong {
  background: rgba(200,100,100,0.2);
}

#quiz-progress {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 16px;
}

#quiz-result {
  text-align: center;
  padding: 20px;
}

#quiz-result h3 {
  font-family: var(--font-display);
  margin-top: 0;
}

/* ============================================================
   CHAPTER 6 — WHY I LOVE YOU
   ============================================================ */
#love-lines {
  max-width: 400px;
  width: 100%;
}

.love-line {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 28px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  text-align: center;
}

.love-line-final {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(240,192,64,0.1);
}

/* ============================================================
   CHAPTER 7 — FAMILY PORTRAIT
   ============================================================ */
#family-scene {
  width: 100%;
  max-width: 500px;
  height: 400px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-dark) 0%, #2a1f3e 50%, #3a2f4e 100%);
}

.family-sky {
  position: absolute;
  top: 0;
  width: 100%;
  height: 60%;
}

/* Moon in the sky */
.family-sky::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffeaa7, #f0c040);
  box-shadow: 0 0 30px rgba(240,192,64,0.4), 0 0 60px rgba(240,192,64,0.15);
  top: 15%;
  left: 25%;
  animation: moonGlow 4s ease-in-out infinite;
}

/* Jupiter in the sky */
.family-sky::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8a030, #c8802a);
  box-shadow: 0 0 15px rgba(232,160,48,0.3);
  top: 22%;
  right: 30%;
}

.family-ground {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(180deg, transparent 0%, rgba(100,80,130,0.3) 100%);
  border-radius: 50% 50% 0 0 / 20% 20% 0 0;
}

.family-members {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.family-member {
  text-align: center;
}

.family-member svg {
  width: 50px;
  height: auto;
}

.family-member span,
.family-member label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: var(--font-display);
  margin-top: 6px;
}

@media (min-width: 768px) {
  .family-member svg {
    width: 60px;
  }
}

.family-caption {
  position: relative;
  margin-top: 20px;
  text-align: center;
  font-size: 1rem;
  padding: 16px;
  line-height: 1.5;
}

/* ============================================================
   CHAPTER 8 — THE LAST WORDS
   ============================================================ */
.final-words {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 400px;
  width: 100%;
}

.neu-pill {
  padding: 20px 40px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  box-shadow: var(--neu-light);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
}

/* Neumorphic reveal: starts pressed, reveals to raised */
.final-words .scroll-reveal {
  opacity: 0.3;
  transform: scale(0.96);
  box-shadow: var(--neu-light-inset);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.final-words .scroll-reveal.revealed,
.final-line.revealed {
  opacity: 1;
  transform: scale(1);
  box-shadow: var(--neu-light);
}

/* Heart pulse on final-love */
.final-love .micro-heart {
  display: inline-block;
  margin-left: 8px;
}

.final-love.revealed .micro-heart {
  animation: heartPulse 1s ease-in-out infinite;
}

/* Kiss fade-in */
.final-kiss .micro-kiss {
  display: inline-block;
  margin-left: 8px;
  opacity: 0;
}

.final-kiss.revealed .micro-kiss {
  opacity: 1;
  animation: fadeIn 1s ease 0.5s both;
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

/* Replay button */
#replay-btn {
  margin-top: 20px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  box-shadow: var(--neu-light);
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  color: var(--plum);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

#replay-btn:active {
  box-shadow: var(--neu-light-inset);
  transform: scale(0.97);
}

/* ============================================================
   CONFETTI CANVAS
   ============================================================ */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

/* ============================================================
   SHARED / UTILITY ANIMATIONS
   ============================================================ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ============================================================
   CUSTOM SCROLLBAR — WEBKIT
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--plum);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8a6cbe;
}

/* Firefox thin scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--plum) var(--bg-light);
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (min-width: 768px) {
  .chapter {
    padding: 80px 48px;
  }

  .chapter-heading {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }

  .chapter-title {
    font-size: clamp(2.4rem, 5vw, 3.5rem);
  }

  .pin-key {
    width: 80px;
    height: 80px;
    font-size: 1.7rem;
  }

  #pin-keypad {
    max-width: 300px;
    gap: 14px;
  }

  .timeline-item {
    flex: 0 0 320px;
  }

  .timeline-photo {
    height: 200px;
  }

  .game-container {
    max-width: 450px;
    padding: 28px;
  }

  #family-scene {
    height: 450px;
  }

  .neu-pill {
    font-size: 1.5rem;
    padding: 24px 48px;
  }

  .love-line {
    font-size: 1.25rem;
    padding: 20px 28px;
  }
}

/* ============================================================
   RESPONSIVE — DESKTOP
   ============================================================ */
@media (min-width: 1024px) {
  .chapter {
    padding: 100px 64px;
  }

  .pet-cards {
    max-width: 750px;
  }

  #celestial-animation {
    max-width: 500px;
    height: 360px;
  }

  .game-container {
    max-width: 500px;
    padding: 32px;
  }

  #family-scene {
    max-width: 600px;
    height: 500px;
  }

  .final-words {
    max-width: 500px;
  }

  .love-quotes {
    max-width: 450px;
  }

  #love-lines {
    max-width: 500px;
  }
}

/* ============================================================
   TOUCH ACCESSIBILITY
   ============================================================ */
button,
[role="button"],
.pin-key,
.game-select-btn,
.food-btn,
.quiz-option,
.game-back-btn,
#mulank-toggle,
#replay-btn,
#logout-btn,
.progress-dot {
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.the-moon .celestial-label {
  color: #1a1428 !important;
  font-weight: 800 !important;
  font-size: 0.95rem;
  text-shadow: none;
  margin-top: 24px;
}
.the-moon .celestial-mulank {
  color: #2c2044 !important;
  font-weight: 700 !important;
  opacity: 0.9 !important;
  font-size: 0.75rem;
}
.the-jupiter .celestial-label {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  margin-top: 14px;
}
.the-jupiter .celestial-mulank {
  color: #ffe6c0 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
