:root {
  --sky: #5eb8e0;
  --melon-pink: #ff6b9d;
  --melon-green: #7dff9a;
  --cream: #fff6e8;
  --ink: #1a1c2c;
  --coin-gold: #ffd166;
  --liability: #ff6b6b;
  --sonic-blue: #4cc9f0;
  --cabinet: #ff4d6d;
  --cabinet-deep: #c9184a;
  --shadow: rgba(10, 12, 24, 0.45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: var(--font-game, "Nunito", system-ui, sans-serif);
  color: var(--cream);
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1020;
}

/* Blazor root must fill the viewport or % heights below collapse. */
#app {
  height: 100dvh;
  height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-shell {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #07090f;
}

/*
  Portrait arcade — one column, full viewport height.
  Layer stack: #app → game-shell → phone-frame → arcade-enter → stage → cabinet
*/
.phone-frame {
  position: relative;
  width: min(100vw, 430px);
  height: 100%;
  min-height: 0;
  flex: 0 0 auto;
  align-self: stretch;
  outline: none;
  overflow: hidden;
  background: #0d1020;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.phone-frame > .gift-cinematic {
  flex: 1 1 0;
  min-height: 0;
}

.phone-frame > .arcade-enter {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ClawCabinet root */
.phone-frame .stage {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  outline: none;
  overflow: hidden;
}

.stage .cabinet {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* —— Gift box → Sonic → claw reveal —— */
.gift-cinematic {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, #7ec8f0 0%, transparent 55%),
    linear-gradient(180deg, #3d8fd4 0%, #2b6fad 45%, #1e4f86 100%);
  animation: giftFadeIn 0.55s ease;
  cursor: pointer;
}

.gift-cinematic.phase-opening {
  pointer-events: none;
}

/* Full-bleed soft blue present */
.gift-screen-box {
  position: relative;
  width: min(88vw, 360px);
  height: min(72dvh, 520px);
  max-height: calc(100dvh - 96px);
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.gift-soft-shadow {
  position: absolute;
  inset: 8% 6% -4%;
  border-radius: 48px;
  background: radial-gradient(ellipse at 50% 100%, rgba(10, 30, 60, 0.45), transparent 70%);
  filter: blur(8px);
  z-index: 0;
}

.gift-face {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  background:
    linear-gradient(165deg, #6eb6ef 0%, #3a8fd9 42%, #2f78c4 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -10px 24px rgba(20, 60, 110, 0.28),
    0 22px 48px rgba(12, 40, 80, 0.35);
  overflow: hidden;
}

.gift-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.08) 28%,
    transparent 48%
  );
  pointer-events: none;
}

.ribbon-wrap {
  position: absolute;
  background: linear-gradient(180deg, #ffe9a8 0%, #ffd166 45%, #f0b429 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(180, 120, 20, 0.25);
  z-index: 2;
}

.ribbon-wrap.ribbon-v {
  left: 50%;
  top: 0;
  bottom: 0;
  width: clamp(36px, 12vw, 52px);
  transform: translateX(-50%);
  border-radius: 0;
}

.ribbon-wrap.ribbon-h {
  left: 0;
  right: 0;
  top: 48%;
  height: clamp(36px, 12vw, 52px);
  transform: translateY(-50%);
}

.gift-bow {
  position: absolute;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  width: clamp(110px, 36vw, 150px);
  height: 88px;
  z-index: 3;
  filter: drop-shadow(0 6px 10px rgba(120, 80, 0, 0.25));
}

.bow-loop {
  position: absolute;
  top: 10px;
  width: 54px;
  height: 42px;
  background: radial-gradient(circle at 35% 35%, #fff1b8, #ffd166 55%, #e8a820);
  border-radius: 50%;
  box-shadow: inset 0 -5px 0 rgba(180, 120, 10, 0.18);
}

.bow-loop.left {
  left: 4px;
  transform: rotate(-28deg);
}

.bow-loop.right {
  right: 4px;
  transform: rotate(28deg);
}

.bow-knot {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  background: radial-gradient(circle at 40% 30%, #ffe08a, #f0b429);
  border-radius: 10px;
  box-shadow: 0 3px 0 #d49a12;
  z-index: 2;
}

.bow-tail {
  position: absolute;
  top: 44px;
  width: 22px;
  height: 40px;
  background: linear-gradient(180deg, #ffd166, #e8a820);
  border-radius: 0 0 6px 6px;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
  z-index: 1;
}

.bow-tail.left {
  left: 42%;
  transform: translateX(-100%) rotate(12deg);
}

.bow-tail.right {
  left: 58%;
  transform: rotate(-12deg);
}

.gift-screen-box.is-shaking {
  animation: giftShake 2.4s ease-in-out infinite;
}

.gift-screen-box.is-opening .gift-face {
  animation: giftUnwrap 0.85s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

.gift-screen-box.is-opening .gift-bow {
  animation: bowFly 0.7s ease forwards;
}

.gift-screen-box.is-opening .ribbon-wrap.ribbon-h {
  animation: ribbonPeelH 0.75s ease forwards;
}

.gift-screen-box.is-opening .ribbon-wrap.ribbon-v {
  animation: ribbonPeelV 0.75s ease forwards;
}

.gift-tap-hint {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #1e4f86;
  background: rgba(255, 246, 232, 0.92);
  box-shadow: 0 8px 24px rgba(12, 40, 80, 0.22);
  animation: hintPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}

.gift-tap-hint.soft {
  position: static;
  transform: none;
  margin-top: 20px;
  color: #fff6e8;
  background: rgba(20, 50, 90, 0.35);
  animation: hintPulse 1.5s ease-in-out infinite;
}

/* Sonic birthday beat */
.sonic-reveal {
  width: min(100%, 400px);
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: giftFadeIn 0.4s ease;
}

.sonic-stage {
  position: relative;
  width: 100%;
  min-height: 340px;
  display: grid;
  place-items: center;
}

.sonic-jump {
  display: flex;
  justify-content: center;
  width: min(58vw, 220px);
  margin-inline: auto;
}

.sonic-jump .toy-art,
.sonic-jump img,
.sonic-jump svg {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(10, 40, 80, 0.35));
  animation: sonicJumpIn 0.75s cubic-bezier(0.2, 1.2, 0.35, 1) both;
  user-select: none;
  -webkit-user-drag: none;
}

.sonic-speech {
  position: relative;
  margin-top: -8px;
  max-width: 320px;
  padding: 18px 20px 16px;
  border-radius: 22px;
  background: rgba(255, 246, 232, 0.96);
  color: #1a1c2c;
  box-shadow: 0 16px 40px rgba(12, 40, 80, 0.28);
  animation: speechPop 0.45s ease 0.35s both;
}

.sonic-speech::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: rgba(255, 246, 232, 0.96);
}

.speech-hi {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #2b6fad;
}

.speech-from {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #e6396b;
}

.speech-gift {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1c2c;
}

@keyframes giftFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes giftShake {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  15% {
    transform: translate3d(-2px, 1px, 0) rotate(-0.6deg);
  }
  30% {
    transform: translate3d(2px, -1px, 0) rotate(0.6deg);
  }
  45% {
    transform: translate3d(-1.5px, 0, 0) rotate(-0.4deg);
  }
  60% {
    transform: translate3d(1.5px, 1px, 0) rotate(0.4deg);
  }
  75% {
    transform: translate3d(-1px, -1px, 0) rotate(-0.3deg);
  }
}

@keyframes giftUnwrap {
  0% {
    transform: scale(1);
    filter: brightness(1);
    opacity: 1;
  }
  55% {
    transform: scale(1.06);
    filter: brightness(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.2) translateY(40px);
    filter: brightness(1.4);
    opacity: 0;
    border-radius: 60px;
  }
}

@keyframes bowFly {
  to {
    transform: translate(-50%, -120px) rotate(-18deg) scale(1.2);
    opacity: 0;
  }
}

@keyframes ribbonPeelH {
  to {
    transform: translateY(-50%) scaleX(0.2);
    opacity: 0;
  }
}

@keyframes ribbonPeelV {
  to {
    transform: translateX(-50%) scaleY(0.2);
    opacity: 0;
  }
}

@keyframes sonicJumpIn {
  0% {
    transform: translateY(120%) scale(0.4);
    opacity: 0;
  }
  55% {
    transform: translateY(-18%) scale(1.08);
    opacity: 1;
  }
  75% {
    transform: translateY(6%) scale(0.97);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes speechPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes hintPulse {
  50% {
    opacity: 0.65;
  }
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 120%, #3d1a4a 0%, transparent 55%),
    radial-gradient(ellipse at 10% 10%, #1b3a5f 0%, transparent 40%),
    radial-gradient(ellipse at 90% 20%, #4a1d3a 0%, transparent 40%),
    linear-gradient(180deg, #12152b 0%, #0d1020 100%);
}

.neon {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: pulse 6s ease-in-out infinite;
}

.neon-a {
  width: 50vw;
  height: 50vw;
  left: -10%;
  top: 20%;
  background: #ff4d6d;
}

.neon-b {
  width: 45vw;
  height: 45vw;
  right: -8%;
  top: 5%;
  background: #4cc9f0;
  animation-delay: -3s;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff8, transparent),
    radial-gradient(2px 2px at 70% 20%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, #fff4, transparent),
    radial-gradient(2px 2px at 55% 40%, #ffd16688, transparent);
  animation: drift 20s linear infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(1.08);
  }
}

@keyframes drift {
  to {
    transform: translateY(-2%);
  }
}

.hud-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px 0;
  pointer-events: none;
  flex-shrink: 0;
}

.hud-bar.is-playing {
  padding-top: 6px;
}

.hud-bar.is-playing .brand-block h1 {
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
}

.hud-bar.is-playing .brand-tag {
  font-size: 0.78rem;
}

.hud-bar * {
  pointer-events: auto;
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.brand-block p,
.brand-tag {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 246, 232, 0.82);
  line-height: 1.2;
}

.brand-block p {
  color: var(--coin-gold);
}

.hud-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  max-width: 58%;
}

.pill {
  background: rgba(255, 246, 232, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: var(--cream);
  box-shadow: 0 4px 16px var(--shadow);
}

.pill.gold {
  background: linear-gradient(180deg, #ffe08a, #ffc233);
  color: var(--ink);
  border-color: transparent;
}

.pill .pop {
  display: inline-block;
  animation: coinPop 0.35s ease;
}

@keyframes coinPop {
  40% {
    transform: scale(1.4);
  }
}

.icon-btn {
  min-height: 44px;
  min-width: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
  box-shadow: none;
  color: var(--cream);
}

.cabinet {
  position: relative;
  z-index: 1;
  margin: 4px 8px calc(6px + var(--safe-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  border-radius: 26px 26px 20px 20px;
  background: linear-gradient(180deg, #ff7a92 0%, var(--cabinet) 35%, var(--cabinet-deep) 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.15),
    0 20px 60px var(--shadow),
    inset 0 2px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.cabinet-top {
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 4px;
}

.viewport-wrap {
  grid-row: 2;
  min-height: 0;
  overflow: hidden;
  margin: 6px 10px 0;
}

.cabinet-base {
  grid-row: 3;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.15));
}

.cabinet-sign {
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--coin-gold);
  background: #1a1c2c;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.35);
}

.speaker {
  height: 10px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    #1a1c2c 0 3px,
    #3a3d52 3px 6px
  );
  opacity: 0.7;
  margin: 0 8px;
}

.viewport {
  position: relative;
  height: 100%;
  width: 100%;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 25%),
    linear-gradient(180deg, #9ad8f0 0%, #5eb8e0 45%, #3a9fc9 100%);
  box-shadow: inset 0 0 40px rgba(0, 40, 80, 0.2);
}

.glass-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.35) 0%, transparent 35%, transparent 65%, rgba(255, 255, 255, 0.08) 100%);
  pointer-events: none;
  z-index: 6;
}

.glass-frame {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  pointer-events: none;
  z-index: 7;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.15);
}

.playfield-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  background: linear-gradient(180deg, #e8c9a0, #c9a07a);
  z-index: 1;
}

.playfield-floor::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20%;
  height: 100%;
  background: linear-gradient(180deg, rgba(55, 38, 24, 0.18), rgba(35, 24, 14, 0.32));
  border-left: 2px dashed rgba(70, 48, 28, 0.45);
  pointer-events: none;
}

.floor-grid {
  position: absolute;
  inset: 0;
  right: 18%;
  opacity: 1;
  /* 6 play lanes — toys stop at 72%; chute zone stays clear on the right */
  background-image:
    linear-gradient(90deg, transparent 11.5%, rgba(80, 50, 30, 0.35) 12%, transparent 12.8%),
    linear-gradient(90deg, transparent 23.5%, rgba(80, 50, 30, 0.35) 24.5%, transparent 25.3%),
    linear-gradient(90deg, transparent 35.5%, rgba(80, 50, 30, 0.35) 36.5%, transparent 37.3%),
    linear-gradient(90deg, transparent 47.5%, rgba(80, 50, 30, 0.35) 48.5%, transparent 49.3%),
    linear-gradient(90deg, transparent 59.5%, rgba(80, 50, 30, 0.35) 60.5%, transparent 61.3%),
    linear-gradient(90deg, transparent 71.5%, rgba(80, 50, 30, 0.35) 72.5%, transparent 73.3%);
}

.floor-grid-label {
  position: absolute;
  left: 41%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 246, 232, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

.cabinet.is-playing .floor-grid-label {
  display: none;
}

.claw-drop-line {
  position: absolute;
  top: 18%;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.15), rgba(255, 209, 102, 0.65));
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.35);
}

.prize-chute {
  position: absolute;
  right: 6%;
  bottom: 8%;
  width: 52px;
  height: 38px;
  background: #3d2f24;
  border-radius: 10px 10px 4px 4px;
  z-index: 4;
  display: grid;
  place-items: center;
  box-shadow: inset 0 10px 14px rgba(0, 0, 0, 0.45);
  color: #ffd166;
  font-size: 0.65rem;
  font-weight: 800;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.prize-chute.is-flash {
  box-shadow:
    inset 0 10px 14px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(255, 209, 102, 0.85);
  transform: scale(1.06);
}

.claw-rail {
  position: absolute;
  top: 10px;
  left: 6%;
  right: 6%;
  height: 8px;
  background: linear-gradient(180deg, #cfd8e3, #8b95a5);
  border-radius: 4px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.claw-arm {
  position: absolute;
  top: 14px;
  width: 5px;
  height: 32px;
  background: linear-gradient(90deg, #9aa3ad, #6c757d);
  transform: translateX(-50%);
  transition: height 0.65s ease-in-out, left 0.08s linear;
  z-index: 4;
}

.cabinet.is-homing .claw-arm,
.cabinet.is-homing .claw-head,
.cabinet.is-delivering .claw-arm,
.cabinet.is-delivering .claw-head {
  transition:
    left 0.48s ease-in-out,
    height 0.55s ease-in-out,
    top 0.55s ease-in-out;
}

.claw-arm.dropping {
  height: 62%;
}

.claw-arm.lifting {
  height: 32px;
  transition-duration: 0.55s;
}

.claw-head {
  position: absolute;
  top: 42px;
  width: 52px;
  height: 32px;
  transform: translateX(-50%);
  z-index: 5;
  transition: top 0.65s ease-in-out, left 0.08s linear;
}

.toy-held {
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translate(-50%, 0);
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.toy-delivering {
  z-index: 8;
  transform: translate(-50%, -50%);
  transition: left 0.03s linear, top 0.03s linear;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.aim-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin-top: -16px;
  border: 3px solid #ffd166;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.75), inset 0 0 10px rgba(255, 209, 102, 0.35);
  pointer-events: none;
  animation: aimPulse 0.7s ease-in-out infinite;
}

.claw-head.locked .claw-shape::before,
.claw-head.locked .claw-shape::after {
  border-color: #fff6e8;
  filter: drop-shadow(0 0 4px #ffd166);
}

@keyframes aimPulse {
  50% {
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.95), inset 0 0 12px rgba(255, 209, 102, 0.45);
  }
}

.grab-sparkles {
  position: absolute;
  top: 55%;
  width: 0;
  height: 0;
  z-index: 8;
  transform: translateX(-50%);
  pointer-events: none;
}

.grab-sparkles span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 8px #fff;
  animation: sparkOut 0.55s ease-out forwards;
  transform: rotate(var(--a)) translateY(-8px);
}

@keyframes sparkOut {
  to {
    transform: rotate(var(--a)) translateY(-42px) scale(0.2);
    opacity: 0;
  }
}

.stage.punch .cabinet,
.cabinet.punch {
  animation: screenPunch 0.28s ease;
}

@keyframes screenPunch {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

.cabinet.is-dropping .claw-head {
  top: calc(62% + 8px);
}

.cabinet.is-lifting .claw-head {
  top: 42px;
  transition-duration: 0.55s;
}

.claw-shape {
  position: relative;
  width: 52px;
  height: 32px;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}

.claw-shape::before,
.claw-shape::after {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 28px;
  border: 3px solid #ffd166;
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.55), rgba(255, 209, 102, 0.15));
  border-radius: 4px 4px 12px 12px;
  transition: transform 0.2s ease;
}

.claw-shape::before {
  left: 5px;
  transform: rotate(14deg);
}

.claw-shape::after {
  right: 5px;
  transform: rotate(-14deg);
}

.claw-arm.closed + .claw-head .claw-shape::before {
  transform: rotate(-10deg) translateX(5px);
}

.claw-arm.closed + .claw-head .claw-shape::after {
  transform: rotate(10deg) translateX(-5px);
}

.toys {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.toy {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(var(--scale, 1));
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.toy .toy-sprite {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 18%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.35), transparent 55%);
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.toy .toy-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
  z-index: -1;
}

.toy.idle-0 {
  animation: bob 2.4s ease-in-out infinite;
}
.toy.idle-1 {
  animation: bob 2.8s ease-in-out infinite 0.3s;
}
.toy.idle-2 {
  animation: bob 2.2s ease-in-out infinite 0.6s;
}
.toy.idle-3 {
  animation: bob 3s ease-in-out infinite 0.15s;
}

@keyframes bob {
  50% {
    transform: translate(-50%, calc(-50% - 4px));
  }
}

.toy.caught {
  opacity: 0;
  transform: translate(-50%, -90%) scale(0.35);
  animation: none;
}

.toy-liability {
  outline: 2px dashed rgba(255, 107, 107, 0.85);
  outline-offset: 3px;
  border-radius: 16px;
}

.toy-birthday .toy-glow {
  background: radial-gradient(circle, rgba(255, 209, 102, 0.55), transparent 70%);
}

.mission-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.92);
  color: #3b2200;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toy.mission-target {
  z-index: 5;
  filter: drop-shadow(0 0 12px rgba(255, 196, 77, 0.95)) drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
}

.toy.mission-target .toy-glow {
  inset: -10px;
  background: radial-gradient(circle, rgba(255, 220, 120, 0.75), transparent 72%);
  animation: missionGlow 1.4s ease-in-out infinite;
}

.toy.mission-target::before {
  content: "🎯";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.toy.mission-decoy {
  opacity: 0.72;
  filter: saturate(0.75) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.2));
}

@keyframes missionGlow {
  50% {
    opacity: 0.65;
    transform: scale(1.06);
  }
}

.toy.targeted {
  z-index: 6;
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.85)) drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
  transform: translate(-50%, -50%) scale(1.08);
}

.toy.targeted .toy-glow {
  background: radial-gradient(circle, rgba(255, 209, 102, 0.7), transparent 70%);
  inset: -12px;
}

.toy.targeted::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 209, 102, 0.85);
  animation: aimPulse 0.7s ease-in-out infinite;
}

.status-line {
  margin: 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--cream);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  min-height: 1.2em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.start-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(26, 28, 44, 0.35);
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.start-panel .btn-play {
  min-height: 52px;
  margin-top: 2px;
}

.btn-play-start {
  animation: play-pulse 1.6s ease-in-out infinite;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

@keyframes play-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); }
  50% { transform: scale(1.03); box-shadow: 0 8px 20px rgba(255, 196, 77, 0.45); }
}

.start-level {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.start-goal {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--coin-gold);
}

.start-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 246, 232, 0.75);
}

.level-picker {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.level-pick {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff8ef;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.level-pick.is-selected {
  border-color: var(--coin-gold);
  background: rgba(255, 209, 102, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25);
}

.level-pick.is-locked,
.level-pick:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.level-pick-stars {
  font-size: 0.55rem;
  color: var(--coin-gold);
  letter-spacing: -0.05em;
}

.lesson-hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffd166;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 800;
}

.legend span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.legend .a {
  outline: 2px solid var(--melon-green);
}
.legend .l {
  outline: 2px solid var(--liability);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 8px;
}

.cabinet.is-playing .btn-move,
.cabinet.is-playing .btn-drop,
.cabinet.is-playing .btn-grip {
  min-height: 52px;
  font-size: 1.05rem;
}

.control-hint {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 246, 232, 0.7);
  letter-spacing: 0.02em;
}

button {
  font: inherit;
  font-weight: 800;
  border: none;
  cursor: pointer;
  border-radius: 18px;
  min-height: 58px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  color: var(--ink);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

button:disabled {
  opacity: 0.45;
}

.btn-move {
  background: linear-gradient(180deg, #6ed3ff, var(--sonic-blue));
  color: white;
  font-size: 1.5rem;
}

.btn-drop {
  background: linear-gradient(180deg, #ff9ebb, var(--melon-pink));
  color: white;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.btn-grip {
  background: linear-gradient(180deg, #ffb347, #ff6b35);
  color: white;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  animation: grip-pulse 0.45s ease-in-out infinite alternate;
}

.grip-meter {
  margin-top: 10px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.grip-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb347, #ff6b35);
  transition: width 0.08s linear;
}

.grip-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.88;
  text-align: center;
}

.pill.aim {
  background: rgba(255, 255, 255, 0.18);
  font-variant-numeric: tabular-nums;
}

@keyframes grip-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.btn-play {
  width: 100%;
  background: linear-gradient(180deg, #ffe08a, var(--coin-gold));
  font-size: 1.1rem;
  min-height: 60px;
  color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 20, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

.modal-card {
  width: min(380px, 100%);
  background: linear-gradient(180deg, #fff8ee, #ffe8d2);
  color: var(--ink);
  border-radius: 28px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 3px solid rgba(255, 255, 255, 0.7);
}

.modal-card.liability {
  border-color: #ffb3b3;
}

.modal-card.levelclear,
.modal-card.savegoal {
  border-color: #ffd166;
  background: linear-gradient(180deg, #fff9e6, #ffeab0);
  box-shadow:
    0 0 0 4px rgba(255, 209, 102, 0.25),
    0 24px 60px rgba(255, 193, 7, 0.35);
  position: relative;
  overflow: hidden;
}

.modal-card.levelclear::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: conic-gradient(from 180deg, transparent, rgba(255, 209, 102, 0.18), transparent 55%);
  animation: stage-glow 4s linear infinite;
  pointer-events: none;
}

.modal-screen-win .modal-card {
  animation: stage-pop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes stage-glow {
  to { transform: rotate(360deg); }
}

@keyframes stage-pop {
  from { transform: scale(0.88) translateY(12px); opacity: 0.6; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-card.levelfail {
  border-color: #ffb347;
  background: linear-gradient(180deg, #fff5ee, #ffe0cc);
}

.modal-card.asset,
.modal-card.birthday {
  border-color: #9ee493;
}

.screen-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 999px;
}

.screen-badge-win {
  background: linear-gradient(90deg, #ffd166, #ff9f1c);
  color: #3b2200;
}

.screen-badge-retry {
  background: #ffb347;
  color: #3b2200;
}

.screen-stars {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--coin-gold);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 #b8860b, 0 0 12px rgba(255, 209, 102, 0.45);
  position: relative;
  z-index: 1;
}

.screen-perf {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.82;
  position: relative;
  z-index: 1;
}

.stage-unlock-card {
  width: 100%;
  margin-top: 4px;
  padding: 14px 16px 16px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 236, 179, 0.85));
  border: 2px solid rgba(255, 196, 77, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(255, 159, 28, 0.22);
}

.stage-unlock-champion {
  background: linear-gradient(145deg, #fff6cc, #ffe08a);
  border-color: #ffd166;
}

.stage-unlock-arrow {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ff9f1c;
  animation: stage-arrow 1.1s ease-in-out infinite;
  margin-bottom: 2px;
}

@keyframes stage-arrow {
  0%, 100% { transform: translateX(-4px); opacity: 0.75; }
  50% { transform: translateX(6px); opacity: 1; }
}

.stage-unlock-level {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 900;
  color: #3b2200;
  background: linear-gradient(180deg, #ffe08a, #ffb347);
  box-shadow: 0 4px 0 #c97a12, 0 8px 20px rgba(201, 122, 18, 0.35);
}

.stage-unlock-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
}

.stage-unlock-head {
  font-size: 1.05rem;
  font-weight: 900;
  color: #3b2200;
  margin-bottom: 4px;
}

.stage-unlock-goal {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: #5c3d00;
}

.pill.drops {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  font-weight: 800;
  min-width: 3.2rem;
}

.screen-next-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
}

.screen-next-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}

.screen-goal {
  font-size: 1rem;
  font-weight: 800;
  color: #8b4513;
}

.screen-encourage {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.btn-next-level {
  background: linear-gradient(180deg, #b8f284, #7bc950);
}

.btn-retry-level {
  background: linear-gradient(180deg, #ffd6a5, #ffb347);
}

.modal-art {
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
}

.modal-card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.kind {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
}

.kind.asset,
.kind.birthday {
  background: var(--melon-green);
  color: var(--ink);
}

.kind.liability {
  background: var(--liability);
  color: white;
}

.kind.miss {
  background: #ddd;
}

.modal-coins {
  font-size: 1.45rem;
  font-weight: 800;
  color: #9a6b00;
}

.modal-lesson {
  margin: 4px 0 8px;
  font-weight: 700;
  line-height: 1.35;
}

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

.confetti i {
  position: absolute;
  top: -14px;
  animation: confettiBurst var(--dur, 0.7s) cubic-bezier(0.15, 0.75, 0.35, 1) forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0.95;
}

.confetti i.rect {
  width: 8px;
  height: 14px;
  border-radius: 2px;
}

.confetti i.sq {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.confetti i.ribbon {
  width: 4px;
  height: 16px;
  border-radius: 99px;
}

.confetti.lite i {
  /* sparse mid burst */
}

.confetti.epic i {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
}

@keyframes confettiBurst {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--dx, 0px), 85dvh, 0) rotate(var(--spin, 360deg)) scale(0.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none !important;
  }
}

#blazor-error-ui {
  display: none;
}

.arcade-enter.is-revealing {
  animation: arcadeReveal 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes arcadeReveal {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(24px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .neon,
  .stars,
  .toy,
  .gift-screen-box,
  .sonic-jump,
  .sonic-speech,
  .gift-tap-hint,
  .arcade-enter,
  .confetti i {
    animation: none !important;
  }
}

/* Tablet portrait / large phone */
@media (min-width: 600px) {
  .phone-frame {
    width: min(100vw, 520px);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.08);
  }

  .btn-move,
  .btn-drop,
  .btn-play {
    min-height: 64px;
    font-size: 1.25rem;
  }

  .toy .toy-art {
    width: 80px !important;
    height: 80px !important;
  }

  .gift-screen-box {
    width: min(70vw, 400px);
    height: min(68dvh, 560px);
  }

  .sonic-jump {
    width: min(42vw, 240px);
  }
}

/* iPad / big tablet */
@media (min-width: 768px) {
  .phone-frame {
    width: min(100vw, 600px);
  }

  .hud-bar {
    padding: 14px 18px 0;
  }

  .brand-block h1 {
    font-size: 1.9rem;
  }

  .controls {
    gap: 14px;
  }

  .btn-move,
  .btn-drop {
    min-height: 72px;
    border-radius: 22px;
  }

  .control-hint {
    font-size: 0.85rem;
  }
}

/* Landscape tablet: keep a tall cabinet centered, don't go 16:9 full-bleed */
@media (orientation: landscape) and (min-width: 700px) {
  .phone-frame {
    width: min(48vw, 480px);
  }

  .control-hint {
    display: block;
  }
}

/* Narrow phones */
@media (max-width: 380px) {
  .brand-block h1 {
    font-size: 1.2rem;
  }

  .pill {
    padding: 6px 9px;
    font-size: 0.85rem;
  }

  .btn-move,
  .btn-drop {
    min-height: 52px;
  }

  .control-hint {
    font-size: 0.65rem;
  }
}

.pill.goal {
  background: rgba(255, 255, 255, 0.16);
  max-width: 9.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 20, 0.55);
  z-index: 35;
}

.collection-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(420px, 100%);
  max-height: min(78vh, 640px);
  background: linear-gradient(180deg, #fff8f0, #ffe4cf);
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  z-index: 36;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 22px;
}

.collection-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
  margin-bottom: 12px;
}

.collection-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.collection-head p {
  grid-column: 1 / -1;
  margin: 0;
  opacity: 0.78;
  font-size: 0.9rem;
}

.collection-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.collection-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.collection-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe08a, #ffb347);
  transition: width 0.35s ease;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding-bottom: 8px;
}

.collection-slot {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 8px 6px 10px;
  text-align: center;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.collection-slot.locked {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.collection-slot.got {
  box-shadow: inset 0 0 0 2px rgba(255, 196, 77, 0.85);
}

.collection-name {
  font-size: 0.68rem;
  line-height: 1.15;
  font-weight: 800;
}

.collection-tag {
  font-size: 0.58rem;
  font-weight: 800;
  color: #0a7a45;
}

.collection-tag-bonus {
  color: #b8860b;
}

.collection-tag-locked {
  color: rgba(0, 0, 0, 0.35);
}

.collection-tag-asset {
  color: #0a7a45;
}

.collection-foot {
  margin: 10px 0 0;
  font-size: 0.78rem;
  opacity: 0.75;
  text-align: center;
}

.howto-backdrop,
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
}

.howto-backdrop {
  background: rgba(8, 10, 20, 0.55);
}

.howto-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 24px));
  background: linear-gradient(180deg, #fff8f0, #ffe4cf);
  color: var(--ink);
  border-radius: 24px;
  padding: 22px 18px;
  z-index: 46;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.howto-panel h2 {
  margin: 0 0 12px;
  text-align: center;
}

.howto-list {
  margin: 0 0 12px;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.howto-foot {
  margin: 0 0 14px;
  font-size: 0.8rem;
  opacity: 0.85;
  text-align: center;
}

.pause-overlay {
  background: rgba(8, 10, 20, 0.45);
  display: grid;
  place-items: center;
  gap: 12px;
  pointer-events: none;
}

.pause-overlay p {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.pause-overlay .btn-play {
  pointer-events: auto;
  width: auto;
  min-width: 160px;
  padding: 0 24px;
}

.goal-track {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 6px;
}

.goal-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 209, 102, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
}

.goal-dot.is-on {
  background: linear-gradient(180deg, #ffe08a, #ffb347);
  border-color: #ffd166;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.65);
}

.goal-track-hunt .goal-icon {
  font-size: 1.6rem;
  filter: grayscale(0.35) opacity(0.65);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.goal-track-hunt .goal-icon.is-on {
  filter: none;
  transform: scale(1.2);
  animation: goal-pop 0.45s ease;
}

@keyframes goal-pop {
  0% { transform: scale(0.7); }
  70% { transform: scale(1.25); }
  100% { transform: scale(1.2); }
}

.modal-card.asset .modal-art,
.modal-card.birthday .modal-art {
  animation: catch-pop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes catch-pop {
  from { transform: scale(0.6) rotate(-8deg); opacity: 0.5; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-screen-catch .modal-card.miss {
  animation: stage-pop 0.35s ease;
}

.howto-icons {
  list-style: none;
  padding-left: 0;
}

.howto-icons li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.howto-emoji {
  font-size: 1.25rem;
  line-height: 1.2;
  flex-shrink: 0;
}
