:root {
  --gold: #ffd166;
  --gold-soft: #ffb703;
  --pink: #ff8fab;
  --pink-deep: #ff5d8f;
  --cream: #fff3e0;
  --cream-dark: #ffe6c2;
  --night-1: #1a0b2e;
  --night-2: #3d1a4a;
  --party-1: #ffdde1;
  --party-2: #ff9a9e;
  --ink: #3a0d2e;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--white);
  background: linear-gradient(160deg, var(--night-1), var(--night-2));
  overflow-x: hidden;
  transition: background 1.2s ease;
}

body.party {
  background: linear-gradient(160deg, var(--party-1), var(--party-2));
  color: var(--ink);
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

#floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.floater {
  position: absolute;
  bottom: -80px;
  animation: floatUp linear forwards;
  opacity: 0;
  user-select: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) rotate(-12deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-115vh) translateX(28px) rotate(14deg);
    opacity: 0;
  }
}

.screen {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  animation: fadeIn 0.9s ease both;
}

.screen[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: "Pacifico", "Segoe Script", cursive;
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  margin: 0 0 6px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.hero-sub {
  margin: 0 0 34px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  max-width: 460px;
}

.glow-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--night-1);
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  border: none;
  border-radius: 999px;
  padding: 15px 32px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(255, 177, 3, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.glow-btn:active {
  transform: scale(0.97);
}

.mic-hint {
  margin-top: 18px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.cake {
  position: relative;
  width: 300px;
  height: 280px;
  margin-bottom: 36px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}

.cake-tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 14px 14px 8px 8px;
}

.tier-3 {
  bottom: 34px;
  width: 300px;
  height: 120px;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  box-shadow: inset 0 -14px 0 rgba(0, 0, 0, 0.08);
}

.tier-2 {
  bottom: 104px;
  width: 225px;
  height: 96px;
  background: linear-gradient(180deg, #ffb6c1, #ff8fab);
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.08);
}

.tier-1 {
  bottom: 154px;
  width: 155px;
  height: 80px;
  background: linear-gradient(180deg, var(--cream), var(--cream-dark));
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08);
}

.tier-1::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 40%);
}

.cake-plate {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 330px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.35));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.3);
}

.sprinkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 5px at 12% 30%, var(--gold) 40%, transparent 42%),
    radial-gradient(circle 5px at 38% 62%, var(--gold-soft) 40%, transparent 42%),
    radial-gradient(circle 5px at 66% 24%, var(--white) 40%, transparent 42%),
    radial-gradient(circle 5px at 84% 58%, var(--pink) 40%, transparent 42%),
    radial-gradient(circle 5px at 22% 74%, var(--gold) 40%, transparent 42%),
    radial-gradient(circle 5px at 55% 84%, var(--white) 40%, transparent 42%),
    radial-gradient(circle 5px at 74% 44%, var(--gold-soft) 40%, transparent 42%),
    radial-gradient(circle 5px at 30% 46%, var(--white) 40%, transparent 42%);
  opacity: 0.65;
  border-radius: inherit;
}

.tier-3 .sprinkles,
.tier-2 .sprinkles {
  background-image:
    radial-gradient(circle 5px at 12% 30%, var(--gold) 40%, transparent 42%),
    radial-gradient(circle 5px at 38% 62%, var(--cream) 40%, transparent 42%),
    radial-gradient(circle 5px at 66% 24%, var(--white) 40%, transparent 42%),
    radial-gradient(circle 5px at 84% 58%, var(--gold-soft) 40%, transparent 42%),
    radial-gradient(circle 5px at 22% 74%, var(--cream) 40%, transparent 42%),
    radial-gradient(circle 5px at 55% 84%, var(--white) 40%, transparent 42%),
    radial-gradient(circle 5px at 74% 44%, var(--gold-soft) 40%, transparent 42%),
    radial-gradient(circle 5px at 30% 46%, var(--white) 40%, transparent 42%);
}

.candles {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 7px;
  align-items: flex-end;
}

.candle {
  position: relative;
  width: 12px;
  height: 58px;
  border-radius: 6px 6px 3px 3px;
  background: repeating-linear-gradient(
    135deg,
    var(--gold),
    var(--gold) 6px,
    #ff7ba3 6px,
    #ff7ba3 12px
  );
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12);
}

.candle::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: #5a4a3a;
  border-radius: 2px;
}

.flame {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 24px;
  background: radial-gradient(circle at 50% 78%, #fff7ae 0%, var(--gold) 45%, var(--gold-soft) 72%, rgba(255, 107, 61, 0.75) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 18px 6px rgba(255, 177, 3, 0.55), 0 0 42px 16px rgba(255, 138, 45, 0.28);
  animation: flicker 0.22s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) scaleX(1) scaleY(1) rotate(-3deg);
  }
  100% {
    transform: translateX(-50%) scaleX(0.82) scaleY(1.12) rotate(3deg);
  }
}

.candle.out .flame {
  transform: translateX(-50%) scale(0.05) rotate(8deg);
  opacity: 0;
  animation: none;
  box-shadow: none;
}

.candle.out::before {
  background: #bdb3a3;
}

.candle.out {
  background: repeating-linear-gradient(
    135deg,
    #f2d8a7,
    #f2d8a7 6px,
    #f3a7b8 6px,
    #f3a7b8 12px
  );
}

.wish-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 46px 38px;
  max-width: 520px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.wish-kicker {
  margin: 0 0 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.85;
}

.wish-box h2 {
  font-family: "Pacifico", "Segoe Script", cursive;
  font-weight: 400;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  margin: 0 0 14px;
}

.wish-text {
  font-weight: 300;
  line-height: 1.7;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.9);
}

.party-content {
  width: 100%;
  max-width: 640px;
}

.party-title {
  font-family: "Pacifico", "Segoe Script", cursive;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 6px 0 4px;
  text-shadow: 0 4px 16px rgba(255, 255, 255, 0.55);
}

.party-date {
  margin: 0 0 26px;
  font-weight: 300;
  opacity: 0.75;
}

.gallery {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(58, 13, 46, 0.35);
  background: rgba(255, 255, 255, 0.4);
}

.gallery .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gallery .slide.active {
  opacity: 1;
}

.gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery img.placeholder {
  object-fit: contain;
  background: linear-gradient(160deg, var(--party-1), var(--party-2));
  padding: 24px;
}

.caption {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 20px 22px;
  background: linear-gradient(180deg, transparent, rgba(58, 13, 46, 0.78));
  color: var(--white);
  font-weight: 600;
  line-height: 1.6;
}

.caption small {
  display: block;
  font-weight: 300;
  opacity: 0.85;
  margin-top: 4px;
}

.dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 3;
}

.dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.3s ease, transform 0.3s ease;
}

.dots span.active {
  background: var(--white);
  transform: scale(1.3);
}

.ghost-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 26px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ghost-btn:hover {
  background: var(--ink);
  color: var(--party-1);
}

@media (max-width: 480px) {
  .cake {
    transform: scale(0.85);
    margin-bottom: 10px;
  }

  .gallery {
    height: 320px;
  }
}
