/* =========================================================
   Birthday Experience — a romantic, artistic design system
   Palette: warm rose, dusty gold, cream, deep plum
   ========================================================= */
:root {
  --cream:      #fdf7f2;
  --cream-2:    #f7ead9;
  --rose-50:    #fde3ea;
  --rose:       #e8859a;
  --rose-deep:  #b3325a;
  --plum:       #3a1730;
  --plum-ink:   #1c0a1a;
  --gold:       #c9a24a;
  --gold-soft:  #e6c98a;
  --ink:        #2b1424;
  --ink-muted:  #6a4a5c;
  --glass:      rgba(255, 255, 255, 0.55);
  --glass-brd:  rgba(255, 255, 255, 0.65);
  --shadow-lg:  0 30px 80px -30px rgba(58, 23, 48, 0.45);
  --shadow-md:  0 10px 30px -12px rgba(58, 23, 48, 0.35);
  --ease:       cubic-bezier(.22, 1, .36, 1);
  --dur:        720ms;
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-script:  'Great Vibes', 'Cormorant Garamond', cursive;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---------- Ambient background art ---------- */
.bg-gradient {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(1200px 700px at 15% 10%,  #ffe4ec 0%, transparent 60%),
    radial-gradient(900px 700px  at 85% 20%,  #fff1d8 0%, transparent 60%),
    radial-gradient(1000px 800px at 50% 100%, #f5dcea 0%, transparent 65%),
    linear-gradient(180deg, #fdf7f2 0%, #f8ecdd 100%);
  animation: hueShift 22s ease-in-out infinite alternate;
}
@keyframes hueShift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to   { filter: hue-rotate(-8deg) saturate(1.1); }
}
.bokeh {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.55) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 65%, rgba(255,255,255,.4)  0 2px, transparent 3px),
    radial-gradient(circle at 85% 15%, rgba(201,162,74,.35)  0 4px, transparent 6px),
    radial-gradient(circle at 40% 85%, rgba(232,133,154,.4)  0 3px, transparent 5px);
  background-size: 400px 400px, 320px 320px, 500px 500px, 380px 380px;
  animation: bokehDrift 40s linear infinite;
  opacity: .8;
}
@keyframes bokehDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 400px 200px, -320px 160px, 500px -250px, -380px 190px; }
}
#petals    { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#confetti  { position: fixed; inset: 0; z-index: 40;  pointer-events: none; }

/* ---------- Balloons ---------- */
.balloons { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.balloon {
  position: absolute; bottom: -180px;
  width: 54px; height: 68px;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  box-shadow: inset -8px -12px 18px rgba(0,0,0,.15), 0 10px 30px -10px rgba(58,23,48,.35);
  animation: floatUp linear forwards;
  opacity: .9;
}
.balloon::after {
  content: ""; position: absolute; left: 50%; bottom: -60px;
  width: 1px; height: 60px; background: rgba(58,23,48,.35); transform: translateX(-50%);
}
.balloon::before {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg);
  background: inherit;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) rotate(-3deg); opacity: 0; }
  10%  { opacity: .95; }
  100% { transform: translate(var(--drift, 40px), -110vh) rotate(4deg); opacity: 0; }
}

/* ---------- Music toggle ---------- */
.music-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem .95rem;
  border: 1px solid var(--glass-brd);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--plum); font-weight: 500; font-size: 13px;
  cursor: pointer; box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.music-toggle:hover { transform: translateY(-1px); background: rgba(255,255,255,.75); }
.music-toggle .music-icon {
  display: inline-block; animation: musicSpin 3.6s linear infinite;
  font-size: 15px; color: var(--rose-deep);
}
.music-toggle.paused .music-icon { animation-play-state: paused; opacity: .5; }
@keyframes musicSpin { to { transform: rotate(360deg); } }

/* ---------- Scenes ---------- */
#app { position: relative; z-index: 5; }
.scene {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 60px);
  opacity: 0; transform: translateY(24px) scale(.985);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  overflow-y: auto;
}
.scene.active   { display: flex; }
.scene.entered  { opacity: 1; transform: translateY(0) scale(1); }
.scene.leaving  { opacity: 0; transform: translateY(-16px) scale(.99); }

.frame {
  position: relative; width: 100%; max-width: 640px;
  padding: clamp(28px, 5vw, 56px);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 28px;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: frameIn .9s var(--ease) both;
}
.frame.wide { max-width: 960px; }
@keyframes frameIn {
  from { transform: translateY(30px); opacity: 0; filter: blur(6px); }
  to   { transform: translateY(0);    opacity: 1; filter: blur(0);   }
}

/* ---------- Typography ---------- */
.eyebrow {
  margin: 0 0 .8rem; letter-spacing: .28em; text-transform: uppercase;
  font-size: 11px; color: var(--rose-deep); font-weight: 500;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 5.4vw, 52px);
  line-height: 1.12;
  color: var(--plum);
  margin: 0 0 1.4rem;
  letter-spacing: -0.01em;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 78px);
  line-height: 1;
  color: var(--rose-deep);
  margin: 0 0 1.4rem;
}
.lede  { font-size: clamp(15px, 2vw, 17px); color: var(--ink-muted); margin: 0 0 1.5rem; }
.hint  { font-size: 12px; color: var(--ink-muted); margin-top: 1rem; letter-spacing: .06em; }

/* ---------- Fields & buttons ---------- */
.field-wrap {
  display: flex; flex-direction: column; gap: 14px; align-items: stretch;
  margin: 8px auto 0; max-width: 420px;
}
.field {
  width: 100%; padding: 16px 20px;
  font: inherit; font-size: 16px; color: var(--plum);
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(179,50,90,.18);
  border-radius: 14px;
  outline: none;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.field:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(232,133,154,.18);
  transform: translateY(-1px);
}
.field-area { resize: vertical; min-height: 120px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 14px 26px;
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: .02em;
  border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  will-change: transform;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep) 0%, var(--rose) 60%, var(--gold) 120%);
  box-shadow: 0 12px 30px -10px rgba(179,50,90,.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(179,50,90,.65); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  color: var(--plum);
  background: rgba(255,255,255,.7);
  border-color: rgba(58,23,48,.18);
}
.btn-ghost:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.actions { margin-top: 1.8rem; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Yip yip stage ---------- */
.yipyip-stage { min-height: 320px; display: grid; place-items: center; }
.yip-icon {
  font-size: clamp(64px, 12vw, 120px);
  filter: drop-shadow(0 12px 24px rgba(179,50,90,.35));
  transition: transform 1.2s var(--ease);
}
.yip-text {
  position: absolute;
  transition: transform 1.2s var(--ease), opacity 1.2s var(--ease);
  font-size: clamp(48px, 10vw, 96px);
}

/* ---------- Portrait ---------- */
.portrait {
  margin: 6px auto 26px; width: min(280px, 70%);
  aspect-ratio: 4/5;
  border-radius: 22px;
  overflow: hidden;
  border: 6px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
  transition: transform .6s var(--ease);
}
.portrait:hover { transform: rotate(0) scale(1.02); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Wishes rail (horizontal glass cards) ---------- */
.wishes-rail, .gallery-rail {
  display: flex; gap: 20px;
  overflow-x: auto; overflow-y: hidden;
  padding: 20px 6px 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.wishes-rail::-webkit-scrollbar,
.gallery-rail::-webkit-scrollbar { height: 6px; }
.wishes-rail::-webkit-scrollbar-thumb,
.gallery-rail::-webkit-scrollbar-thumb { background: rgba(179,50,90,.25); border-radius: 999px; }

.wish-card {
  flex: 0 0 min(320px, 78vw);
  scroll-snap-align: center;
  padding: 28px 26px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255,255,255,.7), rgba(255,232,220,.55));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  color: var(--plum);
  font-family: var(--font-display);
  font-size: 19px; line-height: 1.55;
  min-height: 260px;
  display: flex; flex-direction: column; justify-content: space-between;
  text-align: left;
  transition: transform .5s var(--ease);
}
.wish-card:hover { transform: translateY(-4px); }
.wish-card .wish-num {
  font-family: var(--font-script);
  color: var(--rose-deep);
  font-size: 40px; line-height: 1;
}
.wish-card .wish-sig {
  font-family: var(--font-body);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-muted); margin-top: 18px;
}

.gallery-item {
  flex: 0 0 min(300px, 78vw);
  scroll-snap-align: center;
  aspect-ratio: 3/4;
  border-radius: 22px; overflow: hidden;
  border: 6px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow-md);
  transition: transform .5s var(--ease);
}
.gallery-item:hover { transform: translateY(-4px) scale(1.01); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Quiz options ---------- */
.options {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  max-width: 460px; margin: 8px auto 0;
}
.options-gift { max-width: 520px; }
.option-card {
  padding: 18px 22px;
  text-align: left;
  font: inherit; font-size: 16px; color: var(--plum);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(179,50,90,.18);
  border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.option-card:hover { transform: translateY(-2px); border-color: var(--rose); box-shadow: var(--shadow-md); }
.option-card.selected { background: linear-gradient(135deg, var(--rose-deep), var(--rose)); color: #fff; border-color: transparent; }
.option-card.correct  { background: linear-gradient(135deg, #3f8f6b, #6bbf99); color: #fff; border-color: transparent; }
.option-card.wrong    { background: linear-gradient(135deg, #a83244, #d47187); color: #fff; border-color: transparent; }

/* ---------- Score ---------- */
.score-sep { margin: 0 .3rem; color: var(--rose); }
.score-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: left; }
.score-list li {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(179,50,90,.14);
  font-size: 14px;
  display: grid; gap: 4px;
}
.score-list .q { color: var(--plum); font-weight: 500; }
.score-list .row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.score-list .badge {
  padding: 2px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.score-list .badge.ok  { background: #dff0e6; color: #2a6a4a; }
.score-list .badge.no  { background: #f7dbe0; color: #9a2941; }
#score-number {
  display: inline-block;
  background: linear-gradient(135deg, var(--rose-deep), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: clamp(72px, 14vw, 128px); font-weight: 500;
}

/* ---------- Prayer ---------- */
.prayer {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(17px, 2.2vw, 20px); line-height: 1.7;
  color: var(--plum);
  padding: 22px 24px;
  background: linear-gradient(150deg, rgba(255,255,255,.55), rgba(255,220,200,.35));
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 18px;
  text-align: left;
  white-space: pre-line;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 480px) {
  .frame { border-radius: 22px; }
  .music-toggle .music-label { display: none; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
