/* ===== Variabel warna & font (ganti di sini kalau mau ubah tema) ===== */
:root {
  --pink-utama: #FF4D8D;
  --pink-muda: #FFD0E8;
  --bg: #FFFBF8;
  --teks-utama: #4A1F2D;
  --teks-sekunder: #B87C8A;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--teks-utama);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

.quote { font-family: 'Allura', cursive; color: var(--pink-utama); }

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pink-muda) 0%, var(--bg) 40%);
}

/* ===== Screen management ===== */
.screen {
  position: absolute;
  inset: 0;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
}

.screen.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.screen-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teks-sekunder);
}

/* ===== Tombol ===== */
.btn {
  min-height: 44px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: var(--pink-utama);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 77, 141, 0.35);
  transition: transform 0.15s ease;
}
.btn:active { transform: scale(0.96); }

.btn-outline {
  background: transparent;
  color: var(--pink-utama);
  border: 2px solid var(--pink-utama);
  box-shadow: none;
}

/* ===== Hero ===== */
.hero-title {
  font-size: 30px;
  line-height: 1.25;
}
.hero-sub {
  font-size: 14px;
  color: var(--teks-sekunder);
  max-width: 300px;
}

/* ===== Timeline (Our Story) ===== */
.timeline {
  width: 100%;
  max-width: 340px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  position: relative;
  padding: 0 0 28px 28px;
  border-left: 2px solid var(--pink-muda);
  min-height: 44px;
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink-utama);
}
.timeline-date { font-size: 12px; color: var(--teks-sekunder); }
.timeline-title { font-weight: 600; margin-top: 2px; }
.timeline-photo {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
  box-shadow: 0 8px 20px rgba(74,31,45,0.12);
}
.timeline-detail {
  font-size: 13px;
  line-height: 1.65;
  color: var(--teks-sekunder);
  margin-top: 10px;
}

/* ===== Gallery (Our Memories) ===== */
.gallery-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.filter-chip {
  min-height: 32px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--pink-muda);
  background: #fff;
  font-size: 12px;
  color: var(--teks-sekunder);
  cursor: pointer;
}
.filter-chip.active {
  background: var(--pink-utama);
  color: #fff;
  border-color: var(--pink-utama);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 340px;
}
.polaroid {
  background: #fff;
  padding: 8px 8px 20px;
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
}
.polaroid img, .photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #999;
  text-align: center;
}
.polaroid-cap { font-size: 10px; color: var(--teks-sekunder); text-align: center; margin-top: 6px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.lightbox.open { display: flex; }
.lightbox img, .lightbox .photo-placeholder { max-width: 90%; max-height: 70%; border-radius: 8px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ===== Things I Love About You ===== */
.love-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  font-size: 16px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.love-progress { font-size: 12px; color: var(--teks-sekunder); }

/* ===== Love Letter ===== */
.envelope {
  width: 220px;
  height: 150px;
  background: var(--pink-utama);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 10px 24px rgba(255,77,141,0.3);
}
.letter-text {
  display: none;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.8;
  max-width: 320px;
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
}
.letter-text.open { display: block; }

/* ===== Birthday Wish ===== */
.cake-wrap { position: relative; font-size: 70px; user-select: none; }
.candle-flame { display: inline-block; transition: opacity 0.3s; }
.candle-flame.blown { opacity: 0; }
.hold-hint { font-size: 12px; color: var(--teks-sekunder); }

/* ===== Gift ===== */
.gift-box { font-size: 70px; cursor: pointer; }
.gift-reveal { display: none; }
.gift-reveal.open { display: block; }

/* ===== Floating heart particles ===== */
.heart-particle {
  position: fixed;
  pointer-events: none;
  font-size: 14px;
  z-index: 50;
  animation: floatHeart 1.2s ease-out forwards;
}

/* Floating music toggle */
.music-toggle {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--pink-muda);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 60;
}
.music-toggle.show { display: flex; }

canvas#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}
