/* === LOVE MODE GLOBAL === */
.love-mode {
  --c-heart: #e91e63;
  --c-soft: #ffc1e3;
  --c-bg: #fff0f8;
  --c-text: #2d1b3a;
  background: linear-gradient(135deg, #ffeef8 0%, #fff5f9 100%);
  color: var(--c-text);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* === HEADER === */
.love-header {
  text-align: center;
  margin: 2rem 0;
  animation: float 6s ease-in-out infinite;
}

.love-header h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 3.5rem;
  color: var(--c-heart);
  text-shadow: 0 2px 10px rgba(233,30,99,0.3);
  margin: 0;
}

.love-header p {
  font-size: 1.2rem;
  color: #a05a7a;
  margin-top: 0.5rem;
}

/* === FLOATING HEARTS BACKGROUND === */
.love-hearts {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.heart-float {
  position: absolute;
  color: var(--c-heart);
  font-size: 1.5rem;
  opacity: 0;
  animation: floatUp 8s linear infinite;
  user-select: none;
}

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

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

/* === VAULT LOCK === */
#passcode-screen {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
  padding: 2.5rem;
  background: white;
  border-radius: 28px;
  box-shadow: 0 15px 40px rgba(233,30,99,0.25);
  border: 3px solid var(--c-soft);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 15px 40px rgba(233,30,99,0.25); }
  50% { box-shadow: 0 20px 50px rgba(233,30,99,0.35); }
}

#passcode-input {
  font-size: 2.2rem;
  text-align: center;
  letter-spacing: 1.2rem;
  padding: 1.2rem;
  border: 3px solid var(--c-soft);
  border-radius: 20px;
  width: 100%;
  margin: 1.5rem 0;
  background: #fff9fd;
  color: var(--c-heart);
  font-weight: 600;
  transition: all 0.3s;
  -webkit-text-security: disc;
  text-security: disc;
}

#passcode-input:focus {
  border-color: var(--c-heart);
  box-shadow: 0 0 20px rgba(233,30,99,0.4);
  outline: none;
}

/* === UPLOAD CARD === */
.upload-card {
  display: none;
  max-width: 500px;
  margin: 2.5rem auto;
  padding: 2rem;
  background: white;
  border-radius: 24px;
  box-shadow: 0 12px 35px rgba(233,30,99,0.2);
  border: 2px dashed var(--c-soft);
  text-align: center;
  transition: all 0.4s;
}

.upload-card.show {
  display: block;
  animation: fadeInUp 0.8s ease-out;
}

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

.upload-card h3 {
  color: var(--c-heart);
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.upload-card input[type="file"] {
  margin: 1rem 0;
  padding: 0.8rem;
  border: 2px dashed var(--c-soft);
  border-radius: 16px;
  background: #fff9fd;
  width: 100%;
  font-size: 1rem;
  transition: all 0.3s;
}

.upload-card input[type="file"]:hover {
  border-color: var(--c-heart);
}

/* === Favorite pin (shared by every photo-thumb, including inside the book) === */
.photo-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #1a0e14;
}

/* Blurred, scaled-up copy of the same photo fills the landscape frame
   behind it, so portrait shots never get cropped — they just sit on a
   soft blurred version of themselves instead of losing their top/bottom. */
.photo-thumb .thumb-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.15) brightness(0.88);
  transform: scale(1.2);
}

.photo-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease, filter 1s cubic-bezier(.22,1,.36,1), opacity 1s ease;
}

.photo-thumb img.developing {
  filter: blur(12px) saturate(0.3) brightness(1.15);
  opacity: 0;
  transform: scale(1.1);
}

.photo-thumb:hover img { transform: scale(1.06); }

/* "Tap to enlarge" hint — touch devices only, since desktop already gets
   the hover-zoom above as its affordance. Pure CSS, no per-photo markup. */
@media (hover: none) and (pointer: coarse) {
  .photo-thumb::after {
    content: "🔍 Tap to enlarge";
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 5;
    font-family: 'Dancing Script', cursive;
    font-size: 0.62rem;
    font-weight: 500;
    color: #fff;
    background: rgba(45, 15, 30, 0.55);
    backdrop-filter: blur(3px);
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    pointer-events: none;
    opacity: 0.92;
  }
  .photo-thumb.golden::after { bottom: 8px; left: 8px; }
}

.photo-thumb .fav-pin {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
  z-index: 5;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), background 0.25s ease;
}

.photo-thumb .fav-pin:hover { transform: scale(1.15); }
.photo-thumb .fav-pin.is-fav {
  background: linear-gradient(45deg, #e91e63, #ff4081);
  color: #fff;
  animation: favPop 0.4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes favPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* === Gallery control bar === */
.vault-gallery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.vault-count {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: #ad5078;
}

.vault-count-sub {
  display: block;
  font-family: 'Dancing Script', cursive;
  font-size: 0.75rem;
  color: #c9829a;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

.vault-gallery-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.vault-filter {
  display: flex;
  background: #fff;
  border: 2px solid var(--c-soft);
  border-radius: 50px;
  padding: 4px;
  gap: 4px;
}

.vault-filter-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #a05a7a;
  cursor: pointer;
  transition: all 0.3s;
}

.vault-filter-btn.active {
  background: linear-gradient(45deg, #e91e63, #ff4081);
  color: white;
  box-shadow: 0 4px 12px rgba(233,30,99,0.35);
}

.vault-icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--c-soft);
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.vault-icon-btn:hover {
  border-color: var(--c-heart);
  transform: rotate(-8deg) scale(1.08);
}

.gallery-empty {
  display: none;
  text-align: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: #c9829a;
  padding: 2rem;
}

.gallery-empty.show { display: block; }

/* === LIGHTBOX / POP-OUT VIEWER === */
#lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 12, 22, 0.88);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 1000;
}

#lightbox.is-open #lightbox-backdrop { opacity: 1; }

#lightbox-img {
  position: fixed;
  z-index: 1001;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.5);
  background: #1a0e14;
  cursor: zoom-out;
  transition: top 0.55s cubic-bezier(.22,1,.36,1),
              left 0.55s cubic-bezier(.22,1,.36,1),
              width 0.55s cubic-bezier(.22,1,.36,1),
              height 0.55s cubic-bezier(.22,1,.36,1),
              border-radius 0.55s ease,
              opacity 0.25s ease;
}

.lightbox-hidden { display: none; }

.lightbox-chrome {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1002;
}

#lightbox.is-settled .lightbox-chrome {
  opacity: 1;
  pointer-events: auto;
}

#lightbox-close, #lightbox-prev, #lightbox-next {
  position: fixed;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

#lightbox-close:hover, #lightbox-prev:hover, #lightbox-next:hover {
  background: rgba(233,30,99,0.55);
  border-color: var(--c-heart);
}

#lightbox-close {
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  font-size: 1.1rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 1.6rem;
}

#lightbox.is-settled .lightbox-nav:hover { transform: translateY(-50%) scale(1.1); }

#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

#lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 8px);
  width: min(92vw, 420px);
  background: rgba(255,255,255,0.95);
  border: 2px solid var(--c-soft);
  border-radius: 22px;
  padding: 0.85rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 15px 45px rgba(0,0,0,0.35);
}

#lightbox.is-settled #lightbox-caption { transform: translate(-50%, 0); }

/* heart: gently breathes to invite a tap, same language as the wishing star */
.lightbox-fav-btn {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: #fff0f8;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.22);
  animation: favBreathe 2.6s ease-in-out infinite;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
}
.lightbox-fav-btn:hover { transform: scale(1.15); }
.lightbox-fav-btn.is-fav {
  background: linear-gradient(45deg, #e91e63, #ff4081);
  animation: favPop 0.4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes favBreathe {
  0%, 100% { box-shadow: 0 4px 14px rgba(233,30,99,0.22); }
  50%      { box-shadow: 0 4px 20px rgba(233,30,99,0.4), 0 0 0 6px rgba(233,30,99,0.08); }
}

/* download: the star of the bar — labeled pill, gradient, shimmer + pulse
   to visibly urge a tap ("go on, keep this one") */
.lightbox-download-btn {
  flex: 1 1 auto;
  max-width: 220px;
  width: auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #ff5fa2, #e91e63 55%, #ff8a4c);
  background-size: 220% 100%;
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 6px 18px rgba(233, 30, 99, 0.38);
  animation: dlShimmer 3.2s linear infinite, dlPulse 2.1s ease-in-out infinite;
}
.lightbox-download-btn:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(233, 30, 99, 0.5); }
.lightbox-download-btn.is-sharing { animation: favPop 0.4s cubic-bezier(.34,1.56,.64,1); }
.lightbox-download-btn .dl-label { white-space: nowrap; }
@keyframes dlShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
@keyframes dlPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(233,30,99,0.38); }
  50%      { box-shadow: 0 8px 26px rgba(233,30,99,0.55), 0 0 0 7px rgba(233,30,99,0.1); }
}

.lightbox-index {
  flex: 0 0 auto;
  font-family: 'Dancing Script', cursive;
  font-size: 0.72rem;
  color: #c9829a;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-fav-btn { animation: none; }
  .lightbox-download-btn { animation: none; }
}

@media (max-width: 480px) {
  #lightbox-caption { width: min(94vw, 360px); padding: 0.7rem 0.9rem; gap: 0.7rem; }
  .lightbox-fav-btn { width: 42px; height: 42px; font-size: 1.1rem; }
  .lightbox-download-btn { height: 42px; font-size: 0.82rem; padding: 0 0.85rem; }
  .lightbox-index { display: none; } /* index counter is the least essential item on tiny screens */
}

@media (max-width: 640px) {
  #lightbox-caption { flex-wrap: wrap; bottom: 14px; padding: 0.9rem 1rem; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.3rem; }
  #lightbox-prev { left: 8px; }
  #lightbox-next { right: 8px; }
  #lightbox-close { top: 14px; right: 14px; width: 38px; height: 38px; }
}

/* === VAULT DOOR (unlock ceremony) === */
.vault-door-hidden { display: none; }

#vault-door {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

.vault-door-panel {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background: linear-gradient(135deg, #4a1030 0%, #2d1b3a 60%, #4a1030 100%);
  transition: transform 0.9s cubic-bezier(.76,0,.24,1);
}

.vault-door-left { left: 0; border-right: 2px solid rgba(255,255,255,0.15); }
.vault-door-right { right: 0; border-left: 2px solid rgba(255,255,255,0.15); }

#vault-door.is-opening .vault-door-left { transform: translateX(-100%); }
#vault-door.is-opening .vault-door-right { transform: translateX(100%); }

.vault-door-lock {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.6));
  animation: goldenPulse 1.2s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#vault-door.is-opening .vault-door-lock {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.6) rotate(-15deg);
}

.love-btn {
  background: linear-gradient(45deg, #e91e63, #ff4081);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(233,30,99,0.4);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  font-family: 'Dancing Script', cursive;
}

.love-btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.love-btn:active::before {
  width: 300px;
  height: 300px;
}

.love-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(233,30,99,0.5);
}

/* === HIDDEN STATES === */
.vault-hidden, .modal-hidden {
  display: none !important;
}

.vault-visible {
  animation: fadeInUp 0.8s ease-out;
}

/* === CONFETTI CANVAS === */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .love-header h1 { font-size: 2.8rem; }
  .love-btn { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
}

/* === SHARED PAGE TRANSITION (vault <-> letters) === */
.page-transition-hidden { display: none; }

#page-transition {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4a1030 0%, #2d1b3a 60%, #4a1030 100%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

#page-transition.is-active {
  opacity: 1;
  pointer-events: auto;
}

.page-transition-heart {
  font-size: 2.6rem;
  filter: drop-shadow(0 0 20px rgba(255,105,135,0.6));
  animation: pulse 1.1s ease-in-out infinite;
}

/* === HEARTBEAT VAULT === */
#vault-content.vault-visible {
  animation: heartbeat 3.5s ease-in-out infinite;
}

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

/* === LOVE COUNTER === */
.love-counter {
  text-align: center;
  margin: 2rem 0;
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: #e91e63;
}

#love-days {
  font-weight: bold;
  color: #ff4081;
  text-shadow: 0 0 10px rgba(255,64,129,0.5);
}

/* TIMELINE / PROGRESS / PLAYER etc (unchanged sections) */
.love-timeline, .love-map, .love-player, .daily-quote, .love-progress {
  margin: 3rem 0;
  text-align: center;
}
.timeline-event {
  margin: 2rem 0;
  padding: 1rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(233,30,99,0.2);
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #ffeef8;
  border-radius: 50px;
  overflow: hidden;
  margin: 1rem 0;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb6c1, #e91e63, #c2185b) !important;
  transition: width 1s;
}

.surprise-box {
  width: 200px;
  height: 200px;
  margin: 3rem auto;
  background: linear-gradient(45deg, #ff9a9e, #fad0c4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: giftPulse 2s infinite;
}
@keyframes giftPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.slideshow-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
#slide-img {
  max-width: 90%;
  max-height: 90%;
  border: 10px solid white;
  border-radius: 20px;
}

.love-player {
  text-align: center;
  margin: 3rem 0;
  padding: 1.5rem;
  background: white;
  border-radius: 24px;
  box-shadow: 0 12px 35px rgba(233,30,99,0.2);
  border: 3px solid #ffc1e3;
}

.love-player h2 {
  font-family: 'Dancing Script', cursive;
  color: #e91e63;
  margin-bottom: 1rem;
}

/* hide the native audio element — JS drives a custom player */
#our-song { display: none; }

/* ── Our Song: custom animated player ─────────────────────────── */
.song-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(135deg, #ffffff 0%, #fff4fa 100%);
  border: 1px solid #ffd9ec;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(233, 30, 99, 0.14);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.love-player.playing .song-card {
  box-shadow: 0 14px 40px rgba(233, 30, 99, 0.26);
}

/* circular play / pause button with a heartbeat while playing */
.song-play {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #ff8fbf 0%, #e91e63 72%);
  box-shadow: 0 6px 18px rgba(233, 30, 99, 0.45),
    0 0 0 0 rgba(233, 30, 99, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.song-play:hover { transform: scale(1.08); }
.song-play:active { transform: scale(0.96); }
.song-play:focus-visible { outline: 3px solid #ffb3d4; outline-offset: 3px; }
.love-player.playing .song-play { animation: songBeat 1.4s ease-in-out infinite; }
@keyframes songBeat {
  0%, 100% { box-shadow: 0 6px 18px rgba(233,30,99,0.45), 0 0 0 0 rgba(233,30,99,0.45); }
  50%      { box-shadow: 0 6px 22px rgba(233,30,99,0.55), 0 0 0 12px rgba(233,30,99,0); }
}
/* swap play/pause glyphs based on state */
.pi-pause { display: none; }
.love-player.playing .pi-play  { display: none; }
.love-player.playing .pi-pause { display: inline; }

/* main column: waveform + times */
.song-main { flex: 1 1 auto; min-width: 0; overflow: hidden; }

/* waveform */
.wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 46px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}
.wave .bar {
  flex: 1 1 0;
  height: var(--h, 40%);
  min-width: 2px;
  border-radius: 4px;
  background: #f7c6dd;                 /* unplayed */
  transform-origin: center;
  transition: background 0.15s ease, height 0.2s ease;
}
.wave .bar.played {
  background: linear-gradient(180deg, #ff6fa5 0%, #e91e63 55%, #ffb14e 100%);
}
/* dancing bars only while playing */
.love-player.playing .wave .bar {
  animation: waveDance 0.9s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes waveDance {
  0%, 100% { transform: scaleY(0.55); }
  50%      { transform: scaleY(1.18); }
}

.song-times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: #b06a89;
}

@media (prefers-reduced-motion: reduce) {
  .love-player.playing .song-play { animation: none; }
  .love-player.playing .wave .bar { animation: none; }
}

/* ── mobile: shrink so all 56 bars genuinely fit, not just get clipped ── */
@media (max-width: 480px) {
  .song-card {
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
  }
  .song-play {
    width: 46px;
    height: 46px;
    font-size: 0.92rem;
  }
  .wave {
    gap: 1.5px;
    height: 40px;
  }
  .wave .bar {
    min-width: 1.5px;
    border-radius: 3px;
  }
}
@media (max-width: 360px) {
  .song-card { gap: 0.55rem; padding: 0.7rem 0.7rem; }
  .song-play { width: 42px; height: 42px; }
  .wave { gap: 1px; }
  .wave .bar { min-width: 1.2px; }
}

.song-caption {
  font-style: italic;
  color: #ff4081;
  margin-top: 0.8rem;
  font-size: 1.1rem;
}

.open-when-btn {
  background: linear-gradient(45deg, #ff9a9e, #fad0c4);
  color: #e91e63;
  border: 3px solid #ffc1e3;
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  padding: 0.8rem 2rem;
  margin: 2rem auto;
  display: block;
  animation: giftPulse 2s infinite;
}

.daily-quote {
  text-align: center;
  margin: 4rem auto;
  padding: 2.5rem 2rem;
  max-width: 700px;
  background: linear-gradient(135deg, #fff0f8 0%, #ffeef8 100%);
  border-radius: 32px;
  box-shadow: 0 15px 40px rgba(255, 105, 180, 0.25);
  border: 3px solid #ffd1dc;
  position: relative;
  overflow: hidden;
}

.daily-quote::before {
  content: ' 💛 🩷 ❤️ 🤍 ';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  color: rgba(255, 105, 180, 0.15);
  pointer-events: none;
}

.daily-quote h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  color: #e91e63;
  margin: 0 0 1.5rem;
  text-shadow: 0 2px 10px rgba(233, 30, 99, 0.2);
}

.quote-text {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: #c2185b;
  line-height: 1.6;
  margin: 1rem 0;
  opacity: 0;
  animation: fadeInUp 2s ease-out 0.5s forwards;
  position: relative;
}

.quote-text::before,
.quote-text::after {
  content: '"';
  font-size: 4rem;
  color: #ff69b4;
  opacity: 0.3;
  position: absolute;
}

.quote-text::before { top: -30px; left: -20px; }
.quote-text::after { bottom: -50px; right: -20px; }

.quote-date {
  font-size: 1.3rem;
  color: #ff4081;
  font-style: italic;
  margin-top: 1.5rem;
  opacity: 0;
  animation: fadeIn 3s ease-out 2s forwards;
}

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

/* === 🌙 FAREWELL SECTION === */
.vault-farewell {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 520px;
  margin: 3rem auto 1rem;
}

.vault-farewell-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffb6c1, transparent);
  margin: 1.5rem auto;
}

.vault-farewell-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 1rem;
}

.vault-farewell-text {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: #7b3a52;
  line-height: 2;
}

.vault-farewell-text em {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: #c2185b;
  display: block;
  margin-top: 0.5rem;
}


/* =====================================================================
   SCRAPBOOK / MEMORY BOOK — signature redesign of the gallery
   A warm wooden desk, an open leather-bound book with a gilt-ring spine,
   a hand-lettered chapter page on the left, a taped photo page on the
   right, and drifting rose petals. Replaces the old flat photo grid.
   ===================================================================== */

.scrapbook-section {
  --paper: #fbf3e4;
  --paper-shade: #ecdfc4;
  --ink: #5a3345;
  --gold: #cda45e;
  --rose: #c2456b;
  margin: 3rem 0 2.5rem;
}

/* --- The book stage (no more wooden desk — light and airy) --- */
.book-desk {
  position: relative;
  padding: clamp(0.6rem, 2.5vw, 1.5rem) clamp(0.3rem, 1.5vw, 0.8rem) 1.4rem;
  overflow: hidden;
}

.petal-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.petal {
  position: absolute;
  top: -10%;
  font-size: 1.2rem;
  opacity: 0;
  animation: petalDrift linear forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
@keyframes petalDrift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.85; }
  90% { opacity: 0.7; }
  100% { transform: translate(var(--drift, 30px), 115vh) rotate(340deg); opacity: 0; }
}

/* --- Book wrap + nav arrows --- */
.book-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.6rem);
}

.book-nav {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-heart);
  font-size: 1.5rem;
  cursor: pointer;
  border: 2px solid var(--c-soft);
  box-shadow: 0 4px 14px rgba(233,30,99,0.18);
  transition: all 0.25s ease;
}
.book-nav:hover:not(:disabled) {
  background: linear-gradient(45deg, #e91e63, #ff4081);
  color: #fff;
  border-color: var(--c-heart);
  transform: scale(1.08);
}
.book-nav:disabled { opacity: 0.3; cursor: default; }

/* --- The book itself --- */
.book {
  position: relative;
  display: flex;
  width: min(1180px, 100%);
  aspect-ratio: 16 / 10;
  perspective: 2200px;
}

.book-shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -22px;
  height: 34px;
  background: radial-gradient(ellipse, rgba(80,40,60,0.22), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}

.book-spine {
  position: absolute;
  left: 50%;
  top: 2%;
  bottom: 2%;
  width: 26px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #3a1f14, #6b3c22 45%, #3a1f14 100%);
  box-shadow: 0 0 18px rgba(0,0,0,0.5);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  border-radius: 3px;
}
.spine-ring {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3dfa3, var(--gold) 60%, #8a6a2f 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.book-ribbon {
  position: absolute;
  top: -6px;
  right: 12%;
  width: 22px;
  height: 60px;
  background: linear-gradient(180deg, #d43e6b, #a3264d);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  z-index: 4;
}

.book-page {
  position: relative;
  width: 50%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0.05), transparent 40%),
    var(--paper);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.book-page-left {
  border-radius: 10px 4px 4px 10px;
  padding-right: 2px;
}
.book-page-right {
  border-radius: 4px 10px 10px 4px;
  padding-left: 2px;
}

/* subtle page-edge lines like stacked paper */
.book-page-left::before, .book-page-right::before {
  content: '';
  position: absolute;
  top: 4px; bottom: 4px;
  width: 6px;
  background: repeating-linear-gradient(180deg, var(--paper-shade) 0 2px, var(--paper) 2px 5px);
  opacity: 0.7;
}
.book-page-left::before { right: -6px; border-radius: 0 3px 3px 0; }
.book-page-right::before { left: -6px; border-radius: 3px 0 0 3px; }

/* === PAGE TRANSITION — soft cross-fade ===
   The pages themselves stay put; only their content fades out, swaps, and
   fades back in. Simple, smooth, and doesn't rely on 3D transforms. */
.book-page {
  transition: opacity 0.5s cubic-bezier(.4, 0, .2, 1), transform 0.5s cubic-bezier(.4, 0, .2, 1);
}
.book-page.page-fading {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
}

.page-inner {
  position: absolute;
  inset: 0;
  padding: clamp(1rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Title / chapter page (left, first spread of a chapter) --- */
.title-page {
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  position: relative;
}
.page-chapter-title {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.9rem);
  color: var(--ink);
  margin: 0 0 0.6rem;
  line-height: 1.05;
}
.page-heart-doodle {
  font-size: 1.1rem;
  color: var(--rose);
  opacity: 0.55;
  margin-bottom: 0.6rem;
}
.page-chapter-sub {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.72rem, 1.6vw, 0.88rem);
  color: #9c7186;
  max-width: 22ch;
  line-height: 1.6;
}
.title-page-rose {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 1.6rem;
  opacity: 0.5;
  transform: rotate(12deg);
}

/* --- Photo grid page --- */
.photo-page { justify-content: center; }
.page-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: auto;
  align-content: center;
  gap: clamp(0.4rem, 1.6vw, 0.9rem);
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
.page-photo-grid .photo-thumb {
  background: #fff;
  padding: 5px 5px 5px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  transform: rotate(var(--tilt, 0deg));
}
.page-photo-grid .photo-thumb::after {
  /* washi tape corner */
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 34px; height: 14px;
  background: rgba(233, 196, 210, 0.75);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* --- End-of-chapter page --- */
.end-page {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pressed-flower { font-size: 2.2rem; opacity: 0.7; margin-bottom: 0.6rem; }
.end-page-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: #b585a0;
  letter-spacing: 0.02em;
}

.blank-page { background: var(--paper); }

/* --- Footer: chapter label + spread count --- */
.book-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.4rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #a05a7a;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.book-chapter-label::after {
  content: '•';
  margin-left: 1rem;
  color: rgba(160,90,122,0.35);
}
.book-page-count { color: rgba(160,90,122,0.65); font-size: 0.85rem; }

@media (max-width: 640px) {
  .book-desk { padding: 0.4rem 0.3rem 1.1rem; }
  .container { padding: 0.85rem; }

  /* Single full-width page instead of two squeezed half-pages — a real
     open-book layout just doesn't fit a phone screen. */
  .book { aspect-ratio: 4 / 3; perspective: 1400px; }
  .book-spine, .book-ribbon { display: none; }
  .book-page-left { display: none; }
  .book-page-right {
    width: 100%;
    border-radius: 14px;
    padding-left: 0;
  }
  .book-page-right::before { display: none; }

  .page-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .book-nav { width: 40px; height: 40px; font-size: 1.2rem; }
  .book-wrap { gap: 0.4rem; }
  .book-footer { font-size: 0.8rem; gap: 0.6rem; }
}