/* Birthday wish card "Midnight Surprise": midnight blue, gold, rose. */
:root {
  /* Light "girly" pink palette (17 Nov 2026): blush background, rose + wine accents, warm gold touches */
  --night: #4A1630; --night-2: #FFE3EA; --night-3: #FFD3DE;
  --gold: #C28A3C; --gold-soft: #EBC27A; --rose: #F7B9C8; --rose-deep: #E0718F;
  --text: #4A1630; --muted: #8A5A6E;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --display: "Playfair Display", Georgia, serif;
  /* names used by the shared promo block (light version) */
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gold-light: #E0718F; --ivory: #4A1630; --emerald-deep: #FFFFFF;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 400 1rem/1.65 var(--sans); -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 70% at 50% 0%, var(--night-3) 0%, var(--night) 60%) fixed, var(--night);
  min-height: 100vh;
}
h1, h2, h3, p, figure { margin: 0; }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* twinkling sky (stars added by wish.js) */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .6; animation: twinkle 3s ease-in-out infinite; }
.sky i.g { background: var(--gold); width: 3px; height: 3px; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.2); } }

/* ---------- gate ---------- */
.gate { display: none; }
html.js .gate {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 28px; text-align: center; overflow: hidden;
  background: radial-gradient(70% 45% at 50% 58%, rgba(244, 182, 194, .16), transparent 70%);
  transition: opacity .9s ease .35s, visibility .9s .35s;
}
html.js.opened .gate { opacity: 0; visibility: hidden; }
html.js:not(.opened) body { overflow: hidden; }
.moon { position: absolute; top: 7%; right: 10%; width: 64px; height: 64px; border-radius: 50%;
  box-shadow: -14px 8px 0 0 var(--gold-soft); transform: rotate(-20deg); filter: drop-shadow(0 0 18px rgba(244, 227, 181, .55)); }
.shoot { position: absolute; width: 120px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); transform: rotate(-28deg); animation: shoot 6s linear infinite; }
.sh1 { top: 14%; left: -10%; } .sh2 { top: 34%; left: 30%; animation-delay: 3.2s; }
@keyframes shoot { 0% { opacity: 0; translate: 0 0; } 3% { opacity: 1; } 12% { opacity: 0; translate: 260px 140px; } 100% { opacity: 0; translate: 260px 140px; } }
.g-balloons .gbl { position: absolute; width: 50px; height: 100px; animation: drift 7s ease-in-out infinite; }
.g-balloons .b1 { left: 5%; top: 22%; }
.g-balloons .b2 { right: 6%; bottom: 18%; width: 42px; height: 84px; animation-delay: -2.5s; }
.g-balloons .b3 { left: 12%; bottom: 8%; width: 36px; height: 72px; animation-delay: -4.5s; }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-18px) rotate(4deg); } }
.hearts { position: absolute; inset: 0; pointer-events: none; }
.hearts i { position: absolute; bottom: -30px; font-style: normal; animation: heartUp linear infinite; opacity: 0; }
@keyframes heartUp { 0% { transform: translateY(0) scale(.7); opacity: 0; } 15% { opacity: .85; } 100% { transform: translateY(-105vh) scale(1.1); opacity: 0; } }
.gate-k { position: relative; font: 500 .85rem var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.gate-t { position: relative; font: 500 clamp(1.7rem, 7.4vw, 2.3rem)/1.25 var(--display); max-width: 330px; }
.gate-t em { font: 400 1.35em/1 var(--script); color: var(--rose); padding: 0 .08em; }
.gift { position: relative; width: min(62vw, 230px); margin: 14px 0 0; padding: 0; border: 0; background: none; cursor: pointer; animation: wiggle 2.8s ease-in-out infinite; }
.gift svg { position: relative; width: 100%; height: auto; overflow: visible; }
.aura { position: absolute; left: 50%; top: 56%; width: 120%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 201, 135, .32), rgba(244, 182, 194, .12) 45%, transparent 68%); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { scale: .9; opacity: .75; } 50% { scale: 1.08; opacity: 1; } }
@keyframes wiggle { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -5deg; } 82% { rotate: 5deg; } 88% { rotate: -3deg; } 94% { rotate: 2deg; } }
.gift .lid { transform-box: fill-box; transform-origin: 15% 100%; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1), opacity .8s; }
html.opening .gift { animation: none; }
html.opening .gift .lid { transform: translate(-40px, -120px) rotate(-35deg); opacity: 0; }
html.opening .gate .tap-hint { opacity: 0; }
.gate-btn {
  position: relative; overflow: hidden; margin-top: 16px; min-height: 52px; padding: 0 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(244, 227, 181, .7); background: linear-gradient(135deg, #F4E3B5, var(--gold) 55%, #D9A95C);
  color: var(--night); font: 600 1.02rem var(--sans); box-shadow: 0 10px 30px rgba(240, 201, 135, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.gate-btn::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: skewX(-20deg); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.flash { position: absolute; left: 50%; top: 55%; width: 40px; height: 40px; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff, rgba(244, 227, 181, .8) 40%, transparent 70%); opacity: 0; }
html.opening .flash { animation: burst .9s ease-out forwards; }
@keyframes burst { 0% { opacity: 0; scale: 1; } 25% { opacity: 1; } 100% { opacity: 0; scale: 40; } }

/* tap hint: finger + ripple, hidden after first tap */
.tap-hint { position: absolute; right: 4%; bottom: 6%; width: 54px; height: 54px; pointer-events: none; transition: opacity .3s; z-index: 2; }
.tap-hint .ring { position: absolute; left: 6px; top: 0; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold-soft); animation: ripple 1.6s ease-out infinite; }
.tap-hint .hand { position: absolute; left: 8px; top: 8px; font-size: 32px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); animation: tap 1.6s ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translate(6px, 8px); } 35% { transform: translate(0, 0) scale(.92); } 50% { transform: translate(0, 0) scale(.92); } }
@keyframes ripple { 0%, 30% { transform: scale(.4); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.used .tap-hint, .tap-hint.gone { opacity: 0; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx, 0), 110vh) rotate(var(--r, 540deg)); } }

/* ---------- card ---------- */
.wish { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
html.js:not(.opened) .wish { visibility: hidden; }

.hero { min-height: 92vh; min-height: 92svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px 40px; }
.hb { font: 400 clamp(2.6rem, 12vw, 3.6rem)/1 var(--script); color: var(--gold); }
.name { font: 600 clamp(3.2rem, 16vw, 4.8rem)/1.05 var(--display); margin-top: 6px; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff 30%, var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { max-width: 330px; margin-top: 16px; color: var(--muted); font-size: 1.02rem; }
.date { margin-top: 22px; font: 500 .85rem var(--sans); letter-spacing: .3em; color: var(--gold); }
.scroll-hint { width: 28px; height: 28px; margin-top: 34px; color: var(--gold); opacity: .7; animation: bob 2s ease-in-out infinite; }
html.opened .hero > * { animation: rise .9s both; }
html.opened .hero .name { animation-delay: .15s; } html.opened .hero .sub { animation-delay: .3s; }
html.opened .hero .date { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.block { padding: 0 22px; margin: 0 0 64px; text-align: center; }
.k { font: 500 .78rem var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.t { font: 500 clamp(1.4rem, 6vw, 1.75rem)/1.3 var(--display); margin-top: 6px; }

.cake { position: relative; display: block; width: min(76vw, 280px); margin: 18px auto 0; padding: 0; border: 0; background: none; cursor: pointer; }
.cake svg { width: 100%; height: auto; overflow: visible; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .6s ease-in-out infinite alternate; transition: opacity .35s, transform .35s; }
@keyframes flick { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.92, 1.08) rotate(3deg); } }
.candle.out .flame { opacity: 0; animation: none; transform: scale(.2); }
.candle.out::after { content: none; }
.wished { margin-top: 10px; font: 400 1.9rem/1.2 var(--script); color: var(--gold); opacity: 0; transform: translateY(8px); transition: .6s; }
.cake-block.done .wished { opacity: 1; transform: none; }

.polaroids {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 22px 6px 14px; margin: 0 -22px;
  padding-left: 28px; padding-right: 28px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.polaroids::-webkit-scrollbar { display: none; }
.pol {
  flex: 0 0 auto; width: min(64vw, 230px); scroll-snap-align: center; background: #FBF8F2; padding: 10px 10px 14px;
  border-radius: 4px; box-shadow: 0 16px 30px rgba(0, 0, 0, .35); transform: rotate(-2deg);
}
.pol:nth-child(even) { transform: rotate(2deg); }
.pol img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.pol figcaption { margin-top: 10px; font: 400 1.45rem/1.1 var(--script); color: #5A1E3A; }
.swipe { font-size: .82rem; color: var(--muted); }
.pol-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pol-nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(240, 201, 135, .5); background: rgba(255, 255, 255, .06);
  color: var(--gold); font: 500 1.3rem/1 var(--sans); cursor: pointer; }
.pol-nav button:hover { background: rgba(240, 201, 135, .15); }
.polaroids { cursor: grab; }
.polaroids.dragging { cursor: grabbing; scroll-snap-type: none; }
.polaroids.dragging img { pointer-events: none; }

.letter {
  position: relative; margin-top: 16px; padding: 30px 24px 26px; text-align: left; border-radius: 18px;
  background: linear-gradient(180deg, #FBF6EC, #F4ECDC); color: #4A1A32;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
}
.letter::before { content: ""; position: absolute; top: -10px; left: 50%; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: var(--rose-deep); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .25); }
.letter-text { font: italic 500 1.08rem/1.75 var(--display); min-height: 9em; }
.letter-text.typing::after { content: "|"; margin-left: 2px; animation: blink .8s steps(1) infinite; color: var(--rose-deep); }
@keyframes blink { 50% { opacity: 0; } }
.sign { margin-top: 18px; text-align: right; font-size: .92rem; color: #6C6680; }
.sign span { font: 400 2rem/1.1 var(--script); color: var(--rose-deep); }

.reasons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.flip .tap-hint { right: 6px; bottom: 4px; }
.cake .tap-hint { right: 10%; bottom: 30%; }
.flip { position: relative; min-height: 112px; border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; }
.flip > .f, .flip > .b {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border-radius: 16px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s;
}
.flip .f { background: rgba(255, 255, 255, .07); border: 1px solid rgba(240, 201, 135, .35); font: 500 1.6rem var(--display); color: var(--gold); }
.flip .b { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); color: var(--night); font: 500 .93rem/1.4 var(--sans); transform: rotateY(180deg); }
.flip.on .f { transform: rotateY(180deg); } .flip.on .b { transform: rotateY(360deg); }

.reply .t { margin: 0 auto; max-width: 360px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; min-height: 50px; padding: 0 28px;
  border-radius: 999px; text-decoration: none; background: linear-gradient(135deg, var(--rose), var(--rose-deep)); color: var(--night);
  font: 600 1rem var(--sans); box-shadow: 0 10px 24px rgba(224, 122, 147, .35);
}

.foot { text-align: center; padding: 0 22px calc(36px + env(safe-area-inset-bottom)); }
.foot .promo-line { margin-top: 0; }
.foot .credit { margin-top: 14px; font-size: .86rem; color: var(--muted); }
.foot .credit a { color: var(--gold); }
.sample-note { margin-top: 10px; font-size: .76rem; color: var(--muted); opacity: .75; }

/* music button */
.music-btn {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 30; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: 1px solid rgba(240, 201, 135, .55);
  background: rgba(42, 13, 28, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--gold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.music-btn .bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music-btn .bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--gold); animation: eq 1s ease-in-out infinite; }
.music-btn .bars i:nth-child(2) { animation-delay: -.3s; } .music-btn .bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.music-btn .bars i { transform-origin: bottom; }
.music-btn .note { display: none; font-size: 1.2rem; line-height: 1; }
.music-btn[aria-pressed="false"] .bars { display: none; }
.music-btn[aria-pressed="false"] .note { display: block; opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- light pink theme overrides ---------- */
body { background: radial-gradient(120% 70% at 50% 0%, #FFDCE5 0%, #FFF3F6 55%) fixed, #FFF3F6; }
.sky i { background: var(--rose-deep); opacity: .45; }
.sky i.g { background: var(--gold-soft); }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.8); } 50% { opacity: .7; transform: scale(1.25); } }
.moon { box-shadow: -14px 8px 0 0 #EFC983; filter: drop-shadow(0 0 16px rgba(239, 201, 131, .6)); }
.shoot { background: linear-gradient(90deg, rgba(224, 113, 143, 0), #E0718F); }
html.js .gate { background: radial-gradient(70% 45% at 50% 58%, rgba(247, 185, 200, .45), transparent 70%); }
.gate-k { color: var(--gold); }
.gate-t em { color: var(--rose-deep); }
.gate-btn { border: 0; color: #fff; background: linear-gradient(135deg, #F7A9BC, #E0718F 60%, #C9567A);
  box-shadow: 0 10px 28px rgba(224, 113, 143, .4), inset 0 1px 0 rgba(255, 255, 255, .45); }
.aura { background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(247, 185, 200, .45) 45%, transparent 68%); }
.flash { background: radial-gradient(circle, #fff, rgba(255, 228, 236, .9) 40%, transparent 70%); }
.hb { color: var(--gold); }
.name { background: linear-gradient(180deg, #7A2448 25%, #E0718F); -webkit-background-clip: text; background-clip: text; }
.k { color: var(--gold); }
.tap-hint .ring { border-color: var(--rose-deep); }
.tap-hint .hand { filter: drop-shadow(0 4px 6px rgba(122, 36, 72, .3)); }
.flip .f { background: #fff; border: 1px solid rgba(224, 113, 143, .35); color: var(--rose-deep); box-shadow: 0 8px 18px rgba(122, 36, 72, .08); }
.flip .b { color: #4A1630; }
.letter { box-shadow: 0 18px 36px rgba(122, 36, 72, .14); }
.pol { box-shadow: 0 14px 28px rgba(122, 36, 72, .18); }
.pol-nav button { background: #fff; color: var(--rose-deep); border-color: rgba(224, 113, 143, .45); }
.pol-nav button:hover { background: #FFE8EE; }
.btn { color: #fff; box-shadow: 0 10px 24px rgba(224, 113, 143, .35); background: linear-gradient(135deg, #F7A9BC, #E0718F); }
.music-btn { background: rgba(255, 255, 255, .88); color: var(--rose-deep); border-color: rgba(224, 113, 143, .45); box-shadow: 0 6px 16px rgba(122, 36, 72, .15); }
.music-btn .bars i { background: var(--rose-deep); }
.promo { background: #FFFFFF; border-color: rgba(224, 113, 143, .3); box-shadow: 0 10px 26px rgba(122, 36, 72, .08); }
.promo-bar { border-color: rgba(224, 113, 143, .45); }
.foot .credit a { color: var(--rose-deep); }

.music-btn[hidden] { display: none; }
