:root {
  /* Premium birthday palette shared across the page. */
  --pink: #ffd7ea;
  --rose: #ff7cb6;
  --purple: #8b5cf6;
  --violet: #44206f;
  --gold: #ffd36a;
  --white: #fffafc;
  --glass: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.38);
  --shadow: 0 28px 90px rgba(67, 24, 93, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 211, 106, 0.35), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(255, 124, 182, 0.32), transparent 28rem),
    radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.42), transparent 30rem),
    linear-gradient(135deg, #2b104e 0%, #71366d 42%, #f2a3c7 100%);
}

/* Soft animated atmosphere behind every section. */
body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 30%, rgba(255, 211, 106, 0.12));
  animation: gradientShift 12s ease-in-out infinite alternate;
}

button {
  font: inherit;
}

.section {
  position: relative;
  min-height: 100vh;
  padding: clamp(4.5rem, 8vw, 7rem) clamp(1rem, 4vw, 4rem);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  gap: 1.2rem;
  align-content: center;
  background:
    radial-gradient(circle, rgba(255, 211, 106, 0.24), transparent 18rem),
    linear-gradient(135deg, #32135e, #d477af);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 86px;
  height: 86px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(255, 211, 106, 0.5);
  animation: spin 1s linear infinite;
}

.loading-screen p {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Fixed effect canvases sit above content but never block clicks. */
.effect-canvas {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fireworksCanvas {
  z-index: 45;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 16px currentColor;
  animation: floatParticle linear infinite;
}

.glass-panel {
  /* Glassmorphism surface used for the hero, wishes, cake, and finale panels. */
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(20px);
}

.hero-card {
  width: min(820px, 100%);
  padding: clamp(2.2rem, 7vw, 5.5rem);
  text-align: center;
  transform: translateY(12px);
  animation: cardIn 1.1s 0.45s ease forwards;
  opacity: 0;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(4rem, 12vw, 8.6rem);
  line-height: 0.92;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.5), 0 0 54px rgba(255, 124, 182, 0.65);
}

h2 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.subtitle {
  max-width: 620px;
  margin: 1.4rem auto 2.3rem;
  color: rgba(255, 250, 252, 0.86);
  font-size: clamp(1rem, 2.3vw, 1.3rem);
  line-height: 1.7;
}

.glow-button {
  /* Buttons use layered glow so the calls to action feel special. */
  position: relative;
  z-index: 1;
  min-height: 54px;
  padding: 0.95rem 1.45rem;
  border: 0;
  border-radius: 999px;
  color: #371444;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #fff7d0, var(--gold), #ff9bc9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38), 0 16px 42px rgba(255, 156, 202, 0.4), 0 0 36px rgba(255, 211, 106, 0.42);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glow-button::after {
  position: absolute;
  inset: -6px;
  z-index: -1;
  content: "";
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.45), rgba(255, 124, 182, 0.34));
  filter: blur(16px);
  opacity: 0.86;
}

.glow-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 52px rgba(255, 156, 202, 0.5), 0 0 54px rgba(255, 211, 106, 0.58);
}

.glow-button:active {
  transform: translateY(0) scale(0.99);
}

.background-orbit {
  position: absolute;
  width: min(72vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  filter: drop-shadow(0 0 46px rgba(255, 211, 106, 0.2));
  animation: orbit 18s linear infinite;
}

.floating-scene span {
  position: absolute;
  display: inline-grid;
  place-items: center;
  opacity: 0.84;
}

.balloon {
  /* CSS balloons avoid extra image assets and stay crisp on every screen. */
  width: 54px;
  height: 68px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(135deg, #fff, #ff8fc4 48%, #8b5cf6);
  box-shadow: inset -10px -12px 20px rgba(96, 27, 112, 0.22), 0 12px 34px rgba(255, 124, 182, 0.32);
  animation: balloonFloat 7s ease-in-out infinite;
}

.balloon::after {
  position: absolute;
  top: 65px;
  width: 1px;
  height: 82px;
  content: "";
  background: rgba(255, 255, 255, 0.6);
}

.balloon-1 {
  top: 12%;
  left: 8%;
}

.balloon-2 {
  top: 22%;
  right: 9%;
  width: 46px;
  height: 60px;
  animation-delay: -2s;
}

.balloon-3 {
  bottom: 16%;
  left: 14%;
  width: 42px;
  height: 56px;
  animation-delay: -4s;
}

.heart,
.star {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.75);
  animation: twinkle 2.8s ease-in-out infinite;
}

.heart {
  color: #ffd2e7;
  font-size: 2rem;
}

.star {
  color: var(--gold);
  font-size: 1.5rem;
}

.heart-1 {
  right: 20%;
  bottom: 20%;
}

.heart-2 {
  left: 24%;
  top: 24%;
  animation-delay: -1.3s;
}

.star-1 {
  top: 16%;
  left: 36%;
}

.star-2 {
  right: 32%;
  top: 32%;
  animation-delay: -0.8s;
}

.star-3 {
  bottom: 26%;
  right: 16%;
  animation-delay: -1.8s;
}

.celebration {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.celebration.visible {
  opacity: 1;
  transform: translateY(0);
}

.celebration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 470px);
  gap: clamp(1rem, 3vw, 2rem);
  width: min(1120px, 100%);
  align-items: stretch;
}

.wish-panel,
.cake-panel,
.finale-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.wish-panel {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: center;
}

.typewriter {
  min-height: 4.2rem;
  margin: 2rem 0 1.4rem;
  color: rgba(255, 250, 252, 0.94);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.22;
}

.typewriter::after {
  content: "|";
  color: var(--gold);
  animation: blink 0.75s infinite;
}

.wish-dots {
  display: flex;
  gap: 0.55rem;
}

.wish-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
}

.wish-dots span.active {
  background: var(--gold);
  box-shadow: 0 0 20px rgba(255, 211, 106, 0.8);
}

.cake-panel {
  display: grid;
  min-height: 430px;
  place-items: center;
  text-align: center;
}

.cake {
  /* The cake starts hidden and is revealed by the first surprise button. */
  position: relative;
  width: min(330px, 82vw);
  height: 300px;
  margin: 1.5rem auto;
  filter: drop-shadow(0 30px 38px rgba(61, 17, 82, 0.35));
  transform: translateY(16px) scale(0.92);
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.cake.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.candles {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 28px;
  transform: translateX(-50%);
}

.candle {
  position: relative;
  width: 18px;
  height: 72px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #fff, #fff 8px, #ff8fc4 8px, #ff8fc4 15px);
  box-shadow: inset -4px 0 8px rgba(57, 15, 75, 0.15);
}

.flame {
  /* Candle flames flicker until the candles are blown out. */
  position: absolute;
  left: 50%;
  bottom: 68px;
  width: 20px;
  height: 30px;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 70%, #fff 0 18%, #ffd36a 20% 52%, #ff7b4a 54% 100%);
  box-shadow: 0 0 18px rgba(255, 211, 106, 0.95), 0 0 34px rgba(255, 124, 74, 0.7);
  transform: translateX(-50%);
  transform-origin: 50% 90%;
  animation: flameDance 0.18s ease-in-out infinite alternate;
}

.cake.extinguished .flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.2);
  animation: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.cake-top {
  position: absolute;
  top: 78px;
  left: 50%;
  z-index: 2;
  width: 240px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff6fb, #ffd3e8);
  transform: translateX(-50%);
  box-shadow: inset 0 -12px 18px rgba(255, 124, 182, 0.24);
}

.sprinkle {
  position: absolute;
  width: 28px;
  height: 6px;
  border-radius: 8px;
  background: var(--gold);
  transform: rotate(22deg);
}

.sprinkle:nth-child(1) {
  top: 24px;
  left: 42px;
}

.sprinkle:nth-child(2) {
  top: 18px;
  right: 42px;
  background: var(--purple);
  transform: rotate(-18deg);
}

.sprinkle:nth-child(3) {
  top: 38px;
  left: 108px;
  background: #ff7cb6;
  transform: rotate(-9deg);
}

.sprinkle:nth-child(4) {
  top: 32px;
  right: 96px;
  background: #fff;
}

.cake-layer {
  position: absolute;
  left: 50%;
  overflow: hidden;
  transform: translateX(-50%);
}

.layer-one {
  top: 114px;
  z-index: 1;
  width: 280px;
  height: 92px;
  border-radius: 22px 22px 34px 34px;
  background: linear-gradient(135deg, #ff8fc4, #ffcae0 45%, #fff3bf);
}

.layer-two {
  top: 186px;
  width: 330px;
  height: 88px;
  border-radius: 24px 24px 38px 38px;
  background: linear-gradient(135deg, #8b5cf6, #d8b4fe 45%, #ffd36a);
}

.drip {
  position: absolute;
  top: 0;
  width: 28px;
  height: 44px;
  border-radius: 0 0 18px 18px;
  background: #fff6fb;
}

.drip-1 {
  left: 46px;
  height: 50px;
}

.drip-2 {
  left: 132px;
  height: 36px;
}

.drip-3 {
  right: 58px;
  height: 58px;
}

.cake-stand {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 370px;
  max-width: 94vw;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 211, 106, 0.85), rgba(255, 255, 255, 0.38));
  transform: translateX(-50%);
}

.wish-result {
  min-height: 1.7rem;
  margin: 1rem 0 0;
  color: var(--gold);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.wish-result.visible {
  opacity: 1;
  transform: translateY(0);
}

.finale {
  min-height: 82vh;
}

.finale-panel {
  width: min(820px, 100%);
  text-align: center;
}

.final-message {
  /* Finale message appears after fireworks are launched. */
  position: relative;
  margin-top: 2.2rem;
  opacity: 0;
  transform: translateY(22px) scale(0.96);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.final-message.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.final-message::before {
  position: absolute;
  inset: -34px;
  z-index: -1;
  content: "";
  border-radius: 32px;
  background: radial-gradient(circle, rgba(255, 211, 106, 0.22), transparent 68%);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

.final-message h2 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.4rem, 9vw, 7rem);
  text-shadow: 0 0 28px rgba(255, 211, 106, 0.66);
}

.final-message p {
  margin: 0.7rem auto 0;
  max-width: 620px;
  color: rgba(255, 250, 252, 0.9);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.7;
}

.rising-balloons {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.rise-balloon {
  position: absolute;
  bottom: -140px;
  width: 48px;
  height: 62px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(135deg, #fff, var(--rose), var(--purple));
  box-shadow: 0 0 28px rgba(255, 124, 182, 0.46);
  animation: rise 8s ease-in forwards;
}

.rise-balloon::after {
  position: absolute;
  top: 60px;
  left: 50%;
  width: 1px;
  height: 84px;
  content: "";
  background: rgba(255, 255, 255, 0.55);
}

.heart-pop {
  position: fixed;
  z-index: 60;
  color: #ffd2e7;
  font-size: 1.2rem;
  pointer-events: none;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.8);
  animation: heartPop 1s ease-out forwards;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gradientShift {
  to {
    filter: hue-rotate(14deg) brightness(1.08);
  }
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes balloonFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-26px) rotate(5deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.36;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.22);
  }
}

@keyframes floatParticle {
  from {
    transform: translateY(110vh) scale(0.6);
    opacity: 0;
  }

  15%,
  85% {
    opacity: 0.8;
  }

  to {
    transform: translateY(-12vh) scale(1);
    opacity: 0;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes flameDance {
  from {
    transform: translateX(-50%) rotate(-5deg) scaleY(0.96);
  }

  to {
    transform: translateX(-50%) rotate(5deg) scaleY(1.08);
  }
}

@keyframes pulseGlow {
  50% {
    opacity: 0.55;
    transform: scale(1.04);
  }
}

@keyframes rise {
  to {
    transform: translateY(-120vh) translateX(var(--drift, 20px)) rotate(8deg);
  }
}

@keyframes heartPop {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }

  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.7);
  }
}

@media (max-width: 820px) {
  .celebration-grid {
    grid-template-columns: 1fr;
  }

  .wish-panel,
  .cake-panel {
    min-height: auto;
  }

  .hero-card,
  .wish-panel,
  .cake-panel,
  .finale-panel {
    border-radius: 22px;
  }

  .balloon-1 {
    left: 2%;
  }

  .balloon-2 {
    right: 4%;
  }
}

@media (max-width: 520px) {
  .section {
    padding-inline: 0.85rem;
  }

  .hero-card {
    padding: 2rem 1.1rem;
  }

  .glow-button {
    width: 100%;
    padding-inline: 1rem;
  }

  .floating-scene .heart-2,
  .floating-scene .star-2 {
    display: none;
  }
}

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