/* ============================================
   HALIMA — Romantic Interactive Journey
   Design System & Styles
   ============================================ */

/* --- CSS Variables — Unified Design System --- */
:root {
  /* Base palette */
  --base-dark: #0B0D12;
  --base-dark-alt: #0E1118;
  --base-light: #F5EFE8;
  --base-light-alt: #EFE6DD;

  /* Accent colors — unified warm gold/rose family */
  --accent-amber: #D6A77A;
  --accent-amber-light: #E6B98C;
  --accent-blush: #CFA3A3;
  --accent-blush-muted: #B98C8C;
  --accent-warm: rgba(210, 175, 145, 0.8);

  /* Text — warm ivory spectrum */
  --text-primary: #3A2E28;
  --text-secondary: #6B5D56;
  --text-light: #9A8E86;
  --text-ivory: #F2ECE4;
  --text-muted: #B8ADA4;
  --text-body: rgba(240, 232, 220, 0.6);
  --text-body-bright: rgba(245, 238, 228, 0.85);

  /* Surfaces — unified glass */
  --glass-bg: rgba(16, 14, 24, 0.65);
  --glass-border: rgba(210, 175, 145, 0.12);
  --glass-border-light: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* Shadows — warm-tinted, consistent depth scale */
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-medium: 0 16px 56px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(210, 175, 145, 0.1);

  /* Radii */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Typography — unified scale */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-script: 'Dancing Script', cursive;

  /* Type scale */
  --text-xs: 0.72rem;     /* 11.5px — labels, eyebrows */
  --text-sm: 0.85rem;     /* 13.6px — captions, hints */
  --text-base: 0.95rem;   /* 15.2px — body */
  --text-md: 1.05rem;     /* 16.8px — lead body */
  --text-lg: 1.35rem;     /* 21.6px — sub-headings */
  --text-xl: 1.7rem;      /* 27.2px — section headings */
  --text-2xl: 2.2rem;     /* 35.2px — hero headings */

  /* Spacing scale (8px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Label tracking */
  --tracking-label: 0.14em;

  /* Transition — shared easing */
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--base-dark);
  color: var(--text-ivory);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Particles --- */
#particles-container {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  opacity: 0;
  animation: floatUp linear infinite;
  pointer-events: none;
  font-size: 14px;
}

@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg) scale(0.5); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) rotate(360deg) scale(1); opacity: 0; }
}

/* --- Progress Bar --- */
#progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 4px; background: rgba(255,255,255,0.08);
  z-index: 1000;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-amber), rgba(210, 175, 145, 0.85), var(--accent-amber));
  width: 0%; transition: width 0.8s var(--ease-premium);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(210, 175, 145, 0.35);
}

/* --- Sections --- */
.section {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.8s ease,
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1; padding: 20px;
  overflow-y: auto;
}

.section.active {
  opacity: 1; visibility: visible; z-index: 10;
  transform: translateY(0);
}

.section.leaving {
  opacity: 0; transform: translateY(-12px);
  z-index: 5;
}

.section-inner {
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}

/* --- Animation Utilities --- */
.fade-in-up {
  opacity: 0; transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ============================================
   PREMIUM BUTTON SYSTEM — Unified Gold Metallic
   ============================================ */
:root {
  /* Gold palette */
  --gold-light: #e8d5a3;
  --gold-mid: #c9a84c;
  --gold-deep: #a67c2e;
  --gold-dark: #7a5a1e;
  --gold-shadow: rgba(201, 168, 76, 0.25);
  --gold-glow: rgba(201, 168, 76, 0.15);
  --gold-text: #f5edd6;
  --btn-radius: 50px;
  --btn-transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Base Premium Button ── */
.premium-btn {
  position: relative;
  display: inline-block;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold-text);
  padding: 16px 48px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: var(--btn-radius);
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  text-decoration: none;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: var(--btn-transition);
  /* Layered gold metallic gradient */
  background:
    linear-gradient(
      180deg,
      rgba(232, 213, 163, 0.22) 0%,
      rgba(201, 168, 76, 0.18) 40%,
      rgba(166, 124, 46, 0.22) 70%,
      rgba(122, 90, 30, 0.28) 100%
    );
  /* Premium shadow stack */
  box-shadow:
    0 1px 0 0 rgba(232, 213, 163, 0.15) inset,
    0 -1px 1px 0 rgba(100, 70, 20, 0.1) inset,
    0 4px 16px rgba(201, 168, 76, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.2);
  /* Subtle brushed-metal texture via repeating gradient */
  background-blend-mode: normal;
}

/* Inner top highlight for dimensionality */
.premium-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: var(--btn-radius) var(--btn-radius) 0 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.09) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Shimmer sweep on hover */
.premium-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; bottom: 0;
  width: 60%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 245, 220, 0.12) 40%,
    rgba(255, 245, 220, 0.2) 50%,
    rgba(255, 245, 220, 0.12) 60%,
    transparent 80%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 2;
  transition: none;
}

.premium-btn:hover::after {
  animation: premiumShimmer 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes premiumShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* Hover state */
.premium-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(232, 213, 163, 0.5);
  color: #fff;
  background:
    linear-gradient(
      180deg,
      rgba(232, 213, 163, 0.3) 0%,
      rgba(201, 168, 76, 0.25) 40%,
      rgba(166, 124, 46, 0.3) 70%,
      rgba(122, 90, 30, 0.35) 100%
    );
  box-shadow:
    0 1px 0 0 rgba(232, 213, 163, 0.2) inset,
    0 -1px 1px 0 rgba(100, 70, 20, 0.1) inset,
    0 8px 28px rgba(201, 168, 76, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(201, 168, 76, 0.08);
}

/* Active / pressed state */
.premium-btn:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 0.1s;
  box-shadow:
    0 1px 0 0 rgba(232, 213, 163, 0.1) inset,
    0 2px 8px rgba(201, 168, 76, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Focus ring for keyboard navigation */
.premium-btn:focus-visible {
  outline: 2px solid rgba(232, 213, 163, 0.6);
  outline-offset: 3px;
}

/* Subtle glow pulse animation — used on CTAs that need attention */
.premium-btn--pulse {
  animation: premiumPulse 3.5s ease-in-out infinite;
}

@keyframes premiumPulse {
  0%, 100% {
    box-shadow:
      0 1px 0 0 rgba(232, 213, 163, 0.15) inset,
      0 -1px 1px 0 rgba(100, 70, 20, 0.1) inset,
      0 4px 16px rgba(201, 168, 76, 0.12),
      0 1px 4px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow:
      0 1px 0 0 rgba(232, 213, 163, 0.2) inset,
      0 -1px 1px 0 rgba(100, 70, 20, 0.1) inset,
      0 6px 24px rgba(201, 168, 76, 0.22),
      0 2px 6px rgba(0, 0, 0, 0.2),
      0 0 40px rgba(201, 168, 76, 0.06);
  }
}

/* Visibility toggle (for buttons that fade in) */
.premium-btn--hidden {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
}

.premium-btn--hidden.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ── Secondary variant (No button / subtle) ── */
.premium-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 168, 76, 0.15);
  color: rgba(232, 213, 163, 0.5);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.03) inset,
    0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.premium-btn--secondary::before {
  display: none;
}

.premium-btn--secondary:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: rgba(201, 168, 76, 0.3);
  color: rgba(232, 213, 163, 0.8);
  box-shadow:
    0 4px 16px rgba(201, 168, 76, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.premium-btn--secondary:active {
  transform: translateY(1px) scale(0.98);
  background: rgba(201, 168, 76, 0.05);
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  .premium-btn { padding: 15px 42px; font-size: 0.92rem; }
}

@media (max-width: 600px) {
  .premium-btn { padding: 14px 36px; font-size: 0.9rem; letter-spacing: 0.05em; }
}

@media (max-width: 380px) {
  .premium-btn { padding: 13px 32px; font-size: 0.85rem; }
}

/* Touch devices — no hover shimmer */
@media (hover: none) {
  .premium-btn:hover { transform: none; }
  .premium-btn:hover::after { animation: none; }
  .premium-btn:active { transform: scale(0.97); }
}

@keyframes softGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(210,175,145,0.15); }
  50% { box-shadow: 0 0 40px rgba(210,175,145,0.3); }
}

/* --- Opening / Hero Screen --- */
#sec-opening {
  background: #E8DDD4;
  overflow: hidden;
  padding: 0;
}

/* Ensure hero video is fully hidden when section is not active */
#sec-opening:not(.active) {
  pointer-events: none;
  z-index: 0 !important;
}

#sec-opening:not(.active) .hero-video {
  visibility: hidden;
}

/* ══════════════════════════════════════════
   CINEMATIC HOMEPAGE
   ══════════════════════════════════════════ */

/* ── Video Background ── */
.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #0a0508;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.hero-video.loaded {
  opacity: 1;
}

/* ── Dark Gradient Overlay + Vignette ── */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    /* Vignette — darkens edges */
    radial-gradient(ellipse 80% 70% at 50% 50%, transparent 40%, rgba(5, 2, 4, 0.55) 100%),
    /* Bottom gradient — ensures text contrast at bottom */
    linear-gradient(180deg, rgba(5, 2, 4, 0.15) 0%, transparent 35%, transparent 50%, rgba(5, 2, 4, 0.4) 85%, rgba(5, 2, 4, 0.6) 100%),
    /* Top subtle gradient */
    linear-gradient(180deg, rgba(5, 2, 4, 0.25) 0%, transparent 25%);
  pointer-events: none;
}

/* ── Content Overlay ── */
.hero-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 600px;
}

/* ── Top Text ── */
.opening-pre {
  font-family: 'Inter', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(255, 245, 248, 0.85);
  text-shadow:
    0 0 20px rgba(200, 140, 165, 0.3),
    0 0 60px rgba(200, 140, 165, 0.1);
  margin-bottom: 14px;
  visibility: hidden;
}

/* ── Sub Text ── */
.opening-sub {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: rgba(220, 195, 205, 0.75);
  letter-spacing: 1px;
  text-shadow:
    0 0 15px rgba(180, 120, 145, 0.2);
  margin-bottom: 44px;
  visibility: hidden;
}

/* ── CTA Button — Glassmorphism ── */
/* Hero button needs pointer-events since overlay is pointer-events:none */
#hero-btn { pointer-events: auto; z-index: 20; }

/* --- Story Cards --- */
.story-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(210, 175, 145, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-10);
  text-align: center;
  box-shadow: var(--shadow-medium), inset 0 1px 0 var(--glass-highlight);
  width: 100%;
  animation: fadeInUp 0.6s ease;
}

.story-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--sp-5);
  color: var(--accent-warm);
}

.story-title {
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 600;
  color: var(--text-ivory);
  margin-bottom: var(--sp-6);
  line-height: 1.3;
}

.story-text {
  font-size: var(--text-md); font-weight: 400;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
  max-width: 440px;
  margin-left: auto; margin-right: auto;
}

.story-card .premium-btn {
  margin-top: 24px;
}

/* --- Game Cards --- */
.game-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 100%;
  box-shadow: var(--shadow-medium);
  animation: fadeInUp 0.6s ease;
}

.game-header {
  text-align: center;
  margin-bottom: 24px;
}

.game-label {
  font-size: var(--text-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--accent-warm);
  display: block; margin-bottom: var(--sp-2);
}

.game-title {
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 600;
  color: var(--text-ivory);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.game-desc {
  font-size: var(--text-sm); font-weight: 400;
  color: var(--text-body);
  line-height: 1.7;
}

.game-desc small {
  opacity: 0.7;
}

/* --- Game Arena --- */
.game-arena {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}

.game-arena canvas {
  width: 100%; max-width: 400px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #F5EFE8 0%, #F0E7DE 100%);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
  touch-action: none;
}

/* --- Game HUD --- */
.game-hud {
  display: flex; gap: 24px;
  justify-content: center;
  margin-top: 16px;
}

.hud-item {
  text-align: center;
}

.hud-label {
  display: block;
  font-size: var(--text-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: rgba(210, 175, 145, 0.5);
  margin-bottom: var(--sp-1);
}

.hud-value {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent-warm);
}

/* --- Game Feedback --- */
.game-feedback {
  text-align: center;
  font-size: var(--text-base); font-weight: 400;
  color: var(--accent-warm);
  min-height: 28px;
  margin-top: var(--sp-3);
  transition: opacity 0.3s ease;
}

/* --- MEMORY GAME --- */
#sec-memory .game-card-premium {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-10) var(--sp-8);
  box-shadow:
    var(--shadow-medium),
    inset 0 1px 0 var(--glass-highlight);
  max-width: 720px;
  width: 720px;
  border-top: 1px solid rgba(210, 175, 145, 0.08);
}
#sec-memory .game-label { font-size: var(--text-xs); color: rgba(210, 175, 145, 0.55); letter-spacing: var(--tracking-label); text-transform: uppercase; }
#sec-memory .game-title { font-size: var(--text-2xl); color: var(--text-ivory); font-weight: 700; }
#sec-memory .game-desc { font-size: var(--text-base); color: var(--text-body); }

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.mem-card {
  aspect-ratio: 1;
  perspective: 800px;
  cursor: pointer;
}

.mem-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 18px;
}

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

.mem-card-front, .mem-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}

/* ── Card front — 3D rose-gold frosted glass tile ── */
.mem-card-front {
  /* Warm frosted glass surface */
  background:
    radial-gradient(ellipse 80% 60% at 35% 30%, rgba(210, 180, 165, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 70% 75%, rgba(180, 140, 130, 0.2) 0%, transparent 65%),
    linear-gradient(155deg,
      rgba(185, 155, 145, 0.75) 0%,
      rgba(165, 135, 125, 0.65) 20%,
      rgba(145, 120, 110, 0.6) 45%,
      rgba(155, 130, 120, 0.65) 65%,
      rgba(170, 140, 130, 0.7) 100%
    );
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  /* Rose-gold metallic frame border */
  border: 3px solid;
  border-image: linear-gradient(
    160deg,
    rgba(220, 185, 175, 0.9) 0%,
    rgba(195, 155, 145, 0.7) 25%,
    rgba(175, 135, 125, 0.6) 50%,
    rgba(195, 155, 145, 0.75) 75%,
    rgba(215, 180, 170, 0.85) 100%
  ) 1;
  border-image: none;
  border-color: rgba(205, 170, 158, 0.8);
  /* 3D depth shadows — thick beveled edge illusion */
  box-shadow:
    /* Outer drop shadow for 3D lift */
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.3),
    /* Bottom/right edge for depth thickness */
    3px 4px 0 rgba(140, 105, 95, 0.5),
    2px 3px 0 rgba(150, 115, 105, 0.4),
    1px 2px 0 rgba(165, 130, 120, 0.35),
    /* Subtle rose glow */
    0 0 20px rgba(200, 155, 140, 0.08),
    /* Inner top-left highlight for bevel */
    inset 0 2px 4px rgba(255, 235, 225, 0.25),
    inset 2px 0 4px rgba(255, 235, 225, 0.1),
    /* Inner bottom-right shadow for bevel */
    inset 0 -2px 4px rgba(80, 50, 40, 0.2),
    inset -2px 0 4px rgba(80, 50, 40, 0.1);
  font-size: 1.5rem;
  color: rgba(200, 160, 150, 0.7);
  overflow: hidden;
}

/* Inner border line — frosted glass inset frame */
.mem-card-front::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(220, 190, 178, 0.35);
  border-radius: 12px;
  pointer-events: none;
  box-shadow:
    inset 0 1px 2px rgba(255, 240, 230, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Subtle specular highlight sweep across the glass surface */
.mem-card-front::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 245, 238, 0.18) 0%,
    rgba(255, 245, 238, 0.06) 40%,
    transparent 70%
  );
  transform: rotate(-15deg);
  pointer-events: none;
}

/* Heart icon — rose-gold embossed */
.mem-card-front .card-heart {
  font-size: 2.4rem;
  color: rgba(205, 165, 155, 0.7);
  text-shadow:
    0 1px 0 rgba(255, 235, 225, 0.5),
    0 -1px 0 rgba(100, 65, 55, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.15);
  margin-bottom: 4px;
  filter: drop-shadow(0 1px 2px rgba(180, 140, 128, 0.3));
}

/* "halima" script — rose-gold engraved text */
.mem-card-front .card-script {
  font-family: 'Dancing Script', 'Great Vibes', cursive;
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(205, 165, 155, 0.6);
  letter-spacing: 0.06em;
  margin-top: 0;
  text-shadow:
    0 1px 0 rgba(255, 240, 230, 0.35),
    0 -1px 0 rgba(80, 50, 40, 0.15);
}

/* Hover lift effect for unflipped cards */
.mem-card:not(.flipped):not(.matched):hover .mem-card-front {
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3),
    3px 4px 0 rgba(140, 105, 95, 0.5),
    2px 3px 0 rgba(150, 115, 105, 0.4),
    1px 2px 0 rgba(165, 130, 120, 0.35),
    0 0 28px rgba(200, 155, 140, 0.12),
    inset 0 2px 4px rgba(255, 235, 225, 0.3),
    inset 2px 0 4px rgba(255, 235, 225, 0.12),
    inset 0 -2px 4px rgba(80, 50, 40, 0.2),
    inset -2px 0 4px rgba(80, 50, 40, 0.1);
  transform: translateY(-2px);
  transition: all 0.25s ease;
}

.mem-card:not(.flipped):not(.matched) .mem-card-front {
  transition: all 0.25s ease;
}

.mem-card-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(155deg, rgba(165, 135, 125, 0.6) 0%, rgba(145, 115, 105, 0.5) 100%);
  backdrop-filter: blur(8px);
  border: 3px solid rgba(205, 170, 158, 0.8);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.25),
    3px 4px 0 rgba(140, 105, 95, 0.4),
    2px 3px 0 rgba(150, 115, 105, 0.3),
    inset 0 2px 4px rgba(255, 235, 225, 0.15),
    inset 0 -2px 4px rgba(80, 50, 40, 0.15);
  font-size: 2.2rem;
  padding: 6px;
  overflow: hidden;
}

.mem-card-back img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.mem-card.matched .mem-card-inner {
  transform: rotateY(180deg);
  animation: softGlow 2s ease-in-out;
}

.mem-card.matched .mem-card-back {
  border-color: rgba(220, 185, 170, 0.9);
  box-shadow:
    0 8px 24px rgba(200, 155, 140, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.2),
    3px 4px 0 rgba(140, 105, 95, 0.4),
    0 0 24px rgba(200, 155, 140, 0.15),
    inset 0 2px 4px rgba(255, 235, 225, 0.2);
}

/* HUD styling for memory section */
#sec-memory .game-hud {
  gap: 40px;
  margin-top: 16px;
}
#sec-memory .hud-item {
  background: rgba(18, 18, 30, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 14px;
  padding: 10px 24px;
}
#sec-memory .hud-label { font-size: 12px; color: rgba(200, 138, 138, 0.55); letter-spacing: 0.14em; text-transform: uppercase; }
#sec-memory .hud-value { font-size: 28px; color: rgba(200, 138, 138, 0.8); }

.memory-caption {
  background: rgba(18, 18, 30, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 16px;
  padding: 14px 24px;
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem; font-weight: 400;
  color: rgba(255, 245, 235, 0.6);
  font-style: italic;
  transition: all 0.4s ease;
  width: 100%;
}

.memory-caption.hidden { opacity: 0; transform: translateY(10px); }

/* --- GUESS THE MOMENT --- */
.guess-arena {
  text-align: center;
}

.guess-prompt {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 500;
  font-style: italic;
  color: var(--text-ivory);
  padding: 20px;
  margin-bottom: 20px;
  line-height: 1.5;
  min-height: 80px;
}

.guess-options {
  display: flex; flex-direction: column;
  gap: 10px; width: 100%;
}

.guess-opt {
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 400;
  padding: 14px 20px;
  background: rgba(18, 18, 30, 0.5);
  border: 2px solid rgba(200, 138, 138, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text-ivory);
  text-align: left;
}

.guess-opt:hover {
  border-color: rgba(200, 138, 138, 0.8);
  background: rgba(245, 239, 232, 0.8);
  transform: translateX(4px);
}

.guess-opt.correct {
  border-color: rgba(210, 175, 145, 0.7); background: rgba(210, 175, 145, 0.15); color: rgba(235, 218, 195, 0.9);
}

.guess-opt.wrong {
  border-color: var(--accent-blush); background: rgba(18, 18, 30, 0.65);
  opacity: 0.6;
}

/* --- WORD SEARCH PUZZLE --- */
#sec-wordsearch .game-card-premium {
  background: rgba(18, 18, 30, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(200, 138, 138, 0.12);
  border-radius: 28px;
  padding: 32px 36px 28px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: 780px;
  width: 780px;
}
#sec-wordsearch .game-label { font-size: 13px; color: rgba(200, 138, 138, 0.55); letter-spacing: 0.16em; text-transform: uppercase; }
#sec-wordsearch .game-title { font-size: 30px; color: var(--text-ivory); font-weight: 700; }
#sec-wordsearch .game-desc { font-size: 14px; color: rgba(255, 245, 235, 0.6); }

.ws-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.ws-word-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 16px;
  background: rgba(18, 18, 30, 0.5);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  max-width: 100%;
}

.ws-word-tag {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 245, 235, 0.6);
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(18, 18, 30, 0.65);
  border: 1px solid rgba(200, 138, 138, 0.1);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ws-word-tag.found {
  background: rgba(200, 138, 138, 0.15);
  color: var(--text-ivory);
  text-decoration: line-through;
  text-decoration-color: rgba(200, 138, 138, 0.4);
  border-color: rgba(200, 138, 138, 0.2);
}

.ws-grid-container {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.ws-grid {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(18, 18, 30, 0.45);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(6px);
}

.ws-cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-ivory);
  background: rgba(18, 18, 30, 0.65);
  border: 1px solid rgba(200, 138, 138, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.ws-cell:hover { background: rgba(200, 138, 138, 0.12); }

.ws-cell.selecting {
  background: rgba(200, 138, 138, 0.25);
  color: var(--text-ivory);
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(200, 138, 138, 0.2);
  z-index: 2;
}

.ws-cell.found-cell {
  background: rgba(200, 138, 138, 0.2);
  color: var(--text-ivory);
  font-weight: 700;
  border-color: rgba(200, 138, 138, 0.15);
}

.ws-lines-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 3;
}

.ws-found-line {
  stroke: rgba(200, 138, 138, 0.25);
  stroke-width: 28;
  stroke-linecap: round;
  fill: none;
}

.ws-selecting-line {
  stroke: rgba(200, 138, 138, 0.2);
  stroke-width: 30;
  stroke-linecap: round;
  fill: none;
}

.ws-caption {
  background: rgba(18, 18, 30, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 16px;
  padding: 12px 24px;
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(255, 245, 235, 0.6);
  transition: all 0.4s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-caption.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.ws-caption.visible { opacity: 1; transform: translateY(0); }

.ws-complete {
  text-align: center;
  padding: 20px 0 0;
  transition: all 0.5s ease;
}

.ws-complete.hidden { display: none; }

.ws-complete-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-ivory);
  margin-bottom: 16px;
}

#sec-wordsearch .game-hud { gap: 40px; margin-top: 12px; }
#sec-wordsearch .hud-item {
  background: rgba(18, 18, 30, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 14px;
  padding: 8px 22px;
}
#sec-wordsearch .hud-label { font-size: 12px; color: rgba(200, 138, 138, 0.55); letter-spacing: 0.14em; text-transform: uppercase; }
#sec-wordsearch .hud-value { font-size: 26px; color: rgba(200, 138, 138, 0.8); }

@keyframes wsFoundPulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 138, 138, 0.35); }
  50% { box-shadow: 0 0 12px 4px rgba(200, 138, 138, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(214, 167, 122, 0); }
}

.ws-cell.just-found { animation: wsFoundPulse 0.6s ease; }

/* --- WORD CHALLENGE --- */
.word-arena {
  text-align: center;
}

.word-clue {
  font-family: var(--font-display);
  font-size: 1.1rem; font-style: italic;
  color: rgba(255, 245, 235, 0.6);
  margin-bottom: 24px;
  min-height: 30px;
}

.word-answer-slots {
  display: flex; gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  min-height: 52px;
  flex-wrap: wrap;
}

.word-slot {
  width: 44px; height: 48px;
  border: 2px dashed rgba(200, 138, 138, 0.35);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600;
  color: rgba(200, 138, 138, 0.8);
  background: rgba(18, 18, 30, 0.5);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.word-slot.filled {
  border-style: solid;
  border-color: rgba(200, 138, 138, 0.8);
  background: rgba(245, 239, 232, 0.8);
  animation: fadeInUp 0.2s ease;
}

.word-letter-bank {
  display: flex; gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.word-letter {
  width: 44px; height: 48px;
  background: linear-gradient(135deg, var(--accent-amber-light), var(--accent-amber));
  border: none; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600;
  color: white; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 8px rgba(200, 138, 138, 0.15);
}

.word-letter:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(214, 167, 122, 0.35);
}

.word-letter.used {
  opacity: 0.3; transform: scale(0.9);
  pointer-events: none;
}

.word-correct {
  animation: wordCorrect 0.6s ease;
}

@keyframes wordCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); background: rgba(210, 175, 145, 0.7); color: white; }
  100% { transform: scale(1); }
}

/* --- LETTER REVEAL --- */
#sec-reveal .game-card-premium {
  background: rgba(18, 18, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(200, 138, 138, 0.12);
  border-radius: 28px;
  padding: 36px 40px 32px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: 700px;
  width: 700px;
}
#sec-reveal .game-label { font-size: 13px; color: rgba(200, 138, 138, 0.55); letter-spacing: 0.16em; text-transform: uppercase; }
#sec-reveal .game-title { font-size: 26px; color: var(--text-ivory); font-weight: 700; }
#sec-reveal .game-desc { font-size: 14px; color: rgba(255, 245, 235, 0.6); margin-bottom: 0; }

.reveal-header { text-align: center; margin-bottom: 8px; }

.reveal-heart-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 20px;
  position: relative;
  width: 360px;
  height: 320px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

.reveal-heart-img {
  width: 340px;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
  transition: filter 0.6s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: brightness(0.7) saturate(0.35) opacity(0.55);
}

.reveal-heart-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  mask-image: radial-gradient(ellipse 65% 60% at center, black 40%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at center, black 40%, transparent 72%);
}

.reveal-heart-video.active {
  opacity: 1;
}

/* Pink fill overlay clipped to heart shape */
.reveal-heart-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  mask-image: url('assets/glass-heart.png?v=2');
  mask-size: 340px auto;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('assets/glass-heart.png?v=2');
  -webkit-mask-size: 340px auto;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-heart-fill::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--fill-height, 0%);
  background: linear-gradient(0deg,
    rgba(210, 175, 145, 0.6) 0%,
    rgba(210, 160, 175, 0.45) 30%,
    rgba(220, 180, 190, 0.3) 60%,
    rgba(230, 200, 210, 0.12) 85%,
    transparent 100%);
  transition: height 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-heart-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(214, 167, 122, 0) 30%, transparent 100%);
  z-index: 0;
  transition: all 0.6s ease;
  pointer-events: none;
}

.reveal-sentence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  padding: 12px 8px;
  min-height: 56px;
}

.reveal-word {
  display: flex;
  gap: 4px;
}

.reveal-char {
  width: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: transparent;
  border-bottom: 2px solid rgba(200, 138, 138, 0.2);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.reveal-char.revealed {
  color: var(--text-ivory);
  border-bottom-color: rgba(200, 138, 138, 0.4);
}

.reveal-char.just-revealed {
  animation: revealPop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes revealPop {
  0% { transform: translateY(6px) scale(0.8); opacity: 0; }
  60% { transform: translateY(-2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.reveal-caption {
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(255, 245, 235, 0.5);
  min-height: 28px;
  margin: 8px 0 16px;
  transition: opacity 0.4s ease;
}

.reveal-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
}

.reveal-letter-btn {
  width: 42px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-ivory);
  background: rgba(18, 18, 30, 0.7);
  border: 1px solid rgba(200, 138, 138, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reveal-letter-btn:hover {
  background: rgba(200, 138, 138, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(200, 138, 138, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reveal-letter-btn:active { transform: scale(0.95); }

.reveal-letter-btn.correct {
  background: rgba(200, 138, 138, 0.2);
  color: var(--text-ivory);
  border-color: rgba(200, 138, 138, 0.25);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(200, 138, 138, 0.12);
}

.reveal-letter-btn.incorrect {
  opacity: 0.2;
  transform: scale(0.85);
  pointer-events: none;
  border-color: transparent;
  background: rgba(180, 170, 160, 0.15);
  color: rgba(255, 245, 235, 0.5);
}

.reveal-complete {
  text-align: center;
  padding-top: 16px;
  animation: fadeInUp 0.8s ease;
}

.reveal-complete.hidden { display: none; }

.reveal-echo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  color: rgba(255, 245, 235, 0.6);
  margin-bottom: 18px;
  opacity: 0;
  animation: revealEcho 1s 0.5s ease forwards;
}

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

.reveal-sentence.complete .reveal-char {
  color: var(--text-ivory);
  text-shadow: 0 0 12px rgba(200, 138, 138, 0.25);
  border-bottom-color: rgba(200, 138, 138, 0.4);
}

@media (max-width: 600px) {
  #sec-reveal .game-card-premium { max-width: 96vw; width: 96vw; padding: 24px 14px 20px; }
  .reveal-heart-wrap { width: 240px; height: 210px; }
  .reveal-heart-img { width: 220px; }
  .reveal-heart-video { width: 250px; }
  .reveal-heart-fill { mask-size: 220px auto; -webkit-mask-size: 220px auto; }
  .reveal-char { width: 26px; height: 34px; font-size: 1.1rem; }
  .reveal-letter-btn { width: 36px; height: 38px; font-size: 0.85rem; }
}

/* --- MAZE JOURNEY (Chapter Five) --- */

.maze-3d-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  background: #08080f;
}

.maze-3d-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Overlays (shared base) ── */
.maze-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}
.maze-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.maze-overlay.fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Intro Overlay ── */
.maze-intro-overlay {
  background: radial-gradient(ellipse at center, rgba(8,8,15,0.85) 0%, rgba(8,8,15,0.96) 100%);
  flex-direction: column;
}
.maze-intro-content {
  text-align: center;
  max-width: 520px;
  padding: 40px;
}
.maze-intro-content .game-label {
  display: block;
  margin-bottom: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: rgba(210,175,145,0.6);
}
.maze-intro-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: rgba(245,238,228,0.9);
  margin-bottom: var(--sp-6);
  line-height: 1.2;
}
.maze-intro-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: rgba(210,175,145,0.6);
  margin-bottom: var(--sp-10);
  line-height: 1.6;
}
.maze-intro-line {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.maze-intro-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* (Old maze-start-btn removed — using .premium-btn system) */

/* ── Memory Reveal Overlay ── */
.maze-memory-overlay {
  background: rgba(8,8,15,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.maze-memory-overlay.visible {
  opacity: 1;
}
.maze-memory-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-10);
  max-width: 420px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1), opacity 0.7s ease;
  opacity: 0;
}
.maze-memory-overlay.visible .maze-memory-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.maze-memory-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 18px;
}
.maze-memory-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: rgba(245,238,228,0.92);
  margin-bottom: var(--sp-2);
}
.maze-memory-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(210,175,145,0.5);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  margin-bottom: var(--sp-5);
}
.maze-memory-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: var(--sp-8);
}
/* (Old maze-memory-continue removed — using .premium-btn system) */

/* ── Final Message Overlay ── */
.maze-final-overlay {
  background: radial-gradient(ellipse at center, rgba(8,8,15,0.7) 0%, rgba(8,8,15,0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-direction: column;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.maze-final-overlay.visible {
  opacity: 1;
}
.maze-final-content {
  text-align: center;
  max-width: 560px;
  padding: 40px;
}
.maze-final-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: rgba(245,238,228,0.9);
  line-height: 1.35;
  margin-bottom: var(--sp-4);
}
.maze-final-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: rgba(210,175,145,0.55);
  margin-bottom: var(--sp-12);
  line-height: 1.5;
}
/* (Old maze-final-btn removed — using .premium-btn system) */

/* ── Progress Dots ── */
.maze-progress {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  gap: 10px;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}
.maze-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(210,175,145,0.15);
  border: 1px solid rgba(210,175,145,0.2);
  transition: all 0.6s ease;
}
.maze-progress-dot.collected {
  background: rgba(210,175,145,0.55);
  border-color: rgba(210,175,145,0.5);
  box-shadow: 0 0 10px rgba(210,175,145,0.25);
}

/* ── Controls Hint ── */
.maze-controls-hint {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255,245,235,0.25);
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1s ease;
}
.maze-controls-hint.visible {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .maze-intro-title { font-size: 1.6rem; }
  .maze-intro-quote { font-size: 0.95rem; }
  .maze-memory-card { padding: 36px 28px; }
  .maze-memory-title { font-size: 1.25rem; }
  .maze-final-title { font-size: 1.5rem; }
  .maze-controls-hint { display: none; }
}

/* --- TRIVIA (legacy, kept for compat) --- */
.trivia-arena {
  text-align: center;
}

/* ============================================ */
/*  CHAPTER 6 — WHAT WAS WRITTEN               */
/* ============================================ */

/* Section override — luminous, spacious, silky feel */
.sec-written .themed-bg-overlay {
  background: var(--base-dark);
}

/* Inner layout */
.written-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 60px 20px 40px;
  gap: 0;
  overflow: hidden;
  z-index: 1;
}

/* Ambient particles canvas */
.written-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
.written-header {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.written-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.written-eyebrow {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #C09080;
  margin-bottom: 10px;
}

.written-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 700;
  font-style: italic;
  color: #3D2830;
  margin: 0 0 10px;
  line-height: 1.2;
}

.written-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  color: #9A7A80;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ── Stage container ── */
.written-stage {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.written-stage.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Heart ── */
.written-heart-wrap {
  position: relative;
  width: 160px;
  height: 110px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  --glow-intensity: 0;
}

.written-heart-img {
  width: 160px;
  height: auto;
  position: relative;
  z-index: 3;
  filter: brightness(calc(1.05 + var(--glow-intensity) * 0.15))
          saturate(calc(1.0 + var(--glow-intensity) * 0.25))
          drop-shadow(0 4px 24px rgba(230, 185, 160, 0.45))
          drop-shadow(0 0 40px rgba(245, 210, 185, 0.2));
  transition: filter 0.8s ease, transform 0.8s ease;
}

.written-heart-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 225, 205, calc(0.18 + var(--glow-intensity) * 0.45)) 0%,
    rgba(255, 210, 185, calc(0.08 + var(--glow-intensity) * 0.25)) 40%,
    transparent 70%);
  z-index: 2;
  pointer-events: none;
  transition: all 0.8s ease;
}

.written-heart-bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 230, 215, calc(0.1 + var(--glow-intensity) * 0.2)) 0%,
    transparent 60%);
  z-index: 1;
  pointer-events: none;
  transition: all 1s ease;
}

.written-heart-wrap.pulse .written-heart-img {
  animation: writtenHeartPulse 0.6s ease;
}

@keyframes writtenHeartPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.written-heart-wrap.luminous .written-heart-img {
  filter: brightness(1.15) saturate(1.2)
          drop-shadow(0 0 24px rgba(255, 200, 170, 0.6))
          drop-shadow(0 0 60px rgba(255, 190, 160, 0.25));
}
.written-heart-wrap.luminous .written-heart-glow {
  width: 260px;
  height: 190px;
  background: radial-gradient(circle,
    rgba(255, 215, 195, 0.6) 0%,
    rgba(255, 200, 180, 0.3) 40%,
    transparent 70%);
}
.written-heart-wrap.luminous .written-heart-bloom {
  width: 360px;
  height: 260px;
  background: radial-gradient(circle,
    rgba(255, 220, 200, 0.35) 0%,
    transparent 55%);
}

/* ══════════════════════════════════════════
   3D Basketball Experience — Full Screen
   ══════════════════════════════════════════ */

/* Basketball: deep purple dream court gradient */
#sec-basketball .themed-bg-overlay {
  background: #120e1e;
}


.bball-3d-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: grab;
  z-index: 1;
}

.bball-3d-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Basketball Overlays ── */
.bball-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
  transition: opacity 0.8s ease;
}

.bball-overlay.hidden {
  display: none;
  pointer-events: none;
}

.bball-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Intro Overlay ── */
.bball-intro-overlay {
  background: radial-gradient(ellipse at center,
    rgba(10, 6, 8, 0.7) 0%,
    rgba(8, 4, 6, 0.82) 100%);
}

.bball-intro-content {
  text-align: center;
  padding: 40px 30px;
  max-width: 520px;
}

.bball-intro-line {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 245, 235, 0.9);
  line-height: 1.6;
  margin: 0 0 28px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.bball-intro-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Progress Dots ── */
/* ── Scoreboard — Floating Violet Neon Glass ── */
.bball-scoreboard {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bball-scoreboard.visible { opacity: 1; }

.bball-board-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 16px;
  background: rgba(15, 12, 10, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(200, 138, 138, 0.2);
  box-shadow:
    0 0 20px rgba(200, 138, 138, 0.08),
    0 0 50px rgba(214, 167, 122, 0.05),
    inset 0 0 20px rgba(214, 167, 122, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: bball-board-breathe 4s ease-in-out infinite;
}

.bball-board-glow {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: transparent;
  box-shadow:
    0 0 30px rgba(214, 167, 122, 0.06),
    0 0 60px rgba(214, 167, 122, 0.03);
  pointer-events: none;
  z-index: -1;
}

@keyframes bball-board-breathe {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(200, 138, 138, 0.08),
      0 0 50px rgba(214, 167, 122, 0.05),
      inset 0 0 20px rgba(214, 167, 122, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 138, 138, 0.2);
  }
  50% {
    box-shadow:
      0 0 25px rgba(214, 167, 122, 0.16),
      0 0 60px rgba(214, 167, 122, 0.07),
      inset 0 0 25px rgba(214, 167, 122, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-color: rgba(214, 167, 122, 0.35);
  }
}

.bball-score-current,
.bball-score-target {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 2px;
  min-width: 28px;
  text-align: center;
  color: #E6B98C;
  text-shadow:
    0 0 10px rgba(200, 138, 138, 0.4),
    0 0 25px rgba(200, 138, 138, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bball-score-target {
  color: rgba(214, 167, 122, 0.35);
  text-shadow:
    0 0 8px rgba(200, 138, 138, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  font-size: 2rem;
}
.bball-score-divider {
  width: 2px;
  height: 24px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(200, 138, 138, 0.25) 30%,
    rgba(200, 138, 138, 0.25) 70%,
    transparent
  );
  border-radius: 2px;
  margin: 0 2px;
}

/* Score flash animation */
.bball-scoreboard.score-flash .bball-board-inner {
  animation: bball-flash-glow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bball-scoreboard.score-flash .bball-score-current {
  animation: bball-num-surge 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bball-flash-glow {
  0% {
    box-shadow:
      0 0 20px rgba(200, 138, 138, 0.08),
      0 0 50px rgba(214, 167, 122, 0.05),
      inset 0 0 20px rgba(214, 167, 122, 0.05);
    border-color: rgba(200, 138, 138, 0.2);
  }
  30% {
    box-shadow:
      0 0 40px rgba(230, 185, 140, 0.4),
      0 0 80px rgba(200, 138, 138, 0.15),
      0 0 120px rgba(200, 138, 138, 0.06),
      inset 0 0 30px rgba(230, 185, 140, 0.15);
    border-color: rgba(230, 185, 140, 0.5);
  }
  100% {
    box-shadow:
      0 0 20px rgba(200, 138, 138, 0.08),
      0 0 50px rgba(214, 167, 122, 0.05),
      inset 0 0 20px rgba(214, 167, 122, 0.05);
    border-color: rgba(200, 138, 138, 0.2);
  }
}

@keyframes bball-num-surge {
  0%   { transform: scale(1); color: #E6B98C; }
  25%  { transform: scale(1.35); color: #fff;
         text-shadow: 0 0 20px rgba(230, 185, 140, 0.9), 0 0 50px rgba(200, 138, 138, 0.4); }
  60%  { transform: scale(1.05); color: #F0D0A8; }
  100% { transform: scale(1); color: #E6B98C; }
}

/* ── Feedback Text — Cinematic Encouragement System ── */
.bball-feedback {
  position: absolute;
  z-index: 16;
  pointer-events: none;
  text-align: center;
  left: 0;
  right: 0;
  margin: 0 auto;
  /* Vertical position set dynamically via JS projection */
  top: 30%;
  transform: translateY(-50%);
  perspective: 600px;
}

.bball-feedback-bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 225, 170, 0.12) 0%, transparent 70%);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.bball-feedback-text {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-style: normal;
  font-weight: 600;
  color: rgba(255, 235, 240, 0);
  letter-spacing: 1.6px;
  line-height: 1.3;
  white-space: nowrap;
  text-shadow: none;
  filter: blur(0px);
  transform: translateY(6px) scale(0.96) rotateX(4deg);
  transform-origin: center bottom;
  transition: none;
  opacity: 0;
}

/* ── Entry animation ── */
.bball-feedback-text.entering {
  animation: bball-fb-enter 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0s;
}
.bball-feedback.active .bball-feedback-bloom {
  animation: bball-fb-bloom-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Exit animation ── */
.bball-feedback-text.exiting {
  animation: bball-fb-exit 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.bball-feedback.fading .bball-feedback-bloom {
  animation: bball-fb-bloom-out 0.6s ease-out forwards;
}

@keyframes bball-fb-enter {
  0% {
    opacity: 0;
    color: rgba(255, 235, 240, 0);
    transform: translateY(12px) scale(0.96) rotateX(6deg);
    filter: blur(4px);
    text-shadow:
      0 0 20px rgba(220, 170, 185, 0),
      0 0 50px rgba(220, 170, 185, 0);
  }
  40% {
    opacity: 0.85;
    transform: translateY(-3px) scale(1.04) rotateX(-1deg);
    filter: blur(0.4px);
  }
  70% {
    opacity: 0.95;
    transform: translateY(1px) scale(1.01) rotateX(0deg);
  }
  100% {
    opacity: 1;
    color: rgba(255, 235, 240, 0.92);
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: blur(0px);
    text-shadow:
      0 0 18px rgba(220, 170, 185, 0.18),
      0 0 45px rgba(210, 160, 175, 0.07),
      0 2px 4px rgba(0, 0, 0, 0.25);
  }
}

@keyframes bball-fb-exit {
  0% {
    opacity: 1;
    color: rgba(255, 235, 240, 0.92);
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: blur(0px);
    text-shadow:
      0 0 18px rgba(220, 170, 185, 0.18),
      0 0 45px rgba(210, 160, 175, 0.07),
      0 2px 4px rgba(0, 0, 0, 0.25);
  }
  100% {
    opacity: 0;
    color: rgba(255, 235, 240, 0);
    transform: translateY(-18px) scale(0.97) rotateX(-2deg);
    filter: blur(3px);
    text-shadow:
      0 0 20px rgba(220, 170, 185, 0),
      0 0 50px rgba(220, 170, 185, 0);
  }
}

@keyframes bball-fb-bloom-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  50% { opacity: 1; }
  100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
}

@keyframes bball-fb-bloom-out {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

/* ── Hint ── */
.bball-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: rgba(200, 185, 175, 0.35);
  letter-spacing: 0.03em;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.bball-hint.visible {
  opacity: 1;
}

/* ── Complete Overlay ── */
.bball-complete-overlay {
  background: radial-gradient(ellipse at center,
    rgba(10, 6, 8, 0.7) 0%,
    rgba(8, 4, 6, 0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bball-complete-content {
  text-align: center;
  padding: 40px 30px;
}

.bball-complete-line {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 245, 235, 0.95);
  line-height: 1.4;
  margin: 0 0 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.bball-complete-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.bball-complete-sub {
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  font-weight: 400;
  color: rgba(200, 180, 170, 0.7);
}

/* ══════════════════════════════════════════
   Complete the Dua Experience
   ══════════════════════════════════════════ */

/* ── Background ── */
.dua-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(18, 14, 28, 1) 0%,
    rgba(8, 6, 16, 1) 60%,
    rgba(4, 3, 10, 1) 100%);
  z-index: 0;
}

.dua-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Overlays ── */
.dua-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
  transition: opacity 0.8s ease;
}

.dua-overlay.hidden {
  display: none;
  pointer-events: none;
}

.dua-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Intro Overlay ── */
.dua-intro-overlay {
  background: radial-gradient(ellipse at center,
    rgba(12, 10, 22, 0.85) 0%,
    rgba(6, 4, 14, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dua-intro-content {
  text-align: center;
  padding: 50px 36px;
  max-width: 500px;
}

.dua-intro-eyebrow {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(210, 175, 145, 0.5);
  margin-bottom: 20px;
}

.dua-intro-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  font-style: italic;
  color: rgba(255, 248, 240, 0.95);
  margin: 0 0 12px;
  line-height: 1.15;
}

.dua-intro-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(210, 200, 195, 0.5);
  margin: 0 0 28px;
  letter-spacing: 0.02em;
}

.dua-intro-divider {
  width: 40px;
  height: 1px;
  background: rgba(210, 175, 145, 0.25);
  margin: 0 auto 28px;
}

.dua-intro-quote {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(200, 190, 185, 0.45);
  line-height: 1.7;
  margin: 0 0 36px;
}

.dua-start-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.95);
  padding: 16px 52px;
  background: linear-gradient(180deg,
    rgba(210, 175, 145, 0.25) 0%,
    rgba(180, 140, 40, 0.35) 100%);
  border: 1px solid rgba(210, 175, 145, 0.2);
  border-radius: 50px;
  cursor: pointer;
  box-shadow:
    0 4px 24px rgba(210, 175, 145, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.dua-start-btn:hover {
  background: linear-gradient(180deg,
    rgba(210, 175, 145, 0.35) 0%,
    rgba(180, 140, 40, 0.45) 100%);
  box-shadow:
    0 6px 32px rgba(210, 175, 145, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ── Game Area ── */
.dua-game-area {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  transition: opacity 0.5s ease;
}

.dua-game-area.hidden {
  display: none;
}

.dua-game-area.transitioning {
  opacity: 0;
}

/* ── Round Label ── */
.dua-round-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(210, 175, 145, 0.4);
  margin-bottom: 28px;
}

/* ── Progress Letters ── */
.dua-progress {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
}

.dua-letter-slot {
  width: 36px;
  height: 42px;
  border: 1px solid rgba(210, 175, 145, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: transparent;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.6s ease;
}

.dua-letter-slot.revealed {
  color: rgba(210, 175, 145, 0.85);
  border-color: rgba(210, 175, 145, 0.35);
  background: rgba(210, 175, 145, 0.08);
  box-shadow: 0 0 16px rgba(210, 175, 145, 0.12);
  animation: duaLetterPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes duaLetterPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Partial Dua Display ── */
.dua-partial-wrap {
  margin-bottom: 36px;
  max-width: 520px;
  text-align: center;
}

.dua-partial {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 248, 235, 0.9);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.dua-partial.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Options ── */
.dua-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.dua-options.visible {
  opacity: 1;
  transform: translateY(0);
}

.dua-option {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(240, 235, 228, 0.8);
  text-align: left;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  line-height: 1.5;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(8px);
  animation: duaOptionIn 0.5s ease forwards;
}

@keyframes duaOptionIn {
  to { opacity: 1; transform: translateY(0); }
}

.dua-option:hover {
  background: rgba(210, 175, 145, 0.06);
  border-color: rgba(210, 175, 145, 0.15);
  transform: scale(1.02) translateY(0);
  box-shadow: 0 4px 20px rgba(210, 175, 145, 0.05);
}

/* Correct answer glow */
.dua-option.correct {
  background: rgba(210, 175, 145, 0.1);
  border-color: rgba(210, 175, 145, 0.35);
  color: rgba(240, 225, 205, 0.95);
  box-shadow:
    0 0 24px rgba(210, 175, 145, 0.12),
    0 4px 16px rgba(210, 175, 145, 0.08);
  transform: scale(1.02);
  cursor: default;
}

/* Wrong answer shake */
.dua-option.wrong {
  animation: duaShake 0.4s ease;
  border-color: rgba(255, 255, 255, 0.05);
  opacity: 0.5;
}

@keyframes duaShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Dimmed non-selected options */
.dua-option.dimmed {
  opacity: 0.2;
  transform: scale(0.98);
  pointer-events: none;
}

/* ── Result Reveal ── */
.dua-result {
  max-width: 520px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.dua-result.visible {
  opacity: 1;
  transform: translateY(0);
}

.dua-result-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-8) var(--sp-6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dua-full-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  font-weight: 600;
  font-style: italic;
  color: rgba(210, 175, 145, 0.85);
  line-height: 1.6;
  margin: 0 0 var(--sp-5);
  text-shadow: 0 0 30px rgba(210, 175, 145, 0.1);
}

.dua-result-divider {
  width: 30px;
  height: 1px;
  background: rgba(210, 175, 145, 0.2);
  margin: 0 auto 20px;
}

.dua-meaning {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(200, 195, 185, 0.6);
  line-height: 1.6;
  margin: 0 0 24px;
}

.dua-message {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 245, 235, 0.75);
  line-height: 1.7;
  margin: 0;
  white-space: pre-line;
}

/* ── Continue Button ── */
/* Dua continue button — uses .premium-btn .premium-btn--hidden, keep margin */
#dua-continue-btn { margin-top: 28px; }

/* ── Final Screen ── */
.dua-final-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.dua-final-screen.hidden {
  display: none;
}

.dua-final-letters {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
}

.dua-final-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  color: rgba(210, 175, 145, 0.9);
  text-shadow:
    0 0 40px rgba(210, 175, 145, 0.3),
    0 0 80px rgba(210, 175, 145, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(30px) scale(0.7);
  animation: duaFinalLetterIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes duaFinalLetterIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dua-final-sub1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 248, 235, 0.7);
  text-align: center;
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.dua-final-sub1.visible {
  opacity: 1;
  transform: translateY(0);
}

.dua-final-sub2 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
  color: rgba(200, 195, 190, 0.6);
  text-align: center;
  letter-spacing: 0.02em;
  margin: 0 0 40px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.dua-final-sub2.visible {
  opacity: 1;
  transform: translateY(0);
}

/* (Old dua-final-cta removed — using .premium-btn system) */

/* ── Responsive ── */
@media (max-width: 600px) {
  .dua-game-area { padding: 30px 16px; }
  .dua-option { padding: 16px 20px; font-size: 0.88rem; }
  .dua-result-inner { padding: 24px 20px; }
  .dua-letter-slot { width: 26px; height: 32px; font-size: 1rem; }
  .dua-progress { gap: 8px; }
  .dua-final-letters { gap: 8px; }
}

/* Progress dots */
.written-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.written-pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(210, 185, 178, 0.35);
  border: 1px solid rgba(195, 165, 155, 0.25);
  transition: all 0.6s ease;
}

.written-pdot.lit {
  background: rgba(200, 150, 135, 0.6);
  border-color: rgba(190, 140, 125, 0.5);
  box-shadow: 0 0 8px rgba(210, 155, 140, 0.3);
}

/* ── Hint ── */
.written-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: #B09098;
  letter-spacing: 0.01em;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.written-hint.visible {
  opacity: 1;
  transform: translateY(0);
}
.written-hint.fade-out {
  opacity: 0 !important;
  transform: translateY(-6px) !important;
}

/* ── Post-reveal content ── */
.written-after {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 28px;
}

.written-personal {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  font-style: italic;
  color: #4A2530;
  text-align: center;
  line-height: 1.4;
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(16px);
  filter: blur(5px);
  transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}
.written-personal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.written-closing {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.88rem, 2.2vw, 1.05rem);
  font-weight: 400;
  color: #8A6A72;
  text-align: center;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin: 0 0 32px;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(3px);
  transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}
.written-closing.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* CTA button — glassy, premium */
.written-cta {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  padding: 16px 48px;
  background: linear-gradient(180deg,
    rgba(195, 155, 160, 0.85) 0%,
    rgba(175, 130, 140, 0.9) 50%,
    rgba(165, 120, 135, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  cursor: pointer;
  box-shadow:
    0 6px 24px rgba(160, 110, 125, 0.25),
    0 2px 8px rgba(160, 110, 125, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s ease, transform 1s ease, box-shadow 0.3s ease;
}
.written-cta.visible {
  opacity: 1;
  transform: translateY(0);
}
.written-cta:hover {
  box-shadow:
    0 10px 32px rgba(160, 110, 125, 0.32),
    0 2px 8px rgba(160, 110, 125, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  transform: scale(1.03) translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .written-inner { padding: 40px 16px 30px; }
  .written-header { margin-bottom: 20px; }
  .written-viewport { border-radius: 14px; }
  .written-heart-wrap { width: 110px; height: 75px; margin-bottom: 6px; }
  .written-heart-img { width: 110px; }
  .written-after { margin-top: 22px; }
  .written-personal { margin-bottom: 18px; }
  .written-closing { margin-bottom: 24px; }
  .written-pdot { width: 7px; height: 7px; }
}

.trivia-progress {
  display: flex; gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}

.trivia-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(200, 138, 138, 0.2);
  transition: all 0.3s ease;
}

.trivia-dot.active {
  background: var(--accent-amber);
  transform: scale(1.3);
}

.trivia-dot.done {
  background: var(--accent-amber);
}

.trivia-question {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 500;
  color: var(--text-ivory);
  margin-bottom: 24px;
  line-height: 1.5;
  min-height: 60px;
}

.trivia-options {
  display: flex; flex-direction: column;
  gap: 10px;
}

.trivia-opt {
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 400;
  padding: 14px 20px;
  background: rgba(18, 18, 30, 0.5);
  border: 2px solid rgba(200, 138, 138, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text-ivory);
  text-align: left;
}

.trivia-opt:hover {
  border-color: rgba(200, 138, 138, 0.8);
  background: rgba(245, 239, 232, 0.8);
}

.trivia-opt.correct {
  border-color: rgba(210, 175, 145, 0.7); background: rgba(210, 175, 145, 0.15); color: rgba(235, 218, 195, 0.9);
}

.trivia-opt.wrong {
  border-color: var(--accent-blush); background: rgba(18, 18, 30, 0.65);
  opacity: 0.6;
}

/* ══════════════════════════════════════════
   Grand Finale — Buildup & Question
   ══════════════════════════════════════════ */

/* ── Combined Finale Section ── */
#sec-finale {
  padding: 0;
  overflow: hidden;
}

/* Video — the main visual, full and unfiltered */
.finale-vid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Very subtle overlay just for text readability */
.finale-vid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* Soft vignette — just edges, keeps center fully visible */
.finale-vid-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 40%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

/* Phase containers — stack on top of each other */
.finale-phase {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 2s ease, visibility 0s;
}

.finale-phase-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 2s ease, visibility 0s 2s;
}

.finale-phase-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 2s ease, visibility 0s;
}

.finale-canvas {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ── BUILD-UP CHAMBER ── */
.buildup-chamber {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 60px 32px;
}

.buildup-lines {
  max-width: 560px;
  text-align: center;
  margin-bottom: 48px;
}

.buildup-line {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 245, 238, 0.65);
  line-height: 1.7;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(4px);
  transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease, color 1s ease;
}

.buildup-line.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  color: rgba(255, 248, 240, 0.85);
}

/* Previously visible lines fade back slightly */
.buildup-line.faded {
  color: rgba(255, 245, 238, 0.4);
  transition: color 1.5s ease;
}

/* Last two lines are heavier */
.buildup-line-heavy {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
}

/* ── Heart CTA ── */
.buildup-heart-cta {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.buildup-heart-cta.visible {
  opacity: 1;
  transform: scale(1);
}

.buildup-heart-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 175, 145, 0.25) 0%, transparent 70%);
  animation: finaleHeartPulse 2.5s ease-in-out infinite;
}

.buildup-heart-icon {
  position: relative;
  font-size: 2.4rem;
  color: rgba(220, 175, 185, 0.7);
  text-shadow:
    0 0 20px rgba(210, 175, 145, 0.4),
    0 0 50px rgba(210, 175, 145, 0.15);
  animation: finaleHeartFloat 3s ease-in-out infinite;
  transition: all 0.3s ease;
}

.buildup-heart-cta:hover .buildup-heart-icon {
  color: rgba(235, 218, 195, 0.9);
  text-shadow:
    0 0 28px rgba(210, 175, 145, 0.6),
    0 0 60px rgba(210, 175, 145, 0.25);
  transform: scale(1.1);
}

.buildup-heart-cta:hover .buildup-heart-glow {
  background: radial-gradient(circle, rgba(210, 175, 145, 0.4) 0%, transparent 70%);
}

@keyframes finaleHeartPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

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

/* ── FINAL QUESTION CHAMBER ── */
.finale-question-chamber {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: 60px 32px;
}

.final-content {
  position: relative;
  z-index: 10;
}

.final-pre {
  font-family: 'Dancing Script', 'Great Vibes', cursive;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
  color: rgba(210, 175, 145, 0.8);
  margin-bottom: 16px;
  text-shadow: 0 0 30px rgba(210, 175, 145, 0.3);
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px);
}

.final-question {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: rgba(255, 248, 240, 0.92);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: 52px;
  text-shadow:
    0 0 40px rgba(255, 248, 240, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.3);
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
}

@keyframes finaleTextIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes finaleQuestionIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.final-buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
}

/* ── Yes Button — Premium rose-gold pill ── */
/* Yes button — slightly larger, uses premium-btn system */
.btn-yes { padding: 18px 56px; font-size: 1.05rem; }

/* No button — uses premium-btn--secondary, keeps dodge transition */
.btn-no { transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── CELEBRATION STATE — Alhamdulillah cinematic moment ── */
.celebration {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

.celebration.hidden {
  opacity: 0;
  pointer-events: none;
}

.celebration.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Deep vignette overlay */
.celeb-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 20%,
    rgba(6, 3, 8, 0.3) 50%,
    rgba(6, 3, 8, 0.7) 75%,
    rgba(6, 3, 8, 0.92) 100%);
  pointer-events: none;
}

/* Soft halo glow behind text */
.celeb-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(200, 160, 175, 0.12) 0%,
    rgba(180, 130, 150, 0.06) 35%,
    rgba(160, 110, 130, 0.02) 60%,
    transparent 100%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: width 4s cubic-bezier(0.25, 0.1, 0.25, 1),
              height 4s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 3s ease;
}

.celebration.visible .celeb-halo,
.finale-phase-visible .celeb-halo {
  width: min(90vw, 700px);
  height: min(90vw, 700px);
  opacity: 1;
}

.celeb-content {
  text-align: center;
  padding: 40px;
  position: relative;
  z-index: 10;
  max-width: 680px;
  width: 90vw;
  margin-top: -12vh;
}

.celeb-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 248, 242, 0);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-shadow:
    0 0 60px rgba(220, 180, 195, 0),
    0 0 120px rgba(210, 175, 145, 0),
    0 2px 4px rgba(0, 0, 0, 0);
  transform: scale(1.05);
  transition: none;
  will-change: color, text-shadow, transform, filter;
}

/* Glow pulse after reveal settles */
@keyframes celebGlowPulse {
  0%, 100% {
    text-shadow:
      0 0 50px rgba(220, 180, 195, 0.25),
      0 0 100px rgba(210, 175, 145, 0.1),
      0 2px 4px rgba(0, 0, 0, 0.3);
    filter: brightness(1);
  }
  50% {
    text-shadow:
      0 0 65px rgba(220, 180, 195, 0.35),
      0 0 130px rgba(210, 175, 145, 0.15),
      0 2px 4px rgba(0, 0, 0, 0.3);
    filter: brightness(1.04);
  }
}

.celeb-title.settled {
  animation: celebGlowPulse 5s ease-in-out infinite;
}

/* "May Allah protect what we have forever" subtitle */
.celeb-sub {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(220, 190, 200, 0.85);
  margin-top: 24px;
  letter-spacing: 0.03em;
  text-shadow:
    0 0 30px rgba(200, 160, 175, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 2.5s ease, transform 2.5s ease;
}

/* --- Animated background shimmer --- */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 20% 30%, rgba(214,167,122,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 70%, rgba(207,163,163,0.08) 0%, transparent 70%);
  animation: bgShift 15s ease-in-out infinite alternate;
  pointer-events: none; z-index: 0;
}

@keyframes bgShift {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* --- Story card inner glow on hover --- */
.story-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(214,167,122,0.08), transparent 50%, rgba(207,163,163,0.06));
  z-index: -1; opacity: 0;
  transition: opacity 0.5s ease;
}

.story-card:hover::before {
  opacity: 1;
}

.story-card {
  position: relative;
}

/* --- Game card subtle lift --- */
.game-card {
  position: relative;
  transition: box-shadow 0.4s ease;
}

.game-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(214,167,122,0.06), transparent 60%);
  z-index: -1;
}

/* ============================================
   THEMED SECTIONS — 3D Scene Background
   Reusable pattern for sections that share the
   romantic 3D scene as their backdrop.
   ============================================ */

/* ── Single global background video ── */
/* Section with themed background */
/* ============================================
   CINEMATIC SECTIONS — Shared Premium Card Style
   ============================================ */

/* ── Section Container ── */
.sec-cinematic {
  padding: 0 !important;
  background: #07060e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Background Layers ── */
.cin-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* Looping cinematic video background */
.cin-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  opacity: 0.45;
  filter: brightness(0.6) saturate(1.1);
  pointer-events: none;
}

/* Semi-transparent gradient overlay on top of video */
.cin-bg-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 55%, rgba(58, 30, 68, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 30% 70%, rgba(40, 20, 60, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 75% 40%, rgba(60, 25, 55, 0.25) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10, 8, 18, 0.7) 0%, rgba(14, 11, 26, 0.5) 30%, rgba(18, 13, 32, 0.5) 60%, rgba(7, 6, 14, 0.75) 100%);
}

.cin-fog {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  z-index: 2;
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0) scale(1.05);
}

.cin-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  opacity: 0.7;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

.cin-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 65% at 50% 50%, transparent 40%, rgba(7, 6, 14, 0.7) 100%);
  box-shadow: inset 0 0 120px 40px rgba(7, 6, 14, 0.5);
}

/* ── Card Wrapper ── */
.cin-card-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px;
  will-change: transform;
  transform: translateZ(0);
}

/* ── Card — Glassmorphism Floating Card ── */
.cin-card {
  position: relative;
  max-width: 540px;
  width: 100%;
  border-radius: 28px;
  /* Start hidden for GSAP entrance */
  visibility: hidden;
}

/* Soft outer glow — warm bloom */
.cin-card-glow {
  position: absolute;
  inset: -20px;
  border-radius: 40px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(210, 175, 145, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(200, 160, 130, 0.05) 0%, transparent 50%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}

/* Gradient border — warm gold accent */
.cin-card-border {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(
    160deg,
    rgba(210, 175, 145, 0.25) 0%,
    rgba(200, 165, 130, 0.1) 25%,
    rgba(190, 155, 120, 0.05) 50%,
    rgba(200, 165, 130, 0.1) 75%,
    rgba(210, 175, 145, 0.2) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* ── Card Inner — Glass Surface ── */
.cin-card-inner {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-12) var(--sp-10);
  text-align: center;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.35),
    0 8px 32px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 var(--glass-highlight);
  /* Top-edge warm highlight */
  border-top: 1px solid rgba(210, 175, 145, 0.08);
}

/* Glow reflection beneath card */
.cin-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 15%;
  right: 15%;
  height: 40px;
  background: radial-gradient(ellipse at 50% 0%, rgba(210, 175, 145, 0.06) 0%, transparent 80%);
  filter: blur(12px);
  pointer-events: none;
}

/* ── Star Icon ── */
.cin-star {
  display: block;
  font-size: 1.4rem;
  color: rgba(210, 175, 145, 0.55);
  margin-bottom: var(--sp-5);
  text-shadow:
    0 0 12px rgba(210, 175, 145, 0.3),
    0 0 30px rgba(200, 160, 130, 0.15);
  animation: cinStarShimmer 3s ease-in-out infinite;
}

@keyframes cinStarShimmer {
  0%, 100% {
    opacity: 0.6;
    text-shadow:
      0 0 12px rgba(210, 175, 145, 0.3),
      0 0 30px rgba(200, 160, 130, 0.15);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 18px rgba(220, 185, 155, 0.5),
      0 0 45px rgba(210, 175, 145, 0.25),
      0 0 80px rgba(200, 160, 130, 0.1);
  }
}

/* ── Heading ── */
.cin-heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: rgba(245, 240, 232, 0.95);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-shadow:
    0 0 20px rgba(210, 175, 145, 0.1),
    0 0 60px rgba(200, 160, 130, 0.04);
}

/* ── Body Text ── */
.cin-body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.72;
  margin-bottom: var(--sp-4);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.cin-body:last-of-type {
  margin-bottom: 0;
}

/* "Are you ready?" — italic emphasis */
.cin-body-cta {
  font-style: italic;
  color: rgba(210, 175, 145, 0.7);
  margin-top: var(--sp-2);
  margin-bottom: 0;
  text-shadow: 0 0 16px rgba(210, 175, 145, 0.08);
}

/* Eyebrow label — "Chapter Six" etc. */
.cin-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: rgba(210, 175, 145, 0.5);
  margin-bottom: var(--sp-3);
}

/* ── Button — Premium Pill ── */
/* Cinematic section buttons — use .premium-btn, keep margin */
.cin-card-inner .premium-btn { margin-top: 28px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .cin-card-inner { padding: 44px 32px 36px; }
  .cin-heading { font-size: 1.6rem; }
  .cin-body { font-size: 0.92rem; }
}

@media (max-width: 480px) {
  .cin-card-wrap { padding: 16px; }
  .cin-card-inner { padding: 36px 24px 32px; }
  .cin-heading { font-size: 1.4rem; margin-bottom: 20px; }
  .cin-body { font-size: 0.88rem; line-height: 1.65; max-width: 100%; }
  .cin-star { font-size: 1.2rem; }
}

/* ============================================
   SEC-THEMED — Shared themed section base
   ============================================ */
.sec-themed {
  padding: 0 !important;
  background: var(--base-dark);
  overflow: hidden;
}

.themed-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.themed-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--base-dark);
  pointer-events: none;
}

.sec-themed .section-inner {
  position: relative;
  z-index: 10;
}

/* ── Premium Game Card (glass card for game sections) ── */
.game-card-premium {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-8) var(--sp-8);
  box-shadow:
    var(--shadow-medium),
    inset 0 1px 0 var(--glass-highlight);
  max-width: 620px;
  width: 100%;
  overflow: visible;
  /* Subtle top-edge warmth */
  border-top: 1px solid rgba(210, 175, 145, 0.08);
}

/* Warm accent frame for game cards */
.game-card-premium .card-frame {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(210, 175, 145, 0.06);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
  z-index: 0;
}

/* Inner content above frame */
.game-card-premium .game-header,
.game-card-premium .game-arena,
.game-card-premium .game-hud,
.game-card-premium .game-feedback {
  position: relative;
  z-index: 1;
}

/* Override game-header text styles in premium cards */
.game-card-premium .game-label {
  color: rgba(210, 175, 145, 0.55);
}

.game-card-premium .game-title {
  color: var(--text-ivory);
}

.game-card-premium .game-desc {
  color: var(--text-body);
}

/* Canvas games inside premium cards */
.game-card-premium canvas {
  border-radius: 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* HUD values in premium cards */
.game-card-premium .hud-value {
  color: var(--accent-warm);
}

.game-card-premium .hud-label {
  color: rgba(210, 175, 145, 0.45);
}

/* ── Basketball Section — Pixel-Perfect Override ── */
#sec-basketball .game-card-premium {
  background: rgba(18, 18, 30, 0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 32px;
  padding: 48px 40px 40px;
  box-shadow: 0 8px 32px 0 rgba(180, 140, 140, 0.08);
  max-width: 540px;
  width: 540px;
  min-height: 720px;
  overflow: hidden;
}

#sec-basketball .game-card-premium .card-frame {
  display: none;
}

#sec-basketball .game-header {
  margin-bottom: 0;
}

#sec-basketball .game-label {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #B48C8C;
  margin-bottom: 12px;
}

#sec-basketball .game-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  color: #4B2C2C;
  line-height: 1.1;
  margin-bottom: 16px;
}

#sec-basketball .game-desc {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #6D4B4B;
  line-height: 1.4;
}

#sec-basketball .game-desc strong {
  color: #4B2C2C;
}

#sec-basketball .game-arena {
  margin-top: 16px;
}

#sec-basketball .game-arena canvas {
  background: transparent;
  box-shadow: none;
  max-width: 460px;
}

#sec-basketball .game-hud {
  gap: 48px;
  margin-top: 16px;
}

#sec-basketball .hud-label {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #B48C8C;
  margin-bottom: 4px;
}

#sec-basketball .hud-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: #7B3F3F;
}

#sec-basketball .game-feedback {
  color: #7B3F3F;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
}

/* Basketball responsive */
@media (max-width: 1023px) {
  #sec-basketball .game-card-premium {
    width: 90vw;
    max-width: 540px;
    min-height: auto;
    padding: 36px 24px 32px;
  }
}

@media (max-width: 600px) {
  #sec-basketball .game-card-premium {
    width: 98vw;
    max-width: 380px;
    padding: 28px 16px 24px;
  }
  #sec-basketball .game-label { font-size: 12px; }
  #sec-basketball .game-title { font-size: 26px; }
  #sec-basketball .game-desc { font-size: 14px; }
  #sec-basketball .hud-value { font-size: 24px; }
  #sec-basketball .hud-label { font-size: 11px; }
  #sec-basketball .game-hud { gap: 32px; }
}

/* ── Finale section overrides ── */
#sec-buildup, #sec-final {
  background: transparent;
}

/* ── Responsive adjustments for themed sections ── */
@media (max-width: 600px) {
  .game-card-premium {
    padding: 28px 18px 24px;
    border-radius: 20px;
    max-width: 96vw;
  }
  .game-card-premium .card-frame { inset: 4px; border-radius: 17px; }
}

/* --- Guess/Trivia option active state --- */
.guess-opt:active, .trivia-opt:active {
  transform: scale(0.98);
}

/* --- Score pop animation --- */
@keyframes scorePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: var(--accent-amber-light); }
  100% { transform: scale(1); }
}

.hud-value.pop {
  animation: scorePop 0.4s ease;
}

/* (No button dodge transition handled in .btn-no above) */

/* --- Hidden Utility --- */
.hidden { opacity: 0; pointer-events: none; }

/* --- Selection Color --- */
::selection {
  background: rgba(210, 175, 145, 0.3);
  color: var(--text-ivory);
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(210, 175, 145, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(210, 175, 145, 0.4);
}

/* --- Mobile Responsive --- */

/* Tablet */
@media (max-width: 1023px) {
  .hero-content { max-width: 90vw; bottom: 6%; }
  .opening-pre { font-size: 12px; letter-spacing: 3px; }
  .opening-sub { font-size: 16px; }
}

/* Mobile */
@media (max-width: 600px) {
  .section { padding: 16px; }
  .story-card { padding: 32px 20px; }
  .game-card { padding: 24px 16px; }
  .story-title { font-size: 1.5rem; }
  .game-title { font-size: 1.3rem; }
  .story-text { font-size: 0.95rem; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; }
  #sec-memory .game-card-premium { max-width: 96vw; width: 96vw; padding: 28px 18px 24px; }
  .word-slot, .word-letter { width: 38px; height: 42px; font-size: 1.1rem; }
  .final-buttons { flex-direction: column; align-items: center; }
  .guess-prompt { font-size: 1.05rem; }
  .buildup-line { font-size: 1.05rem; }
  .final-question { font-size: clamp(1.6rem, 5vw, 2rem); }
  .final-pre { font-size: clamp(2rem, 6vw, 2.5rem); }
  .celeb-title { font-size: clamp(2.5rem, 8vw, 3.5rem); }

  /* Hero mobile adjustments */
  .hero-content { max-width: 98vw; padding: 16px; bottom: 5%; }
  .opening-pre { font-size: 11px; letter-spacing: 2.5px; }
  .opening-sub { font-size: 15px; margin-bottom: 32px; }
}

@media (max-width: 380px) {
  .memory-grid { grid-template-columns: repeat(3, 1fr); max-width: 260px; }
  .word-slot, .word-letter { width: 34px; height: 38px; font-size: 1rem; }
  .opening-pre { font-size: 10px; }
  .opening-sub { font-size: 14px; }
}
