:root {
  --ink: #3a3156;
  --sky-top: #a9dcff;
  --sky-bot: #eaf7ff;
  --grass: #7ccb5b;
  --grass-edge: #5fb042;
  --gold: #ffc533;
  --accent: #ff8a3d;
  --lift: 0 5px 0 rgba(58, 49, 86, .14);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #8ccdf3;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

#app {
  position: relative; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto;
  overflow: hidden; box-shadow: 0 0 40px rgba(0, 0, 0, .12);
}
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(28px 18px at 14% 9%, #fff 98%, transparent) ,
    radial-gradient(34px 22px at 21% 7%, #fff 98%, transparent),
    radial-gradient(26px 16px at 80% 15%, rgba(255,255,255,.9) 98%, transparent),
    radial-gradient(36px 22px at 88% 13%, rgba(255,255,255,.9) 98%, transparent),
    linear-gradient(var(--sky-top), var(--sky-bot) 75%);
}

/* ---------- 通用控件 ---------- */
.ic { display: grid; place-items: center; }
.ic svg { width: 30px; height: 30px; display: block; }
.btn-icon {
  flex: none; width: 58px; height: 58px; border-radius: 20px; background: #fff;
  box-shadow: var(--lift); display: grid; place-items: center; transition: transform .1s, box-shadow .1s;
}
.btn-icon:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(58, 49, 86, .14); }
.btn-icon.primary { background: var(--accent); color: #fff; box-shadow: 0 5px 0 #d9662a; }
.hold { --p: 0; box-shadow: var(--lift), 0 0 0 calc(var(--p) * 10px) rgba(255, 138, 61, .55); }
.btn-text {
  font-size: 17px; font-weight: 700; padding: 12px 20px; border-radius: 16px;
  background: #eef2f8; box-shadow: 0 3px 0 rgba(58, 49, 86, .12);
}
.btn-text.danger { color: #c2410c; background: #fff1e8; }
.spacer { width: 58px; flex: none; }

.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 4px; position: relative; z-index: 5; }
.bubble {
  flex: 1; min-width: 0; min-height: 58px; padding: 8px 14px; border-radius: 20px; background: #fff;
  box-shadow: var(--lift); display: flex; align-items: center; font-size: 17px; line-height: 1.35; font-weight: 600;
}
.bubble:empty { visibility: hidden; }
.bubble.pop { animation: pop .3s ease; }
.dots { display: flex; justify-content: center; align-items: center; gap: 9px; height: 22px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .6); border: 2px solid #fff; transition: all .3s; }
.dot.current { background: var(--gold); transform: scale(1.3); }
.dot.done { background: var(--grass); }

.toast {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 300;
  background: rgba(58, 49, 86, .88); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 15px;
  animation: pop .25s ease;
}

/* ---------- 积木角色 ---------- */
.nb { --b: 48px; display: inline-flex; flex-direction: column; align-items: center; position: relative; touch-action: none; }
.nb-anim {
  display: flex; flex-direction: column; align-items: center; transform-origin: 50% 100%;
  animation: idle 3.2s ease-in-out infinite;
}
.nb-num {
  min-width: calc(var(--b) * .78); margin-bottom: calc(var(--b) * .1); padding: 0 .35em;
  font-size: calc(var(--b) * .5 + 6px); font-weight: 900; line-height: 1.25; text-align: center;
  color: #fff; background: var(--c); border: 3px solid #fff; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .15); text-shadow: 0 2px 0 rgba(0, 0, 0, .28);
}
.nb-body { position: relative; display: grid; }
.nb-block {
  position: relative; width: var(--b); height: var(--b); background: var(--c);
  border-radius: calc(var(--b) * .14);
  box-shadow:
    inset 0 calc(var(--b) * .08) 0 rgba(255, 255, 255, .35),
    inset 0 calc(var(--b) * -.1) 0 rgba(0, 0, 0, .18),
    inset calc(var(--b) * -.06) 0 0 rgba(0, 0, 0, .06);
  transition: filter .2s, transform .2s;
}
.nb-block.tappable { cursor: pointer; }
.nb-block.lit {
  z-index: 1; filter: brightness(1.22) saturate(1.1); animation: lit .35s ease;
  box-shadow: inset 0 calc(var(--b) * .08) 0 rgba(255, 255, 255, .4), 0 0 0 3px #fff, 0 0 18px 6px rgba(255, 230, 120, .9);
}
.nb-block.extra { animation: extra .7s ease-in-out infinite alternate; }
.nb-count {
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  min-width: calc(var(--b) * .6); height: calc(var(--b) * .6); padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; background: #fff; color: var(--ink);
  font-size: calc(var(--b) * .38); font-weight: 900; box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
  animation: pop .3s ease;
}
.nb-face { position: absolute; top: 0; left: 50%; width: var(--b); height: var(--b); transform: translateX(-50%); pointer-events: none; }
.nb-eye {
  position: absolute; top: 24%; width: 24%; height: 32%; background: #fff; border-radius: 50%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); animation: blink 4.2s infinite;
}
.nb-eye::after { content: ""; position: absolute; left: 32%; top: 34%; width: 46%; height: 46%; border-radius: 50%; background: #2b2340; }
.nb-eye.l { left: 20%; }
.nb-eye.r { right: 20%; }
.nb-cheek { position: absolute; top: 56%; width: 16%; height: 10%; border-radius: 50%; background: rgba(255, 120, 140, .55); }
.nb-cheek.l { left: 10%; }
.nb-cheek.r { right: 10%; }
.nb-mouth {
  position: absolute; left: 50%; top: 60%; width: 28%; height: 14%; transform: translateX(-50%);
  border: max(2px, calc(var(--b) * .05)) solid #2b2340; border-top: 0; border-radius: 0 0 999px 999px;
}
.nb-arm {
  position: absolute; top: calc(var(--b) * .5); width: calc(var(--b) * .3); height: calc(var(--b) * .13);
  background: var(--c); border-radius: 999px; filter: brightness(.88); transition: rotate .2s;
}
.nb-arm.l { right: 100%; transform-origin: right center; rotate: -24deg; }
.nb-arm.r { left: 100%; transform-origin: left center; rotate: 24deg; }
.nb-feet { display: flex; gap: calc(var(--b) * .18); margin-top: -1px; }
.nb-feet i { width: calc(var(--b) * .32); height: calc(var(--b) * .16); background: var(--c); filter: brightness(.68); border-radius: 0 0 999px 999px; }

.cheer .nb-mouth { background: #8a2a3a; height: 22%; }
.cheer .nb-arm.l { rotate: 40deg; }
.cheer .nb-arm.r { rotate: -40deg; }
.shake .nb-mouth { width: 14%; height: 12%; border: max(2px, calc(var(--b) * .05)) solid #2b2340; border-radius: 50%; }
.sleepy .nb-eye { height: 5%; top: 40%; animation: none; }
.sleepy .nb-eye::after { display: none; }
.sleepy .nb-anim { animation: breathe 3s ease-in-out infinite; }

.nb-anim.cheer { animation: cheer .9s ease; }
.nb-anim.shake { animation: shake .6s ease; }
.nb.dragging { z-index: 60; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .22)); }
.nb.nb-hint .nb-body { animation: hint 1s ease-in-out infinite alternate; }

.nb-hidden { visibility: hidden; }
.nb-drop { animation: drop .4s cubic-bezier(.3, 1.4, .6, 1); }
.nb-building :is(.nb-face, .nb-num, .nb-arm, .nb-feet) { opacity: 0; }
.nb :is(.nb-face, .nb-num, .nb-arm, .nb-feet) { transition: opacity .3s; }
.nb-born .nb-num { animation: pop .45s ease; }

.nb-locked .nb-block { box-shadow: inset 0 calc(var(--b) * -.08) 0 rgba(0, 0, 0, .08); }
.nb-locked .nb-num { color: #fff; }
.nb-ghost { opacity: .9; }
.nb-ghost .nb-anim { animation: none; }
.nb-ghost .nb-block { background: rgba(255, 255, 255, .35); box-shadow: none; outline: 3px dashed rgba(255, 255, 255, .95); outline-offset: -4px; }

/* ---------- 关卡舞台 ---------- */
.stage {
  flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column;
  background: linear-gradient(to top, var(--grass) 0 34px, var(--grass-edge) 34px 39px, transparent 39px);
}
.play-top, .play-bottom { flex: 1 1 0; min-height: 0; display: flex; }
.play-top { padding: 6px 14px; gap: 10px; }
.tray { justify-content: space-evenly; align-items: stretch; padding: 4px 6px 24px; }
.tray-cell {
  flex: 1 1 0; min-width: 72px; display: flex; justify-content: center; align-items: flex-end;
  touch-action: none; cursor: grab; transition: opacity .5s;
}
.tray-cell.fade { opacity: 0; pointer-events: none; }
.drop-hover { background: rgba(255, 236, 140, .75) !important; border-color: var(--gold) !important; transform: scale(1.03); }

/* 角色登场 */
.intro { flex: 1; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 24px; }

/* 数数配对 */
.match-top { align-items: stretch; padding-bottom: 12px; }
.match-board {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 8px;
  padding: 10px; background: #fffaf0; border: 4px solid #fff; border-radius: 26px; box-shadow: var(--lift);
  transition: background .2s, transform .2s;
}
.item {
  position: relative; display: grid; place-items: center; width: 1.3em; height: 1.3em;
  font-size: clamp(38px, 12vw, 58px); line-height: 1; cursor: pointer;
}
.item.counted::after {
  content: attr(data-count); position: absolute; top: -4px; right: -6px; min-width: 26px; height: 26px;
  border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 900; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); animation: pop .25s ease;
}
.item.bounce { animation: hop .5s ease; }
.match-slot {
  flex: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
  border: 4px dashed rgba(255, 255, 255, .95); border-radius: 22px; background: rgba(255, 255, 255, .28);
  transition: background .2s, transform .2s;
}
.match-slot.filled { border-style: solid; border-color: transparent; background: transparent; }

/* 比大小 */
.cmp { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cmp-sign { align-self: center; width: 96px; padding: 6px 10px 2px; background: #fff; border-radius: 18px; box-shadow: var(--lift); }
.cmp-sign svg { display: block; width: 100%; }
.cmp-row { flex: 1; display: flex; justify-content: space-evenly; align-items: stretch; padding: 10px 8px 20px; }
.cmp-cell {
  flex: 0 0 44%; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 6px;
  border-radius: 26px; transition: background .2s;
}
.cmp-cell:active { background: rgba(255, 255, 255, .25); }
.cmp-cell.picked { background: rgba(255, 236, 140, .45); }

/* 排序 */
.sort-top { flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding-bottom: 8px; }
.shelf { display: flex; gap: 12px; align-items: flex-end; }
.sort-slot {
  position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  border: 4px dashed rgba(255, 255, 255, .95); border-radius: 20px; background: rgba(255, 255, 255, .25);
  transition: background .2s, transform .2s;
}
.sort-slot .nb-ghost { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); }
.sort-slot.first { animation: glow 1.2s ease-in-out infinite alternate; }
.sort-slot[data-filled] { border-color: transparent; background: transparent; }
.sort-arrow { width: min(70%, 260px); }
.sort-arrow svg { display: block; width: 100%; }

/* ---------- 弹层 ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(40, 30, 70, .45); animation: fade .25s ease;
}
.overlay.out { animation: fade .25s ease reverse forwards; }
.overlay.rest-ov { position: fixed; z-index: 500; }
.overlay-card {
  position: relative; width: min(100%, 380px); max-height: 100%; overflow: auto; padding: 22px;
  background: #fff; border-radius: 30px; box-shadow: 0 10px 0 rgba(0, 0, 0, .12); text-align: center;
  animation: card-in .45s cubic-bezier(.3, 1.4, .5, 1);
}
.result { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ribbon {
  margin-top: -6px; padding: 6px 22px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 20px; font-weight: 900; animation: pop .5s ease;
}
.rs-stars { display: flex; align-items: flex-end; gap: 6px; }
.rs-star { color: #e1e5ee; }
.rs-star .ic svg { width: 66px; height: 66px; }
.rs-star:nth-child(2) { transform: translateY(-14px); }
.rs-star:nth-child(2) .ic svg { width: 80px; height: 80px; }
.rs-star.on { color: var(--gold); animation: star-in .5s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 3px 0 #e0a516); }
.rs-mascot { min-height: 60px; display: flex; align-items: flex-end; padding: 0 30px; }
.rs-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.badge-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: #fff4d6; font-weight: 800; animation: pop .5s ease;
}
.badge-chip .badge-ic { font-size: 24px; }
.rs-actions { display: flex; gap: 16px; justify-content: center; }
.celebrate { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cele-title { font-size: 56px; }
.cele-row { display: flex; align-items: flex-end; gap: 16px; padding: 0 16px; }

/* ---------- 首页 ---------- */
.home .logo {
  margin: 4vh 0 0; text-align: center; font-size: clamp(48px, 15vw, 72px); font-weight: 900; letter-spacing: 4px;
}
.home .logo span {
  display: inline-block; color: var(--c); -webkit-text-stroke: 3px #fff; paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(58, 49, 86, .18); animation: float 3s ease-in-out infinite;
}
.home .logo span:nth-child(2) { animation-delay: .25s; }
.home .logo span:nth-child(3) { animation-delay: .5s; }
.home .logo span:nth-child(4) { animation-delay: .75s; }
.home .topbar { justify-content: flex-end; }
.home .spacer { display: none; }
.home-play { flex: 1; display: grid; place-items: center; }
.btn-big {
  width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--accent); box-shadow: 0 8px 0 #d9662a, 0 0 0 10px rgba(255, 255, 255, .6);
  animation: breathe 2s ease-in-out infinite;
}
.btn-big .ic svg { width: 70px; height: 70px; margin-left: 8px; }
.btn-big:active { transform: translateY(6px); box-shadow: 0 2px 0 #d9662a, 0 0 0 10px rgba(255, 255, 255, .6); }
.home-ground {
  position: relative; height: 34%; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, var(--grass) 0 70px, var(--grass-edge) 70px 76px, transparent 76px);
}
.home-chars { display: flex; justify-content: center; align-items: flex-end; gap: 18px; padding-bottom: 58px; }
.home-chars .nb { cursor: pointer; }
.gallery-btn { position: absolute; right: 14px; bottom: 10px; }

/* ---------- 地图 ---------- */
.map-title { flex: 1; text-align: center; font-size: 19px; font-weight: 900; text-shadow: 0 2px 0 #fff; }
.star-count {
  flex: none; display: flex; align-items: center; gap: 4px; height: 58px; padding: 0 14px; border-radius: 20px;
  background: #fff; box-shadow: var(--lift); font-size: 20px; font-weight: 900;
}
.star-count .ic { color: var(--gold); }
.star-count .ic svg { width: 26px; height: 26px; }
.map-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.map-path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 18px 0 28px; }
.map-road { position: absolute; left: 0; top: 0; pointer-events: none; }
.road-base { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 22; stroke-linecap: round; }
.road-dash { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 16; }
.map-row { position: relative; width: 100%; display: flex; justify-content: center; }
.map-node {
  position: relative; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 5px solid #fff; box-shadow: 0 6px 0 rgba(58, 49, 86, .16); transform: translateX(var(--x));
}
.map-node:active { box-shadow: 0 2px 0 rgba(58, 49, 86, .16); margin-top: 4px; }
.map-node.locked { background: #e2e7ef; color: #9aa4b5; }
.map-node.current { border-color: var(--gold); animation: node-pulse 1.4s ease-in-out infinite; }
.node-face {
  width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--c);
  color: #fff; font-size: 27px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18), inset 0 4px 0 rgba(255, 255, 255, .3);
}
.node-emoji { font-size: 42px; line-height: 1; }
.node-svg svg { width: 50px; height: 50px; display: block; }
.node-stars { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); display: flex; }
.node-stars > span { color: #d8dde7; }
.node-stars > span.on { color: var(--gold); }
.node-stars .ic svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .15)); }
.future { display: flex; flex-direction: column; gap: 10px; padding: 8px 20px 30px; }
.stage-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px;
  background: rgba(255, 255, 255, .55); color: #7b8396; font-weight: 800; font-size: 16px;
}
.stage-card > span:nth-child(2) { flex: 1; }
.stage-ic { font-size: 30px; filter: grayscale(.6); }
.stage-card .ic svg { width: 24px; height: 24px; }

/* ---------- 图鉴 ---------- */
.g-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 10px 14px 30px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.g-card {
  height: 132px; border-radius: 22px; background: #fff; box-shadow: var(--lift);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 12px;
}
.g-card.locked { background: rgba(255, 255, 255, .55); }
.g-char { display: flex; align-items: flex-end; justify-content: center; }
.g-section { margin: 22px 4px 10px; font-size: 18px; font-weight: 900; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 20px;
  background: rgba(255, 255, 255, .5); color: #8b93a6;
}
.badge .badge-ic { font-size: 38px; filter: grayscale(1); opacity: .45; }
.badge.on { background: #fff; color: var(--ink); box-shadow: var(--lift); }
.badge.on .badge-ic { filter: none; opacity: 1; }
.badge-name { font-size: 14px; font-weight: 800; }
.detail { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.detail-close { align-self: flex-end; margin: -8px -8px 0 0; }
.detail-close .btn-icon { width: 48px; height: 48px; background: #eef2f8; }
.detail-char { min-height: 150px; display: flex; align-items: flex-end; padding: 0 40px; }
.detail-name { font-size: 30px; font-weight: 900; color: var(--c); }
.detail-trait { font-size: 16px; color: #6b6585; }
.combos { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.combo {
  display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 10px; border-radius: 16px;
  background: #f4f7fb;
}
.combo b { font-size: 22px; align-self: center; }
.combo .nb-anim { animation: none; }

/* ---------- 家长设置 / 休息 ---------- */
.settings { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.settings h2 { margin: -30px 0 4px; font-size: 22px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 700; }
.set-row.col { flex-direction: column; align-items: stretch; }
.toggle { position: relative; width: 60px; height: 34px; border-radius: 17px; background: #d5dae3; transition: background .2s; }
.toggle i { position: absolute; left: 3px; top: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); }
.toggle.on { background: var(--grass); }
.toggle.on i { transform: translateX(26px); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 10px 0; border-radius: 12px; background: #eef2f8; font-size: 15px; font-weight: 700; }
.seg button.on { background: var(--accent); color: #fff; }
.note { margin: 0; font-size: 13px; line-height: 1.5; color: #8a6d3b; background: #fff8e6; padding: 10px 12px; border-radius: 12px; }
.set-stats { display: flex; gap: 10px; }
.set-stats div { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 16px; background: #f4f7fb; }
.set-stats b { font-size: 22px; }
.set-stats span { font-size: 13px; color: #6b6585; }
.rest { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rest h2 { margin: 6px 0; font-size: 26px; }
.zzz { font-size: 26px; font-weight: 900; color: #8aa4d6; letter-spacing: 4px; animation: float 2.4s ease-in-out infinite; }

/* ---------- 动画 ---------- */
@keyframes idle { 0%, 100% { transform: none; } 50% { transform: scale(1.025, .975); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes cheer {
  0% { transform: none; }
  20% { transform: scale(1.08, .9); }
  45% { transform: translateY(calc(var(--b) * -.9)) scale(.95, 1.06); }
  70% { transform: scale(1.06, .94); }
  100% { transform: none; }
}
@keyframes shake { 0%, 100% { rotate: 0deg; } 20% { rotate: -7deg; } 40% { rotate: 6deg; } 60% { rotate: -4deg; } 80% { rotate: 3deg; } }
@keyframes drop { from { transform: translateY(calc(var(--b) * -4)); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@keyframes lit { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes extra { from { filter: brightness(1); } to { filter: brightness(1.35); box-shadow: 0 0 0 3px #fff, 0 0 16px 4px rgba(255, 230, 120, .9); } }
@keyframes hint { from { filter: drop-shadow(0 0 0 rgba(255, 210, 60, 0)); } to { filter: drop-shadow(0 0 10px rgba(255, 210, 60, 1)) drop-shadow(0 0 4px #fff); } }
@keyframes glow { from { background: rgba(255, 255, 255, .2); } to { background: rgba(255, 236, 140, .6); } }
@keyframes hop { 0%, 100% { transform: none; } 40% { transform: translateY(-14px) scale(1.15); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes star-in { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes node-pulse { 0%, 100% { box-shadow: 0 6px 0 rgba(58, 49, 86, .16), 0 0 0 0 rgba(255, 197, 51, .6); } 50% { box-shadow: 0 6px 0 rgba(58, 49, 86, .16), 0 0 0 12px rgba(255, 197, 51, 0); } }

@media (prefers-reduced-motion: reduce) {
  .nb-anim, .home .logo span, .btn-big, .map-node.current { animation: none; }
}
