/* ========================================================
   MODERN EMOTIONAL BIRTHDAY EXPERIENCE - STYLE SHEET
   ======================================================== */

:root {
  --bg-deep: #06040b;
  --bg-dark: #0d0818;
  --bg-card: rgba(20, 12, 34, 0.78);
  --bg-card-hover: rgba(28, 18, 48, 0.88);
  
  --primary: #ff6584;
  --primary-glow: rgba(255, 101, 132, 0.45);
  --primary-light: #ff8fa3;
  --accent-gold: #ffd166;
  --accent-gold-glow: rgba(255, 209, 102, 0.45);
  --accent-rose: #ff758c;
  --text-white: #ffffff;
  --text-muted: #c4bcd4;
  --text-dim: #8c82a2;

  --border-glass: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(255, 209, 102, 0.38);

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-hand: 'Caveat', cursive;

  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background Canvas & Ambient Glows */
#starsCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.ambient-nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: nebulaFloat 18s ease-in-out infinite alternate;
}

.nebula-1 {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, #e91e63, transparent 70%);
}

.nebula-2 {
  bottom: -15%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, #7928ca, transparent 70%);
  animation-delay: -7s;
}

.nebula-3 {
  top: 45%;
  left: 30%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, #ff0080, transparent 70%);
  animation-delay: -12s;
  opacity: 0.2;
}

@keyframes nebulaFloat {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.15) translate(25px, -30px); }
  100% { transform: scale(0.95) translate(-20px, 20px); }
}

/* ========================================================
   RANDOM PHOTO COLLAGE BACKGROUND (NGEBLINK / BERKEDIP GENTLE)
   ======================================================== */
.photo-collage-bg {
  position: fixed;
  inset: -15px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  padding: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
  overflow: hidden;
}

.photo-collage-bg.active {
  opacity: 1;
}

.photo-collage-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(6, 4, 11, 0.45) 0%, rgba(6, 4, 11, 0.85) 85%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.photo-collage-overlay.active {
  opacity: 1;
}

.collage-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  filter: brightness(0.32) saturate(0.55);
  opacity: 0.45;
  transform: scale(0.96);
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.collage-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Glowing / Blinking Tile: Terang 1, ntar yang lain redup bergantian */
.collage-tile.blink-glow {
  filter: brightness(1.28) saturate(1.35) contrast(1.1);
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(255, 101, 132, 0.85), 0 0 16px rgba(255, 209, 102, 0.75);
  z-index: 5;
}

@media (max-width: 600px) {
  .photo-collage-bg {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
  }
}

/* ========================================================
   FULLSCREEN BLACKOUT OVERLAY (TIUP LILIN TRANSITION)
   ======================================================== */
.blackout-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #10061e 0%, #000000 95%);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), visibility 1.2s;
}

.blackout-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.blackout-whisper {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  color: var(--accent-gold);
  text-shadow: 0 0 25px var(--accent-gold-glow);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
  line-height: 1.5;
  padding: 0 16px;
}

.blackout-overlay.active .blackout-whisper {
  opacity: 1;
  transform: scale(1);
}

.blackout-whisper.fade-out {
  opacity: 0 !important;
  transform: scale(0.92) !important;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Container */
.app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 16px 80px;
}

/* ========================================================
   STAGE SECTIONS & CHOREOGRAPHED TRANSITIONS
   ======================================================== */
.stage-section {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-section.active {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
  animation: stageSectionFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ========================================================
   INTRO SCREEN / GIFT BOX PRESENTATION
   ======================================================== */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: radial-gradient(circle at center, #1b0f2e 0%, #06040b 85%);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1), visibility 1s;
}

.intro-screen.hide {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
  visibility: hidden;
}

.intro-screen.gone {
  display: none !important;
}

.intro-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.gift-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: var(--text-muted);
  backdrop-filter: blur(10px);
  margin-bottom: 30px;
  letter-spacing: 0.3px;
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { border-color: rgba(255, 255, 255, 0.12); }
  50% { border-color: rgba(255, 209, 102, 0.4); box-shadow: 0 0 15px rgba(255, 209, 102, 0.2); }
}

/* 3D Gift Box Presentation */
.gift-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 34px;
  perspective: 1000px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.35s ease;
}

.gift-wrapper:hover {
  transform: translateY(-4px) scale(1.05);
}

/* Wiggle / Anticipation Shake on click */
.gift-wrapper.shaking {
  animation: giftShake 0.4s ease-in-out infinite;
}

@keyframes giftShake {
  0% { transform: scale(1.03) rotate(0deg); }
  20% { transform: scale(1.06) rotate(-3.5deg) translateY(-2px); }
  40% { transform: scale(1.06) rotate(3.5deg) translateY(2px); }
  60% { transform: scale(1.08) rotate(-4.5deg) translateY(-3px); }
  80% { transform: scale(1.08) rotate(4.5deg) translateY(1px); }
  100% { transform: scale(1.04) rotate(0deg); }
}

.gift-glow-effect {
  position: absolute;
  inset: -18px;
  background: radial-gradient(circle, var(--primary-glow) 0%, rgba(255, 209, 102, 0.25) 50%, transparent 72%);
  border-radius: 50%;
  animation: pulseBoxGlow 2.5s infinite ease-in-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulseBoxGlow {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.3); opacity: 0.95; filter: drop-shadow(0 0 15px rgba(255, 101, 132, 0.6)); }
}

/* Radiant Light Burst from Inside the Box upon Opening */
.gift-light-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  background: radial-gradient(circle, #fffbe6 0%, #ffd166 35%, rgba(255, 77, 109, 0.6) 65%, transparent 85%);
  opacity: 0;
  pointer-events: none;
  z-index: 12;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.gift-light-burst.active {
  opacity: 1;
  transform: translate(-50%, -60%) scale(3.6);
  filter: drop-shadow(0 0 40px #ffd166);
}

/* Shimmering Floating Orbit Sparkles around Gift */
.gift-sparkles-orbit {
  position: absolute;
  inset: -22px;
  pointer-events: none;
  z-index: 3;
}

.sparkle-star {
  position: absolute;
  font-size: 1.15rem;
  animation: sparkleFloat 3s infinite ease-in-out;
  filter: drop-shadow(0 0 6px #ffd166);
}

.sparkle-star.s1 { top: -2%; left: 8%; animation-delay: 0s; }
.sparkle-star.s2 { top: 12%; right: 4%; animation-delay: 0.8s; font-size: 0.92rem; }
.sparkle-star.s3 { bottom: 22%; left: -2%; animation-delay: 1.6s; font-size: 0.85rem; }
.sparkle-star.s4 { bottom: 2%; right: 8%; animation-delay: 2.3s; font-size: 1.05rem; }

@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) scale(0.8); opacity: 0.3; }
  50% { transform: translateY(-10px) scale(1.25); opacity: 1; }
}

/* Surprise Item that Floats out upon opening */
.gift-surprise {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  z-index: 16;
  pointer-events: none;
  transition: transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.gift-surprise .surprise-icon {
  display: block;
  font-size: 3.2rem;
  filter: drop-shadow(0 0 20px #ffd166) drop-shadow(0 0 45px #ff4d6d);
  animation: surprisePulse 1.2s infinite alternate ease-in-out;
}

.gift-surprise.active {
  opacity: 1;
  transform: translate(-50%, -105px) scale(1.35);
}

@keyframes surprisePulse {
  0% { transform: scale(1) rotate(-4deg); }
  100% { transform: scale(1.15) rotate(4deg); }
}

/* 3D Box Body */
.gift-box {
  position: relative;
  width: 140px;
  height: 110px;
  margin: 40px auto 0;
  background: linear-gradient(145deg, #ff4d6d 0%, #c9184a 55%, #800f2f 100%);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(128, 15, 47, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.4), inset 0 -4px 10px rgba(0, 0, 0, 0.3);
  animation: floatBox 3.5s ease-in-out infinite;
  transition: transform 0.6s ease, filter 0.6s ease;
  overflow: hidden;
  z-index: 2;
}

@keyframes floatBox {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

/* Box Ribbons */
.gift-box-ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 100%;
  background: linear-gradient(to right, #ffd166, #ffb703 60%, #e09600);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.5);
}

.gift-box-ribbon-h {
  position: absolute;
  top: 48%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 24px;
  background: linear-gradient(to bottom, #ffd166, #ffb703 60%, #e09600);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Gift Lid */
.gift-lid {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 154px;
  height: 34px;
  background: linear-gradient(145deg, #ff758f 0%, #d90429 60%, #9b041e 100%);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  transform-origin: top center;
  transition: transform 0.85s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.8s ease, filter 0.8s ease;
  z-index: 10;
}

.gift-lid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 100%;
  background: linear-gradient(to right, #ffd166, #ffb703 60%, #e09600);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.gift-lid-lip {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0 0 10px 10px;
}

/* Gift Bow / Pita 3D */
.gift-bow {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 32px;
  z-index: 12;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.gift-bow-left, .gift-bow-right {
  position: absolute;
  top: 4px;
  width: 32px;
  height: 24px;
  border: 5px solid #ffd166;
  background: radial-gradient(circle at center, rgba(255, 209, 102, 0.28), transparent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

.gift-bow-left {
  left: 2px;
  border-radius: 60% 60% 10% 60%;
  transform: rotate(-32deg);
}

.gift-bow-right {
  right: 2px;
  border-radius: 60% 60% 60% 10%;
  transform: rotate(32deg);
}

.gift-bow-center {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fff3b0 25%, #ffb703 70%, #d48b00 100%);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.gift-ribbon-tail {
  position: absolute;
  top: 22px;
  width: 14px;
  height: 32px;
  background: linear-gradient(to bottom, #ffd166, #ffb703);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
  z-index: 1;
  transition: transform 0.7s ease, opacity 0.5s ease;
}

.gift-ribbon-tail.tail-left {
  left: 14px;
  transform: rotate(18deg);
}

.gift-ribbon-tail.tail-right {
  right: 14px;
  transform: rotate(-18deg);
}

/* Dramatic Opening Sequence */
.gift-wrapper.opening .gift-lid {
  transform: translateX(-50%) translateY(-140px) rotateX(-65deg) rotateZ(20deg) scale(0.9);
  opacity: 0;
  filter: brightness(1.5);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.gift-wrapper.opening .gift-bow {
  transform: translateX(-50%) translateY(-45px) scale(1.4);
  opacity: 0;
}

.gift-wrapper.opening .gift-box {
  transform: translateY(16px) scale(0.92);
  filter: brightness(1.35);
  box-shadow: 0 0 55px rgba(255, 209, 102, 0.85), 0 20px 45px rgba(255, 77, 109, 0.75);
}

/* Open Button */
.btn-open-gift {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  background: linear-gradient(135deg, #ff4d6d 0%, #c9184a 50%, #7209b7 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 77, 109, 0.45);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  overflow: hidden;
}

.btn-open-gift::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: rotate(30deg);
  animation: shineRibbon 3.5s infinite;
}

@keyframes shineRibbon {
  0% { transform: translateX(-100%) rotate(30deg); }
  50%, 100% { transform: translateX(100%) rotate(30deg); }
}

.btn-open-gift:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 40px rgba(255, 77, 109, 0.6);
}

.gift-hint {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ========================================================
   FLOATING AUDIO CONTROLLER WIDGET (ALWAYS AT TOP-RIGHT)
   ======================================================== */
.audio-controller {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 12, 30, 0.85);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(14px);
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.audio-controller:hover {
  background: rgba(28, 18, 48, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.vinyl-disk {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #222 25%, #050505 50%, #333 75%, #000 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.vinyl-disk::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.audio-controller.playing .vinyl-disk {
  animation: spinVinyl 3.5s linear infinite;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.audio-info {
  display: flex;
  flex-direction: column;
}

.audio-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-status {
  font-size: 0.64rem;
  color: var(--text-muted);
}

.audio-waves {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.audio-waves span {
  width: 2px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.audio-controller.playing .audio-waves span:nth-child(1) { animation: soundWave 0.8s infinite ease-in-out alternate; }
.audio-controller.playing .audio-waves span:nth-child(2) { animation: soundWave 0.5s infinite ease-in-out alternate 0.2s; }
.audio-controller.playing .audio-waves span:nth-child(3) { animation: soundWave 0.9s infinite ease-in-out alternate 0.4s; }

@keyframes soundWave {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* ========================================================
   GLOBAL GLASS CARDS & TYPOGRAPHY
   ======================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

/* ========================================================
   STAGE 1: CANDLE SECTION (CENTERED WITH BACKGROUND COLLAGE)
   ======================================================== */
#stageCandle.active {
  min-height: calc(100vh - 130px);
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.candle-date-wrap {
  margin-bottom: 14px;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 101, 132, 0.2));
  border: 1.5px solid var(--border-gold);
  padding: 7px 18px;
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: clamp(0.78rem, 3.5vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 0 25px var(--accent-gold-glow);
  animation: pulseGold 2.5s infinite alternate;
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 15px rgba(255, 209, 102, 0.2); }
  100% { box-shadow: 0 0 30px rgba(255, 209, 102, 0.5); }
}

.candle-section {
  text-align: center;
  margin: auto;
  max-width: 440px;
}

.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5.2vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.candle-desc {
  color: var(--text-muted);
  font-size: clamp(0.88rem, 3.8vw, 0.95rem);
  max-width: 420px;
  margin: 0 auto 24px;
  padding: 0 6px;
}

/* ========================================================
   22ND BIRTHDAY SPECIAL CAKE & 3D SCULPTED GOLD CANDLES
   ======================================================== */
.cake-container {
  position: relative;
  width: 185px;
  height: 180px;
  margin: 0 auto 22px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cake-container:hover {
  transform: scale(1.04);
}

.cake-glow-aura {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 55px;
  background: radial-gradient(ellipse, rgba(255, 209, 102, 0.4) 0%, rgba(255, 101, 132, 0.2) 40%, transparent 72%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: cakeAuraPulse 3s infinite alternate ease-in-out;
}

@keyframes cakeAuraPulse {
  0% { transform: translateX(-50%) scale(0.95); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(1.08); opacity: 0.95; }
}

/* Ceramic Cake Stand / Plate */
.cake-stand {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 186px;
  height: 15px;
  z-index: 2;
}

.cake-plate {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #ece6f8 40%, #cac0df 80%, #998eb3 100%);
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 2px 5px rgba(255, 255, 255, 0.85);
  position: relative;
}

.cake-plate-rim {
  position: absolute;
  top: 1px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd166 25%, #fff 50%, #ffd166 75%, transparent);
  border-radius: 50px;
  opacity: 0.85;
}

/* 3D Round Cylindrical Cake Body */
.cake-tier {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 76px;
  background: linear-gradient(135deg, #f7a072 0%, #e76f51 45%, #b53824 100%);
  border-radius: 16px 16px 10px 10px;
  box-shadow: 0 14px 35px rgba(181, 56, 36, 0.45), inset 4px 0 10px rgba(255, 255, 255, 0.35), inset -5px 0 14px rgba(0, 0, 0, 0.38);
  z-index: 3;
}

.cake-sponge {
  position: absolute;
  inset: 0;
  border-radius: 16px 16px 10px 10px;
  overflow: hidden;
}

.cake-filling-stripe {
  position: absolute;
  top: 52%;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.85) 40%, rgba(255, 255, 255, 0.35) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Thick Glossy Whipped Cream Frosting with Rounded Drips */
.cake-frosting {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  background: linear-gradient(to bottom, #ffffff 0%, #fff6ea 85%, #fbe9d5 100%);
  border-radius: 16px 16px 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), inset 0 2px 4px #ffffff;
  z-index: 4;
}

.frosting-drip {
  position: absolute;
  bottom: -8px;
  background: linear-gradient(to bottom, #fff6ea 0%, #fbe9d5 100%);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.14);
}

.frosting-drip.d1 { left: 8%; width: 15px; height: 11px; }
.frosting-drip.d2 { left: 24%; width: 18px; height: 14px; }
.frosting-drip.d3 { left: 42%; width: 17px; height: 12px; }
.frosting-drip.d4 { left: 59%; width: 19px; height: 15px; }
.frosting-drip.d5 { left: 77%; width: 14px; height: 11px; }
.frosting-drip.d6 { left: 89%; width: 11px; height: 8px; }

/* Warm Candlelight Reflection Shimmering on Cream */
.cream-candlelight-reflection {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 104px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.65) 0%, rgba(255, 120, 0, 0.28) 45%, transparent 80%);
  border-radius: 50%;
  pointer-events: none;
  animation: creamGlowBreath 1.5s infinite alternate ease-in-out;
}

@keyframes creamGlowBreath {
  0% { opacity: 0.65; transform: translateX(-50%) scale(0.94); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* Strawberries & Gold Sugar Pearls on Cake */
.cake-decorations {
  position: absolute;
  top: -5px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 5;
  pointer-events: none;
}

.cake-strawberry {
  font-size: 0.95rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  display: inline-block;
}

.cake-strawberry.s-left {
  transform: rotate(-12deg);
}

.cake-strawberry.s-right {
  transform: rotate(12deg);
}

.cake-pearl {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #ffd166 45%, #b37400 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================================
   3D SCULPTED METALLIC GOLD NUMBER 22 CANDLES
   ======================================================== */
.candles-wrap-22 {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  z-index: 6;
}

.candle-sculpted-3d {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 54px;
}

/* Flame Assembly: Teardrop fire with hot core, blue base & floating embers */
.flame-assembly {
  position: relative;
  width: 22px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 92%;
  z-index: 5;
  margin-bottom: -4px;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.flame-1 {
  animation: flameDanceLeft 1.35s infinite alternate ease-in-out;
}

.flame-2 {
  animation: flameDanceRight 1.55s infinite alternate ease-in-out -0.65s;
}

@keyframes flameDanceLeft {
  0% { transform: rotate(-2.5deg) scaleY(1); }
  30% { transform: rotate(3deg) scaleY(1.07) scaleX(0.96); }
  65% { transform: rotate(-1.5deg) scaleY(0.96); }
  85% { transform: rotate(2deg) scaleY(1.04) scaleX(1.02); }
  100% { transform: rotate(0deg) scaleY(1); }
}

@keyframes flameDanceRight {
  0% { transform: rotate(2deg) scaleY(1.02); }
  35% { transform: rotate(-3deg) scaleY(0.95) scaleX(1.02); }
  70% { transform: rotate(2.5deg) scaleY(1.08) scaleX(0.96); }
  90% { transform: rotate(-1.5deg) scaleY(0.98); }
  100% { transform: rotate(0deg) scaleY(1); }
}

/* Outer Fiery Teardrop */
.flame-body {
  position: absolute;
  bottom: 0;
  width: 17px;
  height: 27px;
  background: radial-gradient(ellipse at 50% 82%, #ffffff 0%, #fff3b0 22%, #ffd166 45%, #ff7700 75%, #e63900 100%);
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  box-shadow: 0 0 14px #ff9e00, 0 0 28px #ff5400, 0 0 45px rgba(255, 84, 0, 0.5);
}

/* Incandescent Hot White Heart of Flame */
.flame-white-core {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6.5px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #fffbe6 60%, transparent 100%);
  opacity: 0.95;
}

/* Blue Combustion Base at the Wick */
.flame-blue-base {
  position: absolute;
  bottom: 0.5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at bottom, rgba(56, 189, 248, 0.95) 0%, rgba(14, 165, 233, 0.55) 60%, transparent 100%);
}

/* Radiant Ambient Firelight Aura */
.flame-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.42) 0%, rgba(255, 107, 0, 0.2) 42%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  animation: auraBreath 2.2s infinite alternate ease-in-out;
}

/* Micro-sparks ascending from flame */
.flame-micro-sparks {
  position: absolute;
  inset: -8px;
  pointer-events: none;
}

.flame-spark {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  background: #fff3b0;
  border-radius: 50%;
  box-shadow: 0 0 4px #ffd166;
  opacity: 0;
}

.flame-spark.sp1 {
  bottom: 12px;
  left: 3px;
  animation: sparkRise1 2.2s infinite ease-out;
}

.flame-spark.sp2 {
  bottom: 14px;
  right: 2px;
  animation: sparkRise2 2.5s infinite ease-out 0.8s;
}

@keyframes sparkRise1 {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  30% { opacity: 0.9; }
  100% { transform: translateY(-24px) translateX(-5px) scale(1.1); opacity: 0; }
}

@keyframes sparkRise2 {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  30% { opacity: 0.85; }
  100% { transform: translateY(-26px) translateX(6px) scale(1.1); opacity: 0; }
}

/* Real Braided Candle Wick with Glowing Ember Tip */
.candle-wick-wrap {
  position: relative;
  width: 6px;
  height: 9px;
  margin-bottom: -1px;
  z-index: 4;
}

.candle-wick-braid {
  width: 3.2px;
  height: 8.5px;
  margin: 0 auto;
  background: linear-gradient(to bottom, #111111 0%, #292524 55%, #44403c 100%);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.candle-wick-ember {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff4500;
  box-shadow: 0 0 6px #ff7b00, 0 0 10px #ff3b00;
}

/* 3D Wax Sculpture Container */
.wax-sculpture {
  position: relative;
  width: 52px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.3s ease;
}

.wax-svg {
  display: block;
  overflow: visible;
}

.candle-sculpted-3d:hover .wax-sculpture {
  transform: translateY(-2px) scale(1.05);
}

/* Acrylic / Gold Peg into Frosting */
.candle-peg-stem {
  width: 4px;
  height: 14px;
  background: linear-gradient(to bottom, #c87600 0%, #ffd166 50%, rgba(255, 255, 255, 0.8) 100%);
  margin-top: -3px;
  border-radius: 1px 1px 3px 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* Fluffy Whipped Cream Rosette Cushioning the Candle Base */
.candle-cream-dollop {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 9px;
  background: radial-gradient(ellipse at center, #ffffff 40%, #fff4e5 100%);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
  z-index: 3;
}

.cream-pearl {
  position: absolute;
  top: -3px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #ffd166 55%, #b37400 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Smoke puffing from the wicks on blow */
.candle-smoke {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 32px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.4) 60%, transparent 100%);
  filter: blur(4px);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

/* Extinguished states */
.cake-container.blown .flame-assembly {
  opacity: 0;
  transform: scale(0.05) translateY(12px);
}

.cake-container.blown .cream-candlelight-reflection {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.cake-container.blown .candle-wick-ember {
  opacity: 0.25;
  box-shadow: none;
  transition: opacity 1s ease;
}

.cake-container.blown .candle-smoke.smoke-left {
  animation: smokePuffRealisticLeft 2.4s forwards ease-out;
}

.cake-container.blown .candle-smoke.smoke-right {
  animation: smokePuffRealisticRight 2.4s forwards ease-out 0.1s;
}

@keyframes smokePuffRealisticLeft {
  0% { opacity: 0.9; transform: translateX(-50%) translateY(0) scale(1); }
  40% { opacity: 0.65; transform: translateX(-35%) translateY(-32px) scale(2.4); }
  100% { opacity: 0; transform: translateX(-75%) translateY(-65px) scale(3.8); }
}

@keyframes smokePuffRealisticRight {
  0% { opacity: 0.9; transform: translateX(-50%) translateY(0) scale(1); }
  40% { opacity: 0.65; transform: translateX(-15%) translateY(-32px) scale(2.4); }
  100% { opacity: 0; transform: translateX(45%) translateY(-65px) scale(3.8); }
}

.btn-blow-candle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 209, 102, 0.15);
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-blow-candle:hover {
  background: var(--accent-gold);
  color: #1a0f2e;
  box-shadow: 0 6px 20px var(--accent-gold-glow);
  transform: translateY(-2px);
}

.wish-granted-box {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255, 209, 102, 0.1);
  border: 1px dashed var(--accent-gold);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.5;
  animation: fadeIn 0.8s ease;
}

.wish-granted-box.show {
  display: block;
}

/* ========================================================
   STAGE 2: GALERI KENANGAN (POLAROID AUTO-SLIDE & TYPEWRITER)
   ======================================================== */
.gallery-section {
  text-align: center;
}

.gallery-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.85rem, 3.6vw, 0.95rem);
  margin-bottom: 20px;
}

.polaroid-stage-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 18px;
  width: 100%;
}

/* POLAROID CARD - MOBILE OPTIMIZED */
.polaroid-card {
  position: relative;
  width: 100%;
  max-width: 285px;
  background: #ffffff;
  color: #1c1917;
  padding: 12px 12px 16px;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 3px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  cursor: pointer;
  transform: rotate(-1.5deg);
  margin: 0 auto;
}

.polaroid-card.changing {
  opacity: 0.25;
  transform: scale(0.96) rotate(1deg);
}

.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: rgba(255, 218, 185, 0.78);
  backdrop-filter: blur(2px);
  border-left: 2px dashed rgba(200, 160, 130, 0.45);
  border-right: 2px dashed rgba(200, 160, 130, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

/* Square Photo Frame for authentic Polaroid feel */
.polaroid-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 260px;
  background: #ece8e1;
  overflow: hidden;
  border-radius: 2px;
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.polaroid-card:hover .polaroid-photo-frame img {
  transform: scale(1.03);
}

.polaroid-caption-area {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0 6px;
  text-align: center;
}

/* CRITICAL: white-space: pre-wrap and word-break for natural typing with spaces */
.polaroid-caption {
  font-family: var(--font-hand);
  font-size: clamp(1.22rem, 4.4vw, 1.45rem);
  line-height: 1.35;
  color: #261f1c;
  display: inline;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
}

.polaroid-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: #8c827a;
  text-align: right;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Auto Slide 3s Progress Line */
.auto-slide-timer-wrap {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.auto-slide-timer-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #ff4d6d, #ffd166);
  border-radius: 2px;
  transition: width 0.05s linear;
}

/* Controls */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.btn-ctrl {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.btn-ctrl:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.carousel-counter {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 55px;
}

.gallery-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Button Buka Pesan */
.open-letter-action-wrap {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.open-letter-action-wrap.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-open-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #ff4d6d 0%, #c9184a 50%, #7209b7 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 77, 109, 0.5);
  transition: all 0.35s ease;
  animation: pulseLetterBtn 2.2s infinite alternate;
  width: 100%;
  max-width: 330px;
}

@keyframes pulseLetterBtn {
  0% { transform: scale(1); box-shadow: 0 10px 25px rgba(255, 77, 109, 0.4); }
  100% { transform: scale(1.03); box-shadow: 0 16px 40px rgba(255, 77, 109, 0.7); }
}

/* ========================================================
   STAGE 3: SURAT TULUS (TYPEWRITER & TYPO EFFECT)
   ======================================================== */
.letter-section {
  position: relative;
}

.letter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
  gap: 12px;
}

.letter-title-wrap {
  display: flex;
  flex-direction: column;
}

.letter-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #b71c1c, #7f0000);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(183, 28, 28, 0.4);
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.letter-date-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.letter-body {
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 3.8vw, 1.02rem);
  color: #f1edfa;
  line-height: 1.85;
  min-height: 220px;
}

/* CRITICAL: white-space: pre-wrap and word-break for letter typing */
.typed-paragraph {
  margin-bottom: 18px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
  animation: fadeIn 0.4s ease;
}

/* Typing Cursor */
.typing-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.2em;
  background: var(--accent-gold);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blinkCursor 0.75s infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.letter-closing {
  margin-top: 28px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 18px;
  text-align: right;
  transition: opacity 0.8s ease;
}

.letter-closing-text {
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  color: var(--text-muted);
  font-style: italic;
}

.letter-sign {
  font-family: var(--font-hand);
  font-size: clamp(1.9rem, 6vw, 2.3rem);
  color: var(--accent-gold);
  margin-top: 4px;
}

.letter-controls {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.btn-reveal-letter {
  background: linear-gradient(135deg, rgba(255, 101, 132, 0.2), rgba(255, 209, 102, 0.2));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  max-width: 270px;
  text-align: center;
}

.btn-reveal-letter:hover {
  background: var(--accent-gold);
  color: #12091f;
}

.btn-restart {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  transition: all 0.25s ease;
}

.btn-restart:hover {
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 36px;
  padding: 0 10px;
}

/* ========================================================
   LIGHTBOX MODAL FOR HIGH-RES PHOTO PREVIEW
   ======================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  color: #fff;
  margin-top: 14px;
  line-height: 1.35;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ========================================================
   COMPREHENSIVE MOBILE & RESPONSIVE ADJUSTMENTS (< 480px)
   Memastikan semua konten tampil utuh, proporsional, & tidak kepotong
   ======================================================== */
@media (max-width: 480px) {
  /* Floating Audio Controller Lebih Kompak & Rapi */
  .audio-controller {
    top: 10px;
    right: 10px;
    padding: 4px 10px 4px 6px;
    gap: 6px;
  }

  .vinyl-disk {
    width: 24px;
    height: 24px;
  }

  .vinyl-disk::before {
    width: 6px;
    height: 6px;
  }

  .audio-title {
    max-width: 72px;
    font-size: 0.68rem;
  }

  .audio-status {
    font-size: 0.58rem;
  }

  .audio-waves {
    height: 10px;
    gap: 1.5px;
  }

  /* Container & Global Cards */
  .app-container {
    padding: 46px 12px 28px;
    max-width: 100%;
  }

  .glass-card {
    padding: 16px 12px 18px;
    border-radius: 18px;
  }

  /* STAGE 0: INTRO SCREEN */
  .intro-screen {
    padding: 16px;
  }

  .gift-tag {
    padding: 6px 14px;
    font-size: 0.82rem;
    margin-bottom: 22px;
  }

  .gift-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
  }

  .gift-box {
    width: 118px;
    height: 94px;
    margin: 32px auto 0;
  }

  .gift-lid {
    width: 130px;
    height: 30px;
    top: 18px;
  }

  .gift-bow {
    width: 56px;
    height: 26px;
    top: -22px;
  }

  .gift-bow-left, .gift-bow-right {
    width: 26px;
    height: 20px;
    border-width: 4px;
  }

  .gift-bow-center {
    width: 15px;
    height: 15px;
  }

  .gift-ribbon-tail {
    width: 11px;
    height: 24px;
    top: 18px;
  }

  .btn-open-gift {
    padding: 12px 26px;
    font-size: 0.92rem;
  }

  .gift-hint {
    margin-top: 14px;
    font-size: 0.78rem;
  }

  /* STAGE 1: TIUP LILIN */
  .candle-section {
    max-width: 100%;
  }

  .candle-date-wrap {
    margin-bottom: 10px;
  }

  .date-badge {
    padding: 5px 14px;
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  .candle-section .section-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .candle-desc {
    font-size: 0.85rem;
    margin-bottom: 14px;
  }

  .cake-container {
    transform: scale(0.92);
    transform-origin: center bottom;
    margin: 0 auto 14px;
  }

  .btn-blow-candle {
    padding: 10px 20px;
    font-size: 0.88rem;
  }

  .wish-granted-box {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 0.84rem;
  }

  /* STAGE 2: GALERI POLAROID */
  .gallery-section .section-tag {
    font-size: 0.7rem;
    margin-bottom: 3px;
    letter-spacing: 1.2px;
  }

  .gallery-section .section-title {
    font-size: 1.32rem;
    margin-bottom: 2px;
  }

  .gallery-subtitle {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .polaroid-stage-wrapper {
    margin: 4px auto 8px;
  }

  .polaroid-card {
    max-width: 232px;
    padding: 8px 8px 10px;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  }

  .washi-tape {
    top: -9px;
    width: 62px;
    height: 18px;
  }

  .polaroid-photo-frame {
    max-height: 195px;
    border-radius: 2px;
  }

  .polaroid-caption-area {
    min-height: 48px;
    margin-top: 8px;
    padding: 0 4px;
  }

  .polaroid-caption {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .polaroid-date {
    font-size: 0.65rem;
    margin-top: 4px;
  }

  .auto-slide-timer-wrap {
    margin-top: 6px;
    height: 2.5px;
  }

  .carousel-controls {
    gap: 12px;
    margin-top: 8px;
  }

  .btn-ctrl {
    width: 36px;
    height: 36px;
  }

  .btn-ctrl svg {
    width: 18px;
    height: 18px;
  }

  .carousel-counter {
    font-size: 0.85rem;
    min-width: 48px;
  }

  .gallery-hint {
    font-size: 0.72rem;
    margin-top: 6px;
  }

  .open-letter-action-wrap {
    margin-top: 12px;
    padding-top: 10px;
  }

  .btn-open-letter {
    padding: 11px 20px;
    font-size: 0.88rem;
    max-width: 260px;
  }

  /* STAGE 3: SURAT TULUS */
  .letter-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .letter-section .section-title {
    font-size: 1.25rem;
  }

  .letter-stamp {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .letter-date-label {
    font-size: 0.72rem;
  }

  .letter-body {
    font-size: 0.9rem;
    line-height: 1.75;
    min-height: 160px;
  }

  .typed-paragraph {
    margin-bottom: 14px;
  }

  .letter-closing {
    margin-top: 18px;
    padding-top: 12px;
  }

  .letter-closing-text {
    font-size: 0.82rem;
  }

  .letter-sign {
    font-size: 1.8rem;
  }

  .letter-controls {
    margin-top: 16px;
  }

  .btn-reveal-letter {
    padding: 9px 18px;
    font-size: 0.82rem;
    max-width: 240px;
  }

  .btn-restart {
    padding: 9px 18px;
    font-size: 0.82rem;
  }

  .app-footer {
    margin-top: 22px;
    font-size: 0.72rem;
  }
}

/* ========================================================
   EXTRA COMPACT UNTUK LAYAR DENGAN TINGGI TERBATAS (< 720px)
   Menjamin 100% stage galeri muat dalam 1 layar tanpa terpotong
   ======================================================== */
@media (max-height: 720px) and (max-width: 480px) {
  .app-container {
    padding: 42px 10px 18px;
  }

  .glass-card {
    padding: 12px 10px 14px;
  }

  .gallery-section .section-title {
    font-size: 1.22rem;
    margin-bottom: 2px;
  }

  .gallery-subtitle {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }

  .polaroid-stage-wrapper {
    margin: 2px auto 6px;
  }

  .polaroid-card {
    max-width: 212px;
    padding: 6px 6px 8px;
  }

  .polaroid-photo-frame {
    max-height: 168px;
  }

  .polaroid-caption-area {
    min-height: 42px;
    margin-top: 6px;
  }

  .polaroid-caption {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .carousel-controls {
    margin-top: 6px;
    gap: 10px;
  }

  .btn-ctrl {
    width: 32px;
    height: 32px;
  }

  .gallery-hint {
    font-size: 0.68rem;
    margin-top: 4px;
  }

  .open-letter-action-wrap {
    margin-top: 8px;
    padding-top: 8px;
  }

  .btn-open-letter {
    padding: 9px 18px;
    font-size: 0.82rem;
  }
}

/* ========================================================
   LAYAR KECIL / COMPACT PHONE (< 360px)
   ======================================================== */
@media (max-width: 360px) {
  .app-container {
    padding: 44px 8px 20px;
  }

  .polaroid-card {
    max-width: 210px;
  }

  .polaroid-photo-frame {
    max-height: 165px;
  }

  .polaroid-caption {
    font-size: 1.05rem;
  }

  .btn-open-letter {
    font-size: 0.82rem;
    padding: 9px 16px;
  }
}
