:root {
  --bg-night: #140b18;
  --bg-deep: #09060d;
  --plum: #2d1730;
  --plum-bright: #5d2f63;
  --berry: #bd5f8f;
  --berry-soft: #f0acc6;
  --gold: #f0c36b;
  --gold-soft: #ffe7ab;
  --cream: #fff1e2;
  --cream-deep: #f2d6be;
  --mint: #8ddac3;
  --sky: #9db8ff;
  --ink: rgba(13, 8, 18, 0.82);
  --line: rgba(255, 241, 226, 0.15);
  --shadow: rgba(0, 0, 0, 0.36);
  --headline: "STKaiti", "Kaiti SC", "Songti SC", "Noto Serif SC",
    "Source Han Serif SC", serif;
  --display: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--display);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(111, 63, 122, 0.26), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(255, 204, 140, 0.2), transparent 18%),
    radial-gradient(circle at 50% 110%, rgba(81, 42, 92, 0.44), transparent 34%),
    linear-gradient(180deg, #221128 0%, #120a18 50%, #09060d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 30%, rgba(255, 255, 255, 0.04), transparent 0.8rem),
    radial-gradient(circle at 24% 8%, rgba(255, 255, 255, 0.08), transparent 0.7rem),
    radial-gradient(circle at 38% 18%, rgba(255, 255, 255, 0.05), transparent 0.75rem),
    radial-gradient(circle at 64% 11%, rgba(255, 255, 255, 0.08), transparent 0.8rem),
    radial-gradient(circle at 82% 28%, rgba(255, 255, 255, 0.05), transparent 0.75rem),
    linear-gradient(0deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02));
  opacity: 0.9;
}

body.has-fine-pointer,
body.has-fine-pointer button,
body.has-fine-pointer a {
  cursor: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.birthday-shell {
  position: relative;
  min-height: 100vh;
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  isolation: isolate;
}

.birthday-stage {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  min-height: calc(100vh - 3rem);
  margin: 0 auto;
  display: grid;
  align-items: center;
}

.glow {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.42;
  z-index: 0;
}

.glow-a {
  top: 5rem;
  left: -3rem;
  width: 20rem;
  height: 20rem;
  background: rgba(182, 104, 176, 0.2);
}

.glow-b {
  top: 18rem;
  right: -4rem;
  width: 24rem;
  height: 24rem;
  background: rgba(255, 194, 113, 0.18);
}

.glow-c {
  bottom: 8rem;
  left: 40%;
  width: 28rem;
  height: 18rem;
  background: rgba(123, 98, 217, 0.16);
}

.birthday-hero,
.birthday-main {
  position: relative;
  z-index: 1;
}

.birthday-hero {
  max-width: 70rem;
  margin: 0 auto;
  padding-top: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.95rem;
  border: 1px solid rgba(255, 241, 226, 0.14);
  background: rgba(20, 11, 24, 0.56);
  color: rgba(255, 241, 226, 0.8);
  backdrop-filter: blur(14px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
  position: relative;
  z-index: 2;
}

.back-link::before {
  content: "↖";
  font-size: 0.9rem;
}

.back-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 241, 226, 0.26);
  background: rgba(36, 19, 43, 0.72);
}

.eyebrow,
.section-kicker,
.panel-kicker,
.meta-label,
.sprout-step {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 241, 226, 0.62);
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.birthday-hero h1,
.section-heading h2,
.playground-copy h2,
.finale-card h3 {
  margin: 0;
  font-family: var(--headline);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: 0.04em;
}

.birthday-hero h1 {
  max-width: 12.5em;
  margin-top: 0.9rem;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  text-shadow: 0 0 28px rgba(255, 184, 116, 0.18);
}

.hero-summary,
.section-heading p,
.playground-copy p,
.finale-card p,
.phrase-caption {
  color: rgba(255, 241, 226, 0.78);
  line-height: 1.8;
}

.hero-summary {
  max-width: 44rem;
  margin: 1.2rem 0 0;
  font-size: 1.03rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 52rem;
  margin-top: 1.8rem;
}

.hero-meta article,
.panel-card,
.game-panel,
.phrase-ribbon,
.cake-stage {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    rgba(19, 11, 24, 0.58);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.hero-meta article {
  padding: 1rem 1.05rem 1.1rem;
}

.meta-value {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--headline);
  font-size: 1.08rem;
  letter-spacing: 0.03em;
  color: var(--gold-soft);
}

.cake-scene,
.playground {
  display: grid;
  gap: 1.5rem;
}

.cake-scene {
  min-height: calc(100vh - 7rem);
  align-items: center;
}

.section-heading {
  display: grid;
  gap: 0.55rem;
  max-width: 42rem;
}

.section-heading h2,
.playground-copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.phrase-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1rem;
}

.phrase-slot {
  display: grid;
  place-items: center;
  min-height: 4.6rem;
  font-family: var(--headline);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  color: rgba(255, 241, 226, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 245, 235, 0.08), rgba(255, 245, 235, 0.02)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 241, 226, 0.08);
  transition:
    transform 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.phrase-slot.is-filled {
  color: var(--gold-soft);
  border-color: rgba(255, 206, 126, 0.24);
  box-shadow: inset 0 0 18px rgba(255, 191, 104, 0.08);
  transform: translateY(-2px);
}

.phrase-slot.is-final {
  color: #fff4dd;
  border-color: rgba(255, 206, 126, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 221, 150, 0.18), rgba(255, 240, 210, 0.06)),
    rgba(255, 255, 255, 0.03);
}

.phrase-caption {
  margin: -0.6rem 0 0;
  font-size: 0.92rem;
}

.cake-stage {
  position: relative;
  min-height: 52rem;
  margin-top: 0;
  padding: 0.5rem 0 2rem;
  overflow: hidden;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

body.all-complete .cake-stage,
body.all-complete .phrase-ribbon {
  border-color: rgba(255, 214, 139, 0.3);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 214, 139, 0.08) inset;
}

.stream,
.cake-aura {
  position: absolute;
  pointer-events: none;
}

.stream {
  top: 7rem;
  width: 18rem;
  height: 12rem;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.6;
}

.stream-left {
  left: -3rem;
  background:
    radial-gradient(circle at 70% 40%, rgba(168, 224, 255, 0.22), transparent 42%),
    radial-gradient(circle at 48% 65%, rgba(255, 185, 233, 0.16), transparent 46%);
}

.stream-right {
  right: -2rem;
  background:
    radial-gradient(circle at 30% 32%, rgba(255, 223, 151, 0.22), transparent 38%),
    radial-gradient(circle at 52% 68%, rgba(160, 129, 255, 0.18), transparent 48%);
}

.cake-aura {
  inset: auto 50% 5rem;
  width: 26rem;
  height: 10rem;
  transform: translateX(-50%);
  background:
    radial-gradient(circle, rgba(255, 207, 130, 0.3), transparent 58%),
    radial-gradient(circle, rgba(255, 167, 208, 0.18), transparent 66%);
  filter: blur(22px);
}

body.all-complete .cake-aura {
  background:
    radial-gradient(circle, rgba(255, 224, 148, 0.42), transparent 54%),
    radial-gradient(circle, rgba(255, 167, 208, 0.22), transparent 66%),
    radial-gradient(circle, rgba(145, 216, 193, 0.18), transparent 72%);
}

.cake {
  position: absolute;
  left: 50%;
  bottom: 6.8rem;
  width: min(38rem, calc(100% - 1rem));
  height: 30rem;
  transform: translateX(-50%);
}

.cake-topper {
  position: absolute;
  left: 50%;
  top: 0.4rem;
  width: 40%;
  height: 2.4rem;
  border-radius: 999px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 247, 225, 0.9), rgba(255, 214, 137, 0.16) 68%, transparent 70%);
  filter: blur(4px);
  opacity: 0.72;
}

.cake-tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2.9rem 2.9rem 2.3rem 2.3rem;
  background:
    linear-gradient(180deg, #fffaf5 0%, #f7ddc6 34%, #ebb999 72%, #d5917a 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 237, 0.48),
    inset 0 -1rem 1.3rem rgba(191, 101, 91, 0.14),
    0 1.4rem 2rem rgba(53, 22, 27, 0.24);
}

.cake-tier-top {
  top: 5rem;
  width: 73%;
  height: 10.2rem;
}

.cake-tier-bottom {
  bottom: 0;
  width: 100%;
  height: 15.2rem;
  border-radius: 4rem 4rem 3.1rem 3.1rem;
}

.icing {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fffefc, #ffe9d7 64%, rgba(255, 233, 215, 0.92));
  box-shadow: inset 0 -0.6rem 0.8rem rgba(255, 194, 166, 0.18);
}

.icing-top {
  top: 3.5rem;
  width: 77%;
  height: 3.8rem;
}

.icing-middle {
  bottom: 12.3rem;
  width: 98%;
  height: 3.8rem;
}

.cake-lace {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  pointer-events: none;
}

.cake-lace-top {
  top: 9.4rem;
  width: 68%;
  height: 1rem;
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 246, 237, 0.9) 0 28%, transparent 30%) 0 0 / 12.5% 100% repeat-x;
}

.cake-lace-bottom {
  bottom: 8.7rem;
  width: 95%;
  height: 1.1rem;
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 246, 237, 0.88) 0 28%, transparent 30%) 0 0 / 10% 100% repeat-x;
}

.cake-drips {
  position: absolute;
  left: 50%;
  bottom: 11.7rem;
  display: flex;
  justify-content: space-between;
  width: 88%;
  transform: translateX(-50%);
}

.cake-drips span {
  width: 1.8rem;
  background: linear-gradient(180deg, #fff2e4, #ffd8bc);
  border-radius: 999px;
}

.cake-drips span:nth-child(1) {
  height: 2rem;
}

.cake-drips span:nth-child(2) {
  height: 3rem;
}

.cake-drips span:nth-child(3) {
  height: 1.6rem;
}

.cake-drips span:nth-child(4) {
  height: 2.6rem;
}

.cake-drips span:nth-child(5) {
  height: 1.9rem;
}

.cake-pearls {
  position: absolute;
  left: 50%;
  display: flex;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.cake-pearls span {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, #fffefb 0 24%, #f6e2ca 56%, #d7a67d 100%);
  box-shadow: 0 0.15rem 0.4rem rgba(80, 29, 40, 0.18);
}

.cake-pearls-top {
  top: 12rem;
  width: 64%;
}

.cake-pearls-bottom {
  bottom: 10.8rem;
  width: 91%;
}

.cake-rosettes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rosette,
.cake-gem {
  position: absolute;
  border-radius: 999px;
}

.rosette {
  width: 2.5rem;
  height: 2.5rem;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 247, 240, 0.92) 0 18%, rgba(255, 185, 214, 0.82) 40%, rgba(182, 92, 142, 0.92) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 225, 0.32);
}

.rosette-a {
  top: 5.6rem;
  left: 18%;
}

.rosette-b {
  top: 4.8rem;
  left: 43%;
}

.rosette-c {
  top: 5.6rem;
  right: 18%;
}

.rosette-d {
  bottom: 9.8rem;
  left: 12%;
}

.rosette-e {
  bottom: 9.8rem;
  right: 12%;
}

.cake-gems {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cake-gem {
  width: 1.2rem;
  height: 1.2rem;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 252, 241, 0.95) 0 24%, rgba(255, 211, 121, 0.92) 44%, rgba(193, 117, 54, 0.92) 100%);
  box-shadow: 0 0 0.65rem rgba(255, 205, 123, 0.3);
}

.cake-gem-a {
  top: 8rem;
  left: 32%;
}

.cake-gem-b {
  top: 7.2rem;
  left: 61%;
}

.cake-gem-c {
  bottom: 12rem;
  left: 27%;
}

.cake-gem-d {
  bottom: 12rem;
  right: 27%;
}

.cake-plate,
.cake-shadow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cake-plate {
  bottom: 4.2rem;
  width: min(42rem, calc(100% - 0.5rem));
  height: 2.6rem;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.82), rgba(215, 199, 228, 0.34)),
    rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 245, 235, 0.24);
}

.cake-shadow {
  bottom: 2.6rem;
  width: min(33rem, calc(100% - 3rem));
  height: 3.7rem;
  border-radius: 999px;
  background: rgba(8, 6, 10, 0.42);
  filter: blur(14px);
}

.candle-unit {
  position: absolute;
  bottom: 22.1rem;
  width: 5.1rem;
  display: grid;
  justify-items: center;
}

.candle-unit-a {
  left: 8%;
}

.candle-unit-b {
  left: 21.5%;
}

.candle-unit-c {
  left: 35%;
}

.candle-unit-d {
  left: 48.5%;
}

.candle-unit-e {
  left: 62%;
}

.candle-unit-f {
  left: 75.5%;
}

.candle-touch {
  position: absolute;
  top: 0.2rem;
  width: 3.1rem;
  height: 8.4rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  z-index: 3;
}

.candle-body {
  position: relative;
  width: 1.45rem;
  height: 7rem;
  margin-top: 1.5rem;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fff2f8 0%, #ffcde0 34%, #f18db5 66%, #c5577f 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    0 0.55rem 1rem rgba(36, 12, 30, 0.28);
}

.candle-unit-b .candle-body {
  background:
    linear-gradient(180deg, #fdf9f1 0%, #ffe6bb 34%, #f2bf5f 66%, #d08a2c 100%);
}

.candle-unit-c .candle-body {
  background:
    linear-gradient(180deg, #f3f6ff 0%, #dce5ff 34%, #9bb3ff 66%, #5c74cc 100%);
}

.candle-unit-d .candle-body {
  background:
    linear-gradient(180deg, #f4fff8 0%, #d8fce9 34%, #94e3c2 66%, #42a888 100%);
}

.candle-unit-e .candle-body {
  background:
    linear-gradient(180deg, #fff8f1 0%, #ffe5c6 34%, #f0b873 66%, #cb7b39 100%);
}

.candle-unit-f .candle-body {
  background:
    linear-gradient(180deg, #faf4ff 0%, #e8d9ff 34%, #ba98f2 66%, #7a5cc4 100%);
}

.candle-body::before {
  content: "";
  position: absolute;
  inset: 0.55rem 0.42rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0));
  border-radius: 999px;
}

.flame-shell {
  position: absolute;
  top: 0;
  width: 3rem;
  height: 3.6rem;
  opacity: 0;
  transform: translateY(0.4rem) scale(0.6);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.flame-core,
.flame-halo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px 999px 999px 999px / 999px 999px 600px 600px;
}

.flame-core {
  top: 0.2rem;
  width: 1.1rem;
  height: 1.8rem;
  background:
    radial-gradient(circle at 50% 22%, #fff7de 0 24%, #ffcf6f 42%, #ff9446 74%, transparent 75%);
  filter: drop-shadow(0 0 10px rgba(255, 178, 71, 0.46));
  animation: flameDance 1.2s ease-in-out infinite;
}

.flame-halo {
  top: 0;
  width: 2.4rem;
  height: 2.7rem;
  background: radial-gradient(circle, rgba(255, 197, 103, 0.4), transparent 68%);
  filter: blur(6px);
}

.candle-unit.is-lit .flame-shell,
.candle-unit.is-complete .flame-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.candle-unit.is-earned .candle-body {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    0 0.55rem 1rem rgba(36, 12, 30, 0.28),
    0 0 0 1px rgba(255, 214, 139, 0.28);
}

.cake-letter {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 999px;
  font-family: var(--headline);
  font-size: 2rem;
  color: #fff1d0;
  background:
    radial-gradient(circle, rgba(255, 241, 226, 0.16), rgba(255, 255, 255, 0));
  opacity: 0;
  transform: translateY(0.8rem) scale(0.88);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.cake-letter.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cake-letter.is-arriving {
  animation: letterLanding 620ms ease;
}

.cake-letter-a {
  left: 14%;
  top: 10rem;
}

.cake-letter-b {
  left: 38%;
  top: 9.7rem;
}

.cake-letter-c {
  left: 63%;
  top: 10rem;
}

.cake-letter-d {
  left: 17%;
  bottom: 6.6rem;
}

.cake-letter-e {
  left: 41%;
  bottom: 6.4rem;
}

.cake-letter-f {
  left: 65%;
  bottom: 6.4rem;
}

.cake-letter.is-wide {
  width: 4.5rem;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
}

.cake-reset {
  position: absolute;
  right: 1rem;
  bottom: 1.1rem;
  z-index: 4;
  min-height: 2.6rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(37, 18, 41, 0.72);
  color: rgba(255, 241, 226, 0.84);
}

.cake-reset:hover {
  transform: translateY(-2px);
}

.sprout-card {
  position: absolute;
  bottom: 7.4rem;
  width: 11rem;
  padding: 0.9rem 0.9rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%),
    rgba(39, 20, 45, 0.86);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(1.35rem) scale(0.9);
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
  pointer-events: none;
}

.sprout-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1.05rem;
  width: 1.2rem;
  height: 1.2rem;
  background: rgba(39, 20, 45, 0.92);
  border-right: 1px solid rgba(255, 241, 226, 0.14);
  border-bottom: 1px solid rgba(255, 241, 226, 0.14);
  transform: translateX(-50%) rotate(45deg);
}

.sprout-card h3 {
  margin: 0.35rem 0 0;
  font-family: var(--headline);
  font-size: 1.28rem;
  letter-spacing: 0.04em;
}

.sprout-card p:not(.sprout-step) {
  margin: 0.45rem 0 0;
  color: rgba(255, 241, 226, 0.74);
  line-height: 1.6;
  font-size: 0.9rem;
}

.candle-unit.is-lit .sprout-card,
.candle-unit.is-complete .sprout-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.candle-unit.is-active .sprout-card {
  border-color: rgba(255, 212, 140, 0.38);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.sprout-button,
.game-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(255, 233, 210, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 194, 120, 0.96), rgba(188, 93, 96, 0.96)),
    rgba(255, 255, 255, 0.08);
  color: #240f1f;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    border-color 180ms ease;
}

.sprout-button {
  width: 100%;
  margin-top: 0.8rem;
}

.secondary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(51, 25, 59, 0.72);
  color: var(--cream);
}

.sprout-button:hover,
.game-action:hover,
.secondary-action:hover,
.memory-pad:hover,
.candle-touch:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(19rem, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.shortcut-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.shortcut-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(32, 17, 39, 0.72);
  color: rgba(255, 241, 226, 0.78);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.shortcut-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 139, 0.24);
}

.shortcut-button.is-active {
  border-color: rgba(255, 214, 139, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 214, 139, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(43, 23, 45, 0.8);
  color: #fff2d5;
}

.shortcut-button:disabled {
  opacity: 0.56;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(24, 13, 31, 0.68);
  color: rgba(255, 241, 226, 0.82);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.utility-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 139, 0.24);
}

.shortcut-index {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
}

.shortcut-button.is-complete .shortcut-index {
  background: linear-gradient(180deg, #c6f0db, #86d2af);
  color: #112117;
}

.game-panel {
  min-height: 30rem;
  padding: 1.2rem;
}

.cake-game-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 7, 16, 0.56);
  backdrop-filter: blur(10px);
  border-radius: 2.8rem;
  opacity: 0;
  transition: opacity 220ms ease;
}

.cake-game-overlay[hidden] {
  display: none;
}

.cake-game-overlay.is-visible {
  opacity: 1;
}

.game-popup-card {
  width: min(48rem, 100%);
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgba(255, 241, 226, 0.16);
  border-radius: 1.6rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%),
    rgba(25, 15, 31, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  transform-origin: var(--popup-origin-x, 50%) var(--popup-origin-y, 50%);
  transform: scale(0.8) translateY(1rem);
  transition: transform 260ms ease;
  overscroll-behavior: contain;
}

.cake-game-overlay.is-visible .game-popup-card {
  transform: scale(1) translateY(0);
}

.panel-card {
  display: grid;
  gap: 0.7rem;
  padding: 1.05rem;
}

.progress-panel {
  display: grid;
  gap: 1rem;
}

.level-list {
  display: grid;
  gap: 0.75rem;
}

.level-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 241, 226, 0.09);
  background: rgba(255, 255, 255, 0.03);
}

.level-item strong {
  font-family: var(--headline);
  font-size: 1.08rem;
}

.level-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.status-pill,
.reward-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.status-pill {
  color: rgba(255, 241, 226, 0.72);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 241, 226, 0.08);
}

.status-pill.is-unlocked {
  color: #ffe8b9;
  border-color: rgba(255, 210, 118, 0.22);
}

.status-pill.is-complete {
  color: #122015;
  background: linear-gradient(180deg, #c2f0d9, #8ad0b0);
}

.reward-chip {
  min-width: 2.35rem;
  font-family: var(--headline);
  color: rgba(255, 241, 226, 0.48);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 241, 226, 0.08);
}

.reward-chip.is-found {
  color: #fff7e9;
  border-color: rgba(255, 210, 118, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 219, 148, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.final-order {
  display: grid;
  gap: 0.8rem;
}

.final-order-row {
  display: grid;
  gap: 0.45rem;
}

.final-order-label {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 241, 226, 0.58);
}

.final-order-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.final-order-chip {
  display: grid;
  place-items: center;
  min-height: 3rem;
  font-family: var(--headline);
  font-size: 1.4rem;
  color: rgba(255, 241, 226, 0.42);
  border: 1px solid rgba(255, 241, 226, 0.09);
  background: rgba(255, 255, 255, 0.03);
}

.final-order-chip.is-visible {
  color: var(--gold-soft);
  border-color: rgba(255, 214, 139, 0.24);
}

.final-order-chip.is-answer {
  color: rgba(255, 241, 226, 0.28);
}

.final-order-chip.is-answer-visible {
  color: #fff6e1;
  border-color: rgba(255, 214, 139, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 224, 160, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.game-shell {
  display: grid;
  gap: 1rem;
}

.level-flow-shell {
  gap: 1.15rem;
}

.game-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 1rem;
  align-items: start;
}

.game-head h3 {
  margin: 0.28rem 0 0;
  font-family: var(--headline);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.popup-close {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(255, 241, 226, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 241, 226, 0.82);
  font-size: 1.3rem;
  line-height: 1;
}

.game-head p {
  margin: 0.45rem 0 0;
  max-width: 34rem;
  color: rgba(255, 241, 226, 0.8);
  line-height: 1.7;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.flow-step {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 241, 226, 0.1);
  border-radius: 999px;
  color: rgba(255, 241, 226, 0.56);
  background: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.06em;
}

.flow-step.is-active {
  color: #fff0cb;
  border-color: rgba(255, 214, 139, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 221, 157, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.flow-step.is-done {
  color: #1d1a1f;
  border-color: transparent;
  background: linear-gradient(180deg, #f9e2a9, #f0b67d);
}

.answer-badge {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  width: fit-content;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(255, 214, 139, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 236, 196, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: rgba(255, 241, 226, 0.76);
}

.answer-badge span {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.answer-badge strong {
  font-family: var(--headline);
  font-size: 1rem;
  color: #fff0cc;
  letter-spacing: 0.04em;
}

.flow-body {
  display: grid;
  gap: 1rem;
}

.question-card,
.challenge-copy {
  display: grid;
  gap: 0.45rem;
}

.question-card h4,
.challenge-copy h4 {
  margin: 0;
  font-family: var(--headline);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.04em;
}

.question-card p:not(.section-kicker),
.challenge-copy p:not(.section-kicker) {
  margin: 0;
  color: rgba(255, 241, 226, 0.76);
  line-height: 1.7;
}

.question-card {
  padding: 1.2rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 211, 149, 0.09), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%),
    rgba(255, 255, 255, 0.03);
}

.question-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  margin-top: 0.3rem;
}

.question-input {
  min-height: 3rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.14);
  border-radius: 1rem;
  background: rgba(15, 10, 19, 0.64);
  color: var(--cream);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.question-input:focus {
  border-color: rgba(255, 214, 139, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 214, 139, 0.08);
}

.game-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.85rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.game-status {
  min-height: 3.4rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 216, 154, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.03);
  color: rgba(255, 241, 226, 0.84);
  line-height: 1.7;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.game-placeholder {
  display: grid;
  place-items: center;
  min-height: 27rem;
  text-align: center;
  padding: 1.8rem;
  border: 1px dashed rgba(255, 241, 226, 0.18);
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 207, 130, 0.08), transparent 20%),
    rgba(255, 255, 255, 0.02);
}

.game-placeholder strong {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--headline);
  font-size: 1.7rem;
}

.finale-shell {
  display: grid;
  gap: 1rem;
}

.finale-banner {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 214, 139, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 219, 148, 0.14), transparent 58%),
    rgba(255, 255, 255, 0.03);
}

.finale-banner strong {
  font-family: var(--headline);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff3cf;
}

.finale-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.finale-grid article {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 241, 226, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.finale-grid strong {
  font-family: var(--headline);
  font-size: 1.2rem;
  color: var(--gold-soft);
}

.finale-grid p {
  margin: 0;
  color: rgba(255, 241, 226, 0.72);
  line-height: 1.7;
}

.trace-board,
.memory-grid,
.timing-board,
.catch-board {
  position: relative;
  border: 1px solid rgba(255, 241, 226, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    rgba(15, 10, 18, 0.5);
  overflow: hidden;
}

.trace-board {
  min-height: 22rem;
  display: grid;
  place-items: center;
}

.trace-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 220, 167, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%);
  pointer-events: none;
}

.trace-wordmark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-inline: 1rem;
  font-family: var(--headline);
  font-size: clamp(2.8rem, 8vw, 6.6rem);
  line-height: 1.12;
  letter-spacing: 0.12em;
  color: rgba(255, 239, 217, 0.12);
  text-align: center;
  pointer-events: none;
}

.trace-path,
.trace-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trace-point {
  position: absolute;
  width: 1.6rem;
  height: 1.6rem;
  margin: -0.8rem 0 0 -0.8rem;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle, #fff9ef 0 28%, #ffca7d 44%, rgba(255, 202, 125, 0.08) 72%);
  box-shadow: 0 0 20px rgba(255, 197, 103, 0.36);
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.trace-point.is-hit {
  transform: scale(1.12);
  filter: saturate(1.15);
  opacity: 0.84;
}

.trace-point.is-start {
  background:
    radial-gradient(circle, #ffffff 0 28%, #ff99d5 42%, rgba(255, 153, 213, 0.08) 74%);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-height: 19rem;
  padding: 1rem;
}

.memory-pad {
  min-height: 8.8rem;
  border: 1px solid rgba(255, 241, 226, 0.14);
  background: var(--pad-bg, rgba(255, 255, 255, 0.06));
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.memory-pad.is-flashing {
  filter: brightness(1.25) saturate(1.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 26px var(--pad-glow, rgba(255, 230, 188, 0.22));
}

.timing-board {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.timing-track {
  position: relative;
  height: 1.45rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.timing-target {
  position: absolute;
  top: 0.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 238, 178, 0.8), rgba(255, 191, 88, 0.94));
  box-shadow: 0 0 20px rgba(255, 206, 113, 0.24);
}

.timing-orb {
  position: absolute;
  top: 50%;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, #fffef8 0 24%, #ffb7d7 48%, #ff759e 76%, rgba(255, 117, 158, 0.12) 77%);
  box-shadow: 0 0 18px rgba(255, 147, 187, 0.34);
}

.timing-meter {
  display: flex;
  gap: 0.6rem;
}

.timing-meter span {
  flex: 1;
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.timing-meter span.is-filled {
  background: linear-gradient(90deg, #ffe39e, #ffaf88);
}

.catch-board {
  min-height: 21rem;
  padding: 0.9rem;
}

.catch-canvas {
  display: block;
  width: 100%;
  height: 18.6rem;
  border: 1px solid rgba(255, 241, 226, 0.1);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 230, 183, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(69, 48, 93, 0.36), rgba(10, 7, 16, 0.7));
}

.catch-note {
  margin: 0;
  color: rgba(255, 241, 226, 0.74);
  line-height: 1.7;
}

.rhythm-board {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    rgba(15, 10, 18, 0.5);
}

.rhythm-track {
  position: relative;
  height: 1.7rem;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.rhythm-target {
  position: absolute;
  top: 0.18rem;
  height: 1.34rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 216, 144, 0.32), rgba(255, 175, 119, 0.58));
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.rhythm-target.is-accent {
  background:
    linear-gradient(90deg, rgba(255, 236, 171, 0.54), rgba(255, 167, 118, 0.78));
}

.rhythm-target.is-preview {
  background: linear-gradient(90deg, rgba(255, 244, 187, 0.92), rgba(255, 190, 113, 0.96));
  box-shadow: 0 0 18px rgba(255, 206, 123, 0.36);
}

.rhythm-target.is-hit {
  background: linear-gradient(90deg, rgba(186, 255, 216, 0.92), rgba(112, 220, 176, 0.9));
}

.rhythm-track.is-previewing .rhythm-orb {
  opacity: 0.2;
}

.rhythm-label {
  width: fit-content;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 139, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 241, 226, 0.82);
  font-family: var(--headline);
  letter-spacing: 0.06em;
}

.moon-board {
  position: relative;
  min-height: 24rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 241, 226, 0.12);
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 238, 196, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    rgba(15, 10, 18, 0.5);
  overflow: hidden;
}

.moon-ring,
.moon-orbit-layer {
  position: relative;
  width: min(19rem, 82%);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 241, 226, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px rgba(255, 217, 142, 0.08);
}

.moon-orbit-layer {
  will-change: transform;
}

.moon-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.moon-core {
  position: absolute;
  width: 5.4rem;
  height: 5.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 252, 242, 0.98) 0 24%, rgba(255, 225, 170, 0.92) 58%, rgba(210, 156, 89, 0.78) 100%);
  color: rgba(79, 47, 27, 0.88);
  font-family: var(--headline);
  font-size: 2rem;
  box-shadow: 0 0 28px rgba(255, 213, 135, 0.18);
}

.moon-node {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 254, 249, 0.98) 0 24%, rgba(255, 214, 146, 0.94) 52%, rgba(212, 152, 84, 0.78) 100%);
  box-shadow: 0 0 18px rgba(255, 209, 129, 0.24);
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.moon-node.is-flashing,
.moon-node.is-hit {
  transform: scale(1.14);
  filter: brightness(1.14);
}

.moon-node.is-start {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 24%, rgba(182, 230, 255, 0.94) 50%, rgba(92, 151, 214, 0.82) 100%);
}

.fuse-board {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(255, 241, 226, 0.12);
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    rgba(15, 10, 18, 0.5);
}

.fuse-track {
  position: relative;
  height: 3.4rem;
}

.fuse-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.34rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background:
    linear-gradient(90deg, rgba(255, 201, 126, 0.2), rgba(255, 165, 101, 0.5), rgba(255, 201, 126, 0.2));
}

.fuse-segment,
.fuse-target,
.fuse-ember {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.fuse-segment {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(255, 235, 197, 0.2);
}

.fuse-target {
  height: 1.2rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background:
    linear-gradient(90deg, rgba(255, 228, 169, 0.36), rgba(255, 168, 116, 0.58));
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.fuse-target.is-accent {
  background:
    linear-gradient(90deg, rgba(255, 241, 187, 0.56), rgba(255, 165, 105, 0.78));
}

.fuse-target.is-preview {
  box-shadow: 0 0 18px rgba(255, 205, 125, 0.34);
}

.fuse-target.is-hit {
  background: linear-gradient(90deg, rgba(190, 255, 212, 0.92), rgba(109, 221, 177, 0.9));
}

.fuse-ember {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 20%, rgba(255, 225, 129, 0.94) 42%, rgba(255, 123, 84, 0.92) 74%, transparent 76%);
  box-shadow: 0 0 16px rgba(255, 177, 92, 0.34);
}

.fuse-track.is-previewing .fuse-ember {
  opacity: 0.2;
}

.success-banner {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(161, 232, 199, 0.26);
  background:
    linear-gradient(90deg, rgba(186, 255, 222, 0.12), transparent 56%),
    rgba(255, 255, 255, 0.03);
  color: #d9ffe8;
}

.spark-field,
.sparkler-cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.sparkler-cursor {
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 150ms ease;
}

body.has-fine-pointer .sparkler-cursor {
  opacity: 1;
}

.finale-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 226, 154, 0.14), transparent 20%),
    rgba(9, 5, 13, 0.74);
  backdrop-filter: blur(18px);
  z-index: 90;
}

.finale-overlay[hidden] {
  display: none;
}

.finale-overlay-panel {
  width: min(32rem, 100%);
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 214, 139, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%),
    rgba(28, 16, 33, 0.94);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 214, 139, 0.08) inset;
}

.finale-overlay-panel h2 {
  margin: 0;
  font-family: var(--headline);
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  letter-spacing: 0.08em;
  color: #fff3cf;
}

.finale-overlay-panel p {
  margin: 0;
  color: rgba(255, 241, 226, 0.8);
  line-height: 1.75;
}

.finale-overlay-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.finale-overlay-chip {
  display: grid;
  place-items: center;
  min-height: 4.3rem;
  font-family: var(--headline);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  border: 1px solid rgba(255, 214, 139, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 224, 160, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: #fff0cb;
  opacity: 0.18;
  transform: translateY(0.8rem) scale(0.92);
  transition:
    opacity 300ms ease,
    transform 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease;
}

.finale-overlay-chip.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  border-color: rgba(255, 214, 139, 0.34);
  box-shadow:
    0 0 26px rgba(255, 214, 139, 0.12),
    inset 0 0 0 1px rgba(255, 214, 139, 0.08);
}

.finale-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sparkler-stick,
.sparkler-star,
.sparkler-ring {
  position: absolute;
  left: 0;
  top: 0;
}

.sparkler-stick {
  width: 1.7rem;
  height: 0.18rem;
  border-radius: 999px;
  transform: translate(-0.2rem, 0.1rem) rotate(-38deg);
  background: linear-gradient(90deg, rgba(255, 252, 237, 0.9), rgba(255, 181, 120, 0.46));
}

.sparkler-star {
  width: 0.9rem;
  height: 0.9rem;
  transform: translate(0.7rem, -0.35rem);
  background:
    radial-gradient(circle, #fffef9 0 28%, #ffd481 42%, rgba(255, 212, 129, 0.06) 74%);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 211, 122, 0.45);
}

.sparkler-ring {
  width: 2rem;
  height: 2rem;
  transform: translate(0.15rem, -0.9rem);
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 176, 0.34);
  animation: cursorPulse 1.2s ease-out infinite;
}

.spark {
  position: absolute;
  left: var(--x, 0px);
  top: var(--y, 0px);
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 30%, rgba(255, 205, 120, 0.86) 48%, rgba(255, 205, 120, 0) 76%);
}

.spark.spark-trail {
  animation: trailFade 520ms ease-out forwards;
}

.spark.spark-burst {
  animation: burstFly 740ms ease-out forwards;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 480ms ease,
    transform 480ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes flameDance {
  0%,
  100% {
    transform: translateX(-50%) scale(0.98) rotate(-2deg);
  }

  50% {
    transform: translateX(-50%) scale(1.05) rotate(3deg);
  }
}

@keyframes cursorPulse {
  0% {
    opacity: 0.8;
    transform: translate(0.15rem, -0.9rem) scale(0.82);
  }

  100% {
    opacity: 0;
    transform: translate(0.15rem, -0.9rem) scale(1.35);
  }
}

@keyframes trailFade {
  0% {
    opacity: 0.92;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-0.2rem, -0.5rem) scale(0.2);
  }
}

@keyframes burstFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.2);
  }
}

@keyframes letterLanding {
  0% {
    transform: translateY(-1.1rem) scale(0.72);
    opacity: 0.1;
  }

  55% {
    transform: translateY(0.2rem) scale(1.08);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero-meta,
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .cake-stage {
    min-height: 54rem;
  }
}

@media (max-width: 760px) {
  .birthday-shell {
    padding-inline: 0.95rem;
  }

  .shortcut-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .phrase-ribbon {
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .cake-stage {
    min-height: 56rem;
    padding-inline: 0.5rem;
  }

  .cake {
    width: min(31rem, calc(100% - 0.3rem));
    height: 27rem;
  }

  .candle-unit {
    bottom: 19.9rem;
    width: 5.2rem;
  }

  .candle-unit-a {
    left: 1%;
  }

  .candle-unit-b {
    left: 17%;
  }

  .candle-unit-c {
    left: 33%;
  }

  .candle-unit-d {
    left: 49%;
  }

  .candle-unit-e {
    left: 65%;
  }

  .candle-unit-f {
    left: 81%;
  }

  .question-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .birthday-hero h1 {
    font-size: clamp(2.25rem, 11vw, 3.3rem);
  }

  .hero-summary {
    font-size: 0.96rem;
  }

  .cake-stage {
    min-height: 58rem;
  }

  .cake-letter {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.75rem;
  }

  .cake-letter.is-wide {
    width: 3.9rem;
    font-size: 1.25rem;
  }

  .cake-reset {
    right: 0.35rem;
    bottom: 0.5rem;
    padding-inline: 0.85rem;
  }

  .shortcut-bar {
    grid-template-columns: 1fr;
  }

  .control-bar,
  .finale-overlay-slots {
    grid-template-columns: 1fr;
  }

  .final-order-slots,
  .finale-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cake {
    bottom: 8rem;
    width: min(23.6rem, calc(100% - 0.2rem));
    height: 24.5rem;
  }

  .cake-tier-top {
    top: 4.8rem;
  }

  .cake-tier-bottom {
    height: 13rem;
  }

  .candle-unit {
    bottom: 18.4rem;
    width: 4.8rem;
  }

  .candle-unit-a {
    left: -2%;
  }

  .candle-unit-b {
    left: 13%;
  }

  .candle-unit-c {
    left: 28%;
  }

  .candle-unit-d {
    left: 43%;
  }

  .candle-unit-e {
    left: 58%;
  }

  .candle-unit-f {
    left: 73%;
  }

  .trace-board,
  .memory-grid,
  .timing-board,
  .catch-board,
  .rhythm-board,
  .moon-board,
  .fuse-board {
    min-height: 18rem;
  }

  .memory-pad {
    min-height: 6.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
