:root {
  --bg-primary: #181014;
  --bg-secondary: #23151b;
  --card-bg: rgba(45, 25, 34, 0.78);
  --card-border: rgba(245, 158, 11, 0.22);
  --card-hover-border: rgba(251, 113, 133, 0.45);
  --amber-primary: #d97706;
  --amber-light: #fbbf24;
  --rose-accent: #fb7185;
  --rose-deep: #be123c;
  --text-main: #fef3c7;
  --text-muted: #d1b8a5;
  --text-dim: #9c8273;
  --gold-glow: rgba(245, 158, 11, 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 15% 20%, rgba(217, 119, 6, 0.15), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(251, 113, 133, 0.12), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(35, 21, 27, 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 Canvas */
#particles-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 Fixed Button */
.audio-ctrl {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 100;
}

.audio-btn {
  background: rgba(35, 21, 27, 0.85);
  border: 1px solid var(--amber-light);
  color: var(--amber-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 15px var(--gold-glow);
  transition: all 0.3s ease;
}

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

/* Passcode Modal Gate */
.passcode-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 8, 12, 0.94);
  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.6), 0 0 25px var(--gold-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 12px var(--amber-light));
  display: inline-block;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

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

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

.lock-sub strong {
  color: var(--text-main);
}

.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(--amber-light);
  background: transparent;
  transition: all 0.25s ease;
}

.pin-dot.filled {
  background: var(--amber-light);
  box-shadow: 0 0 12px var(--amber-light);
  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(251, 191, 36, 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(217, 119, 6, 0.25);
  border-color: var(--amber-light);
  transform: translateY(-2px);
}

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

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

/* Main Container 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(217, 119, 6, 0.18);
  border: 1px solid var(--amber-light);
  color: var(--amber-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(--amber-light) 0%, var(--rose-accent) 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;
}

/* Care Package Unboxing */
.care-package-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.package-box {
  width: 180px;
  height: 180px;
  background: linear-gradient(145deg, #3d202b, #201217);
  border: 2px solid var(--amber-light);
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 30px var(--gold-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.package-box:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 45px var(--gold-glow);
}

.package-box.opened {
  animation: unboxShine 1s forwards ease-in-out;
}

@keyframes unboxShine {
  0% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1.05); border-color: var(--rose-accent); }
}

.box-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  background: linear-gradient(to right, var(--rose-deep), var(--rose-accent), var(--rose-deep));
}

.box-ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(to bottom, var(--rose-deep), var(--rose-accent), var(--rose-deep));
}

.box-emblem {
  position: relative;
  z-index: 2;
  font-size: 3.2rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

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

/* Late Apology Banner */
.late-banner {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(251, 113, 133, 0.15));
  border: 1px dashed var(--amber-light);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.8rem;
  text-align: center;
  position: relative;
}

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

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

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

/* Interactive Tea Ceremony Section */
.tea-ceremony {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.tea-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.tea-cup {
  font-size: 3.8rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: block;
}

.tea-cup:hover {
  transform: scale(1.1) rotate(-5deg);
}

.steam-cloud {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  opacity: 0.7;
  animation: steamRise 2s infinite ease-out;
}

@keyframes steamRise {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  50% { opacity: 0.9; }
  100% { transform: translate(-50%, -25px) scale(1.3); opacity: 0; }
}

.tea-btn {
  background: linear-gradient(135deg, var(--amber-primary), #b45309);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.6rem;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--gold-glow);
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.tea-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--gold-glow);
}

/* Sister's Wisdom Cards */
.wisdom-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

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

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

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

.wisdom-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.wisdom-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.wisdom-num {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rose-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.wisdom-quote {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.wisdom-meaning {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Memories Timeline */
.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(--amber-light);
  transform: translateY(-4px);
}

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

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

.mem-tag {
  background: rgba(251, 113, 133, 0.2);
  color: var(--rose-accent);
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.mem-era {
  font-size: 0.8rem;
  color: var(--amber-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: #fdfaf5;
  color: #2b1f1d;
  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(217, 119, 6, 0.3);
  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: #8b5e43;
  font-weight: 600;
}

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

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

.letter-ps {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(251, 113, 133, 0.12);
  border-left: 4px solid var(--rose-deep);
  border-radius: 0.4rem;
  font-size: 0.95rem;
  color: #701a2b;
  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: #6b4d3e;
}

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

/* Interactive 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%, #fbbf24 60%, #ef4444 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 16px #fbbf24, 0 0 28px #f59e0b;
  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, #f43f5e, #fb7185, #f43f5e);
  border-radius: 4px;
}

.cake-base {
  width: 220px;
  height: 65px;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  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: #78350f;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.cake-btn {
  background: linear-gradient(135deg, var(--rose-accent), var(--rose-deep));
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 2rem;
  cursor: pointer;
  margin-top: 1.5rem;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
  transition: all 0.3s ease;
}

.cake-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(244, 63, 94, 0.6);
}

.cake-wish-banner {
  margin-top: 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--amber-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(255, 255, 255, 0.08);
}

/* 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;
  }
  .cake-base {
    width: 180px;
    height: 55px;
  }
}
