/* ============================================
   Happy Birthday — Romantic & Elegant Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Inter:wght@400;500;600&display=swap');

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #2d1b3d 0%, #1a1a2e 55%, #0f0f1a 100%);
  color: #fff;
  position: relative;
}

/* ---------- Twinkling Stars Layer ---------- */
#stars-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0;
    transform: scale(0.8);
  }

  50% {
    opacity: var(--max-opacity, 0.9);
    transform: scale(1.2);
  }
}

/* ---------- Floating Petals ---------- */
.floating-petal {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: floatPetal var(--float-dur) ease-in-out infinite;
  animation-delay: var(--float-delay);
}

.floating-petal::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse, #b5344a 0%, #8b1a2b 80%);
  border-radius: 50% 0 50% 0;
  transform: rotate(45deg);
}

@keyframes floatPetal {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  10% {
    opacity: 0.5;
  }

  90% {
    opacity: 0.3;
  }

  100% {
    opacity: 0;
    transform: translateY(100vh) translateX(calc(var(--drift))) rotate(360deg);
  }
}

/* ---------- Center Stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ---------- SVG Rose ---------- */
.rose-wrap {
  width: clamp(220px, 45vmin, 380px);
  height: clamp(220px, 45vmin, 380px);
  position: relative;
}

.rose-wrap svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(180, 40, 60, 0.45));
}

/* Petal bloom animation */
.petal {
  transform-origin: center 75%;
  opacity: 0;
  transform: scale(0) rotate(var(--rot, 0deg));
  animation: bloomPetal 1.8s ease-out forwards;
  animation-delay: var(--d, 0s);
}

@keyframes bloomPetal {
  0% {
    opacity: 0;
    transform: scale(0) rotate(var(--rot, 0deg));
  }

  60% {
    opacity: 1;
    transform: scale(1.08) rotate(var(--rot, 0deg));
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(var(--rot, 0deg));
  }
}

/* Stem & leaves */
.stem {
  opacity: 0;
  animation: fadeIn 1.5s ease-out forwards;
  animation-delay: 0.2s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Center of rose */
.rose-center {
  transform-origin: center;
  opacity: 0;
  transform: scale(0);
  animation: bloomCenter 1.4s ease-out forwards;
  animation-delay: 3.8s;
}

@keyframes bloomCenter {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  70% {
    opacity: 1;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Glow pulse behind rose */
.rose-wrap::after {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 40, 60, 0.18) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  animation-delay: 4.5s;
  opacity: 0;
  z-index: -1;
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.08);
  }
}

/* ---------- Birthday Message ---------- */
.message {
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  animation: revealText 2s ease-out forwards;
  animation-delay: 5s;
  margin-top: -10px;
}

.message h1 {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 7vw, 4.2rem);
  background: linear-gradient(135deg, #f8c8d0 0%, #e8a0b0 40%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 12px rgba(212, 175, 55, 0.3));
  letter-spacing: 2px;
  line-height: 1.3;
}

.message .sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.75rem, 2vw, 1rem);
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 400;
}

@keyframes revealText {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Glowing Love Text ---------- */
.love-glow {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  color: #ff6b8a;
  text-shadow:
    0 0 10px rgba(255, 107, 138, 0.6),
    0 0 20px rgba(255, 107, 138, 0.4),
    0 0 40px rgba(255, 107, 138, 0.3),
    0 0 80px rgba(255, 107, 138, 0.15);
  margin-top: 6px;
  opacity: 0;
  animation: glowReveal 2s ease-out forwards;
  animation-delay: 5.8s;
  letter-spacing: 1px;
}

@keyframes glowReveal {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  60% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    text-shadow:
      0 0 10px rgba(255, 107, 138, 0.6),
      0 0 20px rgba(255, 107, 138, 0.4),
      0 0 40px rgba(255, 107, 138, 0.3),
      0 0 80px rgba(255, 107, 138, 0.15);
  }
}

/* ---------- Buttons ---------- */
.btn-row {
  position: fixed;
  bottom: 36px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 10;
  opacity: 0;
  animation: revealText 1.2s ease-out forwards;
  animation-delay: 6s;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-music {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 100%);
  color: #e8a0b0;
  border: 1px solid rgba(232, 160, 176, 0.3);
  backdrop-filter: blur(10px);
}

.btn-music:hover {
  border-color: rgba(232, 160, 176, 0.7);
  box-shadow: 0 0 24px rgba(232, 160, 176, 0.2);
  transform: translateY(-2px);
}

.btn-surprise {
  background: linear-gradient(135deg, #8b1a2b 0%, #b5344a 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(181, 52, 74, 0.35);
}

.btn-surprise:hover {
  box-shadow: 0 6px 28px rgba(181, 52, 74, 0.5);
  transform: translateY(-2px);
}

.btn-surprise:active {
  transform: translateY(0) scale(0.97);
}

/* ---------- Heart Confetti ---------- */
.heart-confetti {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  font-size: var(--size, 18px);
  opacity: 0;
  animation: confettiFall var(--fall-dur) ease-in forwards;
  animation-delay: var(--fall-delay, 0s);
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(100vh) translateX(var(--x-drift, 0px)) rotate(var(--spin, 720deg)) scale(0.3);
  }
}

/* ---------- YouTube iframe (hidden) ---------- */
.yt-embed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -10;
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 600px) {
  .rose-wrap {
    width: 200px;
    height: 200px;
  }

  .btn-row {
    flex-direction: column;
    align-items: center;
    bottom: 20px;
    gap: 10px;
  }

  .btn {
    padding: 10px 24px;
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .message h1 {
    font-size: 1.7rem;
  }
}