:root {
  --black: #0a0508;
  --ink: #1a0a12;
  --pink: #ff4d8d;
  --pink-soft: #ff9ec0;
  --pink-pale: #ffe0ec;
  --lilac: #d9a8ff;
  --foam: #fff5f9;
  --font-display: "Mochiy Pop One", "Zen Maru Gothic", sans-serif;
  --font-body: "Zen Maru Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--foam);
  font-family: var(--font-body);
  background: var(--black);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(255, 77, 141, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 20%, rgba(217, 168, 255, 0.22), transparent 50%),
    radial-gradient(ellipse 80% 55% at 50% 100%, rgba(255, 77, 141, 0.18), transparent 55%),
    linear-gradient(165deg, #14060d 0%, #0a0508 42%, #1a0812 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 158, 192, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 158, 192, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  opacity: 0.45;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: soft-light;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: floaty 10s ease-in-out infinite alternate;
}

.orb-a {
  width: min(48vw, 22rem);
  height: min(48vw, 22rem);
  top: 8%;
  left: -8%;
  background: rgba(255, 77, 141, 0.35);
}

.orb-b {
  width: min(40vw, 18rem);
  height: min(40vw, 18rem);
  right: -6%;
  top: 35%;
  background: rgba(217, 168, 255, 0.28);
  animation-delay: -3s;
}

.orb-c {
  width: min(55vw, 24rem);
  height: min(55vw, 24rem);
  left: 30%;
  bottom: -18%;
  background: rgba(255, 120, 170, 0.2);
  animation-delay: -6s;
}

.sparkle {
  position: absolute;
  color: var(--pink-soft);
  opacity: 0.55;
  animation: twinkle 3.2s ease-in-out infinite;
  font-size: 1.1rem;
}

.s1 {
  top: 14%;
  right: 12%;
}

.s2 {
  top: 48%;
  left: 8%;
  animation-delay: 1s;
  color: var(--lilac);
}

.s3 {
  bottom: 18%;
  right: 18%;
  animation-delay: 1.8s;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(1.25rem, 3.5vw, 2rem);
  padding: clamp(1.25rem, 5vw, 3rem);
  text-align: center;
}

.brand {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 6.4vw, 3.35rem);
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--foam);
  text-shadow:
    0 0 18px rgba(255, 77, 141, 0.55),
    0 2px 0 rgba(255, 77, 141, 0.35);
  animation: rise 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.brand::before,
.brand::after {
  content: "♡";
  display: inline-block;
  margin: 0 0.25em;
  color: var(--pink);
  font-size: 0.72em;
  vertical-align: 0.08em;
  animation: heartbeat 1.6s ease-in-out infinite;
}

.candles-panel {
  width: min(100%, 42rem);
  animation: rise 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s both;
}

.count-number {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  letter-spacing: 0.12em;
  color: var(--pink-soft);
}

.candles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.2rem, 1.2vw, 0.55rem);
  min-height: clamp(5.5rem, 22vw, 9rem);
  padding: 0.35rem 0.25rem 0.75rem;
  filter: drop-shadow(0 0 14px rgba(255, 77, 141, 0.35));
}

.candle {
  display: inline-block;
  line-height: 1;
  user-select: none;
  animation: flicker 1.8s ease-in-out infinite;
  transform-origin: center bottom;
}

.candle-xl {
  font-size: clamp(3.6rem, 14vw, 6.2rem);
  animation-duration: 2.2s;
}

.candle-l {
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  animation-duration: 2s;
}

.candle-m {
  font-size: clamp(1.7rem, 6.5vw, 2.8rem);
  animation-duration: 1.7s;
}

.candle-s {
  font-size: clamp(1.05rem, 4vw, 1.65rem);
  animation-duration: 1.45s;
}

.candle:nth-child(3n) {
  animation-delay: 0.25s;
}

.candle:nth-child(4n) {
  animation-delay: 0.55s;
}

.congrats {
  appearance: none;
  border: 2px solid rgba(255, 158, 192, 0.75);
  border-radius: 999px;
  padding: 0.85rem 1.5rem 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffe6f0 0%, #ff8fb8 48%, #ff4d8d 100%);
  box-shadow:
    0 0 0 3px rgba(255, 77, 141, 0.18),
    0 10px 28px rgba(255, 77, 141, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-family: var(--font-display);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) 0.16s both;
}

.congrats-cake {
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(120, 20, 60, 0.2));
}

.congrats-label {
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  letter-spacing: 0.08em;
}

.congrats:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
}

.congrats:active {
  transform: translateY(1px) scale(0.98);
}

.congrats:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.status {
  min-height: 1.25rem;
  margin: 0;
  color: rgba(255, 224, 236, 0.65);
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes floaty {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(3%, -4%) scale(1.08);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.15);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  60% {
    transform: scale(1);
  }
}

@keyframes flicker {
  0%,
  100% {
    transform: rotate(-2deg) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: rotate(2deg) scale(1.04);
    filter: brightness(1.15);
  }
}

@media (max-width: 480px) {
  .brand {
    max-width: 11ch;
  }

  .congrats {
    width: min(100%, 20rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
