:root {
  --bg-primary: #faf7f2;
  --bg-secondary: #f3eee5;
  --card-bg: #ffffff;
  --card-border: #ebdcd0;
  --pastel-purple: #c084fc;
  --pastel-pink: #f472b6;
  --pastel-mint: #86efac;
  --pastel-peach: #fed7aa;
  --pastel-yellow: #fde68a;
  --text-main: #33272a;
  --text-muted: #6e5d62;
  --text-dim: #9c8a8e;
  --tape-pink: rgba(244, 114, 182, 0.45);
  --tape-purple: rgba(192, 132, 252, 0.45);
  --tape-mint: rgba(134, 239, 172, 0.55);
  --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(#d6c9bd 1px, transparent 1px),
    radial-gradient(#ebdcd0 1px, var(--bg-primary) 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Floating Pastel Confetti 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: #fff;
  border: 2px dashed var(--pastel-purple);
  color: #7e22ce;
  padding: 0.6rem 1.1rem;
  border-radius: 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.25);
  transition: all 0.3s ease;
}

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

/* Passcode Modal Gate (Diary Padlock) */
.passcode-modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 37, 0.85);
  backdrop-filter: blur(12px);
  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: #fffdf9;
  border: 3px solid #f3e8df;
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  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.6rem;
  display: inline-block;
  animation: diaryBounce 2.5s infinite ease-in-out;
}

@keyframes diaryBounce {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

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

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

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

.pin-dot.filled {
  background: var(--pastel-pink);
  border-color: var(--pastel-pink);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.6);
  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: #fdf2f8;
  border: 1px solid #fbcfe8;
  color: #831843;
  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: #f472b6;
  color: #fff;
  transform: translateY(-2px);
}

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

.passcode-hint {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: #be185d;
}

/* 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;
}

/* Washi Tape Strip Decoration */
.washi-tape {
  width: 120px;
  height: 26px;
  background: var(--tape-pink);
  margin: 0 auto -13px;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transform: rotate(-1.5deg);
}

.washi-tape.purple {
  background: var(--tape-purple);
  transform: rotate(2deg);
}

.washi-tape.mint {
  background: var(--tape-mint);
  transform: rotate(-2.5deg);
}

/* Badge Tag */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fdf2f8;
  border: 1px solid var(--pastel-pink);
  color: #be185d;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  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, #7e22ce 0%, #db2777 50%, #ea580c 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;
}

/* Interactive Diary Book Unboxing */
.diary-book-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.diary-book {
  width: 190px;
  height: 230px;
  background: linear-gradient(135deg, #fbcfe8, #f472b6);
  border: 4px solid #fff;
  border-radius: 8px 18px 18px 8px;
  box-shadow: -8px 0 0 #db2777, 0 12px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.4s ease;
}

.diary-book:hover {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: -8px 0 0 #db2777, 0 18px 40px rgba(244, 114, 182, 0.4);
}

.diary-book.opened {
  animation: bookOpen 1s forwards ease-in-out;
}

@keyframes bookOpen {
  0% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1.05); }
}

.diary-ribbon {
  position: absolute;
  top: -12px;
  width: 20px;
  height: 60px;
  background: #c084fc;
  border-radius: 4px;
}

.diary-padlock {
  font-size: 3.2rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.unbox-prompt {
  font-size: 0.95rem;
  color: #9333ea;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Late Apology Banner (Post-it style) */
.late-banner {
  background: #fef08a;
  border-left: 6px solid #eab308;
  border-radius: 6px;
  padding: 1.5rem 1.8rem;
  box-shadow: 2px 4px 15px rgba(0, 0, 0, 0.08);
  transform: rotate(-0.5deg);
}

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

.late-apology {
  font-size: 1.05rem;
  font-weight: 800;
  color: #a16207;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.late-sub {
  font-size: 0.9rem;
  color: #713f12;
}

/* Interactive Sticker Board */
.sticker-board {
  background: #fff;
  border: 2px dashed #e9d5ff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.sticker-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sticker-item {
  font-size: 2.8rem;
  cursor: pointer;
  background: #faf5ff;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.2);
  transition: all 0.25s ease;
  user-select: none;
}

.sticker-item:hover {
  transform: scale(1.2) rotate(8deg);
  background: #f3e8ff;
}

.sticker-status {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: #7e22ce;
  font-weight: 600;
}

/* Memories Section (Polaroid Style Grid) */
.section-header {
  text-align: center;
}

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

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

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

.polaroid-card {
  background: #fff;
  border: 1px solid #ebdcd0;
  border-radius: 6px;
  padding: 1.2rem 1.2rem 1.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s ease;
  position: relative;
}

.polaroid-card:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.polaroid-card:nth-child(even) {
  transform: rotate(1.5deg);
}

.polaroid-card:hover {
  transform: translateY(-6px) scale(1.02) rotate(0deg);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.14);
}

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

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

.mem-tag {
  background: #fdf2f8;
  color: #db2777;
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.mem-era {
  font-size: 0.8rem;
  color: #9333ea;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

/* Heartfelt Letter (Lined Diary Page) */
.letter-section {
  background: #ffffff;
  border: 1px solid #e2d9cf;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  position: relative;
  font-family: var(--font-body);
  background-image: repeating-linear-gradient(white, white 28px, #f1eae2 29px, #f1eae2 30px);
  line-height: 30px;
}

.letter-header {
  border-bottom: 2px dashed #f472b6;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
}

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

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

.letter-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-size: 1rem;
  color: #3f2f2d;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.letter-ps {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fdf2f8;
  border-left: 4px solid #ec4899;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  color: #831843;
  font-weight: 600;
}

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

.letter-signoff {
  font-size: 0.95rem;
  color: #701a75;
}

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

/* Interactive Birthday Cake (Pastel Fun) */
.cake-section {
  text-align: center;
  background: #fff;
  border: 2px dashed #f472b6;
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.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%, #f472b6 60%, #c084fc 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 14px #f472b6, 0 0 24px #c084fc;
  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: repeating-linear-gradient(45deg, #fbcfe8, #fbcfe8 6px, #c084fc 6px, #c084fc 12px);
  border-radius: 4px;
}

.cake-base {
  width: 220px;
  height: 65px;
  background: linear-gradient(135deg, #fdf2f8, #fbcfe8);
  border: 2px solid #f472b6;
  border-radius: 12px 12px 6px 6px;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #db2777;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.cake-btn {
  background: linear-gradient(135deg, #c084fc, #db2777);
  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(219, 39, 119, 0.35);
  transition: all 0.3s ease;
}

.cake-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(219, 39, 119, 0.55);
}

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

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