:root {
  --pink: #ff7fb8;
  --hot-pink: #df4f99;
  --cream: #fff4c9;
  --sky: #8eddf8;
  --ink: #38204d;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: #fff;
  font-family: 'DynaPuff', system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 9%, rgba(255, 210, 230, 0.72) 0 12%, transparent 26%),
    radial-gradient(circle at 87% 12%, rgba(160, 223, 255, 0.7) 0 12%, transparent 27%),
    linear-gradient(180deg, #3f285b 0%, #6a4f82 50%, #b892ad 100%);
}

.room {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0 0 32vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.18) 100%);
}

.room::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32vh;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(255, 255, 255, 0.32) 0 8%, transparent 24%),
    radial-gradient(ellipse at 76% 46%, rgba(255, 221, 235, 0.26) 0 10%, transparent 30%),
    linear-gradient(180deg, #ffe6ef 0%, #f5bad1 20%, #da8fb4 100%);
  border-top: 12px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 16px 22px rgba(92, 45, 91, 0.14);
}

.stage {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 18px 0;
}

.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: #fff9bd;
  box-shadow:
    0 -3px 0 #fff9bd,
    0 3px 0 #fff9bd,
    -3px 0 0 #fff9bd,
    3px 0 0 #fff9bd,
    0 0 18px rgba(255, 249, 189, 0.85);
  opacity: 0;
  image-rendering: pixelated;
  animation: floatAndFlicker 6s infinite ease-in-out;
}

.star1 { top: 18%; left: 12%; animation-delay: 0s; }
.star2 { top: 28%; left: 82%; animation-delay: 2s; }
.star3 { top: 58%; left: 8%; animation-delay: 1s; }
.star4 { top: 68%; left: 86%; animation-delay: 3s; }
.star5 { top: 16%; left: 50%; animation-delay: 4.5s; }
.star6 { top: 43%; left: 26%; animation-delay: 1.6s; }
.star7 { top: 44%; left: 68%; animation-delay: 3.7s; }
.star8 { top: 76%; left: 42%; animation-delay: 5.2s; }

@keyframes floatAndFlicker {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 0;
  }
  50% {
    transform: translateY(-22px) scale(1.2);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-44px) scale(0.7);
    opacity: 0;
  }
}

.photo-wall {
  position: absolute;
  top: 17vh;
  left: 50%;
  width: min(1180px, 96vw);
  height: 260px;
  transform: translateX(-50%);
}

.photo-frame {
  position: absolute;
  width: clamp(150px, 17vw, 235px);
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 10px 10px 30px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #ffffff 0%, #fff5fb 58%, #e4f8ff 100%);
  border: 3px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 34px rgba(48, 24, 72, 0.3),
    0 0 0 1px rgba(214, 126, 178, 0.48),
    inset 0 0 0 1px rgba(255, 150, 196, 0.28);
}

.photo-frame::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 50px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffc4dd, #ff89bb);
  box-shadow:
    0 4px 10px rgba(78, 34, 82, 0.22),
    inset 0 -3px 0 rgba(200, 63, 133, 0.22);
}

.photo-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 52px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(104, 65, 114, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.frame-left {
  left: 4%;
  transform: rotate(-7deg);
}

.frame-right {
  right: 4%;
  transform: rotate(6deg);
}

.balloon-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px 34px;
  width: min(1120px, 100%);
  margin-top: 26px;
  margin-bottom: clamp(10px, 2vh, 30px);
  z-index: 8;
}

.word {
  display: flex;
  gap: 6px;
}

.foil-letter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.68em;
  padding: 6px 5px;
  color: transparent;
  font-family: 'Press Start 2P', 'DynaPuff', system-ui, sans-serif;
  font-size: clamp(22px, 3.7vw, 48px);
  font-weight: 900;
  line-height: 1;
  user-select: none;
  background:
    linear-gradient(180deg, #fff4fb 0%, #ff9bc3 28%, #ff6fa8 67%, #c83d89 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.32),
    0 10px 18px rgba(39, 19, 54, 0.35);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.28));
}

.foil-letter::after {
  content: none;
}

.cake {
  position: relative;
  z-index: 9;
  width: min(540px, 78vw);
  aspect-ratio: 998 / 1188;
  margin-top: clamp(-12px, -1vw, 4px);
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 24px 30px rgba(54, 28, 72, 0.34));
}

.cake::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 4%;
  height: 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(74, 31, 74, 0.33) 0%, transparent 70%);
  z-index: -1;
}

.cake-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.candle {
  position: absolute;
  width: clamp(7px, 1.25vw, 13px);
  height: clamp(30px, 4.7vw, 48px);
  transform: translate(-50%, -100%);
  z-index: 12;
  background:
    repeating-linear-gradient(
      -42deg,
      #78dbff 0 7px,
      #fff7ff 7px 14px,
      #ffa7ce 14px 21px
    );
  border-radius: 4px 4px 2px 2px;
  box-shadow:
    inset -3px 0 0 rgba(88, 44, 92, 0.22),
    0 8px 7px rgba(66, 25, 72, 0.16);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.candle::before {
  content: "";
  position: absolute;
  top: -14%;
  left: 44%;
  width: 14%;
  height: 16%;
  border-radius: 999px;
  background: #4a334d;
}

.candle[data-layer="top"] {
  z-index: 15;
}

.candle[data-layer="middle"] {
  z-index: 14;
}

.candle[data-layer="bottom"] {
  z-index: 13;
}

.candle.out {
  filter: saturate(0.9);
}

.candle.out .flame {
  display: none;
}

.flame {
  position: absolute;
  top: -43%;
  left: 50%;
  width: 82%;
  height: 40%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 50% 66%, #fff8b6 0 18%, #ffd039 19% 42%, #ff831f 43% 68%, #ff4d00 69% 100%);
  box-shadow:
    0 0 16px rgba(255, 190, 39, 0.85),
    0 0 26px rgba(255, 91, 80, 0.5);
  animation: pixelFlicker 0.16s infinite alternate steps(2);
}

@keyframes pixelFlicker {
  0% {
    transform: translateX(-50%) scaleY(1) skewX(-2deg);
  }
  50% {
    transform: translateX(-50%) scaleY(1.16) scaleX(0.92);
  }
  100% {
    transform: translateX(-50%) scaleY(0.94) scaleX(1.08) skewX(3deg);
  }
}

.mute-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 3px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #ff8ab9, #d94f97);
  box-shadow: 0 10px 20px rgba(52, 24, 68, 0.34);
  cursor: pointer;
  font-size: 24px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.mute-btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .stage {
    padding-top: 14px;
  }

  .photo-wall {
    top: 23vh;
    height: 190px;
  }

  .photo-frame {
    width: clamp(118px, 24vw, 170px);
    padding: 8px 8px 26px;
    border-radius: 17px;
  }

  .balloon-banner {
    gap: 18px;
    margin-bottom: 18px;
  }

  .cake {
    width: min(610px, 99vw);
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .room::after {
    height: 30vh;
  }

  .photo-wall {
    top: 20vh;
  }

  .frame-left {
    left: -2%;
  }

  .frame-right {
    right: -2%;
  }

  .word {
    gap: 2px;
  }

  .foil-letter {
    padding: 5px 4px;
  }
}

@media (max-height: 620px) {
  .stage {
    padding-top: 8px;
  }

  .photo-wall {
    top: 18vh;
  }

  .balloon-banner {
    margin-bottom: 0;
  }

  .cake {
    width: min(470px, 84vh);
  }
}
