/* ===================================================================
   Для Кристины — Design System
   =================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500;1,600&family=Manrope:wght@300;400;500;600;700;800&family=Great+Vibes&display=swap");

/* ---------- THEME TOKENS ---------- */
:root {
  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-script: "Great Vibes", cursive;

  --bg: #fff9f7;
  --bg-alt: #fff1ee;
  --bg-deep: #ffe9ea;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.6);
  --text: #3a222c;
  --text-soft: #7d5b64;
  --text-faint: #a8858d;

  --pink: #ffb6c8;
  --pink-soft: #ffe3e9;
  --rose: #e8637c;
  --burgundy: #7a1f3d;
  --red: #c0223f;
  --gold: #cc9a4d;
  --gold-soft: #f4e4c1;

  --shadow-sm: 0 4px 20px rgba(122, 31, 61, 0.08);
  --shadow-md: 0 12px 40px rgba(122, 31, 61, 0.14);
  --shadow-lg: 0 24px 70px rgba(122, 31, 61, 0.2);
  --glow-pink: 0 0 60px rgba(255, 182, 200, 0.55);
  --glow-gold: 0 0 40px rgba(204, 154, 77, 0.35);

  --grad-hero: linear-gradient(135deg, #fff6f2 0%, #ffe3e9 45%, #ffd9e4 100%);
  --grad-accent: linear-gradient(120deg, var(--rose), var(--burgundy));
  --grad-gold: linear-gradient(120deg, var(--gold), #e8c688);

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 34px;
  --radius-full: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.6s var(--ease);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #140b10;
  --bg-alt: #1c1017;
  --bg-deep: #23131c;
  --surface: rgba(43, 24, 33, 0.55);
  --surface-strong: rgba(43, 24, 33, 0.82);
  --glass-border: rgba(255, 255, 255, 0.09);
  --text: #f8ecee;
  --text-soft: #d1abb5;
  --text-faint: #8f6b74;

  --pink: #ff9fb8;
  --pink-soft: #3a1f28;
  --rose: #ff6f8f;
  --burgundy: #ff9fb0;
  --red: #ff5470;
  --gold: #e8c688;
  --gold-soft: #3a2e1c;

  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --glow-pink: 0 0 60px rgba(255, 111, 143, 0.25);
  --glow-gold: 0 0 40px rgba(232, 198, 136, 0.25);

  --grad-hero: linear-gradient(135deg, #1c1017 0%, #2a1620 45%, #341823 100%);
  color-scheme: dark;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  cursor: none;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }
ul { list-style: none; }
::selection { background: var(--pink); color: var(--burgundy); }

@media (max-width: 900px), (hover: none) {
  body, button, a { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- LAYOUT HELPERS ---------- */
.section {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 160px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  color: var(--rose);
  margin-bottom: 8px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 18px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-subtitle {
  max-width: 620px;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 56px;
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 34px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-lg), var(--glow-pink); }
.btn-outline {
  border: 1.5px solid var(--rose);
  color: var(--rose);
  background: transparent;
}
.btn-outline:hover { background: var(--pink-soft); transform: translateY(-2px); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); }
.btn-large { padding: 20px 44px; font-size: 1.1rem; }
.beat { display: inline-block; animation: heartbeat 1.3s ease-in-out infinite; }

/* ---------- PRELOADER ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--grad-hero);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-heart { width: 90px; margin: 0 auto 24px; }
.heart-svg { width: 100%; filter: drop-shadow(0 10px 30px rgba(200, 40, 80, 0.4)); }
.heart-path { fill: var(--rose); animation: heartbeat 1.1s ease-in-out infinite; transform-origin: center; }
.preloader-text {
  font-family: var(--font-display); font-style: italic;
  color: var(--burgundy); font-size: 1.1rem; margin-bottom: 20px;
}
.dots span { animation: blinkDot 1.4s infinite; opacity: 0; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
.preloader-bar { width: 220px; height: 3px; background: rgba(122,31,61,0.15); border-radius: 10px; overflow: hidden; margin: 0 auto; }
.preloader-bar-fill { height: 100%; width: 0%; background: var(--grad-accent); transition: width 0.3s ease; }

/* ---------- CURSOR ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; transform: translate(-50%, -50%); }
.cursor-dot { width: 8px; height: 8px; background: var(--rose); border-radius: 50%; }
.cursor-ring { width: 34px; height: 34px; transition: width 0.25s, height 0.25s, opacity 0.25s; opacity: 0.85; }
.cursor-ring svg { width: 100%; height: 100%; fill: var(--rose); opacity: 0.5; }
.cursor-ring.grow { width: 56px; height: 56px; }
#cursor-trail-canvas { position: fixed; inset: 0; z-index: 9997; pointer-events: none; }

/* ---------- BACKGROUND ---------- */
.sky-layer {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.5; transition: background 3s ease, opacity 3s ease;
}
.sky-layer.time-morning { background: linear-gradient(180deg, #ffe8d6, #ffd3e0 60%, transparent); }
.sky-layer.time-day { background: linear-gradient(180deg, #fef6f0, transparent); opacity: 0.3; }
.sky-layer.time-sunset { background: linear-gradient(180deg, #ffb199, #ff7aa2 50%, #7a1f3d 100%); opacity: 0.4; }
.sky-layer.time-night { background: linear-gradient(180deg, #0c0714, #201029 55%, #2c1420 100%); opacity: 0.85; }
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; filter: blur(80px); opacity: 0.55; }
.aurora-blob { position: absolute; border-radius: 50%; }
.b1 { width: 46vw; height: 46vw; top: -12%; left: -8%; background: var(--pink); animation: driftA 22s ease-in-out infinite; }
.b2 { width: 38vw; height: 38vw; bottom: -14%; right: -6%; background: var(--gold-soft); animation: driftB 26s ease-in-out infinite; }
.b3 { width: 32vw; height: 32vw; top: 40%; left: 50%; background: var(--rose); opacity: 0.4; animation: driftC 30s ease-in-out infinite; }
.grain-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, #main-nav, .mini-player, footer, .modal-overlay, .lightbox { position: relative; z-index: 2; }

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(20, 8, 14, 0.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.5s var(--ease), visibility 0.5s;
  padding: 24px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  max-width: 460px; width: 100%; padding: 44px 36px; text-align: center;
  position: relative; transform: translateY(30px) scale(0.96); transition: transform 0.5s var(--ease);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-heart { font-size: 2.6rem; margin-bottom: 14px; }
.modal h3 { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 10px; }
.modal p { color: var(--text-soft); margin-bottom: 24px; line-height: 1.7; }
.modal-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--pink-soft); }
.modal-secret p { text-align: left; }

/* ---------- NAV ---------- */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 18px 0;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
}
#main-nav.scrolled { background: var(--surface-strong); backdrop-filter: blur(20px); box-shadow: var(--shadow-sm); padding: 10px 0; }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; letter-spacing: 0.02em; }
.nav-logo-heart { color: var(--rose); display: inline-block; transition: transform 0.2s; }
.nav-logo:active .nav-logo-heart { transform: scale(1.4); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-link { font-size: 0.92rem; font-weight: 600; color: var(--text-soft); position: relative; padding: 6px 0; transition: color 0.3s; }
.nav-link::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--rose); transition: width 0.35s var(--ease); }
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }
.nav-more-wrap { position: relative; }
.nav-more-btn { display: flex; align-items: center; gap: 4px; }
.nav-more-menu {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--surface-strong); backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 10px; min-width: 200px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: all 0.3s var(--ease);
}
.nav-more-wrap:hover .nav-more-menu, .nav-more-wrap.open .nav-more-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-more-menu li a { display: block; padding: 9px 14px; border-radius: 10px; font-size: 0.9rem; color: var(--text-soft); }
.nav-more-menu li a:hover { background: var(--pink-soft); color: var(--rose); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--glass-border); transition: transform 0.3s, background 0.3s; }
.icon-btn:hover { transform: translateY(-2px) rotate(-8deg); background: var(--pink-soft); }
.icon-btn svg { width: 18px; height: 18px; fill: var(--text); stroke: var(--text); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
.nav-burger { display: none; flex-direction: column; gap: 5px; width: 30px; }
.nav-burger span { height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

.nav-links-close-wrap { display: none; }
.nav-burger span { transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 495; background: rgba(20, 8, 14, 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
}
@media (max-width: 980px) {
  .nav-burger { display: flex; position: relative; z-index: 500; }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-backdrop.open { opacity: 1; visibility: visible; }
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 82vw); z-index: 499;
    background: var(--surface-strong); backdrop-filter: blur(24px);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 26px;
    padding: 40px; transform: translateX(100%); transition: transform 0.5s var(--ease);
    box-shadow: var(--shadow-lg); overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links-close-wrap { display: block; position: absolute; top: 18px; right: 20px; }
  .nav-links-close { width: 38px; height: 38px; border-radius: 50%; background: var(--pink-soft); color: var(--burgundy); font-size: 1.1rem; }
  .nav-more-menu { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; background: transparent; border: none; padding: 6px 0 0 12px; display: none; }
  .nav-more-wrap.open .nav-more-menu { display: block; }
}

/* ---------- MINI PLAYER ---------- */
.mini-player {
  position: fixed; bottom: 22px; right: 22px; z-index: 400;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 10px; border-radius: var(--radius-full);
  background: var(--surface-strong); backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transform: translateY(140%); transition: transform 0.6s var(--ease);
}
.mini-player.visible { transform: translateY(0); }
.mp-toggle { width: 44px; height: 44px; border-radius: 50%; background: var(--grad-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mp-toggle svg { width: 18px; height: 18px; fill: #fff; }
.mp-toggle .icon-pause { display: none; }
.mini-player.playing .icon-play { display: none; }
.mini-player.playing .icon-pause { display: block; }
.mp-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mp-vinyl { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, var(--burgundy) 0 20%, #111 21% 40%, var(--burgundy) 41% 100%); display: flex; align-items: center; justify-content: center; color: gold; font-size: 0.7rem; flex-shrink: 0; }
.mini-player.playing .mp-vinyl { animation: spin 3s linear infinite; }
.mp-text { min-width: 0; }
.mp-track { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.mp-artist { font-size: 0.72rem; color: var(--text-faint); }
.mp-next { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mp-next svg { width: 16px; height: 16px; fill: var(--text-soft); }
.mp-next:hover svg { fill: var(--rose); }
.mp-volume { width: 70px; accent-color: var(--rose); }
@media (max-width: 640px) { .mp-text, .mp-volume { display: none; } .mini-player { padding: 8px; } }

/* ---------- HERO ---------- */
.hero { min-height: 100vh; min-height: 100svh; justify-content: center; padding-top: 140px; background: var(--grad-hero); border-radius: 0 0 60px 60px; overflow: hidden; }
.hero-photo-wrap { position: relative; margin-bottom: 38px; }
.hero-photo-glow { position: absolute; inset: -30px; background: radial-gradient(circle, var(--pink) 0%, transparent 70%); filter: blur(30px); opacity: 0.7; animation: pulseGlow 4s ease-in-out infinite; }
.hero-photo-frame {
  position: relative; width: clamp(220px, 30vw, 320px); height: clamp(220px, 30vw, 320px);
  border-radius: 50%; overflow: hidden; border: 6px solid #fff;
  box-shadow: var(--shadow-lg), var(--glow-pink);
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-accent);
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; }
.hero-photo.img-fallback { display: none; }
.hero-photo-fallback-icon { display: none; font-size: 4rem; color: #fff; }
.hero-photo.img-fallback ~ .hero-photo-fallback-icon { display: block; }
.hero-sparkle { position: absolute; color: var(--gold); font-size: 1.6rem; animation: sparkle 3s ease-in-out infinite; }
.hero-sparkle.s1 { top: 0; left: -6%; animation-delay: 0.3s; }
.hero-sparkle.s2 { bottom: 10%; right: -8%; animation-delay: 1s; font-size: 2rem; }
.hero-sparkle.s3 { top: 45%; right: -2%; animation-delay: 1.8s; }
.hero-eyebrow { font-size: clamp(0.95rem, 1.6vw, 1.15rem); color: var(--rose); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 8px; }
.hero-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(3.4rem, 11vw, 7.5rem); line-height: 1; background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 22px; }
.hero-typed-wrap { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-soft); min-height: 2.4em; max-width: 560px; }
.typed-cursor { color: var(--rose); animation: blinkDot 0.9s infinite; }
.hero-cta { margin-top: 36px; }
.scroll-hint { position: absolute; bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-hint span { width: 22px; height: 36px; border: 2px solid var(--rose); border-radius: 20px; position: relative; }
.scroll-hint span::before { content: ""; position: absolute; top: 6px; left: 50%; width: 4px; height: 8px; background: var(--rose); border-radius: 4px; transform: translateX(-50%); animation: scrollDot 1.8s ease-in-out infinite; }
.scroll-hint p { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- TOGETHER COUNTER ---------- */
.counter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; width: 100%; max-width: 900px; margin-bottom: 26px; }
.counter-cell { padding: 26px 8px; }
.counter-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.6rem); color: var(--burgundy); font-variant-numeric: tabular-nums; }
.counter-label { font-size: 0.75rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.counter-sub { font-family: var(--font-script); font-size: 1.6rem; color: var(--rose); }
@media (max-width: 780px) { .counter-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- TIMELINE ---------- */
.timeline-track { position: relative; width: 100%; max-width: 860px; margin-top: 20px; }
.timeline-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--pink), var(--gold)); transform: translateX(-50%); }
.timeline-item { position: relative; width: 100%; display: flex; margin-bottom: 70px; }
.timeline-item:nth-child(odd) { justify-content: flex-start; }
.timeline-item:nth-child(even) { justify-content: flex-end; }
.timeline-card { width: 44%; padding: 26px; text-align: left; }
.timeline-dot { position: absolute; left: 50%; top: 30px; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; background: var(--grad-accent); box-shadow: 0 0 0 6px var(--pink-soft); }
.timeline-date { font-family: var(--font-script); font-size: 1.5rem; color: var(--rose); display: block; margin-bottom: 6px; }
.timeline-photo { width: 100%; height: 170px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.timeline-photo-fallback { width: 100%; height: 170px; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--grad-accent); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: #fff; }
.timeline-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.timeline-desc { color: var(--text-soft); font-size: 0.92rem; }
@media (max-width: 760px) {
  .timeline-track::before { left: 18px; }
  .timeline-item, .timeline-item:nth-child(even) { justify-content: flex-start; padding-left: 44px; }
  .timeline-card { width: 100%; }
  .timeline-dot { left: 18px; }
}

/* ---------- GALLERY ---------- */
.gallery-filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.gallery-filter-btn { padding: 9px 20px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); background: var(--surface); font-size: 0.85rem; font-weight: 600; color: var(--text-soft); transition: 0.3s; }
.gallery-filter-btn:hover, .gallery-filter-btn.active { background: var(--grad-accent); color: #fff; border-color: transparent; }
.gallery-grid { columns: 4 260px; column-gap: 16px; width: 100%; }
.gallery-item { break-inside: avoid; margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; position: relative; box-shadow: var(--shadow-sm); }
.gallery-img-box { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--grad-accent); display: flex; align-items: center; justify-content: center; min-height: 160px; }
.gallery-img { width: 100%; display: block; transition: transform 0.7s var(--ease), filter 0.5s; }
.gallery-img.img-fallback { display: none; }
.gallery-fallback-icon { display: none; font-size: 2.2rem; color: #fff; padding: 60px 0; }
.gallery-img.img-fallback ~ .gallery-fallback-icon { display: block; }
.gallery-item:hover .gallery-img { transform: scale(1.12); filter: brightness(0.85); }
.gallery-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 16px; background: linear-gradient(to top, rgba(20,8,14,0.75), transparent 60%); opacity: 0; transition: opacity 0.4s; }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay p { color: #fff; font-size: 0.85rem; font-weight: 600; }
@media (max-width: 900px) { .gallery-grid { columns: 2 200px; } }
@media (max-width: 520px) { .gallery-grid { columns: 1; } }

.lightbox { position: fixed; inset: 0; z-index: 9980; background: rgba(10,4,7,0.92); display: flex; align-items: center; justify-content: center; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0.5s; padding: 40px; }
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-img { max-width: 84vw; max-height: 74vh; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); transform: scale(0.9); transition: transform 0.5s var(--ease); }
.lightbox.active .lightbox-img { transform: scale(1); }
.lightbox-caption { color: #fff; margin-top: 20px; font-size: 0.95rem; opacity: 0.85; }
.lightbox-close { position: absolute; top: 26px; right: 30px; color: #fff; font-size: 1.4rem; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 2.2rem; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.1); transition: background 0.3s; }
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 20px; } .lightbox-next { right: 20px; }

/* ---------- REASONS ---------- */
.reasons-stats { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 20px; }
.reasons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; width: 100%; margin-bottom: 40px; }
.reason-card { perspective: 1000px; height: 150px; }
.reason-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s var(--ease); }
.reason-card:hover .reason-card-inner, .reason-card.flipped .reason-card-inner { transform: rotateY(180deg); }
.reason-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; padding: 18px; text-align: center; }
.reason-front { background: var(--grad-accent); color: #fff; font-family: var(--font-display); font-size: 1.5rem; }
.reason-back { background: var(--surface-strong); border: 1px solid var(--glass-border); transform: rotateY(180deg); font-size: 0.92rem; color: var(--text); font-weight: 600; }
.reason-card.seen .reason-front::after { content: "✓"; position: absolute; top: 8px; right: 12px; font-size: 0.8rem; opacity: 0.7; }

/* ---------- COMPLIMENTS ---------- */
.compliment-card { max-width: 620px; padding: 50px 40px; margin-bottom: 30px; min-height: 140px; display: flex; align-items: center; justify-content: center; }
.compliment-text { font-family: var(--font-display); font-style: italic; font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: var(--burgundy); }
.compliment-count { margin-top: 18px; color: var(--text-faint); font-size: 0.88rem; }

/* ---------- WHEEL ---------- */
.wheel-wrap { position: relative; width: min(320px, 78vw); aspect-ratio: 1; margin-bottom: 30px; }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 2rem; color: var(--burgundy); z-index: 2; }
.wheel-disc {
  width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden;
  border: 8px solid #fff; box-shadow: var(--shadow-lg);
  background: conic-gradient(var(--pink) 0deg, var(--gold-soft) 60deg, var(--pink-soft) 120deg, var(--rose) 180deg, var(--gold-soft) 240deg, var(--pink) 300deg, var(--rose) 360deg);
  transition: transform 4s cubic-bezier(0.15, 0.65, 0.15, 1);
  display: flex; align-items: center; justify-content: center;
}
.wheel-disc::after { content: "❤"; font-size: 2.4rem; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.wheel-result { margin-top: 10px; max-width: 500px; padding: 26px 30px; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--burgundy); opacity: 0; transform: translateY(10px); transition: 0.5s var(--ease); }
.wheel-result.show { opacity: 1; transform: translateY(0); }

/* ---------- JAR ---------- */
.jar-wrap { position: relative; margin-bottom: 20px; }
.jar { position: relative; width: 200px; cursor: none; }
.jar-glass { position: relative; }
.jar-lid { width: 90px; height: 28px; margin: 0 auto; background: linear-gradient(var(--gold), #a97b34); border-radius: 10px 10px 4px 4px; box-shadow: var(--shadow-sm); }
.jar-body {
  width: 200px; height: 220px; border-radius: 20px 20px 40px 40px;
  background: linear-gradient(160deg, rgba(255,255,255,0.35), var(--pink-soft) 60%, rgba(255,182,200,0.4));
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: inset 0 -20px 40px rgba(232,99,124,0.15), var(--shadow-md);
  position: relative; overflow: hidden;
}
.jar-body::after { content: "✨"; position: absolute; bottom: 14px; right: 20px; font-size: 1.2rem; opacity: 0.7; }
.jar-notes { position: absolute; inset: 0; pointer-events: none; }
.jar:hover .jar-lid { animation: jarWiggle 0.5s ease-in-out; }
.jar-note-popup { position: relative; max-width: 480px; margin-top: 10px; padding: 26px 30px; font-family: var(--font-display); font-style: italic; opacity: 0; transform: translateY(14px) scale(0.96); transition: 0.5s var(--ease); }
.jar-note-popup.show { opacity: 1; transform: translateY(0) scale(1); }

/* ---------- LETTERS ---------- */
.letters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 34px; width: 100%; max-width: 900px; align-items: start; }
.letter-envelope { position: relative; cursor: none; }
.envelope-view { position: relative; height: 200px; transition: opacity 0.4s ease, transform 0.4s ease; }
.letter-envelope.open .envelope-view { position: absolute; inset: 0; opacity: 0; transform: scale(0.94); pointer-events: none; }
.envelope-body {
  position: absolute; inset: 0; background: linear-gradient(160deg, var(--gold-soft), var(--pink-soft));
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; overflow: hidden;
}
.envelope-label { font-family: var(--font-script); font-size: 1.4rem; color: var(--burgundy); z-index: 2; }
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(160deg, var(--rose), var(--burgundy));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.envelope-seal { position: absolute; top: 42%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; background: var(--grad-accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-sm); z-index: 2; }
.letter-paper {
  display: none;
  background: var(--surface-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 22px; text-align: left; box-shadow: var(--shadow-md);
}
.letter-envelope.open .letter-paper { display: block; animation: letterPaperIn 0.5s var(--ease); }
.letter-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.letter-date { font-size: 0.75rem; color: var(--rose); display: block; margin-bottom: 8px; }
.letter-body-text { font-size: 0.85rem; color: var(--text-soft); line-height: 1.6; }

/* ---------- FUTURE ---------- */
.future-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 22px; width: 100%; }
.future-card { padding: 32px 20px; transition: transform 0.4s var(--ease); }
.future-card:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: var(--shadow-lg), var(--glow-gold); }
.future-icon { font-size: 2.4rem; margin-bottom: 14px; }
.future-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 6px; }
.future-desc { font-size: 0.85rem; color: var(--text-soft); }

/* ---------- MOOD SECTIONS ---------- */
.mood-section { border-radius: 50px; margin: 20px auto; max-width: 1240px; overflow: hidden; position: relative; }
.mood-sad { background: linear-gradient(160deg, var(--bg-alt), var(--pink-soft)); }
.mood-fight { background: linear-gradient(160deg, var(--bg-deep), var(--gold-soft)); }
.mood-inner { max-width: 640px; position: relative; z-index: 2; }
.mood-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 22px; color: var(--burgundy); }
.mood-text { color: var(--text-soft); margin-bottom: 18px; font-size: 1.05rem; line-height: 1.8; }
.mood-highlight { font-family: var(--font-script); font-size: 2rem; color: var(--rose); margin-top: 20px; }
.mood-hug { font-size: 3rem; margin-top: 20px; animation: floatY 3s ease-in-out infinite; }
.mood-hearts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.beating-heart { width: 110px; margin: 0 auto 20px; }
.big-heart { width: 100%; fill: var(--red); filter: drop-shadow(0 10px 30px rgba(192,34,63,0.4)); animation: heartbeat 1.2s ease-in-out infinite; }

/* ---------- FOOTER ---------- */
.site-footer { text-align: center; padding: 80px 24px 60px; color: var(--text-soft); }
.footer-heart { font-size: 1.8rem; color: var(--rose); margin-bottom: 10px; animation: heartbeat 2s ease-in-out infinite; }
.footer-secret { margin-top: 14px; font-size: 0.8rem; color: var(--text-faint); max-width: 460px; margin-inline: auto; }
.footer-secret b { color: var(--rose); }

/* ---------- SHARED REVEAL BASE STATES (transitions live in animations.css) ---------- */
.reveal-up, .reveal-line { opacity: 0; }

/* ===================================================================
   BONUS FEATURES
   =================================================================== */

/* ---------- Welcome / signature overlay ---------- */
.welcome-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--grad-hero);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  cursor: none; text-align: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.welcome-overlay.active { opacity: 1; visibility: visible; }
.welcome-overlay.hide { opacity: 0; visibility: hidden; }
.welcome-hello { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--text-soft); }
.welcome-signature { width: min(500px, 88vw); }
.welcome-signature-text { font-family: var(--font-script); font-size: 84px; fill: none; stroke: var(--rose); stroke-width: 1.4px; }
.welcome-signature.drawn .welcome-signature-text { fill: var(--burgundy); transition: fill 1s ease 0.3s; }
.welcome-sub { font-size: 0.85rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }

/* ---------- Playlist panel ---------- */
.mp-playlist-btn { width: 30px; height: 30px; border-radius: 50%; color: var(--text-soft); font-size: 1rem; }
.mp-visualizer { width: 40px; height: 24px; flex-shrink: 0; }
.playlist-panel {
  position: fixed; bottom: 90px; right: 22px; z-index: 399; width: 240px;
  background: var(--surface-strong); backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 14px;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.35s var(--ease);
}
.playlist-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.playlist-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 8px; }
.playlist-panel li { padding: 8px 10px; border-radius: 10px; font-size: 0.85rem; cursor: none; transition: background 0.25s; }
.playlist-panel li:hover, .playlist-panel li.active { background: var(--pink-soft); color: var(--rose); }

/* ---------- Quick actions FAB ---------- */
.quick-actions { position: fixed; bottom: 22px; left: 22px; z-index: 400; }
.qa-main {
  width: 54px; height: 54px; border-radius: 50%; background: var(--grad-accent); color: #fff; font-size: 1.4rem;
  box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center;
  animation: heartbeat 2.4s ease-in-out infinite; transition: transform 0.3s;
}
.qa-main:hover { transform: scale(1.08); }
.qa-menu {
  position: absolute; bottom: 66px; left: 0; display: flex; flex-direction: column; gap: 10px;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.35s var(--ease);
}
.qa-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.qa-btn {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-full);
  background: var(--surface-strong); backdrop-filter: blur(16px); border: 1px solid var(--glass-border);
  font-size: 0.85rem; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-sm); transition: transform 0.25s, background 0.25s;
}
.qa-btn:hover { transform: translateX(4px); background: var(--pink-soft); }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-strong); backdrop-filter: blur(16px); border: 1px solid var(--glass-border);
  padding: 14px 26px; border-radius: var(--radius-full); box-shadow: var(--shadow-md);
  font-size: 0.9rem; font-weight: 600; color: var(--burgundy); z-index: 9996; max-width: 90vw; text-align: center;
  opacity: 0; visibility: hidden; transition: 0.4s var(--ease);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ---------- Fun stats + countdowns ---------- */
.fun-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; max-width: 640px; margin-top: 30px; }
.fun-stat { padding: 20px 8px; }
.fun-stat-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--rose); }
.fun-stat-label { font-size: 0.72rem; color: var(--text-soft); }
.countdowns { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.countdown-card { padding: 20px 26px; min-width: 200px; }
.countdown-label { font-size: 0.78rem; color: var(--text-faint); margin-bottom: 6px; }
.countdown-value { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--burgundy); }

/* ---------- Love tree + wish candle ---------- */
.tree-candle-duo { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; align-items: flex-start; margin-top: 50px; width: 100%; }
.mini-label { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 14px; }
.love-tree-wrap, .wish-candle-wrap { display: flex; flex-direction: column; align-items: center; }
.love-tree-svg { width: 180px; height: 200px; }
.tree-blossom { fill: var(--rose); opacity: 0; animation: bloomIn 0.6s ease forwards; }
.candle { position: relative; width: 60px; height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.candle-body { width: 26px; height: 70px; background: linear-gradient(var(--gold-soft), var(--gold)); border-radius: 6px; box-shadow: inset -4px 0 8px rgba(0,0,0,0.1); }
.candle-flame {
  width: 14px; height: 22px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6c8, var(--gold) 60%, transparent 100%);
  margin-bottom: -4px; opacity: 0; transform: scale(0.5);
  transition: opacity 0.4s, transform 0.4s;
}
.candle.lit .candle-flame { opacity: 1; transform: scale(1); animation: flicker 1.6s ease-in-out infinite; }
.wish-form { display: none; gap: 8px; margin-top: 16px; }
.wish-form.show { display: flex; }
.wish-form input { padding: 10px 14px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); background: var(--surface); font: inherit; color: var(--text); min-width: 180px; }
.wish-confirm { margin-top: 12px; font-family: var(--font-display); font-style: italic; color: var(--rose); font-size: 0.9rem; min-height: 1.4em; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.08) rotate(2deg); }
}
@keyframes bloomIn { to { opacity: 1; } }

/* ---------- Daily message / footer feeling ---------- */
.daily-message { margin-top: 18px; font-family: var(--font-display); font-style: italic; color: var(--rose); font-size: 0.95rem; max-width: 460px; }
.footer-feeling { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 6px; }
.footer-feeling span { color: var(--rose); font-weight: 600; }

/* ---------- Gallery pro toolbar ---------- */
.gallery-toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.gallery-toggle-btn { padding: 9px 18px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); background: var(--surface); font-size: 0.82rem; font-weight: 600; color: var(--text-soft); transition: 0.3s; }
.gallery-toggle-btn:hover, .gallery-toggle-btn.active { background: var(--grad-accent); color: #fff; border-color: transparent; }
.gallery-grid.retro-mode .gallery-img { filter: sepia(0.45) contrast(1.05) saturate(1.2) brightness(0.95); }
.gallery-grid.polaroid-mode .gallery-item { background: #fdfaf3; padding: 12px 12px 40px; border-radius: 4px; box-shadow: var(--shadow-md); transform: rotate(var(--tilt, -1deg)); }
.gallery-grid.polaroid-mode .gallery-img-box { border-radius: 2px; }

.photo-wall-overlay {
  position: fixed; inset: 0; z-index: 9985; background: rgba(8,3,5,0.92);
  display: flex; align-items: center; justify-content: center; perspective: 1400px;
  opacity: 0; visibility: hidden; transition: 0.5s var(--ease);
}
.photo-wall-overlay.active { opacity: 1; visibility: visible; }
.photo-wall { position: relative; width: 240px; height: 320px; transform-style: preserve-3d; animation: wallSpin 24s linear infinite; }
.photo-wall-overlay.paused .photo-wall { animation-play-state: paused; }
.photo-wall-item { position: absolute; inset: 0; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-lg); backface-visibility: hidden; }
.photo-wall-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-wall-close { position: fixed; top: 26px; right: 30px; background: rgba(255,255,255,0.12); color: #fff; }
@keyframes wallSpin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

/* ---------- Before / after slider ---------- */
.before-after { margin-top: 60px; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; }
.ba-slider { position: relative; width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-lg); }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-after-wrap { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.ba-after-wrap .ba-img { width: 200%; max-width: none; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: none; margin: 0; }
.ba-handle {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--burgundy); display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%); box-shadow: var(--shadow-md); pointer-events: none; font-size: 1rem;
}
.ba-label { position: absolute; bottom: 12px; font-size: 0.75rem; color: #fff; background: rgba(0,0,0,0.4); padding: 4px 10px; border-radius: var(--radius-full); pointer-events: none; }
.ba-label-left { left: 12px; } .ba-label-right { right: 12px; }

/* ---------- Memory video ---------- */
.memory-video-wrap { margin-top: 60px; width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.memory-video { width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); background: #000; }
.memory-video-fallback { display: none; align-items: center; justify-content: center; padding: 30px; text-align: center; color: var(--text-soft); font-size: 0.85rem; background: var(--surface); border-radius: var(--radius-md); }

/* ---------- Generators ---------- */
.generators-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; width: 100%; max-width: 760px; }
.generator-card { padding: 34px 26px; }
.generator-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 14px; }
.generator-result { min-height: 60px; color: var(--text-soft); font-style: italic; margin-bottom: 18px; }

/* ---------- Quiz ---------- */
.quiz-box { max-width: 560px; padding: 40px 34px; }
.quiz-progress { font-size: 0.78rem; color: var(--text-faint); margin-bottom: 10px; }
.quiz-question { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 22px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option { padding: 13px 18px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--surface); text-align: left; transition: 0.25s; }
.quiz-option:hover { background: var(--pink-soft); }
.quiz-option.chosen { background: var(--grad-accent); color: #fff; }
.quiz-response { margin-top: 18px; font-style: italic; color: var(--rose); min-height: 1.4em; }

/* ---------- Catch hearts game ---------- */
.game-hud { display: flex; gap: 24px; font-size: 0.9rem; color: var(--text-soft); margin-bottom: 20px; }
.game-field { position: relative; width: 100%; max-width: 640px; height: 380px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--glass-border); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.game-start-btn { z-index: 2; }
.falling-heart { position: absolute; top: -40px; font-size: 1.8rem; background: none; }
.falling-heart.miss { opacity: 0.5; }

/* ---------- Sliding puzzle ---------- */
.puzzle-wrap { display: flex; justify-content: center; }
.puzzle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: min(340px, 84vw); aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-md); }
.puzzle-tile { background-size: 300% 300%; border-radius: 4px; transition: transform 0.2s; }
.puzzle-tile.empty { background: var(--pink-soft); }
.puzzle-controls { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.puzzle-status { color: var(--rose); font-family: var(--font-display); font-style: italic; }

/* ---------- Time capsule ---------- */
.capsule-box { max-width: 560px; padding: 34px; width: 100%; }
.capsule-box textarea { width: 100%; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--surface); font: inherit; color: var(--text); resize: vertical; margin-bottom: 16px; }
.capsule-presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.capsule-presets input[type="date"] { padding: 9px 14px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); background: var(--surface); color: var(--text); font: inherit; }
.capsule-list { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; }
.capsule-item { padding: 18px 22px; text-align: left; }
.capsule-item .locked { color: var(--text-faint); font-style: italic; }
.capsule-item .unlocked { color: var(--text); }
.capsule-item .capsule-date { font-size: 0.78rem; color: var(--rose); margin-bottom: 6px; display: block; }

/* ---------- Promises wall ---------- */
.promises-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; width: 100%; }
.promise-card { padding: 22px 20px; font-size: 0.92rem; color: var(--text); text-align: left; }
.promise-card::before { content: "🤍"; display: block; margin-bottom: 10px; }

/* ---------- Secret gate ---------- */
.secret-gate-lock { max-width: 420px; padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.secret-gate-lock input { width: 100%; padding: 13px 16px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); background: var(--surface); color: var(--text); font: inherit; text-align: center; }
.secret-gate-error { color: var(--red); font-size: 0.82rem; min-height: 1.2em; }
.secret-gate-content { display: none; max-width: 560px; padding: 40px 34px; text-align: left; }
.secret-gate-content.unlocked { display: block; }
.secret-gate-lock.unlocked { display: none; }

/* ---------- Finale ---------- */
.finale-section { min-height: 90vh; justify-content: center; position: relative; overflow: hidden; }
#finale-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale-content { position: relative; z-index: 2; }
.finale-text {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: clamp(1.7rem, 4.4vw, 3.2rem); line-height: 1.4; max-width: 900px;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: var(--glow-pink);
}

@media (max-width: 640px) {
  .qa-btn span { display: none; }
  .qa-btn { padding: 12px; border-radius: 50%; }
  .tree-candle-duo { gap: 24px; }
}

/* ===================================================================
   ROUND 2: performance/SEO polish, accessibility, new micro-features
   =================================================================== */

/* ---------- Accessibility ---------- */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 10000;
  background: var(--burgundy); color: #fff; padding: 12px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; transition: top 0.25s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible {
  outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px;
}
.mp-volume:focus-visible, .ba-range:focus-visible { outline-offset: 0; }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 600;
  background: var(--grad-accent); transition: width 0.1s linear;
}

/* ---------- Back to top + surprise me ---------- */
.back-to-top, .surprise-btn {
  position: fixed; right: 22px; z-index: 399;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface-strong); backdrop-filter: blur(16px); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md); font-size: 1.1rem; color: var(--rose);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: 0.35s var(--ease);
}
.back-to-top { bottom: 96px; }
.surprise-btn { bottom: 156px; }
.back-to-top.show, .surprise-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover, .surprise-btn:hover { transform: translateY(-3px) scale(1.06); }

/* ---------- Visit counter ---------- */
.visit-counter { margin-top: 6px; font-size: 0.78rem; color: var(--text-faint); }

/* ---------- Wishes viewer ---------- */
.wish-view-btn { margin-top: 14px; font-size: 0.8rem; color: var(--rose); text-decoration: underline; text-underline-offset: 3px; }
.wish-list { margin-top: 14px; max-width: 320px; max-height: 160px; overflow-y: auto; text-align: left; display: none; }
.wish-list.show { display: block; }
.wish-list-item { font-size: 0.82rem; color: var(--text-soft); padding: 8px 0; border-bottom: 1px dashed var(--glass-border); }
.wish-list-empty { font-size: 0.82rem; color: var(--text-faint); font-style: italic; }

/* ---------- Image skeleton shimmer ---------- */
.gallery-img-box.loading::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, var(--pink-soft) 30%, rgba(255,255,255,0.6) 50%, var(--pink-soft) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Count-up ready state ---------- */
.counter-num, .fun-stat-num { font-variant-numeric: tabular-nums; }

/* ---------- Safe-area insets (iPhone notch / home indicator) ---------- */
@supports (padding: max(0px)) {
  #main-nav { padding-top: max(18px, env(safe-area-inset-top)); }
  .mini-player { bottom: max(22px, env(safe-area-inset-bottom)); right: max(22px, env(safe-area-inset-right)); }
  .quick-actions { bottom: max(22px, env(safe-area-inset-bottom)); left: max(22px, env(safe-area-inset-left)); }
  .back-to-top { bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px)); }
  .surprise-btn { bottom: max(156px, calc(env(safe-area-inset-bottom) + 156px)); }
}

/* ---------- Touch-action fixes for interactive games ---------- */
.game-field, .puzzle-grid, .wheel-disc, .jar, .ba-slider { touch-action: manipulation; }

/* ---------- Dark mode contrast tweaks ---------- */
:root[data-theme="dark"] .text-faint,
:root[data-theme="dark"] .counter-label,
:root[data-theme="dark"] .fun-stat-label { color: #b391a0; }
:root[data-theme="dark"] .gallery-toggle-btn,
:root[data-theme="dark"] .quiz-option { border-color: rgba(255,255,255,0.16); }

/* ---------- Print stylesheet (for printing a letter) ---------- */
@media print {
  #main-nav, .mini-player, .quick-actions, .back-to-top, .surprise-btn, .scroll-progress,
  #bg-canvas, .aurora, .grain-overlay, .sky-layer, .cursor-dot, .cursor-ring, #cursor-trail-canvas,
  .modal-overlay, .lightbox, .photo-wall-overlay, .toast, .skip-link, footer, .site-footer,
  #preloader, #welcome-overlay { display: none !important; }
  body { background: #fff !important; color: #000 !important; cursor: auto !important; }
  .letter-envelope .envelope-view { display: none !important; }
  .letter-paper { display: block !important; box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; }
  .section { padding: 20px 0 !important; }
}
