/* ==========================================================================
   ROMANTIC BIRTHDAY SURPRISE THEME (AESTHETIC & MODERN)
   ========================================================================== */

:root {
  --bg-dark: #090611;
  --bg-gradient: radial-gradient(circle at 50% 20%, #1a102b 0%, #0c0818 50%, #06040b 100%);
  --panel-bg: rgba(22, 15, 38, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-hover: rgba(245, 130, 174, 0.35);
  --text-main: #fdf8f4;
  --text-muted: #b8a8cc;
  --text-dim: #7d6f94;
  
  --accent-rose: #f582ae;
  --accent-pink-glow: rgba(245, 130, 174, 0.45);
  --accent-purple: #9d71e8;
  --accent-gold: #ffd166;
  --accent-lavender: #d8b4e2;
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-serif-italic: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;

  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.25s ease;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  touch-action: pan-y;
}

/* ==========================================================================
   BACKGROUND ATMOSPHERE & PARTICLES
   ========================================================================== */
#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(50px);
  -webkit-filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: ambientFloat 14s infinite alternate ease-in-out;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.glow-1 {
  top: -10%;
  left: 20%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(157, 113, 232, 0.28) 0%, rgba(157, 113, 232, 0.08) 50%, transparent 75%);
}

.glow-2 {
  bottom: 0%;
  right: 15%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(245, 130, 174, 0.24) 0%, rgba(245, 130, 174, 0.06) 50%, transparent 75%);
  animation-delay: -5s;
}

.glow-3 {
  top: 40%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(120, 80, 190, 0.16) 0%, rgba(120, 80, 190, 0.04) 50%, transparent 75%);
  animation-delay: -9s;
}

@keyframes ambientFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, 16px, 0) scale(1.06); }
  100% { transform: translate3d(-18px, -18px, 0) scale(0.96); }
}

/* ==========================================================================
   GLASS PANEL UTILITY
   ========================================================================== */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45), 
              0 0 25px rgba(157, 113, 232, 0.08);
  border-radius: 24px;
}

/* ==========================================================================
   TOP NAVIGATION BUTTONS
   ========================================================================== */
.top-nav {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 100;
  display: flex;
  gap: 12px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(24, 18, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
  background: rgba(45, 30, 80, 0.85);
  border-color: var(--accent-rose);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px var(--accent-pink-glow);
}

/* ==========================================================================
   SCREEN MANAGER
   ========================================================================== */
.app-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 80px 20px;
  opacity: 0;
  transform: scale(0.97) translateY(15px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.app-screen.active {
  display: flex;
  opacity: 1;
  transform: none;
}

#screen-memories.active {
  display: block;
  padding-top: 36px;
  padding-bottom: 90px;
}

.screen-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

/* Sparkle Tag Badge */
.sparkle-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-lavender);
  margin-bottom: 24px;
  text-shadow: 0 0 16px rgba(216, 180, 226, 0.5);
  animation: tagGlow 3s infinite alternate ease-in-out;
}

@keyframes tagGlow {
  0% { opacity: 0.8; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-2px); }
}

/* Section Title & Subtitle */
.section-title {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.section-subtitle {
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--accent-lavender);
  margin-bottom: 36px;
  opacity: 0.9;
}

/* Common Primary Button - Glass Transparent with Liquid Left-to-Right Wipe */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
}

/* Liquid Gradient Fill Wipe from Left to Right */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(157, 113, 232, 0.95) 0%, rgba(245, 130, 174, 0.95) 100%);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 50px;
}

/* Light Gleam Sweep */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-25deg);
  transition: left 0.7s ease;
  z-index: 0;
  pointer-events: none;
}

.btn-primary:hover:not(:disabled)::before,
.btn-primary:active:not(:disabled)::before,
.btn-primary.clicked::before,
.btn-primary.filled::before {
  transform: scaleX(1);
}

.btn-primary:hover:not(:disabled)::after,
.btn-primary.clicked::after {
  left: 130%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 35px rgba(245, 130, 174, 0.5), 0 0 25px rgba(157, 113, 232, 0.35);
}

.btn-primary:active:not(:disabled),
.btn-primary.clicked {
  transform: translateY(-1px) scale(0.99);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 40px rgba(245, 130, 174, 0.7), 0 0 30px rgba(157, 113, 232, 0.5);
}

.btn-primary .btn-text {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.btn-primary.locked {
  background: rgba(30, 20, 50, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary.locked::before {
  display: none;
}

.btn-primary.glowing-btn {
  animation: buttonGlassGlow 2.5s infinite ease-in-out;
}

@keyframes buttonGlassGlow {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 15px rgba(245, 130, 174, 0.15);
  }
  50% {
    border-color: rgba(245, 130, 174, 0.6);
    box-shadow: 0 10px 30px rgba(245, 130, 174, 0.35), 0 0 25px rgba(157, 113, 232, 0.3);
  }
}

/* ==========================================================================
   SCREEN 1: COUNTDOWN TIMER
   ========================================================================== */
.hero-title {
  margin-bottom: 20px;
}

.title-line-1 {
  display: block;
  font-family: var(--font-serif);
  font-size: 58px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-main);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  line-height: 1.15;
}

.title-line-2.italic-serif {
  display: block;
  font-family: var(--font-serif-italic);
  font-style: italic;
  font-size: 48px;
  font-weight: 400;
  color: #eeddf8;
  margin-top: 6px;
  text-shadow: 0 0 25px rgba(238, 221, 248, 0.4);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 46px;
  letter-spacing: 0.02em;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 540px;
  gap: 20px;
  margin: 0 auto 36px;
}

.countdown-card {
  min-width: 0;
  width: 100%;
  height: 120px;
  background: rgba(25, 18, 42, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
}

.countdown-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 130, 174, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 130, 174, 0.2);
}

.count-number {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.count-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent-lavender);
  margin-top: 8px;
}

.countdown-status {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 28px;
  min-height: 24px;
  transition: var(--transition-fast);
}

/* ==========================================================================
   SCREEN 2: GIFT BOX
   ========================================================================== */
.gift-box-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 30px auto 40px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gift-sparkles-orbit {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: orbitRotate 10s linear infinite;
  pointer-events: none;
}

.orbit-sparkle {
  position: absolute;
  color: var(--accent-gold);
  font-size: 20px;
  text-shadow: 0 0 10px var(--accent-gold);
  animation: sparkleTwinkle 2s infinite alternate ease-in-out;
}

.orbit-sparkle.s1 { top: 0; left: 50%; }
.orbit-sparkle.s2 { top: 50%; right: 0; animation-delay: 0.5s; }
.orbit-sparkle.s3 { bottom: 0; left: 50%; animation-delay: 1s; }
.orbit-sparkle.s4 { top: 50%; left: 0; animation-delay: 1.5s; }

@keyframes orbitRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes sparkleTwinkle {
  0% { transform: scale(0.7); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 1; }
}

.gift-box {
  position: relative;
  width: 130px;
  height: 130px;
  animation: giftFloat 3s infinite ease-in-out;
  transition: transform 0.3s ease;
}

.gift-box:hover {
  transform: scale(1.08);
}

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

.gift-box.wiggle {
  animation: giftWiggle 0.6s ease-in-out;
}

@keyframes giftWiggle {
  0%, 100% { transform: rotate(0deg) scale(1.05); }
  20% { transform: rotate(-8deg) scale(1.1); }
  40% { transform: rotate(8deg) scale(1.1); }
  60% { transform: rotate(-5deg) scale(1.1); }
  80% { transform: rotate(5deg) scale(1.1); }
}

/* Gift Lid */
.gift-lid {
  position: absolute;
  top: 0;
  left: -8px;
  width: 146px;
  height: 34px;
  background: linear-gradient(135deg, #f78bb2 0%, #db598a 100%);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(245, 130, 174, 0.45);
  z-index: 5;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.gift-box.open .gift-lid {
  transform: translateY(-80px) rotate(-25deg);
  opacity: 0;
}

.lid-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 100%;
  background: linear-gradient(to bottom, #fff5d7, #ffd166);
}

/* Bow */
.gift-bow {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 24px;
}

.bow-knot {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 14px;
  background: #ffe3a8;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.bow-loop {
  position: absolute;
  top: 0;
  width: 26px;
  height: 20px;
  border: 4px solid #ffd166;
  border-radius: 50% 50% 10% 10%;
  background: rgba(255, 235, 180, 0.3);
}

.bow-loop.left {
  left: 4px;
  transform: rotate(-35deg);
}

.bow-loop.right {
  right: 4px;
  transform: rotate(35deg);
}

/* Box Body */
.gift-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 130px;
  height: 104px;
  background: linear-gradient(135deg, #e46897 0%, #ba3b6e 100%);
  border-radius: 4px 4px 12px 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.box-ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 100%;
  background: linear-gradient(to bottom, #ffe3a8, #ffd166);
}

.box-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.3) 0%, transparent 70%);
  opacity: 0.6;
}

.gift-hint {
  font-size: 15px;
  color: var(--accent-lavender);
  letter-spacing: 0.05em;
}

.pulsate {
  animation: textPulse 2s infinite ease-in-out;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ==========================================================================
   SCREEN 3: COVER / SPECIAL DAY HERO (WITH FLOATING POLAROIDS)
   ========================================================================== */
#screen-cover {
  position: relative;
  overflow: hidden;
}

.cover-center {
  max-width: 650px;
  z-index: 5;
}

.cover-hero-title {
  margin-bottom: 16px;
}

.cover-line-1 {
  display: block;
  font-family: var(--font-serif);
  font-size: 72px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-main);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.cover-line-2 {
  display: block;
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
  margin-top: 6px;
  text-shadow: 0 6px 35px rgba(245, 130, 174, 0.3);
}

.cover-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 42px;
  letter-spacing: 0.04em;
}

/* Floating Polaroids Side Wings */
.floating-polaroids {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 30px;
  pointer-events: auto;
  z-index: 4;
}

.floating-polaroids.left {
  left: 3%;
}

.floating-polaroids.right {
  right: 3%;
}

.cover-polaroid-item {
  width: 140px;
  background: #fff;
  padding: 8px 8px 18px 8px;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  animation: polaroidBob 5s infinite alternate ease-in-out;
}

.cover-polaroid-item img {
  width: 100%;
  height: 130px;
  object-fit: var(--photo-fit, cover);
  object-position: var(--photo-position, 50% 50%);
  background: #f3ebe5;
  border-radius: 2px;
  display: block;
}

.cover-polaroid-item:hover {
  transform: scale(1.15) rotate(0deg) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 130, 174, 0.4);
  z-index: 10;
}

@keyframes polaroidBob {
  0% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  100% { transform: translateY(-12px) rotate(calc(var(--rot, 0deg) + 2deg)); }
}

/* ==========================================================================
   SCREEN 4: LOVE LETTER (TYPEWRITER - CONTAINED SCROLLING)
   ========================================================================== */
#screen-letter {
  overflow: hidden;
  padding: 16px 16px 22px 16px;
}

#screen-letter.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.letter-layout {
  width: 100%;
  max-width: 700px;
  height: 100%;
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

#screen-letter .section-title {
  margin-bottom: 4px;
  flex-shrink: 0;
}

.letter-card-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 14px 0;
}

.letter-card {
  width: 100%;
  max-width: 660px;
  height: 100%;
  max-height: min(520px, calc(100dvh - 170px));
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  border-radius: 24px;
  text-align: left;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.5), 0 0 25px rgba(157, 113, 232, 0.12);
  overflow: hidden;
  contain: layout style;
}

.letter-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.letter-sound-indicator {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  flex-shrink: 0;
}

.letter-sound-indicator .bar {
  width: 3px;
  background: var(--accent-lavender);
  border-radius: 2px;
  animation: eqBounce 1s infinite alternate ease-in-out;
}

.letter-sound-indicator .b1 { height: 6px; }
.letter-sound-indicator .b2 { height: 14px; animation-delay: 0.2s; }
.letter-sound-indicator .b3 { height: 10px; animation-delay: 0.4s; }

.letter-greeting {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-rose);
  text-transform: uppercase;
  flex: 1;
  line-height: 1.35;
  word-break: break-word;
}

.letter-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-size: 15.5px;
  line-height: 1.85;
  color: #f0eaf7;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-rose) rgba(255, 255, 255, 0.05);
}

.letter-body::-webkit-scrollbar {
  width: 4px;
}
.letter-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}
.letter-body::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--accent-purple), var(--accent-rose));
  border-radius: 4px;
}

.typed-text-flow p {
  margin-bottom: 16px;
}

.typing-cursor {
  display: inline-block;
  color: var(--accent-rose);
  font-weight: 700;
  animation: blinkCursor 0.8s infinite;
  margin-left: 2px;
}

.letter-action {
  flex-shrink: 0;
}

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

/* ==========================================================================
   SCREEN 5: OUR MEMORIES (POLAROID GALLERY & BIRTHDAY THEME)
   ========================================================================== */
#screen-memories {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 36px 16px 120px 16px;
  box-sizing: border-box;
}

#screen-memories.active {
  display: block !important;
}

/* Festive Birthday Garland Pennant Banner */
.birthday-garland {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  animation: garlandSway 4s ease-in-out infinite alternate;
}

.garland-flag {
  width: 26px;
  height: 32px;
  background: linear-gradient(135deg, #f582ae, #9d71e8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0% 0%, 100% 0%, 100% 85%, 50% 100%, 0% 85%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.garland-flag:nth-child(even) {
  background: linear-gradient(135deg, #ffd166, #ff7597);
  color: #2b1736;
}

.garland-item {
  font-size: 20px;
  animation: garlandBounce 2s infinite alternate ease-in-out;
}

@keyframes garlandSway {
  0% { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(4px) rotate(1deg); }
}

@keyframes garlandBounce {
  0% { transform: scale(0.9) translateY(0); }
  100% { transform: scale(1.15) translateY(-3px); }
}

.gallery-layout {
  max-width: 890px;
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 30px; /* Jarak kiri-kanan 30px */
  row-gap: 24px;
  margin-bottom: 34px;
  padding: 8px 12px;
}

.polaroid-card {
  min-width: 0;
  background: #ffffff;
  padding: 6px 6px 18px 6px;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  transform: rotate(var(--tilt, 0deg));
}

/* Washi Tape on Top Center */
.polaroid-tape {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 12px;
  background: linear-gradient(135deg, rgba(245, 130, 174, 0.8), rgba(254, 205, 211, 0.8));
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 4;
}

.polaroid-sticker-wrapper {
  position: absolute;
  width: 32px;
  height: 32px;
  z-index: 6;
  pointer-events: none;
  transition: transform 0.35s ease;
}

.polaroid-sticker-wrapper.pos-top-left {
  top: -12px;
  left: -10px;
}

.polaroid-sticker-wrapper.pos-top-right {
  top: -12px;
  right: -10px;
}

.polaroid-sticker-wrapper.pos-bottom-left {
  bottom: 2px;
  left: -8px;
}

.polaroid-sticker-wrapper.pos-bottom-right {
  bottom: 2px;
  right: -8px;
}

.bday-sticker-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  animation: stickerFloat 3.5s infinite alternate ease-in-out;
}

.pos-top-right .bday-sticker-img,
.pos-bottom-right .bday-sticker-img {
  animation-delay: -1.7s;
}

@keyframes stickerFloat {
  0% { transform: scale(0.95) rotate(-5deg); }
  100% { transform: scale(1.08) rotate(6deg); }
}

.polaroid-card .polaroid-photo-box {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: #f3ebe5;
}

.polaroid-card .polaroid-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: var(--photo-fit, cover);
  object-position: var(--photo-position, 50% 50%);
  display: block;
  transition: transform 0.5s ease;
}

.polaroid-caption {
  font-family: var(--font-hand);
  font-size: 15px;
  color: #3b3147;
  text-align: center;
  margin-top: 8px;
  line-height: 1.2;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
  .polaroid-card:hover {
    transform: scale(1.07) rotate(0deg) translateY(-6px);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 130, 174, 0.35);
    z-index: 10;
  }

  .polaroid-card:hover .polaroid-sticker-wrapper {
    transform: scale(1.15);
  }

  .polaroid-card:hover .polaroid-photo-box img {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   SCREEN 6: A MOMENT FOR YOU (CUSTOM VIDEO PLAYER)
   ========================================================================== */
.video-layout {
  max-width: 820px;
}

.video-player-frame {
  padding: 16px;
  margin-bottom: 38px;
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(157, 113, 232, 0.15);
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 440px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Big Play Overlay */
.video-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(245, 130, 174, 0.85);
  border: 2px solid #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(245, 130, 174, 0.6);
  transition: var(--transition-fast);
  z-index: 6;
}

.video-big-play:hover {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(245, 130, 174, 1);
  box-shadow: 0 12px 35px rgba(245, 130, 174, 0.85);
}

.video-big-play.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Custom Video Controls Bar */
.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.v-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.v-btn:hover {
  color: var(--accent-rose);
  transform: scale(1.1);
}

.v-time {
  font-size: 12px;
  color: #ddd;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.v-progress-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.v-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
  border-radius: 4px;
  position: relative;
}

.v-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   SCREEN 7: BIRTHDAY WISHES
   ========================================================================== */
.wishes-layout {
  max-width: 760px;
}

.wishes-card-container {
  margin: 20px auto 38px auto;
}

.wishes-card {
  padding: 42px 40px;
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.wishes-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 130, 174, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(245, 130, 174, 0.2);
}

.card-sparkle-top {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--accent-gold);
}

.wishes-text-content {
  font-size: 17px;
  line-height: 1.9;
  color: #f7effe;
  letter-spacing: 0.02em;
}

.card-hearts-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 26px;
  font-size: 20px;
}

.card-click-hint {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-lavender);
  margin-top: 18px;
  opacity: 0.7;
}

/* Floating Heart Click Burst */
.floating-click-heart {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 1000;
  animation: floatHeartFade 1.6s forwards ease-out;
}

@keyframes floatHeartFade {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -150px) scale(1.6); opacity: 0; }
}

/* ==========================================================================
   SCREEN 8: FINAL CLOSING (MORPHING TITLE)
   ========================================================================== */
.closing-layout {
  max-width: 760px;
}

.morph-title-container {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.morph-title {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 0 35px rgba(245, 130, 174, 0.5), 0 4px 20px rgba(0, 0, 0, 0.8);
  transition: opacity 0.5s ease;
}

.closing-messages {
  margin-bottom: 46px;
}

.closing-line {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 6px;
}

.closing-sig {
  font-family: var(--font-serif-italic);
  font-style: italic;
  font-size: 26px;
  color: #fff;
  margin-top: 20px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   PERSISTENT FLOATING MUSIC BADGE (BOTTOM RIGHT)
   ========================================================================== */
.music-floating-badge {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  background: rgba(22, 16, 38, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: var(--transition-fast);
}

.music-floating-badge:hover {
  background: rgba(35, 24, 60, 0.95);
  border-color: var(--accent-rose);
  box-shadow: 0 10px 30px var(--accent-pink-glow);
  transform: translateY(-2px);
}

.music-disc {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-rose));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.music-floating-badge.playing .music-disc {
  animation: spinDisc 4s linear infinite;
}

@keyframes spinDisc {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.music-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 160px;
}

.music-title-scroll {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 10px;
}

.equalizer-bars span {
  width: 2.5px;
  height: 3px;
  background: var(--accent-rose);
  border-radius: 1px;
}

.music-floating-badge.playing .equalizer-bars span {
  animation: eqBounce 0.8s infinite alternate ease-in-out;
}

.music-floating-badge.playing .equalizer-bars span:nth-child(1) { animation-delay: 0.1s; height: 8px; }
.music-floating-badge.playing .equalizer-bars span:nth-child(2) { animation-delay: 0.3s; height: 10px; }
.music-floating-badge.playing .equalizer-bars span:nth-child(3) { animation-delay: 0.2s; height: 6px; }
.music-floating-badge.playing .equalizer-bars span:nth-child(4) { animation-delay: 0.4s; height: 9px; }

@keyframes eqBounce {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

.letter-sound-indicator .bar,
.equalizer-bars span {
  transform-origin: center bottom;
}

.badge-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 130, 174, 0.2), rgba(157, 113, 232, 0.2));
  border: 1px solid rgba(245, 130, 174, 0.45);
  color: var(--accent-rose);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  padding: 0;
  outline: none;
}

.badge-play-btn:hover {
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-purple));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 14px var(--accent-pink-glow);
  transform: scale(1.08);
}

.badge-play-btn .badge-icon {
  width: 13px;
  height: 13px;
  display: block;
}

.badge-play-btn .badge-icon path {
  fill: currentColor;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 4, 15, 0.88);
  backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  z-index: 10;
  max-width: 480px;
  width: 90%;
  text-align: center;
  animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lightbox-polaroid {
  background: #fff;
  padding: 16px 16px 36px 16px;
  border-radius: 6px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 130, 174, 0.3);
}

.lightbox-polaroid img {
  width: 100%;
  max-height: min(520px, calc(100dvh - 240px));
  object-fit: contain;
  background: #f3ebe5;
  border-radius: 4px;
  display: block;
}

.lightbox-caption {
  font-family: var(--font-hand);
  font-size: 22px;
  color: #3b3147;
  margin-top: 18px;
}

.lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  background: var(--accent-rose);
  transform: rotate(90deg);
}

.lightbox-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

.lb-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lb-nav-btn:hover {
  background: var(--accent-rose);
  transform: scale(1.1);
}

/* ==========================================================================
   GUIDE MODAL (CARA GANTI FOTO & LAGU)
   ========================================================================== */
.guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 210;
  display: none;
  align-items: center;
  justify-content: center;
}

.guide-modal.active {
  display: flex;
}

.guide-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 4, 15, 0.85);
  backdrop-filter: blur(12px);
}

.guide-box {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 540px;
  padding: 32px;
  border-radius: 24px;
  text-align: left;
  animation: zoomIn 0.3s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.guide-header h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-main);
}

.guide-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.guide-body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.guide-section {
  background: rgba(0, 0, 0, 0.25);
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-section h4 {
  font-size: 14px;
  color: var(--accent-rose);
  margin-bottom: 6px;
}

.guide-section ul {
  padding-left: 20px;
  font-size: 13px;
  color: #ddd;
}

.guide-section code {
  background: rgba(245, 130, 174, 0.15);
  color: var(--accent-rose);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12.5px;
}

.guide-footer {
  margin-top: 24px;
  text-align: right;
}

.guide-done-btn {
  padding: 10px 24px;
  font-size: 13px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET OPTIMIZATIONS)
   ========================================================================== */
@media (max-width: 1024px) {
  .floating-polaroids {
    display: none; /* Hide floating side wings on tablets/mobile to keep focus clean */
  }
  
  .polaroid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  .app-screen {
    flex-direction: column;
    justify-content: flex-start;
    padding: 28px 16px calc(90px + env(safe-area-inset-bottom, 0px));
  }
  .app-screen > .screen-content {
    flex-shrink: 0;
    margin-block: auto;
  }
  #screen-cover {
    overflow-y: auto;
  }

  .title-line-1 { font-size: 42px; }
  .title-line-2.italic-serif { font-size: 34px; }
  
  .cover-line-1 { font-size: 52px; }
  .cover-line-2 { font-size: 44px; }
  
  .section-title { font-size: 32px; }
  .morph-title { font-size: 44px; }
  
  .countdown-card {
    height: 85px;
    border-radius: 16px;
  }
  
  .count-number { font-size: clamp(26px, 8vw, 32px); }
  .count-label { font-size: 9px; letter-spacing: 0.14em; }
  
  .countdown-grid { max-width: 380px; gap: clamp(8px, 2.5vw, 12px); }
  .hero-subtitle { margin-bottom: 30px; }
  .sparkle-tag { font-size: 11px; letter-spacing: 0.18em; }
  .btn-primary { max-width: 100%; padding: 16px 24px; font-size: 12px; }

  /* Keep the message box bounded; the page can still scroll to its action. */
  #screen-letter {
    overflow-y: auto;
    padding: 28px 16px calc(100px + env(safe-area-inset-bottom, 0px));
  }
  #screen-letter.active { display: block; }
  .letter-layout {
    height: auto;
    max-height: none;
    gap: 16px;
  }
  .letter-card-container { flex: none; margin: 0; }
  
  .letter-card { 
    padding: 18px 16px; 
    border-radius: 20px;
    height: clamp(280px, calc(100vh - 190px), 520px);
    height: clamp(280px, calc(100svh - 190px), 520px);
    max-height: none;
  }
  .letter-header-bar {
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  .letter-greeting {
    font-size: 11.5px;
    letter-spacing: 0.08em;
  }
  .letter-body { 
    font-size: 14px; 
    line-height: 1.7; 
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    padding-right: 6px;
    overflow-wrap: anywhere;
  }
  .typed-text-flow p {
    margin-bottom: 12px;
  }
  .letter-action {
    margin: 4px 0 0;
  }
  
  /* Compact mobile album gallery with spacious horizontal distance */
  .gallery-layout {
    max-width: 420px;
    padding: 0 16px;
  }
  .polaroid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px; /* Jarak kiri-kanan 30px sesuai permintaan */
    row-gap: 22px;
    margin-bottom: 24px;
    padding: 6px;
  }
  .polaroid-card {
    padding: 5px 5px 14px 5px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
  .polaroid-caption {
    font-size: 13px !important;
    margin-top: 5px !important;
  }
  .bday-sticker-img {
    width: 25px !important;
    height: 25px !important;
  }
  .polaroid-sticker-wrapper.pos-top-left {
    top: -9px;
    left: -7px;
  }
  .polaroid-sticker-wrapper.pos-top-right {
    top: -9px;
    right: -7px;
  }
  .polaroid-sticker-wrapper.pos-bottom-left {
    bottom: -5px;
    left: -6px;
  }
  .polaroid-sticker-wrapper.pos-bottom-right {
    bottom: -5px;
    right: -6px;
  }
  
  .wishes-card { padding: 28px 22px; }
  .wishes-text-content { font-size: 15px; }
  
  .music-floating-badge {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    padding: 6px 12px;
  }

  .birthday-garland { gap: 4px; }
  .garland-flag { min-width: 0; width: 20px; height: 28px; font-size: 11px; }
  .garland-item { font-size: 16px; }
  .section-subtitle { line-height: 1.7; letter-spacing: 0.1em; }
  .lightbox-modal { height: 100%; height: 100dvh; }
  .lightbox-content { max-height: calc(100dvh - 110px); overflow-y: auto; padding-top: 44px; }
  .lightbox-close { top: 0; }
  .lightbox-polaroid { padding: 10px 10px 20px; }
  .lightbox-polaroid img { max-height: calc(100dvh - 300px); object-fit: contain; }
}

/* Keep the decorations; avoid repainting large blurred layers on touch devices. */
@media (max-width: 768px), (pointer: coarse) {
  .ambient-glow {
    animation: none;
    filter: none;
    -webkit-filter: none;
    will-change: auto;
  }
  .glass-panel,
  .countdown-card,
  .btn-primary,
  .music-floating-badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .lightbox-backdrop { backdrop-filter: none; }
  .polaroid-card .bday-sticker-img { animation-play-state: paused; }
  .polaroid-card.is-visible .bday-sticker-img { animation-play-state: running; }
  .app-screen.is-scrolling *,
  .app-screen.is-scrolling *::before,
  .app-screen.is-scrolling *::after {
    animation-play-state: paused !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 480px) {
  .gallery-layout {
    max-width: 370px;
    padding: 0 12px;
  }
  .polaroid-grid {
    column-gap: 26px; /* 26px di HP kecil */
    row-gap: 18px;
  }
  .polaroid-card {
    padding: 4px 4px 12px 4px;
  }
  .polaroid-caption {
    font-size: 12px !important;
    margin-top: 4px !important;
  }
  .bday-sticker-img {
    width: 22px !important;
    height: 22px !important;
  }
}

@media (max-width: 360px) {
  .gallery-layout {
    max-width: 310px;
    padding: 0 8px;
  }
  .polaroid-grid {
    column-gap: 16px;
    row-gap: 14px;
  }
  .polaroid-caption {
    font-size: 11px !important;
  }
  .bday-sticker-img {
    width: 19px !important;
    height: 19px !important;
  }
}
