:root {
  --bg-0: #050816;
  --bg-1: #07111f;
  --bg-2: #120f2c;
  --bg-3: #1b1237;
  --bg-4: #27144a;
  --accent-cyan: #59d0ff;
  --accent-violet: #8d7dff;
  --accent-pink: #ff73b8;
  --accent-gold: #ffcf76;
  --accent-peach: #ff9f79;
  --text-main: #f7fbff;
  --text-soft: rgba(238, 244, 255, 0.74);
  --text-faint: rgba(238, 244, 255, 0.54);
  --glass-fill: rgba(255, 255, 255, 0.08);
  --glass-fill-strong: rgba(255, 255, 255, 0.12);
  --glass-stroke: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.24);
  --shadow-deep: 0 32px 80px rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 0 80px rgba(113, 153, 255, 0.16);
  --button-shadow: 0 18px 40px rgba(255, 134, 160, 0.32);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  overflow: hidden;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(71, 82, 158, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 30%, var(--bg-2) 60%, var(--bg-3) 100%);
  color: var(--text-main);
  font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  isolation: isolate;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  filter: blur(26px);
  opacity: 0.9;
}

.page-shell::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(89, 208, 255, 0.24), transparent 22%),
    radial-gradient(circle at 82% 18%, rgba(255, 115, 184, 0.24), transparent 20%),
    radial-gradient(circle at 50% 78%, rgba(141, 125, 255, 0.28), transparent 26%);
  animation: auroraShift 18s ease-in-out infinite alternate;
}

.page-shell::after {
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(89, 208, 255, 0.12), rgba(255, 115, 184, 0.12), rgba(255, 207, 118, 0.1), rgba(89, 208, 255, 0.12));
  mix-blend-mode: screen;
  animation: hueFloat 22s linear infinite;
}

.phone-frame {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    linear-gradient(180deg, rgba(8, 13, 29, 0.84), rgba(14, 10, 31, 0.92));
  backdrop-filter: blur(32px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 80px rgba(0, 0, 0, 0.34),
    0 0 80px rgba(109, 132, 255, 0.12);
  overflow: hidden;
}

.phone-frame::before,
.phone-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.phone-frame::before {
  inset: 0;
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 255, 255, 0.14), transparent 18%),
    radial-gradient(circle at 88% 12%, rgba(255, 205, 120, 0.12), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(146, 109, 255, 0.12), transparent 30%);
}

.phone-frame::after {
  display: none;
}

#app {
  position: relative;
  height: 100dvh;
  padding: 8px 14px 14px;
  z-index: 1;
}

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 28px);
  gap: 8px;
  overflow: hidden;
}

.scene--animated {
  animation: sceneIn 200ms ease-out;
}

.scene-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.scene-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.2), rgba(5, 8, 22, 0.54)),
    radial-gradient(circle at 50% 70%, rgba(141, 125, 255, 0.28), transparent 46%);
  backdrop-filter: blur(12px) saturate(135%);
}

.scene-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 26px 64px rgba(0, 0, 0, 0.34),
    0 0 80px rgba(141, 125, 255, 0.18);
}

.scene-modal__copy {
  margin-top: 0;
}

.scene[data-scene="preloader"] {
  justify-content: center;
}

.scene-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.scene-body--hero {
  justify-content: stretch;
}

.scene-body--game {
  flex: 1;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
}

.progress-pill,
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-stroke);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  backdrop-filter: blur(20px) saturate(135%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 12px 30px rgba(6, 11, 28, 0.24);
}

.progress-pill {
  font-size: 0.92rem;
  font-weight: 600;
}

.sound-toggle {
  cursor: pointer;
  justify-content: center;
  min-width: 96px;
}

.sound-toggle.is-on {
  border-color: rgba(255, 207, 118, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 40px rgba(255, 190, 110, 0.18);
}

.glass-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(24px) saturate(155%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    var(--shadow-deep),
    var(--shadow-glow);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.22), transparent 18%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.hero-card--split {
  padding: 0;
}

.hero-card__visual,
.hero-card__content {
  position: relative;
  z-index: 1;
}

.hero-card__visual {
  min-height: clamp(300px, 44vh, 460px);
  padding: 10px 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.hero-card__content {
  margin-top: auto;
  padding: 0 20px 18px;
}

.hero-card__content .button-row {
  margin-top: 14px;
}

.hero-card__visual--locked {
  min-height: 228px;
}

.locked-gift-content {
  padding-top: 4px;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  min-height: auto;
  text-align: center;
}

.welcome-copy {
  margin-top: 0;
  display: grid;
  justify-items: center;
  width: 100%;
}

.welcome-title {
  display: grid;
  justify-items: center;
  gap: 0.08em;
  font-size: clamp(2.3rem, 7.8vw, 4.35rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.welcome-title__line {
  display: block;
  text-align: center;
}

.welcome-title__line--name {
  font-size: 1.03em;
}

.welcome-subtitle {
  font-size: 1.04rem;
  line-height: 1.42;
  width: min(100%, 30ch);
  margin-inline: auto;
  text-align: center;
  text-wrap: pretty;
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92%, 420px);
  height: min(80%, 320px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(48px);
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 115, 184, 0.34), transparent 30%),
    radial-gradient(circle at 72% 26%, rgba(89, 208, 255, 0.28), transparent 32%),
    radial-gradient(circle at 50% 84%, rgba(255, 207, 118, 0.2), transparent 38%);
}

.hero-balloons,
.hero-cluster {
  position: relative;
  width: 100%;
  height: 408px;
}

.hero-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, clamp(312px, 93.6vw, 504px));
  height: 100%;
  min-height: clamp(298px, 43vh, 456px);
  margin: 0 auto;
  padding-top: 0;
}

.welcome-content .button-row {
  display: flex;
  justify-content: center;
}

.hero-balloons .show-balloon {
  position: absolute;
  bottom: 0;
  animation: heroFloat 4.6s ease-in-out infinite alternate;
}

.hero-balloons .show-balloon:nth-child(1) {
  left: 8%;
  transform: scale(1.12);
}

.hero-balloons .show-balloon:nth-child(2) {
  left: 38%;
  bottom: 28px;
  transform: scale(0.92);
  animation-delay: 0.8s;
}

.hero-balloons .show-balloon:nth-child(3) {
  right: 6%;
  bottom: 12px;
  transform: scale(1.04);
  animation-delay: 1.4s;
}

.show-balloon {
  width: 156px;
  height: 304px;
}

.show-balloon .balloon-shape {
  width: 88px;
  height: 120px;
}

.show-balloon .balloon-knot {
  position: absolute;
  left: 50%;
  top: 112px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--balloon-mid), var(--balloon-bottom));
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.show-balloon .balloon-string {
  position: absolute;
  left: 50%;
  top: 124px;
  width: 2px;
  height: 46px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.56), rgba(255,255,255,0.06));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(1.85rem, 6vw, 2.65rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.title-sm {
  font-size: clamp(1.34rem, 4.5vw, 1.82rem);
  line-height: 1.02;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.primary-button {
  color: #391526;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.54), transparent 18%),
    linear-gradient(135deg, var(--accent-gold), var(--accent-peach) 42%, var(--accent-pink) 100%);
  box-shadow: var(--button-shadow);
}

.secondary-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.button-row {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.ambient-layer {
  position: absolute;
  inset: 68px 0 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb,
.ambient-ribbon {
  position: absolute;
  filter: blur(0.4px);
  opacity: 0.92;
}

.ambient-orb {
  border-radius: 999px;
  animation: floatOrb var(--speed, 10s) ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.72), transparent 18%),
    linear-gradient(160deg, var(--orb-a), var(--orb-b));
  box-shadow:
    inset -14px -20px 22px rgba(0, 0, 0, 0.16),
    0 16px 40px rgba(0, 0, 0, 0.18);
}

.ambient-ribbon {
  width: 180px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  transform: rotate(-24deg);
  animation: ribbonDrift 14s ease-in-out infinite alternate;
}

.game-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  padding: 16px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.game-stage--full {
  flex: 1;
  min-height: 0;
}

.game-stage--gift {
  min-height: 100%;
}

.game-stage--balloons {
  flex: 1;
  min-height: 0;
}

.game-stage--stars {
  flex: 1;
  min-height: 0;
  padding: 10px;
}

.game-helper {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.status-card {
  display: grid;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-weight: 600;
}

.gift-box {
  position: relative;
  width: 180px;
  height: auto;
  transform-style: preserve-3d;
  animation: giftIdle 3.6s ease-in-out infinite;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.gift-box--hero {
  width: min(100%, 280px);
  height: auto;
}

.asset-image {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.asset-image--gift-hero {
  width: 280px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 36px rgba(18, 10, 40, 0.28));
}

.asset-image--gift-final {
  width: 250px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 32px rgba(18, 10, 40, 0.28));
}

.asset-image--gift-option {
  width: 132px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(18, 10, 40, 0.24));
}

.asset-image--balloon-show {
  width: 152px;
  height: 298px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(18, 10, 40, 0.18));
}

.asset-image--welcome-cluster {
  width: clamp(300px, 91.2vw, 468px);
  max-width: 100%;
  max-height: min(100%, 480px);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(18, 10, 40, 0.24));
}

.asset-image--balloon-cluster {
  width: min(100%, 252px);
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(58, 146, 164, 0.18));
}

.asset-image--balloon-live {
  width: 96px;
  height: 196px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(18, 10, 40, 0.16));
}

.asset-image--cake {
  width: 220px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 28px rgba(18, 10, 40, 0.26));
}

.asset-image--candle {
  width: 22px;
  height: 66px;
  object-fit: contain;
}

.object-svg {
  display: block;
  width: 100%;
  height: auto;
}

.object-svg--star {
  width: 72px;
  height: 72px;
  overflow: visible;
  filter: drop-shadow(0 14px 22px rgba(22, 36, 88, 0.24));
}

.gift-box.is-reacting {
  animation: giftReact 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gift-lid,
.gift-base {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, #ff83bf, #806dff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset -18px -22px 32px rgba(49, 16, 91, 0.26),
    0 24px 50px rgba(41, 10, 64, 0.28);
}

.gift-base {
  bottom: 0;
  height: 110px;
}

.gift-lid {
  top: 0;
  height: 72px;
}

.gift-lid::before,
.gift-base::before,
.gift-lid::after,
.gift-base::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #fff4b1, #ffb84f);
}

.gift-lid::before,
.gift-base::before {
  left: 50%;
  top: 0;
  width: 20px;
  height: 100%;
  transform: translateX(-50%);
  border-radius: 18px;
}

.gift-lid::after,
.gift-base::after {
  inset: 50% 0 auto;
  height: 18px;
  transform: translateY(-50%);
}

.gift-bow {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 88px;
  height: 58px;
  transform: translateX(-50%);
}

.gift-bow::before,
.gift-bow::after,
.gift-bow-center {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #fff4b1, #ffb84f);
  box-shadow: 0 10px 20px rgba(255, 184, 79, 0.22);
}

.gift-bow::before,
.gift-bow::after {
  top: 10px;
  width: 42px;
  height: 32px;
  border-radius: 26px 26px 8px 26px;
}

.gift-bow::before {
  left: 0;
  transform: rotate(-18deg);
}

.gift-bow::after {
  right: 0;
  border-radius: 26px 26px 26px 8px;
  transform: rotate(18deg);
}

.gift-bow-center {
  left: 50%;
  top: 18px;
  width: 18px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 12px;
}

.gift-box.is-opening .gift-lid {
  animation: lidOpen 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-content: center;
  justify-items: center;
}

.gift-grid .gift-option:last-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 180px);
}

.gift-option {
  position: relative;
  min-height: 118px;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  background: none;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-option.is-wrong {
  animation: shakeWrong 500ms ease;
}

.gift-option.is-right {
  animation: giftPulse 900ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 0 48px rgba(255, 204, 120, 0.4),
    0 18px 30px rgba(0, 0, 0, 0.18);
}

.floating-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.balloon,
.star-falling {
  position: absolute;
  border: 0;
  cursor: pointer;
  background: none;
  padding: 0;
}

.balloon {
  width: 82px;
  height: 168px;
}

.balloon {
  animation: balloonFloat linear forwards;
}

.balloon .asset-image--balloon-live {
  animation: balloonWobble 2.2s ease-in-out infinite alternate;
}

.balloon.is-popped .asset-image--balloon-live {
  animation: balloonPop 360ms ease forwards;
}

.particle-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--particle-color, #fff);
  animation: particleFly 500ms ease forwards;
}

.cake {
  position: relative;
  width: min(100%, 332px);
  height: min(100%, 336px);
}

.cake--photo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.candle-row {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 214px;
  height: 136px;
  transform: translateX(-50%);
}

.candle {
  position: absolute;
  width: 52px;
  height: 112px;
  border: 0;
  cursor: pointer;
  padding: 0;
  background: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
}

.candle-stick {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 12px;
  height: 62px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 210, 164, 0.9), rgba(255, 255, 255, 0.96) 48%, rgba(255, 211, 156, 0.9)),
    linear-gradient(180deg, #ffe9cd, #ffc875);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(22, 16, 44, 0.2);
}

.candle-stick::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  background: rgba(124, 80, 26, 0.86);
  border-radius: 999px;
}

.candle-flame {
  position: absolute;
  left: 50%;
  top: 0;
  width: 18px;
  height: 26px;
  transform: translateX(-50%) scale(0.72);
  opacity: 0.28;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background:
    radial-gradient(circle at 50% 68%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #fff9bf 0%, #ffd36f 38%, #ff9d42 68%, rgba(255, 128, 62, 0.4) 100%);
  filter: drop-shadow(0 0 10px rgba(255, 186, 82, 0.72));
  clip-path: path("M9 0 C14 6 18 12 18 18 C18 23 14 26 9 26 C4 26 0 23 0 18 C0 12 4 6 9 0 Z");
}

.candle.is-lit .candle-flame {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: flameDance 1.2s ease-in-out infinite alternate;
}

.candle.is-lit::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 183, 75, 0.3), transparent 64%);
}

.star-counter {
  align-self: flex-start;
}

.star-falling {
  animation: starDrop linear forwards;
}

.star-falling.is-caught .object-svg--star {
  animation: starCatch 360ms ease forwards;
}

.certificate-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 22px 22px;
  border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)),
    linear-gradient(135deg, rgba(255, 206, 118, 0.2), rgba(123, 150, 255, 0.14), rgba(255, 115, 184, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 22px 50px rgba(0, 0, 0, 0.24);
}

.certificate-card--final {
  flex: 1;
  align-self: stretch;
  margin: 0;
  justify-content: space-between;
}

.final-card-mint {
  padding: 24px 20px 18px;
  background:
    radial-gradient(circle at 15% 18%, rgba(255,255,255,0.46), transparent 22%),
    linear-gradient(180deg, rgba(195, 249, 255, 0.96), rgba(156, 236, 245, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.54),
    0 24px 48px rgba(34, 68, 92, 0.18);
}

.final-card-mint__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 4px 6px 0;
}

.final-card-mint__copy {
  display: grid;
  gap: 16px;
}

.final-card-mint__title,
.final-card-mint__name {
  margin: 0;
  color: #18344d;
  letter-spacing: -0.05em;
  line-height: 0.94;
}

.final-card-mint__title {
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 300;
}

.final-card-mint__name {
  margin-top: -6px;
  font-size: clamp(2.3rem, 8vw, 3.35rem);
  font-weight: 800;
  color: #21145e;
}

.final-card-mint__text {
  margin: 0;
  max-width: 88%;
  color: rgba(18, 51, 72, 0.92);
  font-size: 1rem;
  line-height: 1.36;
}

.final-card-mint__gift {
  display: grid;
  gap: 6px;
}

.final-card-mint__gift-label {
  margin-bottom: 0;
  color: rgba(31, 53, 87, 0.56);
}

.final-card-mint__gift-title {
  margin: 0;
  max-width: 90%;
  color: #1f145e;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.08;
}

.final-card-mint__button {
  margin-top: 38px;
  min-height: 56px;
  color: #f8f4ff;
  background: linear-gradient(135deg, #2b065a, #361068 55%, #3f1574 100%);
  box-shadow: 0 18px 32px rgba(55, 16, 96, 0.28);
}

.final-card-mint__visual {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 264px;
  padding: 0;
  transform: translateY(-34px);
}

.message-stack {
  display: grid;
  gap: 8px;
}

.message-line {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.42;
  font-size: 0.9rem;
}

.preloader-shell {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.loader-core {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 16%),
    conic-gradient(from 180deg, rgba(255, 255, 255, 0.06), rgba(89, 208, 255, 0.44), rgba(255, 115, 184, 0.48), rgba(255, 207, 118, 0.42), rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 0 80px rgba(113, 153, 255, 0.26);
  animation: loaderSpin 2.8s linear infinite;
}

.loader-core::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: rgba(4, 9, 20, 0.76);
  backdrop-filter: blur(12px);
}

.loader-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8d6, #ffbd57);
  transform: translate(-50%, -50%);
  z-index: 1;
  box-shadow: 0 0 30px rgba(255, 189, 87, 0.45);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.scene-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,255,255,0));
  box-shadow: 0 0 18px rgba(255,255,255,0.38);
  animation: sparklePulse 2.4s ease-in-out infinite;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 22px;
  border-radius: 999px;
  opacity: 0.95;
  animation: confettiDrop 1800ms linear forwards;
}

.hidden {
  display: none !important;
}

@keyframes auroraShift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }
}

@keyframes hueFloat {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1.05);
  }
}

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

@keyframes floatOrb {
  0% {
    transform: translate3d(0, 0, 0) rotate(-6deg);
  }
  100% {
    transform: translate3d(10px, -18px, 0) rotate(8deg);
  }
}

@keyframes heroFloat {
  0% {
    transform: translateY(0) rotate(-3deg);
  }
  100% {
    transform: translateY(-16px) rotate(4deg);
  }
}

@keyframes ribbonDrift {
  0% {
    transform: rotate(-24deg) translateY(0);
  }
  100% {
    transform: rotate(-14deg) translateY(-20px);
  }
}

@keyframes giftIdle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes giftReact {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  20% {
    transform: rotate(-4deg) translateY(-4px);
  }
  40% {
    transform: rotate(5deg) translateY(0);
  }
  60% {
    transform: rotate(-3deg) translateY(-2px);
  }
}

@keyframes lidOpen {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-54px) rotate(-16deg);
  }
}

@keyframes balloonFloat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(-1 * var(--float-distance, 620px)));
  }
}

@keyframes balloonWobble {
  0% {
    transform: rotate(-4deg) translateX(0);
  }
  100% {
    transform: rotate(5deg) translateX(4px);
  }
}

@keyframes balloonPop {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
    filter: blur(8px);
  }
}

@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--tx), var(--ty), 0) scale(0.1);
  }
}

@keyframes flameDance {
  0% {
    transform: translateX(-50%) scale(0.96) rotate(-4deg);
  }
  100% {
    transform: translateX(-50%) scale(1.04) rotate(3deg);
  }
}

@keyframes shakeWrong {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(7px);
  }
  75% {
    transform: translateX(-5px);
  }
}

@keyframes giftPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes starDrop {
  from {
    transform: translateY(0) rotate(0deg);
  }
  to {
    transform: translateY(var(--fall-distance, 540px)) rotate(180deg);
  }
}

@keyframes starCatch {
  0% {
    opacity: 1;
    transform: scale(1) rotate(12deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.45) rotate(42deg);
  }
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sparklePulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes confettiDrop {
  0% {
    opacity: 1;
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }
  100% {
    opacity: 0.95;
    transform: translate3d(var(--drift), 110vh, 0) rotate(680deg);
  }
}

@media (max-width: 430px) {
  #app {
    padding: 6px 10px 10px;
  }

  .scene {
    height: calc(100dvh - 16px);
  }

  .game-stage {
    min-height: 220px;
  }

  .hero-card__visual {
    min-height: clamp(250px, 33vh, 330px);
  }

  .hero-balloons,
  .hero-cluster {
    height: 396px;
  }

  .welcome-content {
    min-height: auto;
  }

  .welcome-copy {
    margin-top: 0;
  }

  .welcome-title {
    font-size: clamp(2rem, 7.4vw, 3.3rem);
  }

  .welcome-subtitle {
    font-size: 0.96rem;
    line-height: 1.36;
    width: min(100%, 29ch);
  }

  .show-balloon {
    width: 138px;
    height: 270px;
  }

  .asset-image--balloon-show {
    width: 134px;
    height: 262px;
  }

  .asset-image--welcome-cluster {
    width: clamp(257px, 79.2vw, 350px);
    max-height: 374px;
  }

  .object-svg--gift-hero {
    width: 232px;
  }

  .gift-option {
    min-height: 98px;
  }

  .asset-image--gift-option {
    width: 114px;
  }

  .asset-image--cake {
    width: 228px;
  }

  .certificate-card {
    gap: 16px;
    padding: 22px 18px 18px;
  }

  .final-card-mint {
    padding: 20px 16px 14px;
  }

  .final-card-mint__title {
    font-size: clamp(1.84rem, 6.8vw, 2.5rem);
  }

  .final-card-mint__name {
    font-size: clamp(2.1rem, 7.8vw, 2.95rem);
  }

  .final-card-mint__text {
    max-width: 92%;
    font-size: 0.94rem;
  }

  .final-card-mint__gift-title {
    font-size: 1.08rem;
  }

  .final-card-mint__visual {
    min-height: 238px;
    transform: translateY(-28px);
  }

  .asset-image--balloon-cluster {
    width: min(100%, 244px);
    max-height: 316px;
  }

  .candle-row {
    top: 38px;
    width: 190px;
    height: 126px;
  }

  .candle {
    width: 46px;
    height: 104px;
  }

  .candle-stick {
    height: 54px;
  }
}

@media (max-width: 430px) and (max-height: 820px) {
  .glass-card.hero-card {
    border-radius: 28px;
  }

  .hero-card__visual {
    min-height: clamp(220px, 28vh, 280px);
    padding-top: 4px;
  }

  .hero-balloons,
  .hero-cluster {
    height: 326px;
  }

  .hero-cluster {
    width: min(100%, 324px);
    min-height: 264px;
  }

  .asset-image--welcome-cluster {
    width: clamp(235px, 72vw, 298px);
    max-height: 302px;
  }

  .welcome-content {
    padding: 0 16px 14px;
  }

  .welcome-title {
    font-size: clamp(1.74rem, 6.8vw, 2.6rem);
    line-height: 0.96;
  }

  .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
  }

  .welcome-subtitle {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.28;
    width: min(100%, 27ch);
  }

  .hero-card__content .button-row {
    margin-top: 10px;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
    padding: 14px 16px;
    font-size: 0.96rem;
  }
}

@media (min-width: 431px) {
  .page-shell {
    padding: 0 24px;
  }

  .phone-frame {
    min-height: 100vh;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

@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;
  }
}
