/* ═══════════════════════════════════════════════════════
   MINE — Midnight & Gold  (v2 — richer, more alive)
   A private universe for M & D
   ═══════════════════════════════════════════════════════ */

/* ═══ NIGHT MODE (default) ════════════════════════════ */
:root, [data-theme="night"] {
  --bg-primary: #0A0E27;
  --bg-secondary: #1A1F3A;
  --bg-tertiary: #111633;
  --gold: #D4AF37;
  --champagne: #F4E4BC;
  --ivory: #F8F5EE;
  --rose: #C9A0A8;
  --text-primary: #F8F5EE;
  --text-secondary: #F4E4BC;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --gold-glow-strong: rgba(212, 175, 55, 0.35);
  --card-border: rgba(212, 175, 55, 0.12);
  --card-border-hover: rgba(212, 175, 55, 0.35);
  --input-bg: #0A0E27;
  --input-border: rgba(212, 175, 55, 0.15);
  --overlay-bg: rgba(10, 14, 39, 0.92);
  --modal-bg: #1A1F3A;
  --loading-bg: #000;
  --divider-star-bg: var(--bg-primary);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
  --constellation-bg: radial-gradient(ellipse at 30% 40%, #121840 0%, #080c20 70%);
  --map-bg: #0f1535;
  --transition-page: 600ms cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --font-script: 'Dancing Script', cursive;
  --font-ar-heading: 'Amiri', serif;
  --font-ar-body: 'Tajawal', sans-serif;
}

/* ═══ DAY MODE ════════════════════════════════════════ */
[data-theme="day"] {
  --bg-primary: #FFFCF5;
  --bg-secondary: #F5EFE0;
  --bg-tertiary: #FAF6EC;
  --gold: #A07828;
  --champagne: #7A6230;
  --ivory: #352C1E;
  --rose: #A66878;
  --text-primary: #352C1E;
  --text-secondary: #6B5A3E;
  --gold-glow: rgba(160, 120, 40, 0.1);
  --gold-glow-strong: rgba(160, 120, 40, 0.2);
  --card-border: rgba(160, 120, 40, 0.12);
  --card-border-hover: rgba(160, 120, 40, 0.35);
  --input-bg: #FFFFFF;
  --input-border: rgba(160, 120, 40, 0.18);
  --overlay-bg: rgba(255, 252, 245, 0.95);
  --modal-bg: #FFFFFF;
  --loading-bg: #FFFCF5;
  --divider-star-bg: var(--bg-primary);
  --shadow-card: 0 2px 16px rgba(53, 44, 30, 0.06);
  --constellation-bg: linear-gradient(135deg, #EDE5D0 0%, #F5EFE0 50%, #E8DFCA 100%);
  --map-bg: #EDE5D0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg-primary);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { background: var(--bg-primary); min-height: 100vh; overflow-x: hidden; color: var(--text-primary); transition: background 0.6s ease, color 0.6s ease; }

/* RTL */
html[dir="rtl"] { font-family: var(--font-ar-body); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 { font-family: var(--font-ar-heading); }
html[dir="rtl"] .script-font { font-family: var(--font-ar-heading); }

.hidden { display: none !important; }

/* ═══ SCROLL REVEAL ═══════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* ═══ SECTION DIVIDERS ════════════════════════════════ */
.section-divider {
  width: 100%; height: 1px; position: relative;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3; margin: 0;
}
.section-divider::before {
  content: '✦'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--divider-star-bg); padding: 0 16px;
  color: var(--gold); font-size: 14px; opacity: 0.6;
}
.section-alt + .section .section-divider::before,
.section + .section-alt .section-divider::before { background: var(--bg-secondary); }

/* ═══ ATMOSPHERE ══════════════════════════════════════ */
#atmosphere-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ═══ LOADING SCREEN ══════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--loading-bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 800ms ease;
}
.loading-monogram {
  font-family: var(--font-heading);
  font-size: clamp(56px, 10vw, 72px); color: var(--gold);
  opacity: 0;
  animation: loadFadeIn 2s 0.3s ease forwards;
}
.loading-monogram .amp { color: var(--champagne); font-style: italic; }
@keyframes loadFadeIn {
  0% { opacity: 0; transform: scale(0.8); filter: blur(8px); }
  60% { opacity: 1; transform: scale(1.02); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}

/* ═══ ENTRY SCREEN ════════════════════════════════════ */
#entry-screen {
  position: fixed; inset: 0; z-index: 900;
  background: #000; cursor: crosshair;
}
#entry-canvas { display: block; width: 100%; height: 100%; }
#entry-prompt {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading); font-size: clamp(24px, 5vw, 48px);
  color: var(--champagne); letter-spacing: 0.05em;
  opacity: 0; transition: opacity 800ms ease;
  pointer-events: none; text-align: center;
  text-wrap: balance;
}
.skip-entry {
  position: absolute; bottom: 24px; right: 24px;
  color: var(--ivory); opacity: 0; font-size: 13px;
  font-family: var(--font-body);
  background: none; border: 1px solid rgba(248,245,238,0.2);
  padding: 6px 16px; border-radius: 20px; cursor: pointer;
  transition: opacity 0.3s;
}
.skip-entry:focus, .skip-entry:hover { opacity: 0.7; }

/* ═══ IDENTITY MODAL ══════════════════════════════════ */
#identity-modal {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(10, 14, 39, 0.95);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 32px;
  transition: opacity 500ms ease;
}
#identity-modal h2 {
  font-family: var(--font-heading); font-size: clamp(22px, 4vw, 28px);
  color: var(--champagne); letter-spacing: 0.03em;
}
.identity-btn {
  display: block; width: 220px; padding: 16px;
  background: transparent; border: 1px solid var(--gold);
  border-radius: 40px; color: var(--gold);
  font-family: var(--font-heading); font-size: 20px; cursor: pointer;
  transition: all 0.4s ease;
}
.identity-btn:hover {
  background: var(--gold-glow);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: translateY(-2px);
}

/* ═══ TOP CONTROLS ════════════════════════════════════ */
.top-controls {
  position: fixed; top: 16px; right: 16px; z-index: 500;
  display: flex; gap: 10px; align-items: center;
}
html[dir="rtl"] .top-controls { right: auto; left: 16px; }
#lang-toggle, .settings-btn, #push-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(26, 31, 58, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold); font-size: 15px; cursor: pointer;
  transition: all 0.3s; backdrop-filter: blur(8px);
  font-family: var(--font-heading);
}
#lang-toggle:hover, .settings-btn:hover, #push-toggle:hover { background: var(--gold-glow); border-color: var(--gold); }
#push-toggle { font-size: 17px; line-height: 1; }
#push-toggle:disabled { opacity: 0.5; cursor: wait; }

/* ═══ MOON PHASE ══════════════════════════════════════ */
.moon-widget {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; align-items: center; gap: 8px;
  background: rgba(26, 31, 58, 0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 24px; padding: 6px 16px 6px 10px;
  font-size: 12px; color: var(--champagne); opacity: 0.7;
  transition: opacity 0.3s;
}
.moon-widget:hover { opacity: 1; }
.moon-emoji { font-size: 18px; }
.moon-name { font-family: var(--font-heading); letter-spacing: 0.03em; }
.moon-illum { opacity: 0.5; font-size: 11px; }
@media (max-width: 600px) {
  .moon-widget { position: static; transform: none; margin: 12px auto 0; width: fit-content; }
}

/* ═══ MUSIC TOGGLE ════════════════════════════════════ */
#music-toggle {
  position: fixed; bottom: 20px; right: 20px; z-index: 500;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(26, 31, 58, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold); cursor: pointer;
  transition: all 0.3s; backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
html[dir="rtl"] #music-toggle { right: auto; left: 20px; }
#music-toggle:hover { border-color: var(--gold); box-shadow: 0 0 20px var(--gold-glow); }
#music-toggle.playing { border-color: var(--gold); background: var(--gold-glow); }
#music-toggle .bar {
  display: inline-block; width: 2.5px; height: 10px;
  background: var(--gold); margin: 0 1.5px; border-radius: 2px;
  animation: none;
}
#music-toggle.playing .bar { animation: musicBars 0.8s ease infinite alternate; }
#music-toggle .bar:nth-child(2) { animation-delay: 0.15s; }
#music-toggle .bar:nth-child(3) { animation-delay: 0.3s; }
#music-toggle .bar:nth-child(4) { animation-delay: 0.45s; }
@keyframes musicBars { 0% { height: 4px; } 100% { height: 16px; } }

/* ═══ SECTION BASE ════════════════════════════════════ */
.section {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 100px 24px;
}
.section-alt { background: var(--bg-secondary); }
.section-deep { background: var(--bg-tertiary); }
.section h2 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 5vw, 48px);
  color: var(--champagne); text-align: center;
  margin-bottom: 12px; letter-spacing: 0.02em;
}
.section-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(14px, 2vw, 18px);
  color: var(--ivory); opacity: 0.5;
  text-align: center; font-style: italic;
  margin-bottom: 48px;
}
/* Sections without a subtitle need more h2 bottom space */
.section h2:last-of-type { margin-bottom: 40px; }
.section h2 + .section-subtitle { margin-top: 0; }
.section h2 + .section-subtitle ~ * { /* subtitle present — h2 margin is fine small */ }

/* ═══ HERO ════════════════════════════════════════════ */
#hero { min-height: 100vh; justify-content: center; position: relative; overflow: hidden; }
#hero-constellation {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-monogram {
  font-family: var(--font-heading);
  font-size: clamp(64px, 14vw, 160px);
  color: var(--gold); line-height: 1; margin-bottom: 20px;
  text-shadow: 0 0 80px var(--gold-glow-strong), 0 0 160px rgba(212,175,55,0.1);
  animation: heroGlow 4s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0% { text-shadow: 0 0 60px var(--gold-glow-strong), 0 0 120px rgba(212,175,55,0.08); }
  100% { text-shadow: 0 0 100px var(--gold-glow-strong), 0 0 200px rgba(212,175,55,0.15); }
}
.hero-monogram .amp {
  color: var(--champagne); font-style: italic;
  font-size: 0.65em; margin: 0 0.05em;
  display: inline-block;
  animation: ampFloat 6s ease-in-out infinite;
}
@keyframes ampFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(16px, 2.8vw, 26px);
  color: var(--ivory); opacity: 0.7;
  text-align: center; font-style: italic;
}
.scroll-arrow {
  position: absolute; bottom: 36px;
  left: 50%; transform: translateX(-50%);
  animation: bobArrow 2.5s ease-in-out infinite;
  color: var(--gold); opacity: 0.5; font-size: 26px;
}
@keyframes bobArrow {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(14px); opacity: 0.8; }
}

/* ═══ FLIP CLOCK ══════════════════════════════════════ */
#counter-section { cursor: pointer; }
#flip-clock {
  display: flex; gap: clamp(10px, 3vw, 28px);
  align-items: center; flex-wrap: wrap; justify-content: center;
}
.flip-unit { text-align: center; }
.flip-card {
  position: relative;
  width: clamp(65px, 16vw, 120px);
  height: clamp(75px, 18vw, 130px);
  perspective: 600px;
}
.flip-inner {
  width: 100%; height: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 40px rgba(212,175,55,0.05), inset 0 1px 0 rgba(212,175,55,0.08);
}
.flip-value {
  font-family: var(--font-heading);
  font-size: clamp(28px, 7vw, 56px);
  color: var(--gold); font-weight: 300;
}
.flip-label {
  font-family: var(--font-body);
  font-size: clamp(10px, 1.4vw, 13px);
  color: var(--champagne); opacity: 0.6;
  margin-top: 10px; text-transform: uppercase;
  letter-spacing: 0.15em;
}
.flip-card.flipping .flip-inner { animation: flipTick 0.5s ease-in-out; }
@keyframes flipTick {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(-12deg) scale(1.03); }
  100% { transform: rotateX(0); }
}
.counter-caption {
  margin-top: 40px; font-family: var(--font-heading);
  font-size: clamp(15px, 2.5vw, 22px);
  color: var(--ivory); opacity: 0.6; font-style: italic;
}
.confetti-particle {
  position: fixed; pointer-events: none; z-index: 9999;
  width: var(--size); height: var(--size); border-radius: 50%;
  animation: confettiBurst var(--duration) ease-out forwards;
}
@keyframes confettiBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(calc(cos(var(--angle)) * var(--distance)), calc(sin(var(--angle)) * var(--distance) - 80px)) scale(0); opacity: 0; }
}

/* ═══ CONSTELLATION ═══════════════════════════════════ */
#constellation-sky {
  position: relative; width: 100%;
  height: clamp(350px, 65vh, 650px);
  border-radius: 16px; overflow: hidden;
  background: var(--constellation-bg);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 0 80px rgba(0,0,0,0.5);
}
.constellation-stars { position: absolute; inset: 0; }
.constellation-star {
  position: absolute; width: 12px; height: 12px;
  background: var(--gold); border-radius: 50%; border: none; cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--gold), 0 0 25px var(--gold-glow);
  animation: twinkleStar 3s ease-in-out infinite;
  transition: transform 0.3s, box-shadow 0.3s;
}
.constellation-star:hover {
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 20px var(--gold), 0 0 50px var(--gold-glow-strong);
}
@keyframes twinkleStar { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.constellation-add {
  position: absolute; bottom: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold-glow); border: 1px solid var(--gold);
  color: var(--gold); font-size: 22px; cursor: pointer;
  transition: all 0.3s;
}
html[dir="rtl"] .constellation-add { right: auto; left: 14px; }
.constellation-add:hover { background: var(--gold); color: var(--bg-primary); }
.memory-popup {
  position: absolute; z-index: 10;
  background: var(--modal-bg);
  border: 1px solid var(--card-border-hover);
  border-radius: 12px; padding: 20px; max-width: 260px;
  transform: translate(-50%, -100%) translateY(-10px);
  opacity: 0; transition: all 0.3s ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.memory-popup.visible { opacity: 1; transform: translate(-50%, -100%) translateY(-16px); }
.memory-popup h4 { font-family: var(--font-heading); color: var(--gold); font-size: 17px; margin-bottom: 8px; }
.memory-popup p { font-size: 13px; color: var(--ivory); opacity: 0.8; line-height: 1.5; }
.memory-close { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--champagne); cursor: pointer; font-size: 14px; opacity: 0.4; }
.memory-close:hover { opacity: 1; }

/* ═══ REASONS ═════════════════════════════════════════ */
#reason-btn {
  padding: 16px 44px; border-radius: 40px;
  background: transparent; border: 1.5px solid var(--gold);
  color: var(--gold); font-family: var(--font-heading);
  font-size: clamp(16px, 2.8vw, 22px); cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 0 20px var(--gold-glow);
}
#reason-btn:hover {
  background: var(--gold-glow); box-shadow: 0 0 40px var(--gold-glow-strong);
  transform: translateY(-2px);
}
#reason-display {
  font-family: var(--font-heading); font-size: clamp(18px, 3.5vw, 30px);
  color: var(--ivory); text-align: center; max-width: 550px;
  margin: 36px auto 16px; min-height: 70px;
  display: flex; align-items: center; justify-content: center;
  font-style: italic; transition: opacity 0.3s, transform 0.3s;
}
#reason-counter { font-size: 13px; color: var(--champagne); opacity: 0.4; text-align: center; margin-bottom: 14px; }
.add-reason-link {
  background: none; border: none; color: var(--gold); font-size: 12px;
  cursor: pointer; opacity: 0.4; text-decoration: underline; transition: opacity 0.3s;
}
.add-reason-link:hover { opacity: 1; }
.floating-heart { position: fixed; pointer-events: none; z-index: 999; color: var(--rose); font-size: 18px; animation: floatUp 1.2s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-80px) scale(0.5); } }

/* ═══ OUR STORY (TIMELINE) ════════════════════════════ */
.timeline { position: relative; max-width: 600px; width: 100%; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 1px; background: linear-gradient(180deg, var(--gold), transparent);
}
html[dir="rtl"] .timeline { padding-left: 0; padding-right: 32px; }
html[dir="rtl"] .timeline::before { left: auto; right: 8px; }
.timeline-item { position: relative; margin-bottom: 40px; }
.timeline-dot {
  position: absolute; left: -28px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}
html[dir="rtl"] .timeline-dot { left: auto; right: -28px; }
.timeline-date {
  font-family: var(--font-body); font-size: 12px;
  color: var(--gold); opacity: 0.7; margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.timeline-title {
  font-family: var(--font-heading); font-size: 20px;
  color: var(--champagne); margin-bottom: 6px;
}
.timeline-story { font-size: 14px; color: var(--ivory); opacity: 0.7; line-height: 1.6; }
.timeline-add {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px dashed rgba(212,175,55,0.2);
  color: var(--gold); opacity: 0.4; padding: 10px 20px;
  border-radius: 10px; cursor: pointer; font-size: 13px;
  transition: all 0.3s; margin-top: 8px;
}
.timeline-add:hover { opacity: 1; background: var(--gold-glow); }

/* ═══ MAP ═════════════════════════════════════════════ */
.map-filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.map-filter-btn {
  padding: 7px 20px; border-radius: 20px;
  background: transparent; border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--champagne); font-size: 13px; cursor: pointer; transition: all 0.3s;
}
.map-filter-btn.active, .map-filter-btn:hover { background: var(--gold-glow); border-color: var(--gold); color: var(--gold); }
.map-container {
  position: relative; width: 100%; max-width: 850px;
  aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 0 4px 40px rgba(0,0,0,0.3);
}
.map-svg { width: 100%; height: 100%; opacity: 0.45; }
#map-pins { position: absolute; inset: 0; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--gold); cursor: pointer;
  transition: all 0.3s; background: var(--gold);
}
.map-pin.dream { background: var(--rose); border-color: var(--rose); animation: pulseDream 2s ease-in-out infinite; }
@keyframes pulseDream { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 160, 168, 0.4); } 50% { box-shadow: 0 0 0 8px rgba(201, 160, 168, 0); } }
.map-pin-label {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); white-space: nowrap; font-size: 11px;
  color: var(--champagne); background: rgba(10, 14, 39, 0.9);
  padding: 3px 8px; border-radius: 6px;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.map-pin:hover .map-pin-label { opacity: 1; }
.map-pin:hover { transform: translate(-50%, -50%) scale(1.4); }
#map-counter { margin-top: 16px; font-size: 13px; color: var(--champagne); opacity: 0.5; }
.map-add-btn {
  position: absolute; bottom: 14px; right: 14px;
  background: var(--gold-glow); border: 1px solid var(--gold);
  color: var(--gold); width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; cursor: pointer; transition: all 0.3s;
}
.map-add-btn:hover { background: var(--gold); color: var(--bg-primary); }

/* ═══ DREAMS ══════════════════════════════════════════ */
.dreams-progress { width: 100%; max-width: 450px; height: 5px; background: rgba(212, 175, 55, 0.12); border-radius: 3px; margin-bottom: 10px; overflow: hidden; }
.dreams-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--champagne)); border-radius: 3px; transition: width 0.6s ease; }
#dreams-progress-text { font-size: 12px; color: var(--champagne); opacity: 0.5; margin-bottom: 28px; }
#dreams-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; width: 100%; max-width: 850px;
}
.dream-card {
  background: var(--bg-primary); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 18px; transition: all 0.4s ease;
}
.dream-card:hover { border-color: var(--card-border-hover); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.dream-card.completed {
  background: linear-gradient(135deg, var(--bg-primary), rgba(212, 175, 55, 0.06));
  border-color: rgba(212, 175, 55, 0.25);
}
.dream-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ivory); }
.dream-check input { display: none; }
.dream-checkmark {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 1.5px solid var(--gold); border-radius: 50%;
  position: relative; transition: all 0.3s; margin-top: 1px;
}
.dream-check input:checked + .dream-checkmark { background: var(--gold); }
.dream-check input:checked + .dream-checkmark::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg-primary); font-size: 12px; font-weight: 700;
}
.dream-date { display: block; font-size: 11px; color: var(--champagne); opacity: 0.4; margin-top: 6px; }
.dream-add {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; border-style: dashed;
  color: var(--gold); opacity: 0.4;
  background: transparent; font-family: var(--font-body);
  font-size: 13px; min-height: 90px; transition: all 0.3s;
}
.dream-add:hover { opacity: 1; background: var(--gold-glow); }
.dream-add-icon { font-size: 24px; }
.dream-card.sparkle-burst { animation: sparkle 0.5s ease; }
@keyframes sparkle { 0%, 100% { box-shadow: 0 0 0 rgba(212,175,55,0); } 50% { box-shadow: 0 0 30px var(--gold-glow-strong); } }

/* ═══ LOVE LETTERS ════════════════════════════════════ */
.letters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; width: 100%; max-width: 850px;
}
.letter-card {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 14px; padding: 28px; position: relative;
  transition: all 0.4s; cursor: pointer;
  min-height: 180px; display: flex; flex-direction: column;
}
.letter-card:hover { border-color: var(--card-border-hover); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.letter-card::before {
  content: '✉'; position: absolute; top: 14px; right: 14px;
  font-size: 14px; opacity: 0.2;
}
.letter-title {
  font-family: var(--font-heading); font-size: 19px;
  color: var(--gold); margin-bottom: 12px;
}
.letter-preview {
  font-size: 14px; color: var(--ivory); opacity: 0.7;
  line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.letter-from {
  font-family: var(--font-script); font-size: 14px;
  color: var(--champagne); opacity: 0.6; margin-top: 14px;
}
.letter-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; border: 1px dashed rgba(212,175,55,0.2);
  border-radius: 14px; color: var(--gold); opacity: 0.4;
  background: transparent; font-size: 13px; min-height: 180px; transition: all 0.3s;
}
.letter-add:hover { opacity: 1; background: var(--gold-glow); }

/* ═══ PLAYLIST ════════════════════════════════════════ */
.playlist-list {
  width: 100%; max-width: 550px;
  display: flex; flex-direction: column; gap: 8px;
}
.playlist-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  transition: all 0.3s;
}
.playlist-item:hover { border-color: var(--card-border-hover); background: var(--bg-tertiary); }
.playlist-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gold-glow); border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 15px; flex-shrink: 0;
}
.playlist-info { flex: 1; min-width: 0; }
.playlist-title-text { font-size: 15px; color: var(--ivory); font-weight: 500; }
.playlist-artist { font-size: 12px; color: var(--champagne); opacity: 0.5; }
.playlist-note { font-size: 12px; color: var(--ivory); opacity: 0.4; font-style: italic; margin-top: 2px; }
.playlist-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 12px; border: 1px dashed rgba(212,175,55,0.2);
  color: var(--gold); opacity: 0.4; cursor: pointer; font-size: 13px;
  background: transparent; transition: all 0.3s; width: 100%;
}
.playlist-add:hover { opacity: 1; background: var(--gold-glow); }

/* ═══ INSIDE JOKES ════════════════════════════════════ */
.jokes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; width: 100%; max-width: 750px;
}
.joke-card {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 12px; padding: 20px;
  font-size: 15px; color: var(--ivory);
  line-height: 1.5; transition: all 0.3s;
  position: relative;
}
.joke-card:hover { border-color: var(--card-border-hover); transform: translateY(-2px); }
.joke-card::before {
  content: '😂'; position: absolute; top: -10px; right: 12px;
  font-size: 18px; opacity: 0.6;
}
.joke-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; border: 1px dashed rgba(212,175,55,0.2);
  border-radius: 12px; color: var(--gold); opacity: 0.4;
  background: transparent; font-size: 13px; min-height: 80px; transition: all 0.3s;
}
.joke-add:hover { opacity: 1; background: var(--gold-glow); }

/* ═══ VOICE NOTES ═════════════════════════════════════ */
#voice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px; width: 100%; max-width: 650px;
}
.voice-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px; background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 14px; transition: all 0.3s;
}
.voice-card:hover { border-color: var(--card-border-hover); }
.voice-play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--gold); background: transparent;
  color: var(--gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.3s;
}
.voice-play-btn:hover { background: var(--gold-glow); box-shadow: 0 0 20px var(--gold-glow); }
.voice-play-btn.playing { background: var(--gold); color: var(--bg-primary); }
.voice-title { font-size: 12px; color: var(--champagne); text-align: center; }
.record-btn {
  padding: 12px 28px; border-radius: 30px;
  background: transparent; border: 1.5px solid var(--gold);
  color: var(--gold); font-family: var(--font-heading);
  font-size: 17px; cursor: pointer; margin-bottom: 28px; transition: all 0.3s;
}
.record-btn:hover { background: var(--gold-glow); box-shadow: 0 0 30px var(--gold-glow); }

/* ═══ PHOTOS ══════════════════════════════════════════ */
#photo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px; width: 100%; max-width: 850px;
}
.photo-item {
  position: relative; border-radius: 10px;
  overflow: hidden; cursor: pointer; aspect-ratio: 1;
  background: var(--bg-secondary);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.photo-item:hover img { transform: scale(1.05); }
.photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(10, 14, 39, 0.8));
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: flex-end; padding: 10px;
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-caption { font-size: 12px; color: var(--champagne); }
.empty-state { text-align: center; color: var(--champagne); opacity: 0.35; font-style: italic; grid-column: 1 / -1; padding: 40px; font-size: 14px; }
.upload-btn {
  padding: 9px 22px; border-radius: 24px;
  background: transparent; border: 1px solid var(--gold);
  color: var(--gold); font-size: 13px; cursor: pointer;
  margin-bottom: 22px; transition: all 0.3s;
}
.upload-btn:hover { background: var(--gold-glow); }

/* ═══ LIGHTBOX ════════════════════════════════════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}
.lightbox-img { max-width: 88vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.lightbox-caption { color: var(--champagne); font-size: 14px; }
.lb-prev, .lb-next, .lb-close {
  position: absolute; background: none; border: none;
  color: var(--ivory); font-size: 30px; cursor: pointer; opacity: 0.4; transition: opacity 0.3s;
}
.lb-prev:hover, .lb-next:hover, .lb-close:hover { opacity: 1; }
.lb-prev { left: 16px; top: 50%; } .lb-next { right: 16px; top: 50%; } .lb-close { top: 16px; right: 16px; }

/* ═══ DAILY QUESTION ══════════════════════════════════ */
.question-text {
  font-family: var(--font-heading);
  font-size: clamp(18px, 3.5vw, 30px);
  color: var(--champagne); text-align: center;
  max-width: 550px; margin-bottom: 36px;
  font-style: italic; text-wrap: balance;
}
.answers-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; max-width: 550px; }
@media (max-width: 500px) { .answers-row { grid-template-columns: 1fr; } }
.answer-box label { display: block; font-size: 12px; color: var(--gold); margin-bottom: 6px; font-family: var(--font-heading); }
.answer-box textarea {
  width: 100%; min-height: 90px; padding: 12px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 10px; color: var(--ivory);
  font-family: var(--font-body); font-size: 14px;
  resize: vertical; transition: border-color 0.3s;
}
.answer-box textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 15px var(--gold-glow); }
.answer-box textarea:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══ FUTURE ══════════════════════════════════════════ */
.future-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 850px; }
@media (max-width: 700px) { .future-columns { grid-template-columns: 1fr; } }
.future-col {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 14px; padding: 22px; min-height: 260px;
  transition: border-color 0.3s;
}
.future-col.drag-over { border-color: var(--gold); background: var(--gold-glow); }
.future-col h3 {
  font-family: var(--font-heading); font-size: 18px;
  color: var(--gold); text-align: center; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}
.future-cards { display: flex; flex-direction: column; gap: 8px; }
.future-card {
  padding: 12px; border-radius: 10px; background: var(--bg-primary);
  border: 1px solid var(--card-border);
  color: var(--text-primary); font-size: 13px; cursor: grab; transition: all 0.3s;
}
.future-card:hover { border-color: var(--card-border-hover); transform: translateY(-1px); }
.future-card.dragging { opacity: 0.4; }
.future-add {
  width: 100%; padding: 8px; margin-top: 10px;
  background: transparent; border: 1px dashed rgba(212, 175, 55, 0.15);
  border-radius: 10px; color: var(--gold); opacity: 0.35;
  cursor: pointer; font-size: 18px; transition: all 0.3s;
}
.future-add:hover { opacity: 1; background: var(--gold-glow); }

/* ═══ FOOTER ══════════════════════════════════════════ */
#footer { min-height: auto; padding: 80px 24px 36px; }
.closing-text {
  font-family: var(--font-script);
  font-size: clamp(20px, 4vw, 34px);
  color: var(--gold); text-align: center;
  text-wrap: balance; line-height: 1.5;
}
.closing-heart {
  color: var(--rose); font-size: 18px;
  margin-top: 20px; display: block; text-align: center;
  animation: pulseHeart 2s ease-in-out infinite;
}
@keyframes pulseHeart { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.2); opacity: 1; } }
.made-with-love { margin-top: 28px; font-size: 12px; color: var(--ivory); opacity: 0.25; text-align: center; }

/* ═══ MODALS ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: var(--overlay-bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.4s ease;
  backdrop-filter: blur(6px);
}
.modal-overlay.visible { opacity: 1; }
.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 28px;
  max-width: 400px; width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 85vh; overflow-y: auto;
}
.modal-box h3 { font-family: var(--font-heading); font-size: 20px; color: var(--gold); margin-bottom: 20px; }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 11px; color: var(--champagne); opacity: 0.6; margin-bottom: 5px; }
.modal-field input, .modal-field textarea {
  width: 100%; padding: 10px 12px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
}
.modal-field textarea { min-height: 70px; resize: vertical; }
.modal-field input:focus, .modal-field textarea:focus { outline: none; border-color: var(--gold); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-btn { padding: 9px 22px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all 0.3s; }
.modal-btn-primary { background: var(--gold); border: none; color: var(--bg-primary); font-weight: 600; }
.modal-btn-primary:hover { box-shadow: 0 0 20px var(--gold-glow); }
.modal-btn-secondary { background: transparent; border: 1px solid rgba(248, 245, 238, 0.2); color: var(--ivory); }
.modal-btn-secondary:hover { border-color: var(--ivory); }
.modal-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--champagne); font-size: 18px; cursor: pointer; opacity: 0.4; }
.modal-close:hover { opacity: 1; }
.modal-radio-group { display: flex; gap: 12px; margin-bottom: 14px; }
.modal-radio-group label { display: flex; align-items: center; gap: 6px; color: var(--text-primary); font-size: 13px; cursor: pointer; }
.modal-radio-group input[type="radio"] { accent-color: var(--gold); }

/* ═══ EASTER EGG ══════════════════════════════════════ */
@keyframes heartBurst {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  20% { opacity: 1; transform: scale(1.2) rotate(10deg); }
  100% { opacity: 0; transform: scale(0.5) translateY(-200px) rotate(30deg); }
}

/* ═══ DAY MODE OVERRIDES ══════════════════════════════ */
[data-theme="day"] #loading-screen { background: #FFFCF5; }
[data-theme="day"] .loading-monogram { color: #A07828; }
[data-theme="day"] .loading-monogram .amp { color: #7A6230; }

[data-theme="day"] #entry-screen { background: #FFFCF5; }
[data-theme="day"] #entry-prompt { color: #6B5A3E; }

[data-theme="day"] #identity-modal { background: rgba(255, 252, 245, 0.97); }
[data-theme="day"] #identity-modal h2 { color: #6B5A3E; }
[data-theme="day"] .identity-btn { border-color: #A07828; color: #A07828; }
[data-theme="day"] .identity-btn:hover { background: rgba(160,120,40,0.08); box-shadow: 0 0 24px rgba(160,120,40,0.12); }

[data-theme="day"] .hero-monogram {
  color: #A07828;
  text-shadow: 0 2px 40px rgba(160,120,40,0.15), 0 0 80px rgba(160,120,40,0.08);
}
[data-theme="day"] .hero-monogram .amp { color: #7A6230; }
[data-theme="day"] .hero-tagline { color: #6B5A3E; }
[data-theme="day"] .scroll-arrow { color: #A07828; }

[data-theme="day"] .flip-inner {
  background: #FFFFFF;
  border-color: rgba(160,120,40,0.12);
  box-shadow: 0 2px 16px rgba(53,44,30,0.06), 0 0 0 1px rgba(160,120,40,0.04);
}
[data-theme="day"] .flip-value { color: #A07828; }
[data-theme="day"] .flip-label { color: #7A6230; }
[data-theme="day"] .counter-caption { color: #6B5A3E; }

[data-theme="day"] .timeline::before { background: linear-gradient(180deg, #A07828, rgba(160,120,40,0.1)); }
[data-theme="day"] .timeline-dot { background: #A07828; box-shadow: 0 0 8px rgba(160,120,40,0.3); }
[data-theme="day"] .timeline-date { color: #A07828; }
[data-theme="day"] .timeline-title { color: #352C1E; }
[data-theme="day"] .timeline-story { color: #6B5A3E; }

[data-theme="day"] #constellation-sky {
  box-shadow: inset 0 0 80px rgba(53,44,30,0.04), 0 2px 20px rgba(53,44,30,0.06);
}
[data-theme="day"] .constellation-star {
  background: #C4982E;
  box-shadow: 0 0 10px rgba(196,152,46,0.5), 0 0 24px rgba(196,152,46,0.2);
}
[data-theme="day"] .constellation-star:hover {
  box-shadow: 0 0 18px rgba(196,152,46,0.6), 0 0 40px rgba(196,152,46,0.3);
}

[data-theme="day"] .memory-popup { background: #FFFFFF; box-shadow: 0 8px 32px rgba(53,44,30,0.1); }
[data-theme="day"] .memory-popup h4 { color: #A07828; }
[data-theme="day"] .memory-popup p { color: #6B5A3E; }

[data-theme="day"] #reason-btn {
  border-color: #A07828; color: #A07828;
  box-shadow: 0 0 16px rgba(160,120,40,0.1);
}
[data-theme="day"] #reason-btn:hover {
  background: rgba(160,120,40,0.06);
  box-shadow: 0 0 32px rgba(160,120,40,0.15);
}
[data-theme="day"] #reason-display { color: #352C1E; }
[data-theme="day"] #reason-counter { color: #7A6230; }
[data-theme="day"] .add-reason-link { color: #A07828; }

[data-theme="day"] .letter-card { background: #FFFFFF; }
[data-theme="day"] .letter-card::before { opacity: 0.15; }
[data-theme="day"] .letter-title { color: #A07828; }
[data-theme="day"] .letter-preview { color: #6B5A3E; }
[data-theme="day"] .letter-from { color: #A07828; }
[data-theme="day"] .letter-card:hover { box-shadow: 0 8px 28px rgba(53,44,30,0.08); }

[data-theme="day"] .map-container { box-shadow: 0 4px 24px rgba(53,44,30,0.06); }
[data-theme="day"] .map-svg { opacity: 0.5; }
[data-theme="day"] .map-svg rect { fill: #EDE5D0; }
[data-theme="day"] .map-svg g[stroke] { stroke: rgba(160,120,40,0.35); }
[data-theme="day"] .map-pin { background: #A07828; border-color: #A07828; }
[data-theme="day"] .map-pin.dream { background: #A66878; border-color: #A66878; }
[data-theme="day"] .map-pin-label { background: rgba(255,252,245,0.92); color: #6B5A3E; }
[data-theme="day"] #map-counter { color: #7A6230; }

[data-theme="day"] .dream-card { background: #FFFFFF; }
[data-theme="day"] .dream-card:hover { box-shadow: 0 4px 16px rgba(53,44,30,0.06); }
[data-theme="day"] .dream-card.completed {
  background: linear-gradient(135deg, #FFFFFF, rgba(160,120,40,0.04));
}
[data-theme="day"] .dream-check { color: #352C1E; }
[data-theme="day"] .dream-checkmark { border-color: #A07828; }
[data-theme="day"] .dream-check input:checked + .dream-checkmark { background: #A07828; }
[data-theme="day"] .dream-date { color: #7A6230; }

[data-theme="day"] .playlist-item { background: #FFFFFF; }
[data-theme="day"] .playlist-item:hover { background: #FAF6EC; }
[data-theme="day"] .playlist-title-text { color: #352C1E; }
[data-theme="day"] .playlist-note { color: #A07828; font-style: italic; }
[data-theme="day"] .playlist-artist { color: #7A6230; }
[data-theme="day"] .playlist-icon { background: rgba(160,120,40,0.08); border-color: rgba(160,120,40,0.15); color: #A07828; }

[data-theme="day"] .voice-card { background: #FFFFFF; }
[data-theme="day"] .voice-play-btn { border-color: #A07828; color: #A07828; }
[data-theme="day"] .voice-play-btn:hover { background: rgba(160,120,40,0.06); box-shadow: 0 0 16px rgba(160,120,40,0.1); }
[data-theme="day"] .voice-play-btn.playing { background: #A07828; color: #FFFCF5; }
[data-theme="day"] .voice-title { color: #7A6230; }
[data-theme="day"] .record-btn { border-color: #A07828; color: #A07828; }
[data-theme="day"] .record-btn:hover { background: rgba(160,120,40,0.06); }

[data-theme="day"] .photo-item { background: #F5EFE0; }
[data-theme="day"] .photo-overlay { background: linear-gradient(transparent 40%, rgba(255,252,245,0.9)); }
[data-theme="day"] .photo-caption { color: #6B5A3E; }
[data-theme="day"] .empty-state { color: #7A6230; }

[data-theme="day"] .joke-card { background: #FFFFFF; color: #352C1E; }
[data-theme="day"] .joke-card:hover { box-shadow: 0 4px 16px rgba(53,44,30,0.06); }

[data-theme="day"] .question-text { color: #352C1E; }
[data-theme="day"] .answer-box label { color: #A07828; }
[data-theme="day"] .answer-box textarea { background: #FFFFFF; border-color: rgba(160,120,40,0.15); color: #352C1E; }
[data-theme="day"] .answer-box textarea:focus { border-color: #A07828; box-shadow: 0 0 12px rgba(160,120,40,0.12); }
[data-theme="day"] .answer-box textarea:disabled { opacity: 0.35; }

[data-theme="day"] .future-col { background: #FFFFFF; }
[data-theme="day"] .future-col h3 { color: #A07828; border-bottom-color: rgba(160,120,40,0.1); }
[data-theme="day"] .future-card { background: #FAF6EC; color: #352C1E; }
[data-theme="day"] .future-card:hover { box-shadow: 0 2px 10px rgba(53,44,30,0.06); }
[data-theme="day"] .future-col.drag-over { background: rgba(160,120,40,0.06); }

[data-theme="day"] .closing-text { color: #A07828; }
[data-theme="day"] .closing-heart { color: #A66878; }
[data-theme="day"] .made-with-love { color: #7A6230; }

[data-theme="day"] .modal-box { background: #FFFFFF; box-shadow: 0 16px 56px rgba(53,44,30,0.1); }
[data-theme="day"] .modal-box h3 { color: #A07828; }
[data-theme="day"] .modal-field label { color: #7A6230; }
[data-theme="day"] .modal-field input, [data-theme="day"] .modal-field textarea {
  background: #FFFCF5; border-color: rgba(160,120,40,0.15); color: #352C1E;
}
[data-theme="day"] .modal-field input:focus, [data-theme="day"] .modal-field textarea:focus { border-color: #A07828; }
[data-theme="day"] .modal-btn-primary { background: #A07828; color: #FFFCF5; }
[data-theme="day"] .modal-btn-secondary { border-color: rgba(53,44,30,0.15); color: #6B5A3E; }
[data-theme="day"] .modal-close { color: #7A6230; }

[data-theme="day"] #lang-toggle, [data-theme="day"] .settings-btn, [data-theme="day"] #theme-toggle, [data-theme="day"] #push-toggle {
  background: rgba(255,255,255,0.85); border-color: rgba(160,120,40,0.2); color: #A07828;
  box-shadow: 0 1px 8px rgba(53,44,30,0.06);
}
[data-theme="day"] #lang-toggle:hover, [data-theme="day"] .settings-btn:hover, [data-theme="day"] #theme-toggle:hover, [data-theme="day"] #push-toggle:hover {
  background: rgba(255,255,255,1); border-color: rgba(160,120,40,0.35);
}
[data-theme="day"] #music-toggle {
  background: rgba(255,255,255,0.85); border-color: rgba(160,120,40,0.2);
  box-shadow: 0 1px 8px rgba(53,44,30,0.06);
}
[data-theme="day"] #music-toggle .bar { background: #A07828; }
[data-theme="day"] #music-toggle.playing { background: rgba(160,120,40,0.08); }

[data-theme="day"] .moon-widget {
  background: rgba(255,255,255,0.75); border-color: rgba(160,120,40,0.12);
  color: #6B5A3E; box-shadow: 0 1px 6px rgba(53,44,30,0.05);
}

[data-theme="day"] .section-divider { background: linear-gradient(90deg, transparent, rgba(160,120,40,0.35), transparent); }
[data-theme="day"] .section-divider::before { background: var(--bg-primary); color: #A07828; }

[data-theme="day"] .floating-heart { color: #A66878; }

[data-theme="day"] #lightbox { background: rgba(255,252,245,0.97); }
[data-theme="day"] .lb-prev, [data-theme="day"] .lb-next, [data-theme="day"] .lb-close { color: #6B5A3E; }
[data-theme="day"] .lightbox-caption { color: #6B5A3E; }

[data-theme="day"] .parallax-orb {
  background: radial-gradient(circle, rgba(160,120,40,0.04) 0%, transparent 70%);
}

/* Theme toggle button */
#theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(26, 31, 58, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold); font-size: 17px; cursor: pointer;
  transition: all 0.3s; backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
#theme-toggle:hover { background: var(--gold-glow); border-color: var(--gold); }

/* ═══ NOTIFICATION SENDER ═════════════════════════════ */
.notif-sender {
  width: 100%; max-width: 500px;
  display: flex; flex-direction: column; gap: 16px;
}
.notif-form {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 14px; padding: 24px;
  box-shadow: var(--shadow-card);
}
.notif-field label {
  display: block; font-size: 12px; color: var(--gold);
  font-family: var(--font-heading); margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.notif-field input, .notif-field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.3s;
}
.notif-field textarea { min-height: 80px; resize: vertical; }
.notif-field input:focus, .notif-field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow);
}
.notif-image-preview {
  width: 100%; max-height: 160px; object-fit: cover;
  border-radius: 8px; margin-top: 8px; display: none;
  border: 1px solid var(--card-border);
}
.notif-image-preview.visible { display: block; }
.notif-file-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  background: transparent; border: 1px dashed var(--card-border);
  color: var(--gold); font-size: 13px; cursor: pointer;
  transition: all 0.3s; margin-top: 4px;
}
.notif-file-label:hover { border-color: var(--gold); background: var(--gold-glow); }
.notif-file-label input { display: none; }
.notif-send-btn {
  padding: 14px 32px; border-radius: 30px;
  background: var(--gold); border: none;
  color: var(--bg-primary); font-family: var(--font-heading);
  font-size: 18px; font-weight: 600; cursor: pointer;
  transition: all 0.4s; align-self: center;
  box-shadow: 0 2px 16px var(--gold-glow);
}
.notif-send-btn:hover {
  box-shadow: 0 4px 28px var(--gold-glow-strong);
  transform: translateY(-2px);
}
.notif-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.notif-send-btn.sent {
  background: var(--rose); box-shadow: 0 2px 16px rgba(201,160,168,0.3);
}
.notif-history { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.notif-history-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: 10px;
  background: var(--bg-primary); border: 1px solid var(--card-border);
  transition: all 0.3s;
}
.notif-history-item:hover { border-color: var(--card-border-hover); }
.notif-history-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; background: var(--bg-secondary);
}
.notif-history-content { flex: 1; min-width: 0; }
.notif-history-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.notif-history-body { font-size: 13px; color: var(--text-secondary); opacity: 0.75; }
.notif-history-time { font-size: 11px; color: var(--gold); opacity: 0.5; margin-top: 4px; }
.notif-history-empty { text-align: center; font-size: 13px; color: var(--text-secondary); opacity: 0.4; font-style: italic; padding: 20px; }

[data-theme="day"] .notif-form { background: #FFFFFF; }
[data-theme="day"] .notif-send-btn { color: #FFFCF5; }
[data-theme="day"] .notif-history-item { background: #FFFFFF; }

/* Smooth theme transition on everything */
html[data-theme] *, html[data-theme] *::before, html[data-theme] *::after {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* ═══ PARALLAX LAYERS ═════════════════════════════════ */
.parallax-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
  /* `filter: blur()` is a GPU killer when combined with transform: translateY()
     on scroll — it forces the browser to re-blur every frame. Switched to a
     smaller blur AND promoted to its own compositor layer via will-change so
     the blurred result is cached and only the transform needs re-compositing. */
  filter: blur(20px);
  will-change: transform;
  transform: translateZ(0);
}

/* ═══ MOBILE — TABLET ═════════════════════════════════ */
@media (max-width: 768px) {
  .section { padding: 60px 18px; min-height: auto; }
  .section h2 { font-size: 26px; margin-bottom: 8px; }
  .section-subtitle { font-size: 14px; margin-bottom: 32px; }

  /* Hero */
  .hero-monogram { font-size: 72px; }
  .hero-tagline { font-size: 16px; }
  #hero { min-height: 100svh; }

  /* Moon */
  .moon-widget { position: static; transform: none; margin: 12px auto 0; }

  /* Counter */
  #flip-clock { gap: 10px; }
  .flip-card { width: 65px; height: 75px; }
  .flip-value { font-size: 28px; }
  .flip-label { font-size: 10px; margin-top: 6px; }
  .counter-caption { font-size: 15px; margin-top: 28px; }

  /* Constellation */
  #constellation-sky { height: 50vh; min-height: 300px; }

  /* Reasons */
  #reason-btn { padding: 14px 36px; font-size: 17px; }
  #reason-display { font-size: 20px; min-height: 60px; margin: 28px auto 12px; }

  /* Timeline */
  .timeline { padding-left: 28px; }
  .timeline-title { font-size: 18px; }
  .timeline-story { font-size: 13px; }
  .timeline-item { margin-bottom: 30px; }

  /* Letters */
  .letters-grid { grid-template-columns: 1fr; gap: 14px; }
  .letter-card { min-height: 150px; padding: 22px; }

  /* Map */
  .map-container { aspect-ratio: 4 / 3; }

  /* Dreams */
  #dreams-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dream-card { padding: 14px; }
  .dream-check { font-size: 13px; gap: 8px; }

  /* Playlist */
  .playlist-list { max-width: 100%; }
  .playlist-item { padding: 12px 14px; gap: 10px; }

  /* Voice */
  #voice-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .voice-card { padding: 18px 14px; }
  .voice-play-btn { width: 46px; height: 46px; }
  .record-btn { font-size: 15px; padding: 12px 24px; }

  /* Photos */
  #photo-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }

  /* Jokes */
  .jokes-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Daily Question */
  .question-text { font-size: 20px; margin-bottom: 28px; }

  /* Future */
  .future-columns { grid-template-columns: 1fr; gap: 14px; }
  .future-col { min-height: 200px; padding: 18px; }

  /* Footer */
  .closing-text { font-size: 22px; }

  /* Modals */
  .modal-box { padding: 22px; width: calc(100% - 32px); max-height: 80vh; }
  .modal-box h3 { font-size: 18px; }

  /* Controls */
  .top-controls { top: 12px; right: 12px; }
  html[dir="rtl"] .top-controls { right: auto; left: 12px; }
  #music-toggle { bottom: 14px; right: 14px; width: 42px; height: 42px; }
  html[dir="rtl"] #music-toggle { right: auto; left: 14px; }

  /* Touch targets — minimum 44px */
  .constellation-star { width: 18px; height: 18px; }
  .map-pin { width: 18px; height: 18px; }
  .constellation-add, .map-add-btn { width: 44px; height: 44px; }
  .identity-btn { width: 200px; padding: 14px; font-size: 18px; }
  .dream-checkmark { width: 24px; height: 24px; }
}

/* ═══ MOBILE — SMALL PHONES ═══════════════════════════ */
@media (max-width: 400px) {
  .section { padding: 50px 12px; }
  .section h2 { font-size: 22px; }

  /* Hero */
  .hero-monogram { font-size: 56px; }
  .hero-tagline { font-size: 14px; }

  /* Counter */
  #flip-clock { gap: 6px; }
  .flip-card { width: 55px; height: 65px; }
  .flip-value { font-size: 22px; }
  .flip-label { font-size: 9px; letter-spacing: 0.08em; }

  /* Constellation */
  #constellation-sky { height: 45vh; min-height: 260px; }

  /* Reasons */
  #reason-btn { padding: 12px 28px; font-size: 15px; }
  #reason-display { font-size: 18px; }

  /* Dreams */
  #dreams-grid { grid-template-columns: 1fr; }

  /* Voice */
  #voice-grid { grid-template-columns: 1fr 1fr; }

  /* Photos */
  #photo-gallery { grid-template-columns: 1fr 1fr; }

  /* Daily Question */
  .question-text { font-size: 18px; }
  .answers-row { gap: 14px; }

  /* Identity */
  #identity-modal h2 { font-size: 20px; }
  .identity-btn { width: 180px; font-size: 17px; }

  /* Playlist */
  .playlist-icon { width: 32px; height: 32px; font-size: 13px; }
  .playlist-title-text { font-size: 14px; }

  /* Entry */
  #entry-prompt { font-size: 22px; }

  /* Modal */
  .modal-box { padding: 18px; }
  .modal-field input, .modal-field textarea { padding: 10px; font-size: 16px; /* prevents iOS zoom */ }
}

/* ═══ SAFE AREA (notch phones) ════════════════════════ */
@supports (padding: env(safe-area-inset-top)) {
  .top-controls { top: calc(12px + env(safe-area-inset-top)); }
  #music-toggle { bottom: calc(14px + env(safe-area-inset-bottom)); }
  #footer { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
}

/* ═══ HEIGHT: landscape phones ════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  #hero { min-height: 100svh; }
  .hero-monogram { font-size: 48px; }
  .section { padding: 40px 18px; min-height: auto; }
  #constellation-sky { height: 40vh; }
}

/* ═══ REDUCED MOTION ══════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .constellation-star, .scroll-arrow, #music-toggle .bar { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══ LOGIN SCREEN ════════════════════════════════════ */
/* Shared-password gate. Sits between loading and entry. Visually
   echoes the identity-modal but with a gold-bordered card and an
   input field instead of two buttons. */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 950;                     /* above entry-screen (900), below loading */
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(6px);
}
#login-screen.visible { opacity: 1; }
#login-screen #login-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--modal-bg);
  border: 1px solid var(--gold);
  border-radius: 18px;
  padding: 44px 36px 36px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow:
    0 0 60px rgba(212, 175, 55, 0.18),
    0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(1);
  opacity: 1;
  transition:
    transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.login-card h2 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}
.login-card #login-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--champagne);
  opacity: 0.7;
  margin: 0 0 28px;
  letter-spacing: 0.04em;
}

.login-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
#login-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;              /* 16px prevents iOS auto-zoom */
  letter-spacing: 0.06em;
  text-align: center;
  outline: none;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}
#login-input::placeholder { color: var(--champagne); opacity: 0.4; letter-spacing: 0.2em; }
#login-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

#login-submit {
  padding: 14px 22px;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 18px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 300ms ease, box-shadow 300ms ease, transform 200ms ease;
}
#login-submit:hover {
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.18);
}
#login-submit:active { transform: scale(0.98); }

#login-hint {
  min-height: 18px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  font-style: italic;
  color: var(--champagne);
  opacity: 0;
  margin: 8px 0 0;
  transition: opacity 400ms ease;
}
#login-hint.visible { opacity: 0.65; }

/* Gentle shake when password is wrong — no harsh red, just a soft sway. */
.login-card.wrong {
  animation: loginShake 480ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes loginShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* Dissolve when password is right — card fades + scales away into gold. */
.login-card.dissolving {
  transform: scale(1.08);
  opacity: 0;
  filter: blur(2px);
}

/* Gold particles emitted on successful unlock — drift outward and fade. */
.login-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: loginParticle 1400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes loginParticle {
  0%   { opacity: 0;   transform: translate(-50%, -50%) translate(0, 0)              scale(0.5); }
  20%  { opacity: 1; }
  100% { opacity: 0;   transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.2); }
}

/* Day-theme overrides — mirrors the .modal-box treatment in day mode. */
[data-theme="day"] #login-screen { background: rgba(255, 252, 245, 0.96); }
[data-theme="day"] .login-card {
  background: #FFFFFF;
  border-color: #A07828;
  box-shadow:
    0 0 40px rgba(160, 120, 40, 0.12),
    0 16px 56px rgba(53, 44, 30, 0.1);
}
[data-theme="day"] .login-card h2 { color: #A07828; }
[data-theme="day"] .login-card #login-subtitle { color: #7A6230; opacity: 0.8; }
[data-theme="day"] #login-input {
  background: #FFFCF5;
  border-color: rgba(160, 120, 40, 0.18);
  color: #352C1E;
}
[data-theme="day"] #login-input::placeholder { color: #7A6230; }
[data-theme="day"] #login-input:focus {
  border-color: #A07828;
  box-shadow: 0 0 0 3px rgba(160, 120, 40, 0.1);
}
[data-theme="day"] #login-submit {
  background: #A07828;
  color: #FFFCF5;
  border-color: #A07828;
}
[data-theme="day"] #login-submit:hover {
  background: #7A6230;
  box-shadow: 0 0 24px rgba(160, 120, 40, 0.18);
}
[data-theme="day"] #login-hint { color: #7A6230; }
[data-theme="day"] .login-particle {
  background: #A07828;
  box-shadow: 0 0 12px rgba(160, 120, 40, 0.5);
}

/* RTL — keep input text centered and tweak letter-spacing for Arabic. */
html[dir="rtl"] #login-input { letter-spacing: 0; }
html[dir="rtl"] #login-input::placeholder { letter-spacing: 0; }

/* Phone tweaks. */
@media (max-width: 480px) {
  .login-card { padding: 36px 24px 28px; max-width: 100%; }
  .login-card h2 { font-size: 26px; }
  #login-input { padding: 13px 16px; font-size: 16px; }
  #login-submit { padding: 13px 18px; font-size: 16px; }
}

/* ═══ PHOTO UPLOAD UI ════════════════════════════════
   Used by:
   • Memory modal (single photo field with preview)
   • Photo Reel section (multi-select + progress text)
   • Add-Place modal (future) */

/* Pretty wrapper around <input type="file"> — turns it into
   a gold-bordered pill matching the rest of the design.
   Mirrors .notif-file-label, slightly adjusted. */
.photo-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 300ms ease, border-style 300ms ease;
  user-select: none;
}
.photo-file-label:hover {
  background: rgba(212, 175, 55, 0.06);
  border-style: solid;
}
.photo-file-label input[type="file"] { display: none; }

.photo-preview {
  display: block;
  margin-top: 12px;
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}
.photo-preview[hidden] { display: none; }

/* Upload progress line under the gallery's "Upload photos" button. */
.upload-progress {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--champagne);
  opacity: 0.7;
  margin-top: 10px;
  text-align: center;
  letter-spacing: 0.05em;
}
.upload-progress[hidden] { display: none; }

/* Day theme overrides */
[data-theme="day"] .photo-file-label { border-color: #A07828; color: #A07828; }
[data-theme="day"] .photo-file-label:hover { background: rgba(160, 120, 40, 0.06); }
[data-theme="day"] .photo-preview { border-color: rgba(160, 120, 40, 0.18); box-shadow: 0 8px 24px rgba(53, 44, 30, 0.12); }
[data-theme="day"] .upload-progress { color: #7A6230; }

/* ═══ CLOUD STATUS INDICATOR ═════════════════════════
   Tiny pill in the bottom-left corner. Subtle, won't crowd.
   Three states:
     .cloud-status            → hidden by default
     .cloud-status.local      → "Saved on this device"
     .cloud-status.connected  → "Synced ✦"
   Visibility is controlled by app.js based on Firebase readiness. */
.cloud-status {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 70;
  padding: 6px 12px;
  /* Higher background opacity instead of backdrop-filter:blur — the pill is
     ALWAYS visible during scroll, and backdrop-filter forces the browser to
     re-snapshot+blur the area behind it every frame, which thrashes scroll. */
  background: rgba(10, 14, 39, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--champagne);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.cloud-status.visible { opacity: 0.55; }
.cloud-status.visible:hover { opacity: 1; }
.cloud-status.connected { color: var(--gold); border-color: var(--gold); }

html[dir="rtl"] .cloud-status { left: auto; right: 16px; }

[data-theme="day"] .cloud-status {
  background: rgba(255, 252, 245, 0.85);
  border-color: rgba(160, 120, 40, 0.18);
  color: #7A6230;
}
[data-theme="day"] .cloud-status.connected { color: #A07828; border-color: #A07828; }

/* Safe-area on notch phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .cloud-status { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
