:root {
  --bg: #04070e;
  --text: #fdf7f2;
  --muted: #c6b7d7;
  --gold: #f7c872;
  --gold-soft: #ffe0ac;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.2);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --border: rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Palatino Linotype", "Book Antiqua", serif;
  overflow: hidden;
}

body {
  position: relative;
  background: radial-gradient(circle at top, #10213f 0%, #060912 45%, #020307 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.08) 0.5px, transparent 0.5px);
  background-size: 10px 10px;
  mix-blend-mode: screen;
  opacity: 0.14;
  z-index: 1;
}

.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 200, 114, 0.25), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
}

#app {
  position: relative;
  min-height: 100vh;
  z-index: 2;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, transform 1.2s ease;
  transform: scale(1.02);
  padding: 2rem;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.scene-content {
  position: relative;
  width: min(100%, 980px);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transform-style: preserve-3d;
  transform: perspective(1400px) rotateX(var(--parallax-y, 0deg)) rotateY(var(--parallax-x, 0deg));
  transition: transform 0.35s ease-out;
}

.starfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
  opacity: 0.8;
  animation: drift 14s linear infinite;
}

.star::before {
  content: "";
  position: absolute;
  inset: -50px;
  background: radial-gradient(circle, rgba(255,255,255,0.6), transparent 70%);
}

.aurora {
  position: absolute;
  inset: 0;
  filter: blur(70px);
  opacity: 0.36;
  mix-blend-mode: screen;
  animation: floatAurora 20s ease-in-out infinite alternate;
}

.aurora-a {
  background: radial-gradient(circle at 30% 30%, rgba(255, 107, 107, 0.35), transparent 34%);
}

.aurora-b {
  background: radial-gradient(circle at 70% 70%, rgba(93, 179, 255, 0.26), transparent 40%);
  animation-duration: 24s;
}

.glass-card {
  position: relative;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 32px;
  padding: 2.2rem;
  width: min(100%, 720px);
  text-align: center;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.card-eyebrow {
  margin: 0 0 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.78rem;
  color: var(--gold-soft);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.1;
}

p {
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  line-height: 1.8;
  color: var(--muted);
  margin: 0.7rem 0;
}

.central-loading {
  min-height: 100vh;
}

.loading-shell {
  text-align: center;
  display: grid;
  place-items: center;
  gap: 1rem;
}

.loading-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  border-top-color: var(--gold);
  border-right-color: rgba(255,255,255,0.2);
  animation: spin 2.6s linear infinite;
  box-shadow: inset 0 0 40px rgba(247, 200, 114, 0.12), 0 0 60px rgba(247, 200, 114, 0.15);
}

.loading-word {
  font-size: 2rem;
  color: var(--gold-soft);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.loading-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
}

.gift-scene,
.letter-scene,
.reasons-scene,
.question-scene,
.counter-scene,
.memory-scene,
.rose-scene,
.galaxy-scene,
.finale-scene {
  align-items: center;
  justify-content: center;
}

.gift-stage {
  display: grid;
  place-items: center;
  gap: 2rem;
  width: 100%;
  position: relative;
}

.gift-box {
  position: relative;
  width: min(60vw, 320px);
  aspect-ratio: 1 / 1;
  animation: gentleFloat 4.4s ease-in-out infinite;
  transform-style: preserve-3d;
}

.gift-lid,
.gift-body {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #f0d07b 55%, #c3942e);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: inset 0 -10px 30px rgba(0,0,0,0.16), 0 25px 50px rgba(0,0,0,0.28);
}

.gift-lid {
  inset: -10px 0 auto 0;
  height: 46%;
  border-radius: 24px 24px 18px 18px;
  transform-origin: bottom center;
  transition: transform 0.8s ease;
}

.gift-body {
  top: 42%;
  height: 58%;
  border-radius: 0 0 24px 24px;
}

.gift-ribbon {
  position: absolute;
  left: calc(50% - 24px);
  top: -8px;
  width: 48px;
  height: 56%;
  background: linear-gradient(180deg, #fff1be, #a96c19);
  border-radius: 999px;
  z-index: 4;
}

.gift-ribbon::before,
.gift-ribbon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
}

.gift-ribbon::before {
  transform: rotate(45deg);
}

.gift-ribbon::after {
  transform: rotate(-45deg);
}

.gift-box.open .gift-lid {
  transform: rotateX(-90deg) translateY(-12px);
}

.gift-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 242, 193, 0.9), transparent 42%),
    radial-gradient(circle at 40% 60%, rgba(255, 200, 130, 0.4), transparent 30%);
  filter: blur(14px);
  transition: opacity 0.65s ease;
}

.gift-light.active {
  opacity: 1;
}

.gift-box.shake {
  animation: boxShake 0.45s linear 3;
}

.action-button,
.choice-button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  color: #07111f;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 30px rgba(247, 200, 114, 0.2);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.action-button:hover,
.choice-button:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 38px rgba(247, 200, 114, 0.25);
}

.letter-card {
  max-width: 700px;
}

.letter-card h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.closing {
  margin-top: 1.2rem;
  font-style: italic;
  color: var(--gold-soft);
}

.reason-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.3rem;
}

.reason-card {
  padding: 1rem 1.3rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  opacity: 0;
  transform: translateY(36px) scale(0.98);
}

.reason-card.visible {
  animation: reasonReveal 0.95s ease forwards;
}

.reason-1 { animation-delay: 0.35s; }
.reason-2 { animation-delay: 0.95s; }
.reason-3 { animation-delay: 1.55s; }
.reason-4 { animation-delay: 2.15s; }
.reason-5 { animation-delay: 2.75s; }

.question-card {
  max-width: 640px;
}

.choice-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.choice-button.yes {
  background: linear-gradient(120deg, #ffe6b5, #ff9e8f);
}

.choice-button.no {
  background: linear-gradient(120deg, #dce8ff, #95b7ff);
}

.question-note {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.counter-card {
  max-width: 780px;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.counter-tile {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
}

.counter-tile span {
  display: block;
  font-size: 2rem;
  color: var(--gold-soft);
  font-weight: 700;
}

.counter-tile label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.counter-text {
  margin-top: 1rem;
}

.memory-card {
  min-height: 420px;
  display: grid;
  place-items: center;
  gap: 1.5rem;
}

.memory-vault {
  width: 180px;
  height: 180px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 40px rgba(255,255,255,0.09);
}

.memory-x {
  width: 88px;
  height: 88px;
  position: relative;
}

.memory-x::before,
.memory-x::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--gold-soft) 50%, transparent 100%);
  transform: rotate(45deg);
  border-radius: 999px;
}

.memory-x::after {
  transform: rotate(-45deg);
}

.memory-text {
  font-size: 1.1rem;
  max-width: 560px;
}

.rose-stage {
  width: 100%;
  min-height: 520px;
  display: grid;
  place-items: center;
  position: relative;
}

.rose-container {
  position: relative;
  width: 280px;
  height: 360px;
  transform: translateY(10px);
}

.rose-container::before {
  content: '';
  position: absolute;
  inset: 10% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.rose-root {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 22px;
  height: 92px;
  border-left: 2px solid rgba(255,255,255,0.24);
  border-right: 2px solid rgba(255,255,255,0.24);
  border-radius: 0 0 40px 40px;
  transform: translateX(-50%);
  animation: rootsGrow 3.2s ease forwards;
  opacity: 0;
}

.rose-stem {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 4px;
  height: 176px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.08));
  transform-origin: bottom center;
  transform: translateX(-50%) scaleY(0);
  animation: stemGrow 2.8s ease forwards 0.7s;
}

.rose-leaf {
  position: absolute;
  width: 80px;
  height: 108px;
  background: linear-gradient(135deg, #3d7b5f, #1f3f2f);
  border-radius: 100px 0 100px 0;
  bottom: 164px;
  opacity: 0;
  animation: leafAppear 1.6s ease forwards 2.2s;
}

.rose-leaf.left {
  left: 88px;
  transform: rotate(28deg);
}

.rose-leaf.right {
  right: 88px;
  transform: rotate(-28deg) scaleX(-1);
}

.rose-bud {
  position: absolute;
  left: 50%;
  bottom: 210px;
  width: 64px;
  height: 64px;
  background: radial-gradient(circle, #ffe1e4 0%, #ff7f8d 45%, #b2384f 88%);
  border-radius: 50%;
  transform: translateX(-50%) scale(0.18);
  box-shadow: 0 0 70px rgba(255, 146, 176, 0.35);
  animation: budBloom 1.5s ease forwards 2.6s;
}

.rose-core {
  position: absolute;
  left: 50%;
  bottom: 230px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0%, #ffd7c5 55%, transparent 95%);
  transform: translateX(-50%) scale(0);
  box-shadow: 0 0 38px rgba(255, 220, 180, 0.75);
  animation: coreGlow 1.4s ease forwards 2.9s;
}

.rose-flare {
  position: absolute;
  left: 50%;
  bottom: 238px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 196, 0.32), transparent 58%);
  transform: translateX(-50%) scale(0.18);
  opacity: 0;
  animation: flarePulse 2.4s ease forwards 3.0s;
}

.rose-butterfly {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,186,198,0.35));
  box-shadow: 0 0 18px rgba(255,255,255,0.32);
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(0.92);
  animation: flutter 5.5s ease-in-out infinite;
}

.rose-butterfly::before,
.rose-butterfly::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 20px;
  background: rgba(255,255,255,0.92);
  border-radius: 50% 50% 10% 10%;
  top: 7px;
}

.rose-butterfly::before {
  left: 6px;
  transform: rotate(-20deg);
}

.rose-butterfly::after {
  right: 6px;
  transform: rotate(20deg);
}

.rose-butterfly:nth-child(14) { left: 18%; top: 26%; animation-delay: 0s; }
.rose-butterfly:nth-child(15) { left: 76%; top: 28%; animation-delay: 1.2s; }
.rose-butterfly:nth-child(16) { left: 52%; top: 12%; animation-delay: 2.4s; }

.rose-caption {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  font-size: 1rem;
  color: var(--gold-soft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.petal-a { --petal-rotate: -16deg; transform: translateX(-50%) rotate(-16deg) scale(0.82); }
.petal-b { --petal-rotate: 12deg; transform: translateX(-50%) rotate(12deg) scale(0.92); }
.petal-c { --petal-rotate: 44deg; transform: translateX(-50%) rotate(44deg) scale(0.88); }
.petal-d { --petal-rotate: -44deg; transform: translateX(-50%) rotate(-44deg) scale(0.9); }
.petal-e { --petal-rotate: 76deg; transform: translateX(-50%) rotate(76deg) scale(0.82); }
.petal-f { --petal-rotate: -76deg; transform: translateX(-50%) rotate(-76deg) scale(0.84); }

.rose-petal {
  position: absolute;
  left: 50%;
  bottom: 218px;
  width: 76px;
  height: 100px;
  border-radius: 110px 110px 0 110px;
  background: linear-gradient(135deg, #ff9fb7 0%, #e35777 98%);
  opacity: 0;
  transform-origin: bottom center;
  animation: petalBloom 1.6s ease forwards 3.0s;
  box-shadow: 0 20px 34px rgba(255, 87, 124, 0.22);
}

.rose-petal.petal-a { bottom: 206px; }
.rose-petal.petal-b { bottom: 206px; }
.rose-petal.petal-c { bottom: 216px; }
.rose-petal.petal-d { bottom: 216px; }
.rose-petal.petal-e { bottom: 220px; }
.rose-petal.petal-f { bottom: 220px; }

.galaxy-orb {
  position: absolute;
  inset: auto auto 10% 10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.5), rgba(255,255,255,0.1) 35%, transparent 70%);
  filter: blur(18px);
  animation: orbit 18s linear infinite;
}

.galaxy-scene::before {
  content: '';
  position: absolute;
  inset: 20% 10% 20% 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08), transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(247, 200, 114, 0.08), transparent 38%);
  filter: blur(24px);
  pointer-events: none;
}

.galaxy-card {
  max-width: 620px;
  z-index: 2;
}

.finale-card {
  max-width: 560px;
}

.signature {
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  color: var(--gold-soft);
  margin: 1rem 0 0.4rem;
}

.final-line {
  font-size: 1.2rem;
  color: var(--gold-soft);
  margin-top: 0.7rem;
}

.final-fade {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(1, 6, 18, 0.90) 90%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.4s ease 1.2s;
  z-index: 9;
}

.scene-indicator {
  position: fixed;
  right: 1.5rem;
  top: 1.5rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  z-index: 10;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.8;
  animation: particleDrift 5s ease-out forwards;
  will-change: transform, opacity;
}

.celebration-heart {
  position: absolute;
  font-size: 1.4rem;
  animation: heartRise 1.8s ease-out forwards;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: confettiFall 2.4s ease-out forwards;
  pointer-events: none;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(0.8); }
  100% { transform: translate3d(60px, 120px, 0) scale(1.3); opacity: 0; }
}

@keyframes floatAurora {
  from { transform: translate3d(-4%, -3%, 0) scale(1); }
  to { transform: translate3d(5%, 4%, 0) scale(1.04); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(1deg); }
}

@keyframes boxShake {
  0%, 100% { transform: translateX(0px); }
  25% { transform: translateX(-12px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-8px); }
}

@keyframes reasonReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rootsGrow {
  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes stemGrow {
  to {
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes leafAppear {
  to {
    opacity: 1;
    transform: translateY(0) rotate(26deg);
  }
}

@keyframes budBloom {
  0% { transform: translateX(-50%) scale(0.2); opacity: 0; }
  60% { transform: translateX(-50%) scale(0.7); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes coreGlow {
  0% { transform: translateX(-50%) scale(0); opacity: 0; }
  80% { transform: translateX(-50%) scale(1.05); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
}

@keyframes flarePulse {
  0% { transform: translateX(-50%) scale(0.2); opacity: 0; }
  55% { transform: translateX(-50%) scale(1.05); opacity: 0.4; }
  100% { transform: translateX(-50%) scale(1); opacity: 0.18; }
}

@keyframes petalBloom {
  0% { opacity: 0; transform: translateX(-50%) scale(0.3) rotate(0deg); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(var(--petal-rotate, 0deg)); }
}

@keyframes orbit {
  0% { transform: rotate(0deg) translateX(0px) scale(1); }
  50% { transform: rotate(180deg) translateX(12px) scale(1.06); }
  100% { transform: rotate(360deg) translateX(0px) scale(1); }
}

@keyframes particleDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.9; }
  100% { transform: translate3d(var(--dx), var(--dy), 0) scale(0); opacity: 0; }
}

@keyframes flutter {
  0%, 100% { transform: translate(-50%, -50%) scale(0.85) translateY(0) rotate(0deg); opacity: 0.75; }
  25% { transform: translate(-50%, -52%) scale(0.95) translateX(-18px) rotate(-12deg); opacity: 0.95; }
  50% { transform: translate(-50%, -50%) scale(1) translateY(-22px) rotate(8deg); opacity: 0.85; }
  75% { transform: translate(-50%, -52%) scale(0.9) translateX(16px) rotate(-8deg); opacity: 0.9; }
}

@keyframes heartRise {
  0% { transform: translateY(0) scale(0.2); opacity: 0.9; }
  100% { transform: translateY(-220px) scale(1.2); opacity: 0; }
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(220px) rotate(420deg); opacity: 0; }
}

@media (max-width: 760px) {
  .scene { padding: 1rem; }
  .glass-card { padding: 1.3rem; border-radius: 24px; }
  .counter-grid {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }
  .gift-box { width: min(78vw, 260px); }
  .rose-container { width: 220px; height: 280px; }
  .rose-leaf.left { left: 20px; }
  .rose-leaf.right { right: 20px; }
  .rose-butterfly { width: 28px; height: 28px; }
}
