:root {
  --bg: #05020a;
  --panel: rgba(18, 8, 28, 0.76);
  --panel-border: rgba(255, 193, 239, 0.28);
  --pink: #ff6bd6;
  --pink-soft: #ffc4ef;
  --purple: #a656ff;
  --white: #fff9ff;
  --muted: #cbbbd2;
  --success: #74ffb5;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  background: var(--bg);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 78, 202, 0.08), transparent 36%),
    radial-gradient(circle at 14% 82%, rgba(135, 56, 255, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(5, 2, 10, 0.08), rgba(5, 2, 10, 0.62));
  z-index: -1;
}

#spaceCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.aurora {
  position: fixed;
  width: 38vw;
  height: 38vw;
  min-width: 340px;
  min-height: 340px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .12;
  pointer-events: none;
  z-index: -2;
  animation: drift 12s ease-in-out infinite alternate;
}
.aurora-one { left: -12vw; top: 28vh; background: #ce2fff; }
.aurora-two { right: -8vw; top: -12vh; background: #ff347f; animation-delay: -5s; }

@keyframes drift {
  to { transform: translate3d(8vw, -4vh, 0) scale(1.15); }
}

.system-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  font-size: 12px;
  letter-spacing: .16em;
  color: #ddcce5;
  text-transform: uppercase;
}

#systemStatus { display: flex; gap: 8px; align-items: center; }
#systemStatus i, #wishState i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px var(--success);
}

.header-actions { display: flex; gap: 8px; }
.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(10, 4, 15, .54);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: .25s ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--pink); }
.icon-button.off { opacity: .48; }

#app { width: 100vw; height: 100vh; min-height: 100svh; }
.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 78px 22px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  transition: opacity .75s ease, transform .75s ease, visibility .75s;
}
.scene.active { opacity: 1; visibility: visible; transform: scale(1); }
.scene-content { width: min(760px, 100%); text-align: center; }
.wide-content { width: min(900px, 100%); }

.glass-card {
  width: min(650px, 100%);
  padding: clamp(28px, 5vw, 56px);
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(145deg, rgba(28, 12, 40, .8), rgba(8, 4, 15, .72));
  border: 1px solid var(--panel-border);
  box-shadow: 0 30px 90px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.08), 0 0 55px rgba(241, 71, 205, .08);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.script-title {
  margin: 0;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(54px, 9vw, 96px);
  font-weight: 500;
  line-height: 1.05;
  color: #fff2fc;
  text-shadow: 0 0 8px #fff, 0 0 22px rgba(255, 94, 210, .88), 0 0 52px rgba(186, 63, 255, .6);
}

.intro-message, .scene-description, .recipient-line, .candle-panel p, .typewriter-text {
  color: var(--muted);
  line-height: 1.75;
}
.intro-message { max-width: 470px; margin: 18px auto 28px; }

.loading-wrap { margin: 24px auto; max-width: 420px; }
.loading-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
}
.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8d3fff, #ff5ac8, #ffe8fb);
  box-shadow: 0 0 20px #ff4fd3;
  transition: width .18s linear;
}
.loading-meta { display: flex; justify-content: space-between; margin-top: 10px; color: #ead9ef; font-size: 12px; }

.primary-button, .secondary-button, .gift-button {
  border: 0;
  cursor: pointer;
  transition: transform .24s ease, box-shadow .24s ease, opacity .24s ease;
}
.primary-button, .gift-button {
  padding: 14px 26px;
  border-radius: 999px;
  color: #160719;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, #ffd8f5 42%, #ff86dc);
  box-shadow: 0 12px 40px rgba(255, 70, 198, .26), 0 0 24px rgba(255,255,255,.18);
}
.primary-button:hover, .gift-button:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 48px rgba(255, 70, 198, .4); }
.secondary-button {
  padding: 11px 18px;
  color: #f9e9ff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}
.secondary-button:hover { transform: translateY(-2px); border-color: var(--pink); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .58; transform: none; }
.hidden { display: none !important; }

.wish-content { width: min(820px, 100%); }
.wish-title {
  margin: 8px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.08;
  color: #fff8fc;
  text-shadow: 0 0 20px rgba(255, 125, 216, .45);
}
.wish-orb {
  position: relative;
  width: 245px;
  height: 245px;
  margin: 30px auto 24px;
  display: grid;
  place-items: center;
}
.wish-core {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  color: white;
  font-size: 46px;
  background: radial-gradient(circle at 40% 35%, #fff 0 3%, #ffd8f4 10%, #ff6ed5 32%, #8f3aff 65%, rgba(62, 16, 86, .35) 78%);
  box-shadow: 0 0 28px rgba(255,255,255,.5), 0 0 70px rgba(255,70,210,.65), 0 0 120px rgba(135,50,255,.42);
  animation: wishPulse 2.4s ease-in-out infinite;
}
.wish-ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 234, .5);
  box-shadow: inset 0 0 24px rgba(255, 87, 209, .12), 0 0 20px rgba(151, 72, 255, .15);
}
.ring-one { animation: wishSpin 8s linear infinite; }
.ring-two { inset: 48px; border-style: dashed; animation: wishSpin 5.5s linear infinite reverse; }
.wish-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px #ff72d7;
  animation: wishOrbit 4s ease-in-out infinite;
}
.particle-one { left: 20px; top: 92px; }
.particle-two { right: 28px; top: 42px; animation-delay: -.9s; }
.particle-three { right: 42px; bottom: 30px; animation-delay: -1.8s; }
.particle-four { left: 48px; bottom: 42px; animation-delay: -2.7s; }
.wish-hint { margin: 0 0 20px; color: var(--pink-soft); }
@keyframes wishPulse { 50% { transform: scale(1.08); filter: brightness(1.2); } }
@keyframes wishSpin { to { transform: rotate(360deg); } }
@keyframes wishOrbit { 50% { transform: translateY(-15px) scale(.45); opacity: .35; } }

.countdown-wrap { text-align: center; }
.countdown-number {
  position: relative;
  font-size: clamp(150px, 30vw, 320px);
  line-height: .9;
  font-family: Georgia, serif;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,.88);
  text-shadow: 0 0 30px rgba(255, 85, 209, .68), 0 0 90px rgba(143, 54, 255, .5);
  animation: pulseCount .9s ease infinite;
}
@keyframes pulseCount { 50% { transform: scale(1.06); filter: brightness(1.35); } }
.countdown-wrap p:last-child { color: #cab7d2; letter-spacing: .12em; }

.cake-layout {
  width: min(930px, 100%);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.cake-heading { font-size: clamp(48px, 8vw, 84px); }
.recipient-line { margin: 8px 0 4px; font-size: 17px; }

.cake {
  position: relative;
  width: 360px;
  height: 340px;
  margin: 0 auto;
  cursor: pointer;
  filter: drop-shadow(0 32px 34px rgba(0,0,0,.58));
  transform-origin: bottom;
  animation: cakeFloat 3.3s ease-in-out infinite;
}
@keyframes cakeFloat { 50% { transform: translateY(-7px); } }
.tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 13px 13px 22px 22px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.85) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 32%, rgba(255,255,255,.7) 0 2px, transparent 3px),
    linear-gradient(180deg, #fffaff, #ffc7ec 32%, #d948bd 80%, #8c247f);
  background-size: 23px 22px, 29px 27px, 100% 100%;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 10px 16px rgba(255,255,255,.34), inset 0 -14px 22px rgba(89, 10, 87, .26), 0 0 26px rgba(255, 85, 205, .25);
}
.cake-top { bottom: 180px; width: 165px; height: 68px; z-index: 3; }
.cake-middle { bottom: 107px; width: 235px; height: 88px; z-index: 2; }
.cake-bottom { bottom: 24px; width: 315px; height: 105px; z-index: 1; }
.icing {
  position: absolute;
  inset: -2px -1px auto;
  height: 22px;
  border-radius: 13px 13px 45% 45%;
  background: linear-gradient(#fff, #ffe8f8);
  box-shadow: 0 7px 0 -2px rgba(255,255,255,.84);
}
.cake-plate {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 355px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #d8c4e3 45%, #6e4f7d);
  box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 28px rgba(255, 125, 219, .24);
}
.candle {
  position: absolute;
  left: 50%;
  bottom: 244px;
  z-index: 5;
  width: 14px;
  height: 64px;
  transform: translateX(-50%);
  border-radius: 7px 7px 3px 3px;
  background: repeating-linear-gradient(45deg, #fff 0 7px, #ff4fc8 7px 14px);
  box-shadow: 0 0 13px rgba(255,255,255,.56);
}
.flame {
  position: absolute;
  left: 50%;
  bottom: 58px;
  width: 24px;
  height: 38px;
  transform: translateX(-50%) rotate(4deg);
  transform-origin: 50% 100%;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 50% 68%, #fff 0 13%, #ffe077 26%, #ff9d24 58%, #ff347d 80%, transparent 82%);
  filter: drop-shadow(0 0 12px #ffbd4d) drop-shadow(0 0 28px #ff4fbb);
  animation: flicker .16s ease-in-out infinite alternate;
}
@keyframes flicker { to { transform: translateX(-50%) scale(.9, 1.08) rotate(-5deg); } }
.flame.out { opacity: 0; transform: translateX(-50%) scale(.1); transition: .45s ease; animation: none; }
.smoke {
  position: absolute;
  left: 50%;
  bottom: 75px;
  width: 10px;
  height: 10px;
  opacity: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  filter: blur(3px);
}
.smoke.show { animation: smokeUp 2s ease-out forwards; }
@keyframes smokeUp {
  0% { opacity: .7; transform: translate(-50%, 0) scale(.7); }
  100% { opacity: 0; transform: translate(-80%, -90px) scale(4); }
}
.cake-sparkles { position: absolute; inset: 0; pointer-events: none; }
.cake-sparkles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #ff75d8;
  animation: cakeSparkle 2.6s ease-in-out infinite;
}
@keyframes cakeSparkle { 50% { opacity: .15; transform: translateY(-12px) scale(.3); } }

.candle-panel {
  width: min(560px, 92vw);
  display: grid;
  justify-items: center;
  gap: 12px;
}
#wishState { color: #bfffd8; font-size: 11px; letter-spacing: .18em; }
.wish-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 540px);
  padding: 14px 18px;
  border-radius: 999px;
  color: #f9e9ff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  line-height: 1.55;
  font-size: 14px;
  cursor: pointer;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}
.wish-action-chip:hover, .wish-action-chip:focus-visible {
  transform: translateY(-2px);
  border-color: var(--pink);
  background: rgba(255,255,255,.1);
  box-shadow: 0 14px 34px rgba(255, 70, 198, .18);
  outline: none;
}
.chip-icon {
  flex: 0 0 auto;
  font-size: 18px;
  filter: drop-shadow(0 0 10px rgba(255, 121, 222, .8));
}
.chip-text {
  display: inline-block;
}
.gift-button { margin-top: 8px; animation: giftPulse 1.8s ease-in-out infinite; }
@keyframes giftPulse { 50% { transform: scale(1.06); box-shadow: 0 0 44px rgba(255,91,207,.58); } }

.final-card { max-width: 760px; }
.final-card .script-title { font-size: clamp(48px, 8vw, 82px); }
.typewriter-text { min-height: 125px; font-size: clamp(16px, 2.2vw, 20px); white-space: pre-line; }
.heart-row { margin: 14px 0 24px; color: var(--pink); letter-spacing: .5em; text-shadow: 0 0 16px var(--pink); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,0,6,.76); backdrop-filter: blur(12px); }
.gift-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: 92vh;
  overflow: auto;
  text-align: center;
  padding: 22px 28px 30px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(39,14,51,.98), rgba(11,5,20,.98));
  border: 1px solid rgba(255,174,230,.34);
  box-shadow: 0 30px 100px rgba(0,0,0,.65), 0 0 55px rgba(255,63,200,.18);
  transform: translateY(22px) scale(.96);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.modal.open .gift-card { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  color: white;
  background: rgba(0,0,0,.25);
  cursor: pointer;
}
.gift-photo-wrap { position: relative; width: 100%; aspect-ratio: 4/3; margin: 10px 0 24px; }
.gift-photo-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; border: 1px solid rgba(255,255,255,.18); }
.bouquet-wrap { overflow: hidden; }
.bouquet-image {
  object-fit: contain !important;
  padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 123, 206, .18), rgba(24, 5, 28, .92) 72%);
  filter: drop-shadow(0 0 18px rgba(255, 130, 214, .28));
  animation: bouquetFloat 3.8s ease-in-out infinite;
}
.bouquet-sparkle {
  position: absolute;
  z-index: 3;
  color: #fff6fb;
  font-size: 18px;
  text-shadow: 0 0 18px rgba(255, 108, 210, .95), 0 0 26px rgba(255,255,255,.75);
  pointer-events: none;
  animation: bouquetSparkle 2.8s ease-in-out infinite;
}
.sparkle-one { top: 16%; left: 14%; }
.sparkle-two { top: 22%; right: 12%; animation-delay: -.9s; }
.sparkle-three { bottom: 18%; left: 52%; animation-delay: -1.6s; }
.photo-glow { position: absolute; inset: 12% 4% -5%; z-index: -1; background: #ff44c4; filter: blur(36px); opacity: .35; }
@keyframes bouquetFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}
@keyframes bouquetSparkle {
  0%, 100% { transform: scale(.85); opacity: .45; }
  50% { transform: scale(1.18); opacity: 1; }
}
.gift-card h3 { margin: 4px 0 12px; font-family: Georgia, serif; font-size: 28px; }
.gift-card > p:not(.eyebrow) { color: #d4c2db; line-height: 1.75; white-space: pre-line; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 20px);
  padding: 11px 16px;
  border-radius: 99px;
  color: white;
  background: rgba(19, 8, 27, .92);
  border: 1px solid rgba(255,255,255,.15);
  opacity: 0;
  pointer-events: none;
  transition: .3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti {
  position: fixed;
  z-index: 45;
  pointer-events: none;
  animation: confettiFall var(--duration) linear forwards;
}
@keyframes confettiFall {
  to { transform: translate3d(var(--drift), 110vh, 0) rotate(900deg); opacity: .2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 820px) {
  .scene { padding: 76px 16px 24px; }
  .intro-message, .scene-description, .recipient-line { line-height: 1.6; }
  .gift-card { width: min(430px, calc(100vw - 24px)); padding: 20px 18px 24px; border-radius: 24px; }
}

@media (max-width: 700px) {
  html, body { overflow-y: auto; }
  #app { height: auto; min-height: 100svh; }
  .scene {
    place-items: start center;
    min-height: 100svh;
    padding-top: 74px;
    padding-bottom: 24px;
  }
  .glass-card { width: min(100%, 540px); padding: 26px 18px; border-radius: 22px; }
  .script-title { font-size: clamp(50px, 16vw, 74px); }
  .wish-content { width: 100%; }
  .wish-title { font-size: clamp(34px, 11vw, 58px); }
  .wish-orb { transform: scale(.82); margin: 8px auto 0; }
  .countdown-number { font-size: clamp(120px, 34vw, 190px); }
  .cake-layout { width: min(100%, 560px); gap: 10px; padding-bottom: 14px; }
  .cake-copy { width: 100%; }
  .cake-heading { font-size: clamp(44px, 15vw, 74px); }
  .recipient-line { margin-top: 10px; font-size: 15px; }
  .cake { transform: scale(.74); margin: -34px auto -54px; }
  .candle-panel { width: 100%; gap: 10px; }
  .wish-action-chip { width: 100%; padding: 12px 16px; border-radius: 22px; font-size: 14px; }
  .chip-icon { margin-top: 1px; }
  .gift-button, .primary-button, .secondary-button { min-height: 52px; }
  .gift-button, .primary-button { width: min(100%, 300px); }
  .typewriter-text { min-height: 112px; line-height: 1.75; }
  .gift-card h3 { font-size: 24px; line-height: 1.18; }
  .gift-card > p:not(.eyebrow) { font-size: 15px; line-height: 1.8; }
  .gift-photo-wrap { margin-bottom: 18px; }
}

@media (max-width: 420px) {
  .system-bar { padding: 10px 10px; font-size: 11px; }
  .header-actions { gap: 6px; }
  .icon-button { width: 36px; height: 36px; }
  .scene { padding-left: 12px; padding-right: 12px; }
  .script-title { font-size: clamp(46px, 15vw, 64px); }
  .cake-heading { font-size: clamp(40px, 14vw, 62px); }
  .recipient-line { font-size: 14px; }
  .cake { transform: scale(.66); margin: -52px auto -68px; }
  .wish-action-chip { font-size: 13px; padding: 12px 14px; }
  .gift-button, .primary-button { width: min(100%, 280px); }
  .modal { padding: 12px; }
}


/* =========================================================
   MOBILE STABILITY OVERRIDES
   ========================================================= */
html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  position: relative;
}

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  align-items: center;
  justify-items: center;
}

.scene > * {
  margin-left: auto;
  margin-right: auto;
}

.cake-layout,
.cake-copy,
.candle-panel,
.final-card,
.gift-card {
  margin-left: auto;
  margin-right: auto;
}

.cake {
  margin: 0;
  animation: none !important;
  transform: none;
}

.cake-stage {
  width: 100%;
  height: 340px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.wish-action-chip {
  text-align: center;
}

.modal-close {
  right: 12px;
  top: 12px;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(12, 5, 18, .92);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 24px rgba(0,0,0,.38);
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }

@media (max-width: 700px) {
  .system-bar {
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px 12px;
  }

  .scene {
    padding-top: 68px;
    padding-bottom: 22px;
    align-items: center;
    justify-items: center;
  }

  .scene-content,
  .cake-layout,
  .glass-card,
  .final-card {
    width: min(100%, 440px);
  }

  .cake-layout {
    gap: 8px;
    text-align: center;
  }

  .cake-copy {
    width: 100%;
    text-align: center;
  }

  .cake-heading {
    font-size: clamp(48px, 14vw, 66px);
    line-height: 1;
  }

  .recipient-line {
    max-width: 360px;
    margin: 8px auto 0;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
  }

  .cake-stage {
    height: 272px;
  }

  .cake {
    width: 360px;
    height: 340px;
    transform: scale(.76) !important;
    transform-origin: center center;
    margin: 0;
  }

  .candle-panel {
    width: min(100%, 390px);
    gap: 8px;
  }

  #wishState {
    margin-top: 0;
  }

  .wish-action-chip {
    width: min(100%, 390px);
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.45;
  }

  .chip-icon {
    font-size: 17px;
  }

  .gift-button {
    width: min(100%, 280px);
    min-height: 50px;
    margin-top: 4px;
  }

  .modal {
    padding: 14px;
    align-items: center;
  }

  .gift-card {
    width: min(100%, 410px);
    max-height: calc(100dvh - 28px);
    padding: 18px 16px 24px;
    border-radius: 22px;
    text-align: center;
  }

  .gift-photo-wrap {
    margin-top: 18px;
    margin-bottom: 18px;
  }

  .gift-card h3 {
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
    font-size: 23px;
    line-height: 1.2;
  }

  .gift-card > p:not(.eyebrow) {
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.75;
    text-align: center;
  }

  .final-card {
    padding: 28px 20px;
    text-align: center;
  }

  .final-card .script-title {
    font-size: clamp(48px, 14vw, 66px);
    line-height: 1;
  }

  .typewriter-text {
    max-width: 350px;
    min-height: 0;
    margin: 20px auto 0;
    font-size: 15px;
    line-height: 1.75;
    text-align: center;
  }

  .heart-row {
    margin: 16px 0 22px;
  }
}

@media (max-width: 390px) {
  .scene {
    padding-left: 10px;
    padding-right: 10px;
  }

  .cake-stage {
    height: 250px;
  }

  .cake {
    transform: scale(.69) !important;
  }

  .cake-heading {
    font-size: clamp(44px, 13.5vw, 58px);
  }

  .recipient-line {
    font-size: 13px;
  }

  .wish-action-chip {
    font-size: 12.5px;
  }
}

@media (max-width: 700px) {
  .bouquet-image { padding: 12px; }
  .bouquet-sparkle { font-size: 16px; }
}
