/* ============================================================
   HAPPY BIRTHDAY ALEX — STYLESHEET
   Theme: Elegant / Luxury / Dreamy Glassmorphism, Dark Mode
   Palette: Gold + Blue + Purple gradient
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root{
  --bg: #07040f;
  --bg-2: #0d0620;
  --gold: #f0c419;
  --gold-2: #ffe9a8;
  --blue: #4d7dff;
  --blue-2: #7bc4ff;
  --purple: #9b5cff;
  --purple-2: #c58bff;
  --text: #f5f1ff;
  --text-dim: #b9adcf;
  --glass-bg: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.14);
  --shadow-soft: 0 10px 40px rgba(0,0,0,0.45);
  --font-display: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
  --font-script: 'Great Vibes', cursive;
  --ease: cubic-bezier(.22,.9,.32,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; margin: 0; padding: 0; }
html{ scroll-behavior: smooth; }
body{
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 60%);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a{ color: inherit; text-decoration: none; }
::selection{ background: var(--purple); color: #fff; }

/* Hide native cursor on devices that support hover, replaced by glow */
@media (hover:hover) and (pointer:fine){
  body{ cursor: none; }
  a, button{ cursor: none; }
}

/* ---------- Glass utility ---------- */
.glass{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-soft);
}

/* ---------- Cursor Glow ---------- */
.cursor-glow{
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,196,25,0.55), rgba(155,92,255,0.25) 60%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .2s var(--ease), height .2s var(--ease), opacity .3s;
  mix-blend-mode: screen;
  opacity: 0;
}
.cursor-glow.active{ opacity: 1; }
.cursor-glow.ripple{ width: 60px; height: 60px; }

/* ---------- Canvases ---------- */
#bg-canvas{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#confetti-canvas{
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen{
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}
#loading-screen.hidden{ opacity: 0; visibility: hidden; }
#loading-particles{
  position: absolute;
  inset: 0;
}
.loading-content{
  position: relative;
  z-index: 2;
  text-align: center;
}
.loading-logo{
  position: relative;
  width: 110px; height: 110px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-ring{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--purple);
  animation: spin 1.6s linear infinite;
}
.logo-icon{ font-size: 44px; filter: drop-shadow(0 0 14px rgba(240,196,25,0.6)); animation: pulse 1.8s ease-in-out infinite; }
.loading-title{
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.4em;
  background: linear-gradient(90deg, var(--gold-2), var(--purple-2), var(--blue-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loading-subtitle{
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.loading-bar-track{
  width: 220px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin: 28px auto 10px;
  overflow: hidden;
}
.loading-bar-fill{
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--purple), var(--blue));
  box-shadow: 0 0 12px var(--gold);
  transition: width .15s linear;
}
.loading-percent{
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

@keyframes spin{ to{ transform: rotate(360deg); } }
@keyframes pulse{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.12); } }

/* ============================================================
   ENTER GATE
   ============================================================ */
#enter-gate{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,10,40,0.9), rgba(2,1,8,0.98));
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s var(--ease), visibility .8s var(--ease);
}
#enter-gate.visible{ opacity: 1; visibility: visible; }
#enter-gate.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
.enter-inner{ text-align: center; padding: 20px; }
.enter-eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--gold-2);
  margin-bottom: 10px;
}
.enter-title{
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin-bottom: 34px;
  background: linear-gradient(90deg, var(--gold-2), var(--purple-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.enter-btn{
  position: relative;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--bg);
  font-weight: 600;
  background: linear-gradient(120deg, var(--gold), var(--gold-2), var(--purple-2));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 8px 30px rgba(240,196,25,0.35);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.enter-btn:hover{ transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 40px rgba(155,92,255,0.45); }

@keyframes gradientShift{
  0%,100%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
}

/* ============================================================
   MUSIC PLAYER
   ============================================================ */
#music-player{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 50px;
}
.music-btn{
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}
.music-bars{ display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music-bars i{
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--purple));
  border-radius: 2px;
  animation: musicBar 1s ease-in-out infinite;
  height: 40%;
}
.music-bars i:nth-child(2){ animation-delay: .2s; }
.music-bars i:nth-child(3){ animation-delay: .4s; }
body.playing .music-bars i{ animation-play-state: running; }
body:not(.playing) .music-bars i{ animation-play-state: paused; height: 20%; }
@keyframes musicBar{
  0%,100%{ height: 30%; }
  50%{ height: 100%; }
}
#volume-slider{
  width: 70px;
  accent-color: var(--gold);
}
.mute-btn{ font-size: 0.95rem; }

/* ============================================================
   LAYOUT / SECTIONS
   ============================================================ */
main{ position: relative; z-index: 1; }
section{
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  overflow: hidden;
}
.section-inner{ max-width: 900px; width: 100%; text-align: center; }
.section-eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--purple-2);
  margin-bottom: 12px;
}
.section-title{
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 20px;
  background: linear-gradient(90deg, var(--gold-2), var(--blue-2), var(--purple-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-hint{ color: var(--text-dim); font-size: 0.85rem; margin-bottom: 40px; }
.section-hint code{ color: var(--gold-2); background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; }

/* Reveal-on-scroll */
.reveal{
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in-view{ opacity: 1; transform: translateY(0); }

/* ============================================================
   AURORA / HERO
   ============================================================ */
.aurora{
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(155,92,255,0.35), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(77,125,255,0.3), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(240,196,25,0.22), transparent 45%);
  filter: blur(60px);
  animation: auroraMove 16s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes auroraMove{
  0%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(3%, -2%) scale(1.08); }
  100%{ transform: translate(-3%, 2%) scale(1); }
}

#hero{ padding-top: 60px; }
.hero-content{ position: relative; z-index: 2; text-align: center; }
.hero-eyebrow{
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--gold-2);
  margin-bottom: 20px;
}
.hero-title{ line-height: 1.05; }
.hero-title-line{
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 3rem);
  color: var(--text);
}
.hero-title-name{
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 16vw, 9rem);
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--purple-2), var(--blue-2), var(--gold));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
  filter: drop-shadow(0 0 30px rgba(155,92,255,0.35));
}
@keyframes shine{
  to{ background-position: 300% center; }
}
.hero-age{
  margin-top: 18px;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.hero-age span{
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-2);
  font-weight: 700;
  margin-right: 6px;
}
.hero-subtitle{
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.hero-scroll{
  margin-top: 60px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-mouse{
  width: 24px; height: 38px;
  border: 2px solid var(--text-dim);
  border-radius: 14px;
  position: relative;
}
.scroll-dot{
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  background: var(--gold-2);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot{
  0%{ opacity: 1; top: 6px; }
  70%{ opacity: 0; top: 20px; }
  100%{ opacity: 0; top: 6px; }
}
.scroll-label{ font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }

.floating-layer{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.floating-item{
  position: absolute;
  will-change: transform;
  animation: floatUp linear infinite;
  opacity: 0.85;
}
@keyframes floatUp{
  0%{ transform: translateY(110vh) translateX(0) rotate(0deg); opacity: 0; }
  10%{ opacity: 0.9; }
  90%{ opacity: 0.8; }
  100%{ transform: translateY(-15vh) translateX(var(--drift,0)) rotate(360deg); opacity: 0; }
}

/* ============================================================
   TYPEWRITER MESSAGE
   ============================================================ */
.message-card{
  padding: 50px 40px;
  border-radius: 24px;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}
.typewriter-text{
  display: inline;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}
.typewriter-cursor{
  display: inline-block;
  color: var(--gold-2);
  animation: blink 0.9s step-end infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-track{
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  justify-content: center;
  padding: 40px 10px;
}
.polaroid{
  background: #fdfdfa;
  padding: 14px 14px 46px;
  border-radius: 4px;
  width: 190px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  transform: rotate(var(--rot, 0deg));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  cursor: pointer;
  /* hidden until it scrolls into view, then pops in one by one */
  opacity: 0;
}
.polaroid.shown{ opacity: 1; }
.polaroid.pop{
  animation: polaroidIn .7s var(--ease) both;
  animation-delay: var(--pop-delay, 0s);
}
@keyframes polaroidIn{
  from{ opacity: 0; transform: rotate(var(--rot, 0deg)) translateY(70px) scale(0.8); }
  to{ opacity: 1; transform: rotate(var(--rot, 0deg)) translateY(0) scale(1); }
}
.polaroid:hover{
  transform: rotate(0deg) translateY(-10px) scale(1.06);
  box-shadow: 0 30px 60px rgba(155,92,255,0.35);
  z-index: 5;
}
.polaroid-photo{
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  overflow: hidden;
}
.polaroid-photo span{ filter: grayscale(0.2); opacity: 0.85; }
.polaroid-photo img{ width: 100%; height: 100%; object-fit: cover; }
.ph1{ background: linear-gradient(135deg, #f0c419, #9b5cff); }
.ph2{ background: linear-gradient(135deg, #4d7dff, #c58bff); }
.ph3{ background: linear-gradient(135deg, #ffe9a8, #4d7dff); }
.ph4{ background: linear-gradient(135deg, #9b5cff, #f0c419); }
.ph5{ background: linear-gradient(135deg, #7bc4ff, #f0c419); }
.ph6{ background: linear-gradient(135deg, #c58bff, #7bc4ff); }
.polaroid figcaption{
  position: absolute;
  bottom: 14px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: #333;
}

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(2,1,8,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.lightbox.open{ opacity: 1; visibility: visible; }
.lightbox-inner{ text-align: center; }
.lightbox-photo{
  width: min(80vw, 460px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.lightbox-inner p{ font-family: var(--font-script); font-size: 1.6rem; color: var(--gold-2); }
.lightbox-close{
  position: absolute;
  top: 26px; right: 30px;
  font-size: 1.4rem;
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

/* ============================================================
   CAKE
   ============================================================ */
.cake-scene{
  position: relative;
  width: 300px;
  height: 330px;
  margin: 30px auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cake-glow{
  position: absolute;
  bottom: 10px;
  width: 280px; height: 130px;
  background: radial-gradient(ellipse, rgba(240,196,25,0.35), transparent 70%);
  filter: blur(22px);
  animation: pulse 2.4s ease-in-out infinite;
}
.cake{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Naked drip cake: visible sponge layers + white icing drips --- */
.tier{
  position: relative;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.25), rgba(255,255,255,0.07) 18%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.07) 82%, rgba(0,0,0,0.25)),
    repeating-linear-gradient(180deg, #f7e2c4 0px, #f7e2c4 12px, #8a5a33 12px, #8a5a33 17px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
/* thin gold trim at the base of each tier */
.tier::after{
  content: "";
  position: absolute;
  bottom: -2px; left: 8%; right: 8%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #f0c419, transparent);
  opacity: 0.85;
}
.tier-top{ width: 118px; height: 56px; z-index: 3; }
.tier-mid{ width: 158px; height: 64px; margin-top: -4px; z-index: 2; }
.tier-bottom{ width: 200px; height: 74px; margin-top: -4px; }

/* white icing cap with melting drips */
.drips{
  position: absolute;
  top: -6px; left: -4px; right: -4px;
  height: 14px;
  background: linear-gradient(180deg, #fffdf8, #fbead8);
  border-radius: 10px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.18);
}
.drips::before{
  content: "";
  position: absolute;
  top: 100%; left: 8px; right: 8px;
  height: 20px;
  background:
    radial-gradient(circle at 8px -6px, #fbead8 0 12px, transparent 13px),
    radial-gradient(circle at 22px -10px, #fbead8 0 16px, transparent 17px);
  background-size: 30px 22px, 46px 22px;
  background-repeat: repeat-x;
}

/* golden cake plate */
.cake-plate{
  width: 244px; height: 18px;
  margin-top: -3px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe9a8, #c9962a 55%, #8a6412);
  box-shadow: 0 12px 26px rgba(0,0,0,0.5), 0 0 24px rgba(240,196,25,0.25);
}

/* --- Candles: two staggered rows of striped birthday candles --- */
.candles{
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -10px;
}
.candle-row{ display: flex; align-items: flex-end; gap: 5px; }
.candle-row.back{ margin-bottom: -16px; transform: translateX(5px); opacity: 0.92; }
.candle{
  width: 6px;
  border-radius: 3px 3px 1px 1px;
  position: relative;
  background: repeating-linear-gradient(135deg, #fff 0 3px, #ff9fc0 3px 6px);
  box-shadow: inset -1px 0 2px rgba(0,0,0,0.3);
}
.candle.c2{ background: repeating-linear-gradient(135deg, #fff 0 3px, #9fc4ff 3px 6px); }
.candle.c3{ background: repeating-linear-gradient(135deg, #fff 0 3px, #c9a2ff 3px 6px); }
.candle.c4{ background: repeating-linear-gradient(135deg, #fff 0 3px, #ffd98a 3px 6px); }
/* candle wick */
.candle::after{
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  width: 2px; height: 4px;
  background: #4a3b2a;
  transform: translateX(-50%);
}
.flame{
  position: absolute;
  top: -17px; left: 50%;
  width: 9px; height: 14px;
  background: radial-gradient(circle, #fff6c8, #ffb238 60%, transparent 80%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: translateX(-50%);
  animation: flicker 0.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 7px #ffb238);
  transition: opacity .4s, transform .4s;
}
@keyframes flicker{
  0%{ transform: translateX(-50%) scale(1) rotate(-3deg); }
  100%{ transform: translateX(-50%) scale(1.15) rotate(3deg); }
}
.candle.blown .flame{ opacity: 0; transform: translateX(-50%) scale(0); }
.smoke-layer{
  position: absolute;
  top: 10px; left: 0; right: 0;
  height: 70px;
  pointer-events: none;
}
.smoke-puff{
  position: absolute;
  bottom: 0;
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  filter: blur(3px);
  animation: smokeRise 1.6s ease-out forwards;
}
@keyframes smokeRise{
  0%{ opacity: 0.7; transform: translateY(0) scale(1); }
  100%{ opacity: 0; transform: translateY(-60px) scale(2.4); }
}

.blow-btn{
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: linear-gradient(120deg, var(--gold-2), var(--gold), var(--purple-2));
  background-size: 200% 200%;
  box-shadow: 0 10px 30px rgba(240,196,25,0.3);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .4s;
}
.blow-btn:hover{ transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 40px rgba(155,92,255,0.4); }
.blow-btn:disabled{ opacity: 0.5; pointer-events: none; }
.cake-hint{ margin-top: 16px; color: var(--text-dim); font-size: 0.85rem; }

/* ============================================================
   FIREWORKS
   ============================================================ */
#fireworks-section{
  background: linear-gradient(180deg, #05030c, #0d0620 60%, #05030c);
  padding: 0;
}
#fireworks-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fireworks-caption{
  position: relative;
  z-index: 2;
  text-align: center;
}
.fireworks-caption h2{
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  background: linear-gradient(90deg, var(--gold-2), var(--blue-2), var(--purple-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sticker-floating-layer{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.sticker-item{
  position: absolute;
  aspect-ratio: 260 / 304;
  animation: photoFloat linear infinite;
  will-change: transform;
  opacity: 0.95;
}
.sticker-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.45));
}
@keyframes photoFloat{
  0%{ transform: translateY(110vh) translateX(0) rotate(var(--rot-a, -6deg)); opacity: 0; }
  10%{ opacity: 0.95; }
  90%{ opacity: 0.9; }
  100%{ transform: translateY(-15vh) translateX(var(--drift,0)) rotate(var(--rot-b, 6deg)); opacity: 0; }
}

/* ============================================================
   GIFT BOX
   ============================================================ */
.gift-box-wrap{
  position: relative;
  width: 220px;
  height: 220px;
  margin: 20px auto 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gift-box{
  position: relative;
  width: 180px;
  height: 165px;
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.gift-box:hover{ transform: scale(1.05); }
.gift-base{
  position: absolute;
  bottom: 0; left: 10px; right: 10px;
  height: 100px;
  background: linear-gradient(155deg, #8f5cff 0%, #6d7dff 55%, #4d7dff 100%);
  border-radius: 4px 4px 12px 12px;
  box-shadow:
    inset 0 12px 20px rgba(255,255,255,0.18),
    inset 0 -16px 26px rgba(0,0,0,0.35),
    0 24px 50px rgba(0,0,0,0.5);
}
/* vertical gold ribbon on the base */
.gift-base::before{
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #b57f06, #ffe9a8 30%, #f0c419 70%, #b57f06);
  box-shadow: 0 0 14px rgba(240,196,25,0.35);
}
/* soft light beam that rises out of the opened box */
.gift-base::after{
  content: "";
  position: absolute;
  bottom: 100%; left: 14%; right: 14%;
  height: 0;
  background: linear-gradient(180deg, transparent, rgba(255,233,168,0.55));
  filter: blur(6px);
  transition: height .9s var(--ease);
  pointer-events: none;
}
.gift-lid{
  position: absolute;
  top: 34px; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(155deg, #a97dff, #7b9bff);
  border-radius: 7px;
  box-shadow: 0 12px 20px rgba(0,0,0,0.4), inset 0 4px 10px rgba(255,255,255,0.25);
  transition: transform .8s var(--ease), opacity .8s var(--ease);
  z-index: 2;
}
/* ribbon continues over the lid */
.gift-lid::before{
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #b57f06, #ffe9a8 30%, #f0c419 70%, #b57f06);
  border-radius: 2px;
}
/* --- CSS bow sitting on top of the lid --- */
.gift-bow{
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 40px;
}
.bow-loop{
  position: absolute;
  bottom: 0;
  width: 44px; height: 34px;
  background: radial-gradient(circle at 32% 32%, #ffe9a8, #f0c419 60%, #c78f08);
  border-radius: 55% 45% 50% 50% / 65% 65% 35% 35%;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.28);
}
.bow-l{ left: 2px; transform: rotate(-22deg); }
.bow-r{ right: 2px; transform: rotate(22deg) scaleX(-1); }
.bow-knot{
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 22px;
  border-radius: 7px;
  background: linear-gradient(160deg, #ffe9a8, #d99b0c);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  z-index: 2;
}
.gift-box.opened .gift-lid{ transform: translateY(-110px) rotate(-18deg); opacity: 0; }
.gift-box.opened .gift-base{
  box-shadow:
    0 0 70px rgba(240,196,25,0.6),
    inset 0 12px 20px rgba(255,255,255,0.18),
    0 24px 50px rgba(0,0,0,0.5);
}
.gift-box.opened .gift-base::after{ height: 130px; }

.gift-burst{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gift-particle{
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-2);
  opacity: 0;
}
.gift-particle.go{
  animation: giftBurst 1s var(--ease) forwards;
}
@keyframes giftBurst{
  0%{ opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100%{ opacity: 0; transform: translate(var(--gx), var(--gy)) scale(0.3); }
}

.gift-message{
  margin-top: 10px;
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.gift-message.show{ opacity: 1; transform: translateY(0); }

.gift-photo-card{
  display: block;
  width: min(80vw, 300px);
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 6px rgba(255,255,255,0.06);
  opacity: 0;
  transform: translateY(40px) scale(0.85) rotate(-4deg);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.gift-photo-card.show{ opacity: 1; transform: translateY(0) scale(1) rotate(-2deg); }

/* ============================================================
   TILT EFFECT (JS toggles transform via inline style)
   ============================================================ */
.tilt{ transition: transform .15s ease-out; transform-style: preserve-3d; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px){
  #music-player{ padding: 8px 12px; top: 12px; right: 12px; }
  #volume-slider{ width: 50px; }
  section{ padding: 80px 16px; }
  .message-card{ padding: 34px 24px; }
  .gallery-track{ gap: 20px; }
  .polaroid{ width: 150px; }
  .cake-scene{ transform: scale(0.82); transform-origin: bottom center; height: 290px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
