:root {
  --bg-a: #7de2ff;
  --bg-b: #ffd6f5;
  --bg-c: #fff3a7;
  --card: rgba(255, 255, 255, 0.9);
  --pink: #ff4f9a;
  --purple: #7a49ff;
  --gold: #ffcc33;
  --mint: #52e8c8;
  --text: #44245f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Baloo 2", "Trebuchet MS", "Verdana", sans-serif;
  overflow: hidden;
  color: var(--text);
  position: relative;
  background: #9bd6ff;
}

.sky-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, #ffffffaa 0 12%, transparent 35%),
    radial-gradient(circle at 82% 10%, #fff7bf99 0 15%, transparent 36%),
    linear-gradient(130deg, var(--bg-a), var(--bg-b) 45%, var(--bg-c));
  animation: skyShift 12s ease-in-out infinite alternate;
}

.twinkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, #ffffff 0 1px, transparent 2px),
    radial-gradient(circle, #fffdcc 0 1px, transparent 2px);
  background-size: 60px 60px, 90px 90px;
  background-position: 0 0, 15px 25px;
  opacity: 0.45;
  animation: twinkle 3.4s linear infinite;
}

.hero-banner {
  position: relative;
  z-index: 20;
  text-align: center;
  margin: 1rem auto 0;
  width: min(95vw, 900px);
  padding: 1rem 1rem 0.6rem;
}

.hero-banner h1 {
  display: inline-block;
  font-size: clamp(2rem, 7.5vw, 4.8rem);
  color: #fff;
  background: linear-gradient(90deg, #ff4f9a, #7a49ff, #ff9f2f, #ff4f9a);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 5px 16px rgba(255, 255, 255, 0.8);
  animation: bannerGlow 1.3s ease-in-out infinite alternate, shimmer 3.2s linear infinite;
}

.hero-banner p {
  margin-top: 0.4rem;
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  font-weight: 700;
  color: #5a2175;
}

.sparkles {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: 0.2rem;
  animation: sparkleWobble 1.6s ease-in-out infinite;
}

.music-toggle {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 40;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff7fb8, #ffcf55);
  color: #572948;
  font-size: clamp(0.9rem, 2.8vw, 1rem);
  font-weight: 800;
  padding: 0.85rem 1.1rem;
  min-height: 48px;
  min-width: 160px;
  box-shadow: 0 8px 18px rgba(90, 30, 70, 0.25);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform-origin: center;
  animation: buttonPulse 1.4s ease-in-out infinite;
}

.music-toggle:active {
  transform: scale(0.95);
}

.music-toggle:disabled {
  cursor: wait;
  opacity: 0.92;
}

.stage {
  position: relative;
  height: calc(100vh - 8rem);
  width: 100%;
  z-index: 10;
}

.center-card {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: min(90vw, 680px);
  padding: clamp(1rem, 2.5vw, 2rem);
  text-align: center;
  background: var(--card);
  border: 6px solid #ffffff;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(102, 29, 94, 0.18);
  backdrop-filter: blur(4px);
  animation: cardBounce 2.3s ease-in-out infinite;
}

.name-pop {
  font-size: clamp(1.6rem, 5vw, 3rem);
  color: var(--pink);
  text-shadow: 0 3px 0 #fff;
}

.wish {
  margin: 0.8rem auto;
  font-size: clamp(1rem, 3.2vw, 1.35rem);
  max-width: 30ch;
  font-weight: 700;
}

.dancing-row {
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  display: flex;
  justify-content: center;
  gap: clamp(0.3rem, 1.5vw, 1rem);
  margin: 1rem 0 0.5rem;
}

.ballerina {
  display: inline-block;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.15));
}

.spin-1 { animation: pirouette 1.2s linear infinite; }
.spin-2 { animation: pirouette 1s linear infinite reverse; }
.spin-3 { animation: pirouette 1.4s linear infinite; }
.spin-4 { animation: pirouette 1.1s linear infinite reverse; }

.tutu-row {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  letter-spacing: 0.2rem;
  animation: shimmy 1.4s ease-in-out infinite;
}

.hint {
  margin-top: 0.8rem;
  font-weight: 700;
  color: #75307d;
}

.horse-lane {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.horse {
  position: absolute;
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  animation: gallop 1s steps(2) infinite, rideAcross 12s linear infinite;
}

.horse-1 { top: 18%; animation-delay: 0s, -2s; }
.horse-2 { top: 28%; animation-delay: 0.2s, -6s; }
.horse-3 { top: 38%; animation-delay: 0.3s, -10s; }

.horse-silhouette {
  position: absolute;
  bottom: 6%;
  font-size: clamp(2.3rem, 7vw, 4.5rem);
  color: #3a2f52;
  opacity: 0.85;
  animation: trotAcross 10s linear infinite;
}

.horse-emojis {
  position: absolute;
  bottom: 1.2rem;
  width: 100%;
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 2rem);
  letter-spacing: 0.3rem;
  animation: horseCheer 1s ease-in-out infinite;
}

.dancing-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dancing-dots span {
  position: absolute;
  width: clamp(10px, 2vw, 16px);
  height: clamp(10px, 2vw, 16px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ff7fb8 70%);
  animation: dotDance 2.2s ease-in-out infinite;
}

.dancing-dots span:nth-child(1) { left: 8%; top: 20%; animation-delay: 0s; }
.dancing-dots span:nth-child(2) { left: 16%; top: 70%; animation-delay: 0.2s; }
.dancing-dots span:nth-child(3) { left: 27%; top: 32%; animation-delay: 0.6s; }
.dancing-dots span:nth-child(4) { left: 36%; top: 82%; animation-delay: 0.4s; }
.dancing-dots span:nth-child(5) { left: 48%; top: 18%; animation-delay: 0.8s; }
.dancing-dots span:nth-child(6) { left: 58%; top: 75%; animation-delay: 1s; }
.dancing-dots span:nth-child(7) { left: 66%; top: 35%; animation-delay: 1.3s; }
.dancing-dots span:nth-child(8) { left: 74%; top: 85%; animation-delay: 0.9s; }
.dancing-dots span:nth-child(9) { left: 82%; top: 22%; animation-delay: 0.5s; }
.dancing-dots span:nth-child(10) { left: 88%; top: 65%; animation-delay: 0.1s; }
.dancing-dots span:nth-child(11) { left: 12%; top: 50%; animation-delay: 1.1s; }
.dancing-dots span:nth-child(12) { left: 92%; top: 42%; animation-delay: 0.7s; }

.disco-ball {
  position: absolute;
  left: 50%;
  top: 0.4rem;
  transform: translateX(-50%);
  width: min(80vw, 260px);
  height: 160px;
  pointer-events: none;
  opacity: 0.95;
}

.disco-core {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  animation: discoSpin 2.1s linear infinite;
}

.beam {
  position: absolute;
  left: 50%;
  top: 38px;
  transform-origin: top center;
  width: 4px;
  height: 120px;
  border-radius: 4px;
  opacity: 0.25;
}

.beam-a {
  background: linear-gradient(#fff4, #ff54a6);
  transform: rotate(24deg);
  animation: beamSwing 2.2s ease-in-out infinite;
}

.beam-b {
  background: linear-gradient(#fff4, #52e8c8);
  transform: rotate(-30deg);
  animation: beamSwing 2s ease-in-out infinite reverse;
}

.beam-c {
  background: linear-gradient(#fff4, #7a49ff);
  transform: rotate(0deg);
  animation: beamSwing 2.4s ease-in-out infinite;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0.95;
  will-change: transform, opacity;
}

@keyframes skyShift {
  from { filter: saturate(1) hue-rotate(0deg); }
  to { filter: saturate(1.2) hue-rotate(-16deg); }
}

@keyframes twinkle {
  50% { opacity: 0.7; transform: translateY(-2px); }
}

@keyframes bannerGlow {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.02); }
}

@keyframes shimmer {
  to { background-position: 220% 0; }
}

@keyframes sparkleWobble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes cardBounce {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-8px); }
}

@keyframes pirouette {
  from { transform: rotate(0) translateY(0); }
  25% { transform: rotate(90deg) translateY(-5px); }
  50% { transform: rotate(180deg) translateY(0); }
  75% { transform: rotate(270deg) translateY(-5px); }
  to { transform: rotate(360deg) translateY(0); }
}

@keyframes shimmy {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

@keyframes gallop {
  0%, 100% { transform: translateY(0) scaleX(1); }
  50% { transform: translateY(-8px) scaleX(1.05); }
}

@keyframes rideAcross {
  from { left: -15%; }
  to { left: 110%; }
}

@keyframes trotAcross {
  from { left: -10%; transform: translateY(0); }
  15% { transform: translateY(-3px); }
  30% { transform: translateY(0); }
  45% { transform: translateY(-3px); }
  60% { transform: translateY(0); }
  to { left: 105%; transform: translateY(-3px); }
}

@keyframes horseCheer {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px) scale(1.04); }
}

@keyframes dotDance {
  0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.7; }
  50% { transform: translateY(-14px) scale(1.25); opacity: 1; }
}

@keyframes discoSpin {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes beamSwing {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

@keyframes confettiFall {
  to {
    transform: translate3d(var(--tx), var(--ty), 0) rotate(760deg) scale(0.6);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .music-toggle {
    top: auto;
    bottom: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(88vw, 340px);
    min-height: 56px;
    font-size: 1.05rem;
    padding: 1rem 1.35rem;
    animation: none;
  }

  .music-toggle:active {
    transform: translateX(-50%) scale(0.96);
  }

  .stage {
    height: calc(100vh - 11rem);
  }

  .center-card {
    top: 56%;
    border-width: 4px;
  }

  .horse {
    font-size: clamp(1.3rem, 7vw, 2rem);
  }

  .horse-silhouette {
    bottom: 10%;
  }

  .disco-ball {
    top: -0.2rem;
  }
}

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

  .confetti-piece {
    display: none;
  }
}
