:root {
  color-scheme: light;
  --ink: #4b3a5a;
  --ink-soft: #7a6a8a;
  --pink: #ec8fb3;
  --pink-deep: #c45c8c;
  --pink-pale: #fde6f0;
  --accent: #9a7fd6;
  --rose: #cf6f93;
  --line: rgba(196, 92, 140, 0.22);
  --glass: rgba(255, 255, 255, 0.62);
  --head: 'Comfortaa', 'Quicksand', system-ui, sans-serif;
  --body: 'Quicksand', system-ui, sans-serif;
  --script: 'Great Vibes', 'Snell Roundhand', cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #f6dbe8;
  color: var(--ink);
  font: 500 17px/1.55 var(--body);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ── Frosty sky + snowfall ───────────────────────────── */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 85% 0%, rgba(200, 180, 245, 0.55), transparent 70%),
    radial-gradient(ellipse 70% 45% at 10% 5%, rgba(255, 210, 185, 0.55), transparent 70%),
    linear-gradient(180deg, #f8cfe0 0%, #ead8f6 38%, #d3e7f7 70%, #d2f1e4 100%);
}
.sky i {
  position: absolute; border-radius: 50%;
  background: #fff; box-shadow: 0 0 6px 1px rgba(170, 140, 230, 0.8);
  animation: twinkle 3s ease-in-out infinite;
}
.sky i.lilac { background: #f3efff; box-shadow: 0 0 7px 1px rgba(255, 190, 200, 0.9); }
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.25); }
}
.flake {
  position: absolute; top: -6vh;
  color: #fff; line-height: 1;
  text-shadow: 0 1px 4px rgba(110, 70, 130, 0.35);
  animation: fall linear infinite;
}
.flake.blue { color: #c6b4ef; }
@keyframes fall { to { transform: translate(var(--drift, 30px), 112vh) rotate(240deg); } }
.shooting {
  position: absolute; top: 10%; left: -15%;
  width: 130px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #b7a3ec);
  opacity: 0;
  animation: shoot 11s linear 2s infinite;
}
.shooting.two { top: 40%; animation-delay: 7.5s; animation-duration: 14s; }
@keyframes shoot {
  0% { transform: translate(0, 0) rotate(18deg); opacity: 0; }
  1% { opacity: 1; }
  9% { transform: translate(75vw, 25vw) rotate(18deg); opacity: 0; }
  100% { opacity: 0; }
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh; min-height: 92svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 100px 20px 150px;
  text-align: center;
}
/* snow ledge with icicles hanging off it */
.icicles {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 3px; padding: 0 4px;
  pointer-events: none;
}
.icicles::before {
  content: ''; position: absolute; top: -6px; left: -10px; right: -10px; height: 18px;
  background: #fff; border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 0 4px 12px rgba(110, 70, 130, 0.22);
}
.icicle {
  flex: 1; height: var(--h); margin-top: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eadffb 55%, rgba(255, 255, 255, 0.6) 100%);
  clip-path: polygon(0 0, 100% 0, 55% 100%);
  filter: drop-shadow(0 3px 3px rgba(110, 70, 130, 0.25));
  animation: glint 4s ease-in-out infinite;
}
@keyframes glint { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95)); } }

.moon {
  position: absolute; top: 82px; right: max(7%, 18px);
  width: 58px; height: 58px; border-radius: 50%;
  box-shadow: 13px 8px 0 0 #fff; /* the offset shadow of a transparent circle is the crescent */
  filter: drop-shadow(0 3px 8px rgba(110, 70, 130, 0.3));
  animation: bob 7s ease-in-out infinite;
}
.peaks { position: absolute; left: 0; bottom: 0; width: 100%; height: 140px; display: block; filter: drop-shadow(0 -3px 8px rgba(110, 70, 130, 0.15)); }

.eyebrow { margin: 0; font: 700 0.8rem var(--head); letter-spacing: 0.28em; text-transform: uppercase; color: #8a6cc8; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7); animation: rise 0.9s ease-out both; }
h1 { margin: 0; font-weight: 400; }
.nw { display: inline-block; white-space: nowrap; }
.rhyme {
  display: block;
  font: 400 clamp(2.3rem, 10vw, 4.2rem)/1.15 var(--script);
  color: #d0679a;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7), 0 4px 12px rgba(160, 60, 110, 0.25);
  animation: rise 1s 0.15s ease-out both;
}
.turning {
  display: block; margin-top: 6px;
  font: 700 clamp(1.9rem, 7.6vw, 3.6rem)/1.2 var(--head);
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6), 0 5px 14px rgba(110, 70, 130, 0.22);
  animation: rise 1s 0.45s ease-out both;
}
.one {
  display: block; width: fit-content; margin: 2px auto 0;
  font-size: 1.7em; line-height: 1.05;
  background: linear-gradient(100deg, #e0699a 0%, #b07ee0 30%, #6fa8e0 50%, #b07ee0 70%, #e0699a 100%) 0 0 / 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; /* inherited shadows would paint over the clipped gradient */
  filter: drop-shadow(0 5px 8px rgba(110, 70, 130, 0.3));
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }

.badge { position: relative; width: clamp(130px, 38vw, 190px); aspect-ratio: 1; margin: 6px 0; animation: rise 1s 0.75s ease-out both; }
.badge svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 16px rgba(110, 70, 130, 0.3)); animation: sway 6s ease-in-out infinite; }
.badge span {
  position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10%;
  font: 700 clamp(3rem, 12vw, 4.5rem) var(--head); color: var(--pink-deep);
  text-shadow: 0 0 10px #fff;
}
.when { margin: 0 0 8px; font: 700 1.05rem var(--head); color: var(--pink-deep); text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8); animation: rise 1s 0.9s ease-out both; }
.hero .btn { animation: rise 1s 1s ease-out both; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sway { 0%, 100% { transform: rotate(-7deg) scale(1); } 50% { transform: rotate(7deg) scale(1.04); } }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } }

/* ── Layout & shared bits ─────────────────────────────── */
main { position: relative; /* paint above the hero's fade */ width: min(680px, 100% - 32px); margin: 0 auto; display: grid; gap: 28px; padding: 8px 0 32px; }
.card {
  padding: 26px 20px;
  border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(110, 70, 130, 0.18), 0 3px 8px rgba(110, 70, 130, 0.08);
}
h2 {
  margin: 0 0 4px; text-align: center;
  font: 700 clamp(1.45rem, 5.6vw, 1.95rem)/1.25 var(--head);
  color: var(--pink-deep); text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7), 0 4px 10px rgba(196, 92, 140, 0.25);
}
.sub { margin: 0 0 18px; text-align: center; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 1rem var(--head); color: #fff; text-decoration: none;
  text-shadow: 0 1px 2px rgba(160, 60, 110, 0.35);
  background: linear-gradient(135deg, #f7b3cf, var(--pink) 55%, #c96b9e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 20px rgba(196, 92, 140, 0.4), 0 2px 4px rgba(110, 70, 130, 0.2);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 12px 26px rgba(196, 92, 140, 0.5), 0 3px 6px rgba(110, 70, 130, 0.2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--pink-deep); text-shadow: none; box-shadow: inset 0 0 0 1.5px var(--pink), 0 4px 12px rgba(110, 70, 130, 0.12); }

/* ── Countdown ───────────────────────────────────────── */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown div { padding: 14px 4px 10px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 6px 14px rgba(110, 70, 130, 0.12); }
.countdown b {
  display: block; font: 700 clamp(1.7rem, 8vw, 2.6rem)/1.1 var(--head);
  color: var(--pink-deep); font-variant-numeric: tabular-nums;
}
.countdown span { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.countdown .party-now { grid-column: 1 / -1; margin: 0; text-align: center; font: 700 1.4rem var(--head); color: var(--pink-deep); }

/* ── Details ─────────────────────────────────────────── */
.details dl { display: grid; gap: 10px; margin: 18px 0 22px; }
.details dl div { display: flex; gap: 14px; align-items: baseline; padding: 12px 16px; border-radius: 16px; background: #fff; box-shadow: 0 4px 12px rgba(110, 70, 130, 0.09); }
.details dt { min-width: 88px; color: var(--ink-soft); font-weight: 600; }
.details dd { margin: 0; font-weight: 700; }
.details .tba { font-style: italic; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ── Tap-a-star ──────────────────────────────────────── */
.star-field { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 22px; max-width: 420px; margin: 0 auto; padding: 8px 0; }
.tap-star {
  width: var(--size, 64px); height: var(--size, 64px); padding: 0;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: bob 4s ease-in-out var(--delay, 0s) infinite;
}
.tap-star svg { width: 100%; height: 100%; overflow: visible; opacity: 0.95; filter: drop-shadow(0 6px 8px rgba(110, 70, 130, 0.28)); transition: transform 0.3s, filter 0.3s, opacity 0.3s; }
.tap-star:hover svg { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.95)); }
.tap-star.seen svg { opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 200, 210, 0.95)); }
.tap-star.twinkle svg { animation: twinkle-pop 0.9s ease-out; }
@keyframes twinkle-pop {
  30% { transform: scale(1.4) rotate(30deg); }
  60% { transform: scale(0.9) rotate(-12deg); }
  100% { transform: scale(1) rotate(0); }
}
.reveal {
  max-width: 460px; min-height: 100px; margin: 16px auto 0; padding: 18px 20px;
  text-align: center; border: 1.5px dashed var(--line); border-radius: 20px;
  background: linear-gradient(135deg, #fff, var(--pink-pale));
  box-shadow: 0 10px 24px rgba(110, 70, 130, 0.14);
}
.reveal.pop { animation: pop 0.45s ease-out; }
.reveal .kind { display: block; margin-bottom: 6px; font: 700 0.75rem var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.reveal .text { font-size: 1.05rem; font-weight: 600; }

/* ── Forms ───────────────────────────────────────────── */
form { display: grid; gap: 16px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field { display: grid; gap: 6px; }
label, legend { padding: 0; color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; }
small { opacity: 0.75; font-weight: 500; }
input, textarea {
  width: 100%; padding: 12px 14px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  color: var(--ink); background: #fff;
  border: 1px solid #ead2e6; border-radius: 14px;
  box-shadow: inset 0 2px 4px rgba(110, 70, 130, 0.07);
}
input::placeholder, textarea::placeholder { color: #b8a5c4; }
input:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236, 143, 179, 0.2); }
textarea { min-height: 88px; resize: vertical; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.choices label { position: relative; }
.choices input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choices span {
  display: block; padding: 12px 4px; text-align: center; white-space: nowrap;
  color: var(--ink); font-weight: 700;
  border: 1px solid #ead2e6; border-radius: 14px; background: #fff;
  box-shadow: 0 3px 8px rgba(110, 70, 130, 0.1);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.choices input:checked + span { color: #fff; border-color: transparent; background: linear-gradient(135deg, #f7b3cf, var(--pink)); box-shadow: 0 4px 16px rgba(236, 143, 179, 0.4); }
.choices input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.counts:disabled { display: none; }
.form-msg { min-height: 1.2em; margin: 0; text-align: center; color: #c2415d; font-weight: 700; }
.form-msg:empty { display: none; }
.note { margin: 0 0 16px; text-align: center; color: var(--accent); font-weight: 700; }
form .btn { justify-self: center; min-width: 220px; }

.thanks { text-align: center; padding: 8px 0; animation: pop 0.5s ease-out; }
.thanks .big { display: block; font-size: 3.2rem; animation: bob 3s ease-in-out infinite; }
.thanks h3 { margin: 8px 0 4px; font: 700 1.5rem var(--head); color: var(--pink-deep); }
.thanks p { margin: 0 0 18px; font-size: 1.08rem; }

/* ── Little games ────────────────────────────────────── */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px;
  border-radius: 16px; background: rgba(196, 92, 140, 0.12);
  box-shadow: inset 0 2px 6px rgba(110, 70, 130, 0.14);
}
.tabs button {
  padding: 11px 6px; border: 0; border-radius: 12px; cursor: pointer;
  font: 700 0.95rem var(--head); color: var(--ink-soft); background: transparent;
}
.tabs button[aria-selected='true'] { color: var(--pink-deep); background: #fff; box-shadow: 0 4px 12px rgba(110, 70, 130, 0.18); }
.hud { display: flex; justify-content: space-around; gap: 8px; margin: 14px 0 12px; color: var(--ink-soft); font-weight: 700; }
.hud b { margin-left: 4px; font: 700 1.25rem var(--head); color: var(--pink-deep); }

.play-area {
  position: relative; height: 360px; overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #9d86dc 0%, #b9a3ef 50%, #f3bfd8 100%);
  box-shadow: inset 0 6px 20px rgba(90, 50, 110, 0.4), 0 8px 20px rgba(110, 70, 130, 0.18);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.play-area::after { /* snowy ground */
  content: ''; position: absolute; left: -5%; right: -5%; bottom: -30px; height: 60px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 -4px 12px rgba(90, 50, 110, 0.25);
}
.drop {
  position: absolute; top: 0; z-index: 1;
  width: 54px; height: 54px; margin-left: -27px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font-size: 34px; line-height: 54px; color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 3px 6px rgba(90, 50, 110, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.drop.golden { font-size: 32px; }
.plus { position: absolute; z-index: 1; pointer-events: none; font: 700 1.2rem var(--head); color: #fff; text-shadow: 0 2px 6px rgba(90, 50, 110, 0.6); }
.overlay {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px;
  text-align: center; color: #fff;
  background: rgba(90, 60, 140, 0.4);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.overlay p { margin: 0; text-shadow: 0 2px 6px rgba(90, 50, 110, 0.5); }
.overlay-title { font: 700 1.4rem var(--head); }

.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 800px; }
.mem-card {
  position: relative; aspect-ratio: 3 / 4; padding: 0;
  border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.45s;
  -webkit-tap-highlight-color: transparent;
}
.mem-card.flipped, .mem-card.matched { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 14px; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 6px 14px rgba(110, 70, 130, 0.22);
}
.face.back { color: rgba(255, 255, 255, 0.9); font-size: 1.6rem; background: linear-gradient(135deg, #f5a3c4, #c9a7f0 55%, #9fc9f0); text-shadow: 0 2px 4px rgba(90, 50, 110, 0.3); }
.face.front { transform: rotateY(180deg); font-size: clamp(1.8rem, 9vw, 2.5rem); background: #fff; border: 2px solid #eadcf5; }
.mem-card.matched .front { border-color: #c9a7f0; box-shadow: 0 0 0 3px rgba(236, 143, 179, 0.35), 0 6px 14px rgba(110, 70, 130, 0.22); }
.game-msg { min-height: 1.5em; margin: 14px 0 10px; text-align: center; font-weight: 700; color: var(--pink-deep); }

/* ── Wishes wall ─────────────────────────────────────── */
.wish-form { margin-bottom: 26px; }
.wall { columns: 2 150px; column-gap: 14px; }
.wish {
  position: relative; break-inside: avoid; margin: 0 0 16px; padding: 18px 16px 12px;
  color: var(--ink); background: #fff; border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(110, 70, 130, 0.18), 0 2px 5px rgba(110, 70, 130, 0.1);
  transform: rotate(-1.2deg);
}
.wish:nth-child(even) { transform: rotate(1deg); }
.wish:nth-child(4n + 2) { background: var(--pink-pale); }
.wish:nth-child(4n + 3) { background: #efe8fc; }
.wish:nth-child(4n) { background: #e2f5ec; }
.wish::before { content: '❄'; position: absolute; top: -12px; right: 14px; font-size: 1.4rem; color: #b394e6; text-shadow: 0 0 6px #fff; }
.wish p { margin: 0; overflow-wrap: anywhere; }
.wish .by { margin-top: 8px; font: 700 0.85rem var(--head); color: var(--pink-deep); }
.wish.new { animation: drop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes drop { from { opacity: 0; transform: translateY(-18px) scale(0.9); } }
.empty { text-align: center; color: var(--ink-soft); }

footer { padding: 24px 16px 40px; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* dress code row */
.dress { margin: -10px 0 22px; padding: 12px 16px; text-align: center; border-radius: 16px; color: #a8487a; font-weight: 700; background: repeating-linear-gradient(-45deg, var(--pink-pale) 0 14px, #efe8fc 14px 28px, #e2f0fb 28px 42px, #e2f5ec 42px 56px); box-shadow: inset 0 0 0 1.5px var(--line), 0 4px 12px rgba(110, 70, 130, 0.09); }
.details dd a { color: var(--pink-deep); text-decoration-color: var(--line); text-underline-offset: 3px; }
