:root {
  --bg-primary: #0c1a15;
  --bg-secondary: #13261f;
  --card-bg: rgba(19, 38, 31, 0.78);
  --card-border: rgba(212, 175, 55, 0.25);
  --card-hover-border: rgba(244, 114, 182, 0.5);
  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --peony-pink: #f472b6;
  --peony-light: #fbcfe8;
  --sage-accent: #a3b18a;
  --text-main: #fefce8;
  --text-muted: #cbd5c0;
  --text-dim: #94a38e;
  --bloom-glow: rgba(212, 175, 55, 0.35);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-hand: 'Caveat', cursive;
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(244, 114, 182, 0.14), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(19, 38, 31, 0.8), transparent 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Petals & Confetti Canvases */
#petals-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Audio Control */
.audio-ctrl {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 100;
}

.audio-btn {
  background: rgba(19, 38, 31, 0.85);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.6rem 1.1rem;
  border-radius: 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px var(--bloom-glow);
  transition: all 0.3s ease;
}

.audio-btn:hover {
  background: var(--gold-primary);
  color: #0c1a15;
  transform: translateY(-2px);
}

/* Passcode Modal Gate (Botanical Glass Vault) */
.passcode-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 14, 0.95);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.passcode-modal.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.passcode-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 30px var(--bloom-glow);
  animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lock-icon {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 14px var(--gold-primary));
  display: inline-block;
  animation: bloomPulse 3s infinite ease-in-out;
}

@keyframes bloomPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.lock-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

.lock-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.lock-sub strong {
  color: #fff;
}

.pin-row {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  background: transparent;
  transition: all 0.25s ease;
}

.pin-dot.filled {
  background: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-primary);
  transform: scale(1.15);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 260px;
  margin: 0 auto;
}

.key-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.85rem 0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.key-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.key-btn:active {
  transform: scale(0.95);
}

.passcode-hint {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--peony-light);
}

/* Main Content Layout */
.main-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.25rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Badge Tag */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2rem 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--peony-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

/* Blooming Flower Unboxing Container */
.bloom-unboxing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.bloom-box {
  width: 190px;
  height: 190px;
  background: linear-gradient(145deg, #183329, #0f231b);
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 35px var(--bloom-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.bloom-box:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 50px var(--bloom-glow);
}

.bloom-box.opened {
  animation: bloomOpen 1.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bloomOpen {
  0% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(10deg); border-color: var(--peony-pink); }
  100% { transform: scale(1.08); border-color: var(--peony-pink); box-shadow: 0 0 50px rgba(244, 114, 182, 0.6); }
}

.peony-flower {
  font-size: 4rem;
  filter: drop-shadow(0 0 12px var(--peony-pink));
  transition: transform 0.6s ease;
}

.bloom-box.opened .peony-flower {
  transform: scale(1.2) rotate(15deg);
}

.unbox-prompt {
  font-size: 0.95rem;
  color: var(--gold-light);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Late Apology Banner */
.late-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(244, 114, 182, 0.14));
  border: 1px dashed var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.8rem;
  text-align: center;
}

.late-headline {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.late-apology {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--peony-pink);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.late-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Champagne Toast Section */
.toast-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  text-align: center;
}

.flute-icon-wrap {
  display: inline-block;
  margin-bottom: 1rem;
}

.flute-icon {
  font-size: 3.6rem;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 16px var(--gold-primary));
}

.flute-icon:hover {
  transform: scale(1.15) rotate(-10deg);
}

.toast-btn {
  background: linear-gradient(135deg, var(--gold-primary), #b48a1c);
  color: #0c1a15;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.75rem 2rem;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--bloom-glow);
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.toast-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
}

/* Section Header */
.section-header {
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Memories Grid */
.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.memory-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.memory-card:hover {
  border-color: var(--peony-pink);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.mem-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mem-icon {
  font-size: 2rem;
}

.mem-tag {
  background: rgba(244, 114, 182, 0.2);
  color: var(--peony-pink);
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.mem-era {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mem-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #fff;
  font-weight: 700;
}

.mem-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Heartfelt Letter Section */
.letter-section {
  background: #fffdfa;
  color: #1e2820;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7);
  position: relative;
  font-family: var(--font-body);
}

.letter-header {
  border-bottom: 2px dashed rgba(212, 175, 55, 0.4);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.letter-date {
  font-size: 0.85rem;
  color: #5d6d5f;
  font-weight: 600;
}

.letter-salutation {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #1b3d2b;
  font-weight: 700;
}

.letter-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-size: 1rem;
  line-height: 1.8;
  color: #2b3a2d;
}

.letter-ps {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(244, 114, 182, 0.12);
  border-left: 4px solid var(--peony-pink);
  border-radius: 0.4rem;
  font-size: 0.95rem;
  color: #831843;
  font-weight: 500;
}

.letter-footer {
  margin-top: 2rem;
  text-align: right;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
}

.letter-signoff {
  font-size: 0.95rem;
  color: #4a5c4e;
}

.letter-author {
  font-family: var(--font-hand);
  font-size: 2.3rem;
  color: #b48a1c;
  font-weight: 700;
}

/* Interactive Gilded Birthday Cake */
.cake-section {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
}

.cake-visual {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flame {
  width: 14px;
  height: 24px;
  background: radial-gradient(circle, #fff 10%, #fef08a 50%, #f472b6 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 16px #fef08a, 0 0 28px #d4af37;
  animation: flicker 1s infinite alternate;
  transition: all 0.4s ease;
}

@keyframes flicker {
  0% { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.1) rotate(2deg); }
}

.candle.blown .flame {
  opacity: 0;
  transform: translateY(-8px) scale(0.2);
  box-shadow: none;
}

.candle-stick {
  width: 12px;
  height: 48px;
  background: linear-gradient(to bottom, #d4af37, #fef08a, #d4af37);
  border-radius: 4px;
}

.cake-base {
  width: 220px;
  height: 65px;
  background: linear-gradient(135deg, #1b3d2b, #0f231b);
  border: 2px solid var(--gold-primary);
  border-radius: 12px 12px 6px 6px;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold-light);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.cake-btn {
  background: linear-gradient(135deg, var(--gold-primary), var(--peony-pink));
  color: #0c1a15;
  border: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 2rem;
  cursor: pointer;
  margin-top: 1.5rem;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
  transition: all 0.3s ease;
}

.cake-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
}

.cake-wish-banner {
  margin-top: 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold-light);
  display: none;
  animation: cardFadeIn 0.5s ease-out;
}

.cake-wish-banner.visible {
  display: block;
}

/* Action Reply Buttons */
.reply-section {
  text-align: center;
  padding: 1.5rem 1rem;
}

.reply-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}

.reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  border-radius: 2rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.reply-btn.wa {
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
}

.reply-btn.wa:hover {
  background: #1eb956;
  transform: translateY(-2px);
}

.reply-btn.ig {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(220, 39, 67, 0.35);
}

.reply-btn.ig:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

/* Responsive Media Queries */
@media (max-width: 600px) {
  .main-wrapper {
    padding: 2rem 1rem 5rem;
    gap: 2.5rem;
  }
  .passcode-card {
    padding: 1.8rem 1.2rem;
  }
  .letter-section {
    padding: 1.8rem 1.2rem;
  }
  .bloom-box {
    width: 160px;
    height: 160px;
  }
  .peony-flower {
    font-size: 3.2rem;
  }
  .cake-base {
    width: 180px;
    height: 55px;
  }
}
