/* =========================================================
   TOKEN DESAIN — Album Foto Romantis
   Palet   : krem hangat, blush pink, wine, gold ornament
   Tipografi: Playfair Display (judul) + Cormorant Garamond (isi)
              + Great Vibes (aksen tulisan tangan)
   ========================================================= */
:root {
  --cream:      #FBF3EC;
  --ivory:      #FFFBF5;
  --blush:      #F1D9DC;
  --blush-2:    #F6E4DE;
  --rose:       #C8858F;
  --wine:       #7A3B42;
  --gold:       #C6A15B;
  --gold-soft:  #DCC190;
  --ink:        #4A3B3D;

  --font-display: 'Playfair Display', serif;
  --font-body:    'Cormorant Garamond', serif;
  --font-script:  'Great Vibes', cursive;

  --shadow-book: 0 30px 60px -20px rgba(122, 59, 66, 0.35), 0 10px 20px -10px rgba(122,59,66,0.25);
}

* { box-sizing: border-box; }

/* Hilangkan kotak highlight biru transparan bawaan browser (terutama
   Chrome/Safari di HP) yang muncul setiap kali elemen bisa-diklik
   diketuk — foto, tombol, bingkai surat, dsb. Diganti transparan penuh
   supaya animasi/efek hover kita sendiri yang terlihat, bukan kotak
   biru bawaan sistem. */
html {
  -webkit-tap-highlight-color: transparent;
}
a, button, img, [role="button"], .photo-frame, .letter-frame,
.closing-photo-card, .page-nav-btn, .wax-seal, .reopen-btn,
.track-expand-btn, .music-toggle {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
button, a { outline-offset: 2px; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, var(--blush-2) 0%, var(--cream) 55%, var(--cream) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ============ HIASAN KELOPAK MENGAMBANG ============ */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.petals span {
  position: absolute;
  top: -5%;
  width: 10px;
  height: 10px;
  background: var(--rose);
  opacity: 0.35;
  border-radius: 0 60% 0 60%;
  animation: fall linear infinite;
}
.petals span:nth-child(1) { left: 5%;  animation-duration: 14s; animation-delay: 0s;  background: var(--rose); }
.petals span:nth-child(2) { left: 18%; animation-duration: 18s; animation-delay: 2s;  background: var(--gold-soft); }
.petals span:nth-child(3) { left: 32%; animation-duration: 12s; animation-delay: 4s;  }
.petals span:nth-child(4) { left: 48%; animation-duration: 20s; animation-delay: 1s;  background: var(--gold-soft); }
.petals span:nth-child(5) { left: 62%; animation-duration: 16s; animation-delay: 5s;  }
.petals span:nth-child(6) { left: 74%; animation-duration: 13s; animation-delay: 3s;  background: var(--gold-soft); }
.petals span:nth-child(7) { left: 84%; animation-duration: 19s; animation-delay: 6s;  }
.petals span:nth-child(8) { left: 92%; animation-duration: 15s; animation-delay: 2.5s; background: var(--gold-soft); }
.petals span:nth-child(9) { left: 40%; animation-duration: 22s; animation-delay: 7s;  }
.petals span:nth-child(10){ left: 10%; animation-duration: 17s; animation-delay: 8s;  background: var(--gold-soft); }

@keyframes fall {
  0%   { transform: translateY(-10vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ============ LAYAR LOADING ============ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--cream) 0%, var(--blush-2) 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.loading-content { text-align: center; }
.loading-heart {
  font-size: 42px;
  color: var(--wine);
  animation: heartbeat 1.15s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.18); }
  40% { transform: scale(0.96); }
  60% { transform: scale(1.1); }
}
.loading-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 16px;
  color: var(--wine);
  margin: 14px 0 10px;
  letter-spacing: 0.3px;
}
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  animation: dot-blink 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Sembunyikan isi album selama loading, tampilkan halus setelah siap */
body.is-loading .stage,
body.is-loading .petals,
body.is-loading .music-toggle {
  opacity: 0;
  visibility: hidden;
}
body.is-ready .loading-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.is-ready .stage,
body.is-ready .petals,
body.is-ready .music-toggle {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease 0.15s;
}

/* ============ MUSIK LATAR (YouTube tersembunyi) ============ */
.yt-player-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  top: 0;
  left: 0;
}

.music-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: var(--wine);
  color: var(--blush-2);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(122,59,66,0.3);
  transition: transform 0.25s ease, background 0.25s ease;
}
.music-toggle:hover { transform: scale(1.07); background: #8f4a52; }
.music-toggle:active { transform: scale(0.95); }
.music-toggle.playing { animation: pulse-music 1.6s ease-in-out infinite; }

@keyframes pulse-music {
  0%, 100% { box-shadow: 0 6px 16px rgba(122,59,66,0.3); }
  50% { box-shadow: 0 6px 20px rgba(122,59,66,0.55); }
}

/* ============ PANGGUNG UTAMA ============ */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 56px;
}

.stage-hint {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--wine);
  opacity: 0.75;
  margin: 0 0 22px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ============ BUKU / FLIPBOOK ============ */
.book {
  filter: drop-shadow(0 25px 45px rgba(122,59,66,0.3));
}

/* Petunjuk render ke browser (GPU acceleration) supaya animasi balik
   halaman terasa lebih halus & tidak patah-patah, terutama di HP.
   .stf__item & .stf__block adalah elemen yang dibuat otomatis oleh
   library StPageFlip saat buku diinisialisasi. */
.book, .stf__parent, .stf__wrapper, .stf__block, .stf__item {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.page {
  background: var(--ivory);
  overflow: hidden;
}

/* Sampul depan & belakang (halaman keras) */
.cover-page, .back-cover {
  background: linear-gradient(160deg, var(--wine) 0%, #8f4a52 45%, var(--wine) 100%);
  position: relative;
}
.cover-page::before, .back-cover::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1.5px solid var(--gold-soft);
  pointer-events: none;
}
.cover-page::after, .back-cover::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(220,193,144,0.5);
  pointer-events: none;
}

.cover-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.ornament-frame {
  text-align: center;
  color: var(--ivory);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 14px;
}

.cover-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 6vw, 46px);
  margin: 0;
  color: var(--ivory);
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.cover-title.small { font-size: clamp(24px, 5vw, 34px); }

.cover-divider {
  color: var(--gold-soft);
  font-size: 22px;
  margin: 14px 0;
}

.cover-names {
  font-family: var(--font-script);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--blush-2);
  margin: 6px 0 26px;
}

.wax-seal {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d98f97, var(--wine) 70%);
  border: 2px solid var(--gold-soft);
  color: var(--blush-2);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35), inset 0 0 8px rgba(255,255,255,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wax-seal:hover { transform: scale(1.07); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.wax-seal:active { transform: scale(0.96); }
.wax-seal.seal-static { cursor: default; }
.wax-seal.seal-static:hover { transform: none; }

.cover-hint {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--blush-2);
  opacity: 0.7;
  font-style: italic;
}

/* Halaman kosong bagian dalam sampul */
.page-blank { background: var(--blush-2); }
.blank-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.quote-script {
  font-family: var(--font-script);
  font-size: clamp(22px, 4vw, 28px);
  color: var(--wine);
  text-align: center;
  max-width: 80%;
  line-height: 1.5;
}

/* ============ HALAMAN ISI FOTO ============ */
.content-page { background: var(--ivory); }

.page-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 26px 26px;
  position: relative;
  /* Kalau konten (misalnya surat yang teksnya panjang) lebih tinggi
     daripada ukuran halaman buku, halaman jadi bisa di-scroll sendiri
     alih-alih terpotong begitu saja — terutama penting di HP, di mana
     tinggi buku lebih terbatas dibanding di laptop. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-soft) transparent;
}
.page-inner::-webkit-scrollbar { width: 5px; }
.page-inner::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
  border-radius: 10px;
}

.page-number {
  position: absolute;
  top: 14px;
  right: 20px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.8;
}

.photo-frame {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 5;
  border: 6px solid var(--ivory);
  outline: 1.5px solid var(--gold-soft);
  box-shadow: 0 10px 24px rgba(122,59,66,0.22);
  margin-top: 6px;
  overflow: hidden;
  background: var(--blush);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.photo-frame img:hover,
.photo-frame img:focus-visible {
  transform: scale(1.045);
  filter: brightness(1.04);
}
.photo-frame img:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 3vw, 24px);
  color: var(--wine);
  margin: 18px 0 8px;
  text-align: center;
}

.page-caption {
  font-family: var(--font-body);
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--ink);
  text-align: center;
  line-height: 1.6;
  max-width: 90%;
  opacity: 0.85;
}

/* ============ HALAMAN PLAYLIST SPOTIFY ============ */
.playlist-tracks {
  width: 100%;
  max-width: 300px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.playlist-track {
  position: relative;
}
.playlist-tracks iframe {
  display: block;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(122,59,66,0.18);
  outline: 1px solid var(--gold-soft);
  transition: height 0.4s ease;
}
.playlist-tracks::-webkit-scrollbar { width: 5px; }
.playlist-tracks::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
  border-radius: 10px;
}

.track-expand-btn {
  position: absolute;
  top: -9px;
  right: -6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: var(--wine);
  color: var(--blush-2);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(122,59,66,0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.track-expand-btn:hover { transform: scale(1.1); background: #8f4a52; }
.track-expand-btn:active { transform: scale(0.94); }
.playlist-track.expanded .track-expand-btn { background: var(--rose); }

/* ============ HALAMAN SURAT CINTA ============ */
.letter-inner {
  padding-top: 40px;
  justify-content: flex-start;
}
.letter-meta {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  color: var(--rose);
  letter-spacing: 0.5px;
  margin: 6px 0 18px;
  text-align: center;
}
.letter-dot { margin: 0 6px; opacity: 0.7; }

.letter-text {
  font-family: var(--font-body);
  font-size: clamp(15px, 2.3vw, 18px);
  color: var(--ink);
  line-height: 1.75;
  text-align: left;
  max-width: 92%;
  opacity: 0.9;
}

.letter-signature {
  font-family: var(--font-script);
  font-size: clamp(22px, 4vw, 28px);
  color: var(--wine);
  align-self: flex-end;
  margin: 10px 8% 0 0;
}

/* Bingkai surat — bisa diklik untuk membuka tampilan lebih besar & jelas */
.letter-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ivory);
  border: 1px solid var(--gold-soft);
  outline: 1px solid rgba(122,59,66,0.08);
  outline-offset: -6px;
  box-shadow: 0 12px 26px rgba(122,59,66,0.18);
  padding: 26px 22px 20px;
  margin-top: 4px;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  color: inherit;
  appearance: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.letter-frame:hover,
.letter-frame:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(122,59,66,0.26);
}
.letter-frame:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.letter-frame:active { transform: translateY(-1px) scale(0.995); }

/* Ornamen sudut ala bingkai foto klasik */
.letter-frame-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold);
  opacity: 0.85;
  pointer-events: none;
}
.corner-tl { top: 6px;    left: 6px;    border-right: none; border-bottom: none; }
.corner-tr { top: 6px;    right: 6px;   border-left: none;  border-bottom: none; }
.corner-bl { bottom: 6px; left: 6px;    border-right: none; border-top: none; }
.corner-br { bottom: 6px; right: 6px;   border-left: none;  border-top: none; }

.letter-frame-hint {
  margin-top: 14px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--rose);
  opacity: 0.85;
}

.letter-page-caption { margin-top: 12px; }

/* ============ LIGHTBOX — SURAT CINTA LEBIH JELAS ============ */
.letter-lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(40, 20, 22, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.letter-lightbox.active {
  opacity: 1;
  visibility: visible;
}
.letter-lightbox-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  background: var(--ivory);
  border: 1px solid var(--gold-soft);
  outline: 1px solid rgba(122,59,66,0.08);
  outline-offset: -8px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.3s ease;
}
.letter-lightbox.active .letter-lightbox-panel {
  transform: scale(1) translateY(0);
}
.letter-lightbox-scroll {
  height: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 40px 30px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.letter-lightbox-scroll::-webkit-scrollbar { width: 5px; }
.letter-lightbox-scroll::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
  border-radius: 10px;
}
.letter-lightbox-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: var(--wine);
  color: var(--blush-2);
  font-size: 19px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(122,59,66,0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.letter-lightbox-close-btn:hover { transform: scale(1.08); background: #8f4a52; }
.letter-lightbox-close-btn:active { transform: scale(0.94); }

/* Elemen di dalam surat yang ditampilkan besar (disalin dari .letter-frame via JS) */
.letter-lightbox-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 3.4vw, 24px);
  color: var(--wine);
  text-align: center;
  margin: 4px 0 0;
}
.letter-lightbox-scroll .letter-meta {
  margin-top: 6px;
}
.letter-lightbox-scroll .letter-text {
  font-size: clamp(16px, 2.6vw, 19px);
  max-width: 100%;
}
.letter-lightbox-scroll .letter-signature {
  align-self: flex-end;
}

/* ============ OVERLAY ANIMASI PENUTUPAN ============ */
.closing-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(ellipse at center, var(--blush-2) 0%, var(--cream) 70%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  padding: 20px;
}
.closing-overlay.active {
  opacity: 1;
  visibility: visible;
}

.closing-book {
  position: relative;
  z-index: 2;
  width: min(360px, 70vw);
  height: min(460px, 60vh);
}

.closing-spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 6px;
  transform: translateX(-50%);
  background: linear-gradient(var(--gold-soft), var(--wine), var(--gold-soft));
  z-index: 1;
  border-radius: 3px;
}

.closing-cover {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(160deg, var(--wine) 0%, #8f4a52 45%, var(--wine) 100%);
  border: 1.5px solid var(--gold-soft);
  box-shadow: 0 20px 40px rgba(122,59,66,0.35);
  transition: transform 1.3s cubic-bezier(.65,.05,.36,1);
  z-index: 2;
}
.closing-cover-left {
  left: 0;
  border-radius: 6px 0 0 6px;
  transform-origin: right center;
  transform: rotateY(-110deg);
}
.closing-cover-right {
  right: 0;
  border-radius: 0 6px 6px 0;
  transform-origin: left center;
  transform: rotateY(110deg);
}
.closing-book.shut .closing-cover-left,
.closing-book.shut .closing-cover-right {
  transform: rotateY(0deg);
}

.closing-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle at 35% 30%, #d98f97, var(--wine) 70%);
  border: 2px solid var(--gold-soft);
  color: var(--blush-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 3;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  transition: transform 0.6s cubic-bezier(.34,1.56,.64,1) 1.1s;
}
.closing-book.shut .closing-seal {
  transform: translate(-50%, -50%) scale(1);
}

.closing-text {
  position: relative;
  z-index: 3;
  font-family: var(--font-script);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--wine);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 1.6s, transform 0.8s ease 1.6s;
}
.closing-overlay.active .closing-text {
  opacity: 1;
  transform: translateY(0);
}

.reopen-btn {
  position: relative;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 1px;
  padding: 12px 30px;
  background: var(--wine);
  color: var(--ivory);
  border: 1px solid var(--gold-soft);
  border-radius: 30px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 1.9s, transform 0.8s ease 1.9s, background 0.25s ease;
}
.closing-overlay.active .reopen-btn {
  opacity: 1;
  transform: translateY(0);
}
.reopen-btn:hover { background: #8f4a52; }

/* ============ NAVIGASI HALAMAN — TOMBOL SEBELUMNYA / SELANJUTNYA ============
   Menggantikan interaksi geser/drag pada buku; pembalikan halaman kini
   hanya lewat kedua tombol bulat ini + indikator "n / total" di tengah. */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
}

.page-nav-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: linear-gradient(160deg, var(--wine) 0%, #8f4a52 100%);
  color: var(--blush-2);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(122,59,66,0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.page-nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(122,59,66,0.4);
}
.page-nav-btn:active:not(:disabled) { transform: translateY(0) scale(0.96); }
.page-nav-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.page-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.page-nav-indicator {
  min-width: 56px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.4px;
  color: var(--wine);
  opacity: 0.85;
}

@media (max-width: 480px) {
  .page-nav { gap: 14px; margin-top: 16px; }
  .page-nav-btn { width: 42px; height: 42px; font-size: 20px; }
}

/* ============ FOTO-FOTO KENANGAN — EFEK BIANGLALA ============
   Foto mengorbit melingkar mengelilingi segel hati di tengah buku,
   berputar pelan seperti bianglala. Lapisan .orbit-item-counter
   berputar berlawanan arah dgn .orbit-ring supaya kartu foto itu
   sendiri tetap tegak (tidak ikut miring), persis kabin bianglala
   sungguhan yang selalu menghadap ke atas.
   Sudut tiap foto (--angle) & jeda muncul (--delay) diatur dari script.js,
   otomatis menyesuaikan jumlah foto di album. */

.closing-photos {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 4; /* di atas sampul (2) & segel (3), tampil melayang di depan */
  pointer-events: none;
}

.orbit-ring {
  --wheel-radius: clamp(100px, 26vw, 162px);
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  animation: orbit-spin 32s linear infinite;
  animation-play-state: paused;
}
.closing-photos.show .orbit-ring { animation-play-state: running; }

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.orbit-item {
  position: absolute;
  left: 0;
  top: 0;
  transform: rotate(var(--angle)) translateX(var(--wheel-radius));
}

.orbit-item-fix {
  position: absolute;
  left: 0;
  top: 0;
  transform: rotate(calc(-1 * var(--angle)));
}

.orbit-item-counter {
  position: absolute;
  left: 0;
  top: 0;
  animation: orbit-counter 32s linear infinite;
  animation-play-state: paused;
}
.closing-photos.show .orbit-item-counter { animation-play-state: running; }

@keyframes orbit-counter {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.closing-photo-card {
  position: absolute;
  width: min(84px, 19vw);
  aspect-ratio: 4 / 5;
  left: 0;
  top: 0;
  background: var(--ivory);
  border: 3px solid var(--ivory);
  outline: 1px solid var(--gold-soft);
  border-radius: 3px;
  box-shadow: 0 10px 20px rgba(122,59,66,0.32);
  overflow: hidden;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(0.3);
  transition:
    opacity 0.7s ease var(--delay),
    transform 0.7s cubic-bezier(.34, 1.56, .64, 1) var(--delay),
    filter 0.25s ease;
}
.closing-photo-card:hover,
.closing-photo-card:focus-visible {
  filter: brightness(1.12);
}
.closing-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.closing-photos.show .closing-photo-card {
  opacity: 0.96;
  transform: translate(-50%, -50%) scale(1);
}

/* Kartu khusus "Lagu Kita" — ikut berputar di bianglala bersama foto */
.closing-photo-card.closing-playlist-card {
  border: 3px solid var(--gold-soft);
  outline: 1px solid var(--gold-soft);
  background: linear-gradient(160deg, var(--wine) 0%, #8f4a52 60%, var(--wine) 100%);
  color: var(--ivory);
  padding: 0;
  margin: 0;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.closing-playlist-icon {
  font-size: clamp(18px, 5.5vw, 23px);
  line-height: 1;
}
.closing-playlist-label {
  font-family: var(--font-body);
  font-size: clamp(8px, 2.6vw, 10px);
  letter-spacing: 0.3px;
  line-height: 1.15;
  text-align: center;
  padding: 0 4px;
}

/* Kartu khusus "Surat Cinta" — ikut berputar di bianglala bersama foto.
   Warna dibedakan dari kartu playlist (rose/blush, bukan wine) supaya
   kedua kartu mudah dibedakan sekilas saat bianglala berputar. */
.closing-photo-card.closing-letter-card {
  border: 3px solid var(--gold-soft);
  outline: 1px solid var(--gold-soft);
  background: linear-gradient(160deg, var(--rose) 0%, #d99aa3 60%, var(--rose) 100%);
  color: var(--ivory);
  padding: 0;
  margin: 0;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.closing-letter-icon {
  font-size: clamp(18px, 5.5vw, 23px);
  line-height: 1;
}
.closing-letter-label {
  font-family: var(--font-body);
  font-size: clamp(8px, 2.6vw, 10px);
  letter-spacing: 0.3px;
  line-height: 1.15;
  text-align: center;
  padding: 0 4px;
}

@media (max-width: 480px) {
  .orbit-ring { --wheel-radius: clamp(94px, 30vw, 132px); }
  .closing-photo-card { width: min(70px, 21vw); }
}

/* ============ LIGHTBOX — LIHAT FOTO LEBIH BESAR ============ */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(35, 18, 20, 0.86);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.photo-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: min(92vw, 620px);
  max-height: 82vh;
  border: 8px solid var(--ivory);
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  object-fit: contain;
  background: var(--blush);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(.34,1.2,.64,1);
}
.photo-lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 101;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: var(--wine);
  color: var(--blush-2);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.lightbox-close:hover { transform: scale(1.08); background: #8f4a52; }
.lightbox-close:active { transform: scale(0.94); }

/* ============ LIGHTBOX — SELURUH PLAYLIST LAGU ============ */
.playlist-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  background: rgba(35, 18, 20, 0.86);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.playlist-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.playlist-lightbox-panel {
  width: min(92vw, 380px);
  max-height: 84vh;
  background: var(--ivory);
  border: 1.5px solid var(--gold-soft);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(.34,1.2,.64,1);
}
.playlist-lightbox.active .playlist-lightbox-panel {
  transform: scale(1);
}

.playlist-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 10px 12px 20px;
  border-bottom: 1px solid var(--blush);
  flex-shrink: 0;
}
.playlist-lightbox-header h3 {
  font-family: var(--font-display);
  color: var(--wine);
  font-size: 19px;
  margin: 0;
}

.playlist-lightbox-close-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  background: var(--wine);
  color: var(--blush-2);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
.playlist-lightbox-close-btn:hover { transform: scale(1.08); background: #8f4a52; }
.playlist-lightbox-close-btn:active { transform: scale(0.94); }

.playlist-lightbox-tracks {
  padding: 14px 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.playlist-lightbox-tracks iframe {
  display: block;
  width: 100%;
  border-radius: 12px;
  outline: 1px solid var(--gold-soft);
  box-shadow: 0 6px 14px rgba(122,59,66,0.18);
}
.playlist-lightbox-tracks::-webkit-scrollbar { width: 5px; }
.playlist-lightbox-tracks::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
  border-radius: 10px;
}

/* ============ RESPONSIF ============ */
@media (max-width: 700px) {
  .stage-hint { font-size: 13px; padding: 0 12px; }
  .page-caption { font-size: 14px; }
}

@media (max-width: 480px) {
  .cover-title { font-size: 26px; }
  .cover-names { font-size: 20px; }
  .wax-seal { width: 56px; height: 56px; font-size: 20px; }
  .photo-frame { max-width: 200px; }
  .letter-frame { padding: 20px 16px 16px; }
  .letter-inner { padding-top: 26px; }
  .letter-text { font-size: 14.5px; line-height: 1.65; }
  .letter-lightbox-scroll { padding: 34px 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .petals span { animation: none; display: none; }
  .closing-cover, .closing-seal, .closing-text, .reopen-btn, .closing-photo-card,
  .lightbox-img, .photo-frame img, .playlist-tracks iframe, .playlist-lightbox-panel,
  .letter-frame, .letter-lightbox-panel {
    transition-duration: 0.2s !important;
  }
  .orbit-ring, .orbit-item-counter {
    animation: none !important;
  }
}
