:root {
  --ink: #140025;
  --ink-2: #250047;
  --cream: #fff4d6;
  --pink: #ff0b8f;
  --pink-dark: #a50067;
  --cyan: #00e8ff;
  --cyan-dark: #0086a8;
  --yellow: #ffe434;
  --orange: #ff671c;
  --red: #ff2b16;
  --white: #fffdf5;
  --headline: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  --arcade: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

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

html { background: var(--ink); }

body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  color: var(--white);
  font-family: var(--arcade);
  background:
    radial-gradient(circle at 50% 34%, rgba(170, 0, 255, .34), transparent 35%),
    radial-gradient(circle at 12% 70%, rgba(255, 11, 143, .22), transparent 25%),
    radial-gradient(circle at 88% 76%, rgba(0, 232, 255, .18), transparent 27%),
    linear-gradient(148deg, #12001f, #21003e 46%, #0c001b);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button { font: inherit; }

button:focus-visible, a:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  left: 1rem;
  top: -6rem;
  color: var(--ink);
  background: var(--yellow);
  padding: .8rem 1rem;
  font-weight: 900;
}

.skip-link:focus { top: 1rem; }

#confetti, #fireworks {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fireworks { z-index: 117; }
#confetti { z-index: 130; }

.camera-flash {
  position: fixed;
  inset: 0;
  z-index: 129;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

.camera-flash.flash { animation: flash .45s ease-out; }

.party-stage {
  position: relative;
  z-index: 2;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
}

.radial-rays {
  position: absolute;
  z-index: -4;
  width: 150vmax;
  aspect-ratio: 1;
  left: 50%;
  top: 39%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from -7deg,
    rgba(255, 0, 145, .16) 0 3deg,
    transparent 3deg 8deg,
    rgba(0, 232, 255, .12) 8deg 11deg,
    transparent 11deg 17deg,
    rgba(255, 228, 52, .1) 17deg 18deg,
    transparent 18deg 23deg
  );
  animation: ray-spin 46s linear infinite;
}

.speed-lines {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .8;
  background:
    linear-gradient(112deg, transparent 12%, var(--pink) 12.3% 12.7%, transparent 13%),
    linear-gradient(72deg, transparent 19%, var(--cyan) 19.2% 19.5%, transparent 20%),
    linear-gradient(105deg, transparent 79%, var(--yellow) 79.2% 79.6%, transparent 80%),
    linear-gradient(67deg, transparent 87%, var(--orange) 87.3% 88%, transparent 88.4%);
}

.party-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.party-stage::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -8%;
  height: 31%;
  z-index: -1;
  border-radius: 50% 50% 0 0;
  border-top: 9px solid var(--pink);
  box-shadow: 0 -7px 0 var(--cyan), 0 -18px 50px rgba(255, 11, 143, .7);
  background:
    repeating-radial-gradient(ellipse at center top, #240040 0 18px, #130026 19px 34px);
  transform: perspective(400px) rotateX(25deg);
}

.party-hud {
  position: fixed;
  inset: max(1rem, env(safe-area-inset-top)) 1.15rem auto;
  z-index: 91;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.level-panel, .sound-button {
  pointer-events: auto;
  position: relative;
  color: var(--cyan);
  background: rgba(9, 3, 17, .9);
  border: 2px solid var(--cream);
  box-shadow: 4px 4px 0 var(--pink), -3px -3px 0 var(--cyan), 0 0 28px rgba(0, 232, 255, .24);
}

.level-panel {
  width: 10.7rem;
  height: 8rem;
  padding: .75rem .75rem .45rem;
  transform: rotate(-1deg);
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 10px) 0, calc(100% - 10px) 7px, 100% 7px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.level-label {
  display: block;
  color: var(--yellow);
  font-size: .85rem;
  font-weight: 1000;
  letter-spacing: .06em;
  text-align: center;
  text-shadow: 2px 2px 0 #6a3a00;
}

#party-level {
  display: block;
  margin-top: -.05em;
  color: var(--yellow);
  font-family: var(--headline);
  font-size: 4.6rem;
  line-height: .9;
  letter-spacing: .06em;
  text-align: center;
  text-shadow: 3px 3px 0 #6a3a00;
}

.level-lights {
  position: absolute;
  right: .4rem;
  top: 2.1rem;
  display: grid;
  gap: .3rem;
}

.level-lights i {
  width: .32rem;
  height: .32rem;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}

.smiley {
  position: absolute;
  right: -1.15rem;
  bottom: -1.35rem;
  display: grid;
  place-items: center;
  width: 2.6rem;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  font: 900 2.2rem/1 Arial, sans-serif;
  box-shadow: 2px 3px 0 var(--cream);
}

.sound-button {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: .55rem;
  min-width: 14.6rem;
  min-height: 4.8rem;
  padding: .65rem 1.1rem .45rem;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 1000;
  letter-spacing: .06em;
  transform: rotate(.5deg);
}

.sound-button:hover { transform: rotate(-1deg) scale(1.04); }
.sound-button:active { transform: translateY(3px) scale(.98); }
.speaker { color: var(--cream); font-size: 1.3rem; }

.equalizer {
  grid-column: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: .18rem;
  height: .75rem;
}

.equalizer i { width: 1rem; background: var(--yellow); animation: equalize .65s ease-in-out infinite alternate; }
.equalizer i:nth-child(1) { height: 30%; animation-delay: -.2s; }
.equalizer i:nth-child(2) { height: 75%; animation-delay: -.45s; }
.equalizer i:nth-child(3) { height: 45%; animation-delay: -.1s; }
.equalizer i:nth-child(4) { height: 100%; animation-delay: -.32s; }
.equalizer i:nth-child(5) { height: 55%; animation-delay: -.55s; }
.sound-button[aria-pressed="false"] .equalizer i { animation: none; height: 12%; background: #785d76; }

.disco-wrap {
  position: absolute;
  z-index: -1;
  width: clamp(8rem, 14vw, 13rem);
  aspect-ratio: 1;
  left: 50%;
  top: clamp(-5.3rem, -5vw, -2.6rem);
  transform: translateX(-50%);
  filter: drop-shadow(0 0 22px rgba(255, 20, 204, .85));
}

.disco-wrap::before {
  content: "";
  position: absolute;
  left: 50%; top: -10rem;
  width: 4px; height: 12rem;
  background: #c7dded;
}

.disco-ball {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, #220037 15px 17px),
    repeating-linear-gradient(0deg, transparent 0 14px, #220037 15px 17px),
    radial-gradient(circle at 28% 23%, white 0 2%, #45fcff 3% 9%, #ff22bf 26%, #6f21d6 55%, #120025 78%);
  animation: disco 6s linear infinite;
}

.disco-beam {
  position: absolute;
  z-index: -1;
  left: 50%; top: 55%;
  width: 60vw; height: 10vw;
  transform-origin: left center;
  opacity: .16;
  background: linear-gradient(90deg, var(--cyan), transparent);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 60%);
  animation: beam 5s ease-in-out infinite alternate;
}

.beam-two { background: linear-gradient(90deg, var(--pink), transparent); animation-delay: -2.5s; }

.hero {
  position: absolute;
  z-index: 12;
  width: min(78rem, 80vw);
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.birthday-title {
  position: relative;
  margin: 0;
  cursor: help;
  color: var(--cream);
  font-family: var(--headline);
  font-size: clamp(6rem, 14vw, 13.5rem);
  font-weight: 1000;
  letter-spacing: .015em;
  line-height: .62;
  text-transform: uppercase;
  transform: rotate(-.7deg) scaleX(1.06);
  filter: drop-shadow(0 10px 0 #12001f) drop-shadow(0 18px 9px rgba(0,0,0,.5));
}

.title-line {
  position: relative;
  display: block;
  -webkit-text-stroke: clamp(2px, .32vw, 6px) var(--ink);
  paint-order: stroke fill;
  text-shadow:
    3px 3px 0 var(--pink), 6px 6px 0 var(--pink), 9px 9px 0 var(--pink-dark),
    12px 12px 0 var(--cyan), 16px 16px 0 var(--cyan-dark),
    -3px -3px 0 var(--cyan);
}

.birthday-line {
  z-index: 1;
  font-size: .87em;
  letter-spacing: -.018em;
}

.name-lockup {
  position: relative;
  z-index: 3;
  display: inline-block;
  margin-top: 1.15rem;
  transform: rotate(.8deg);
}

#birthday-name {
  display: block;
  max-width: 78vw;
  color: var(--pink);
  font-family: var(--headline);
  font-size: clamp(4rem, 8.8vw, 9rem);
  font-weight: 1000;
  letter-spacing: .025em;
  line-height: .72;
  text-transform: uppercase;
  -webkit-text-stroke: clamp(2px, .28vw, 5px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--cream), 8px 8px 0 #7b004f, 13px 13px 0 var(--cyan), 17px 17px 0 #006277;
}

.chaos-button {
  position: relative;
  z-index: 6;
  display: grid;
  place-items: center;
  width: clamp(15rem, 25vw, 24rem);
  aspect-ratio: 2.45 / 1;
  margin: clamp(1.2rem, 2.1vh, 2rem) auto 0;
  padding: 1rem 1.7rem 1.35rem;
  overflow: visible;
  border: clamp(4px, .45vw, 8px) solid var(--cream);
  border-radius: 50%;
  cursor: pointer;
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 20%, #ff6041, var(--red) 48%, #b70a00 76%);
  box-shadow:
    0 .55rem 0 #730800,
    0 .85rem 0 var(--ink),
    0 1.12rem 0 var(--yellow),
    0 1.38rem 0 var(--ink),
    0 1.62rem 0 var(--cyan),
    0 2rem 22px rgba(255, 0, 190, .8),
    inset 0 .7rem 1rem rgba(255,255,255,.22);
  font-size: clamp(.95rem, 1.6vw, 1.55rem);
  font-weight: 1000;
  line-height: .95;
  letter-spacing: .04em;
  text-shadow: 3px 3px 0 #8d0900;
  transition: transform .12s ease, filter .12s ease;
  animation: button-beg 2.3s ease-in-out infinite;
}

.chaos-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 18%, #ff6e4e, var(--red) 48%, #b70a00 78%);
  box-shadow: inset 0 .7rem 1rem rgba(255,255,255,.22);
}

.chaos-button::before {
  content: "";
  position: absolute;
  inset: -1.4rem -2rem;
  z-index: -1;
  border: 7px solid #22232a;
  border-radius: 50%;
  background: repeating-linear-gradient(135deg, #191a20 0 12px, var(--yellow) 13px 24px);
  box-shadow: 0 0 0 8px var(--pink), 0 0 20px 12px rgba(255, 11, 143, .45);
}

.chaos-button:hover { transform: scale(1.07) rotate(-1deg); filter: saturate(1.2) brightness(1.1); }
.chaos-button:active { transform: translateY(.65rem) scale(.98); box-shadow: 0 .15rem 0 #730800, 0 .35rem 0 var(--ink), 0 .55rem 0 var(--yellow), 0 .8rem 0 var(--ink), 0 1rem 0 var(--cyan), 0 1.25rem 18px rgba(255,0,190,.8); }

.button-shine {
  position: absolute;
  z-index: 1;
  width: 64%; height: 18%;
  top: 12%; left: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}

#chaos-label { position: relative; z-index: 2; }

.cursor-hand {
  position: absolute;
  right: -2.3rem;
  bottom: -2.3rem;
  z-index: 3;
  color: white;
  font: 4rem/1 sans-serif;
  filter: drop-shadow(4px 4px 0 #000);
  transform: rotate(-25deg);
  animation: point 1s steps(2) infinite;
}

.tap-hint {
  margin: 2.5rem 0 0;
  color: var(--cyan);
  font-size: clamp(.65rem, .9vw, .85rem);
  font-weight: 900;
  letter-spacing: .11em;
  text-shadow: 2px 2px 0 var(--ink), 0 0 10px var(--cyan);
}

.balloon {
  --balloon-color: var(--pink);
  position: absolute;
  z-index: 8;
  width: clamp(5.8rem, 10.5vw, 10.5rem);
  aspect-ratio: .79;
  border: 3px solid rgba(255,255,255,.75);
  border-radius: 52% 48% 49% 51% / 44% 45% 55% 56%;
  cursor: pointer;
  color: var(--white);
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.96) 0 2%, rgba(255,255,255,.35) 3% 9%, transparent 10%),
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--balloon-color), white 20%), var(--balloon-color) 58%, color-mix(in srgb, var(--balloon-color), black 45%));
  box-shadow: inset -16px -12px 24px rgba(0,0,0,.24), 0 0 24px color-mix(in srgb, var(--balloon-color), transparent 42%);
  animation: balloon-float 4s ease-in-out infinite;
}

.balloon::before {
  content: "";
  position: absolute;
  left: 50%; bottom: -10px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 0;
  border-top: 14px solid var(--balloon-color);
  transform: translateX(-50%);
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%; top: calc(100% + 9px);
  width: 1px; height: 28vh;
  background: rgba(255,255,255,.75);
  transform-origin: top;
  transform: rotate(4deg);
}

.balloon:hover { filter: brightness(1.18); }
.balloon.popped { animation: balloon-pop .28s ease-out forwards; pointer-events: none; }
.balloon-doodle { font: 900 clamp(1.7rem, 3vw, 3rem)/.95 Arial, sans-serif; text-shadow: 2px 2px 0 rgba(0,0,0,.28); }
.zigzag { font-size: clamp(2rem, 4vw, 4rem); }
.balloon-pink { --balloon-color: #ff138f; left: 4.2%; top: 23%; animation-delay: -.8s; }
.balloon-cyan { --balloon-color: #00cfe3; left: 1.1%; top: 47%; width: clamp(4.8rem, 8vw, 8rem); animation-delay: -2.1s; }
.balloon-gold { --balloon-color: #f8c400; left: 8.7%; top: 54%; width: clamp(4.5rem, 7.6vw, 7.6rem); animation-delay: -1.3s; }
.balloon-orange { --balloon-color: #ff5a19; right: 3.5%; top: 18%; animation-delay: -.3s; }
.balloon-purple { --balloon-color: #821df5; right: 1.2%; top: 40%; animation-delay: -1.7s; }
.balloon-teal { --balloon-color: #00babe; right: 8.7%; top: 51%; width: clamp(4.8rem, 8.5vw, 8.5rem); animation-delay: -2.7s; }

.burst-sticker {
  position: absolute;
  z-index: 16;
  display: grid;
  place-items: center;
  width: clamp(6rem, 9vw, 9rem);
  aspect-ratio: 1.15;
  color: var(--ink);
  background: var(--yellow);
  clip-path: polygon(50% 0, 59% 17%, 75% 5%, 78% 24%, 99% 19%, 88% 38%, 100% 50%, 84% 59%, 95% 78%, 74% 76%, 69% 98%, 53% 83%, 39% 100%, 34% 80%, 13% 91%, 18% 68%, 0 60%, 17% 48%, 3% 31%, 25% 29%, 27% 8%, 42% 20%);
  font: 1000 clamp(.85rem, 1.35vw, 1.35rem)/1 var(--headline);
  text-align: center;
  transform: rotate(-9deg);
  filter: drop-shadow(5px 6px 0 var(--cream)) drop-shadow(8px 10px 0 var(--ink));
}

.sticker-left { left: 1.6%; bottom: 22%; }
.sticker-right { right: 1.5%; bottom: 20%; background: var(--cyan); transform: rotate(7deg); }

.decor-star { position: absolute; z-index: 5; color: var(--yellow); text-shadow: 0 0 16px currentColor; animation: twinkle 1.4s ease-in-out infinite alternate; }
.star-one { left: 19%; top: 15%; font-size: 3rem; transform: rotate(17deg); }
.star-two { right: 19%; top: 13%; font-size: 2.6rem; animation-delay: -.7s; }
.star-three { right: 28%; bottom: 14%; color: var(--cyan); font-size: 2.2rem; animation-delay: -.4s; }

.curly-streamer { position: absolute; z-index: 4; width: 3rem; height: 15rem; top: 5%; border: 14px solid var(--pink); border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(24deg); animation: streamer 3s ease-in-out infinite alternate; }
.streamer-one { left: 24%; }
.streamer-two { right: 24%; border-color: var(--yellow); border-left-color: transparent; border-bottom-color: transparent; transform: scaleX(-1) rotate(24deg); animation-delay: -1.5s; }

.cannon {
  position: absolute;
  z-index: 15;
  bottom: -2.2rem;
  width: clamp(5rem, 8vw, 8rem);
  transform-origin: bottom center;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.55));
}

.cannon-left { left: 3%; transform: rotate(33deg); }
.cannon-right { right: 3%; transform: scaleX(-1) rotate(33deg); }
.cannon-mouth { width: 72%; height: 2rem; margin: 0 auto -.3rem; border: 4px solid var(--cream); background: #11141c; clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.cannon-body { display: grid; place-items: center; height: 8rem; border: 4px solid var(--cream); border-radius: .5rem 50% .5rem .5rem; color: var(--yellow); background: repeating-linear-gradient(45deg, #11141c 0 18px, #f2f1e9 19px 34px); font-size: 2rem; text-shadow: 2px 2px var(--ink); }
.cannon.firing { animation: cannon-kick .42s ease-out; }

.mystery-gift {
  position: absolute;
  z-index: 20;
  right: 18%;
  bottom: 2.5%;
  width: clamp(6rem, 9vw, 9rem);
  height: clamp(6rem, 9vw, 9rem);
  border: 0;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  transform: rotate(4deg);
  filter: drop-shadow(6px 8px 0 rgba(0,0,0,.42));
  animation: gift-wiggle 4s ease-in-out infinite;
}

.gift-box, .gift-lid {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background:
    radial-gradient(circle, var(--pink) 0 9%, transparent 10%) 0 0 / 22px 22px,
    var(--cyan);
}

.gift-box { inset: 25% 8% 0; font: 1000 3rem/1 var(--headline); }
.gift-lid { left: 0; right: 0; top: 16%; height: 28%; background-color: var(--pink); }
.gift-box::after, .gift-lid::after { content: ""; position: absolute; left: 41%; top: 0; bottom: 0; width: 18%; background: var(--pink); border-inline: 2px solid var(--ink); }
.gift-lid::after { background: var(--yellow); }
.gift-bow { position: absolute; z-index: 2; left: 50%; top: -18%; color: var(--pink); font-size: 4rem; transform: translateX(-50%); text-shadow: 3px 3px 0 var(--ink); }
.gift-tape { position: absolute; z-index: 3; left: -5%; right: -5%; bottom: 22%; padding: .2rem 0; background: var(--yellow); border-block: 2px solid var(--ink); font-size: clamp(.42rem, .65vw, .62rem); font-weight: 1000; white-space: nowrap; transform: rotate(-3deg); }
.gift-whisper { position: absolute; right: -3.8rem; top: 0; padding: .35rem .5rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 1000; transform: rotate(8deg); }

.whats-next { position: absolute; z-index: 10; left: 50%; bottom: .6rem; display: flex; align-items: center; gap: 1rem; color: var(--cyan); font-size: clamp(.6rem, 1vw, .9rem); text-shadow: 0 0 10px var(--cyan), 2px 2px var(--ink); transform: translateX(-50%); }
.whats-next span { color: var(--pink); font-size: 1.7rem; animation: arrow-bounce .8s ease-in-out infinite alternate; }

.breaking-news {
  position: fixed;
  z-index: 105;
  left: 0; right: 0; bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  min-height: 4.3rem;
  border-block: 5px solid var(--cream);
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--cyan), 0 -8px 0 var(--pink), 0 0 30px rgba(0,0,0,.7);
  transform: translateY(180%);
  transition: transform .45s cubic-bezier(.2, .9, .2, 1.3);
}

.breaking-news[aria-hidden="false"] { transform: translateY(0); }
.breaking-tag { display: grid; place-items: center; padding: 0 1.2rem; color: var(--ink); background: var(--yellow); font-family: var(--headline); font-size: 1.7rem; letter-spacing: .08em; }
.breaking-news p { align-self: center; margin: 0; padding: .65rem 1.2rem; overflow: hidden; font-weight: 1000; white-space: nowrap; text-overflow: ellipsis; }

.party-toast {
  position: fixed;
  z-index: 110;
  left: 50%; top: 13%;
  max-width: min(90vw, 34rem);
  padding: .85rem 1.2rem;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--pink), 9px 9px 0 var(--cyan);
  font-size: clamp(.7rem, 1.2vw, 1rem);
  font-weight: 1000;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2rem) rotate(-1deg);
  transition: .3s ease;
}

.party-toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }

.cake-invasion, .compliment-cloud { position: fixed; inset: 0; z-index: 75; overflow: hidden; pointer-events: none; }
.flying-cake, .birthday-duck { position: absolute; top: -15vh; font-size: clamp(3rem, 7vw, 7rem); filter: drop-shadow(6px 8px 0 rgba(0,0,0,.38)); animation: cake-drop var(--fall-time, 4s) linear forwards; }
.compliment {
  position: absolute;
  left: var(--left); top: var(--top);
  padding: .55rem .8rem;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--bubble-color);
  box-shadow: 4px 4px 0 var(--cream);
  font-family: var(--headline);
  font-size: clamp(1rem, 2.2vw, 2rem);
  font-weight: 1000;
  transform: rotate(var(--tilt)) scale(0);
  animation: compliment-pop 3.5s cubic-bezier(.2,1.4,.3,1) forwards;
}

.gift-reveal, .finale {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(12, 0, 25, .83);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.gift-reveal[aria-hidden="false"], .finale[aria-hidden="false"] { opacity: 1; visibility: visible; }

.gift-card {
  position: relative;
  width: min(42rem, 92vw);
  padding: clamp(2rem, 5vw, 4rem);
  border: 9px solid var(--ink);
  outline: 6px solid var(--cream);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 13%, var(--pink) 0 1.6%, transparent 1.7%),
    radial-gradient(circle at 88% 83%, var(--cyan) 0 1.6%, transparent 1.7%),
    repeating-linear-gradient(135deg, #fff7d8 0 24px, #ffefaa 25px 48px);
  box-shadow: 16px 16px 0 var(--pink), -12px -12px 0 var(--cyan), 0 30px 80px rgba(0,0,0,.7);
  text-align: center;
  transform: rotate(-2deg) scale(.7);
  transition: transform .4s cubic-bezier(.2, 1.5, .4, 1);
}

.gift-reveal[aria-hidden="false"] .gift-card { transform: rotate(-2deg) scale(1); }
.gift-card::before { content: ""; position: absolute; inset: 1rem; border: 3px dashed var(--pink); pointer-events: none; }
.gift-card-kicker { margin: 0 0 1rem; font-weight: 1000; letter-spacing: .12em; }
.gift-card h2 { margin: 0; color: var(--pink); font: 1000 clamp(2.5rem, 7vw, 6.3rem)/.78 var(--headline); text-shadow: 4px 4px 0 var(--cyan), 7px 7px 0 var(--ink); }
.gift-card p:not(.gift-card-kicker) { max-width: 30rem; margin: 2rem auto; font: 1000 clamp(1rem, 2.4vw, 1.55rem)/1.3 var(--arcade); }
.gift-card > strong { font-size: clamp(.55rem, 1.3vw, .8rem); }
.gift-card-sparkle { position: absolute; left: 1.2rem; top: 1rem; color: var(--pink); font-size: 3rem; }
.close-gift { position: absolute; z-index: 2; right: .8rem; top: .6rem; width: 3rem; height: 3rem; border: 3px solid var(--ink); border-radius: 50%; cursor: pointer; color: var(--cream); background: var(--pink); font-size: 2rem; font-weight: 1000; line-height: 1; }

.finale { z-index: 115; overflow: hidden; background: #130021; }
.finale-rays { position: absolute; width: 170vmax; aspect-ratio: 1; background: repeating-conic-gradient(var(--pink) 0 5deg, #27004b 5deg 12deg, var(--cyan) 12deg 15deg, #27004b 15deg 23deg, var(--yellow) 23deg 25deg, #27004b 25deg 32deg); animation: ray-spin 18s linear infinite; }
.finale-content { position: relative; z-index: 1; text-align: center; filter: drop-shadow(0 12px 0 rgba(0,0,0,.55)); transform: scale(.4) rotate(-8deg); transition: transform .55s cubic-bezier(.15, 1.6, .35, 1); }
.finale[aria-hidden="false"] .finale-content { transform: scale(1) rotate(-1deg); }
.finale-content p { margin: 0 0 1rem; padding: .45rem .8rem; color: var(--ink); background: var(--yellow); font-weight: 1000; letter-spacing: .08em; }
.finale-content h2 { margin: 0; color: var(--cream); font: 1000 clamp(4rem, 12vw, 10rem)/.72 var(--headline); letter-spacing: .02em; -webkit-text-stroke: clamp(2px, .35vw, 6px) var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 #8e0059, 15px 15px 0 var(--cyan), 20px 20px 0 var(--ink); }
.finale-content strong { display: block; margin: 2rem auto 1.3rem; color: var(--yellow); font-size: clamp(.8rem, 2vw, 1.35rem); text-shadow: 2px 2px var(--ink); }
#encore-button { padding: .9rem 1.2rem; border: 4px solid var(--ink); cursor: pointer; color: var(--ink); background: var(--cream); box-shadow: 5px 5px 0 var(--pink), 9px 9px 0 var(--cyan); font-weight: 1000; }
#encore-button:hover { transform: scale(1.08) rotate(-2deg); }

.noscript { position: fixed; z-index: 999; inset: 0; display: grid; place-items: center; padding: 2rem; background: var(--ink); color: var(--yellow); font: 2rem/1.2 var(--headline); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body.level-2 .radial-rays { animation-duration: 22s; opacity: 1; }
body.level-3 .hero { animation: stage-rumble .18s steps(2) 9; }
body.level-4 .disco-beam { opacity: .42; animation-duration: 1.4s; }
body.level-4 .disco-ball { animation-duration: 1.4s; }

@keyframes ray-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes equalize { to { height: 15%; } }
@keyframes disco { to { transform: rotate(360deg); filter: hue-rotate(360deg); } }
@keyframes beam { from { transform: rotate(8deg); } to { transform: rotate(164deg); } }
@keyframes balloon-float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-1rem) rotate(3deg); } }
@keyframes balloon-pop { 60% { transform: scale(1.32); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
@keyframes twinkle { to { transform: scale(1.28) rotate(24deg); filter: brightness(1.6); } }
@keyframes streamer { to { transform: translateY(1.5rem) rotate(38deg) scaleY(.92); } }
@keyframes button-beg { 0%,84%,100% { transform: scale(1); } 89% { transform: scale(1.06) rotate(-1deg); } 94% { transform: scale(1.02) rotate(1deg); } }
@keyframes point { to { transform: translate(-.4rem, -.4rem) rotate(-25deg); } }
@keyframes cannon-kick { 40% { transform: rotate(46deg) translateY(1.8rem); } }
@keyframes arrow-bounce { to { transform: translateY(.5rem); } }
@keyframes gift-wiggle { 0%,86%,100% { transform: rotate(4deg); } 89% { transform: rotate(-6deg) scale(1.06); } 92% { transform: rotate(7deg); } 95% { transform: rotate(-3deg); } }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes stage-rumble { 0% { transform: translate(-50%, -50%) rotate(-.6deg); } 100% { transform: translate(calc(-50% + 5px), calc(-50% - 3px)) rotate(.6deg); } }
@keyframes cake-drop { to { transform: translateY(125vh) rotate(720deg); } }
@keyframes compliment-pop { 0% { transform: rotate(var(--tilt)) scale(0); opacity: 0; } 15%,78% { transform: rotate(var(--tilt)) scale(1); opacity: 1; } 100% { transform: rotate(calc(var(--tilt) * -1)) scale(.5) translateY(-5rem); opacity: 0; } }

@media (max-width: 800px) {
  .party-hud { inset-inline: .65rem; }
  .level-panel { width: 7rem; height: 5.2rem; padding: .48rem; }
  .level-label { font-size: .55rem; }
  #party-level { font-size: 3rem; }
  .smiley { width: 1.85rem; right: -.7rem; bottom: -.9rem; font-size: 1.55rem; }
  .sound-button { min-width: 8.5rem; min-height: 3.2rem; padding: .5rem .7rem .35rem; column-gap: .25rem; font-size: .75rem; }
  .speaker { font-size: .8rem; }
  .equalizer i { width: .5rem; }
  .disco-wrap { width: 8rem; top: -3.9rem; }
  .hero { width: 96vw; top: 46%; }
  .birthday-title { font-size: clamp(4.3rem, 24vw, 8rem); line-height: .64; }
  .birthday-line { font-size: .76em; }
  .name-lockup { margin-top: .75rem; }
  #birthday-name { max-width: 92vw; font-size: clamp(3.15rem, 16vw, 6rem); }
  .chaos-button { width: min(16rem, 67vw); margin-top: 1.2rem; font-size: .93rem; }
  .cursor-hand { right: -1.5rem; bottom: -1.7rem; font-size: 2.8rem; }
  .tap-hint { margin-top: 2.15rem; font-size: .55rem; }
  .balloon { width: clamp(4rem, 20vw, 6.3rem); }
  .balloon-pink { left: -7%; top: 24%; }
  .balloon-cyan { left: -9%; top: 51%; }
  .balloon-gold { left: 3%; top: 68%; }
  .balloon-orange { right: -8%; top: 21%; }
  .balloon-purple { right: -10%; top: 48%; }
  .balloon-teal { right: 1%; top: 67%; }
  .burst-sticker { width: 5.4rem; font-size: .78rem; }
  .sticker-left { left: -2%; bottom: 14%; }
  .sticker-right { right: -3%; bottom: 12%; }
  .curly-streamer { opacity: .55; }
  .cannon { width: 5rem; }
  .cannon-left { left: -2rem; }
  .cannon-right { right: -2rem; }
  .mystery-gift { width: 6rem; height: 6rem; right: 18%; bottom: 1.2%; }
  .gift-whisper { right: -2.6rem; font-size: .6rem; }
  .whats-next { bottom: .2rem; font-size: .52rem; }
  .breaking-news { min-height: 3.6rem; grid-template-columns: auto minmax(0, 1fr); }
  .breaking-tag { padding: 0 .6rem; font-size: 1rem; }
  .breaking-news p { padding-inline: .65rem; font-size: .64rem; }
  .gift-card { padding: 2.8rem 1.6rem 2.2rem; }
  .gift-card h2 {
    font-size: clamp(2rem, 10vw, 2.65rem);
    line-height: .88;
    letter-spacing: -.015em;
    text-shadow: 2px 2px 0 var(--cyan), 4px 4px 0 var(--ink);
  }
  .gift-card p:not(.gift-card-kicker) { margin-block: 1.5rem; }
}

@media (max-height: 720px) and (min-width: 801px) {
  .hero { top: 46%; transform: translate(-50%, -50%) scale(.95); }
  .level-panel { transform: scale(.9) rotate(-1deg); transform-origin: top left; }
  .sound-button { transform: scale(.9) rotate(.5deg); transform-origin: top right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .radial-rays { animation: none; }
  .disco-beam { display: none; }
}
