:root {
  --ink: #5a3b26;
  --ink-soft: #8a6a52;
  --cream: #fff8ea;
  --paper: #fffdf6;
  --sun: #ffc83d;
  --sun-deep: #f29d1f;
  --coral: #ff7b5c;
  --leaf: #67b956;
  --leaf-deep: #3f8f3a;
  --sky: #8fd3f4;
  --berry: #c95b9b;
  --plum: #7c6fd6;
  --world: #f7b733;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fd3f4;
  color: var(--ink);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus { outline: none; }
button:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

#app { position: fixed; inset: 0; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
  overflow: hidden;
}
.screen:not(.active) { pointer-events: none; }
.screen.active { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,248,234,.18)); }

.topbar {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 0 calc(var(--safe-l) + 12px);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  z-index: 5;
}

/* chunky storybook buttons */
.btn-round, .btn-gear, .btn-spacer {
  width: 58px; height: 58px; flex: 0 0 auto;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
  display: grid; place-items: center;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-spacer { visibility: hidden; }
.btn-round svg, .btn-gear svg { width: 60%; height: 60%; }
.btn-round:active, .btn-gear:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn-round.big { width: 76px; height: 76px; }
.btn-round.huge { width: 104px; height: 104px; }
.btn-round.primary { background: var(--leaf); color: #fff; }
.btn-gear { position: relative; background: rgba(255,253,246,.85); }
.screen > .btn-gear { position: absolute; top: calc(var(--safe-t) + 12px); right: calc(var(--safe-r) + 12px); z-index: 5; }
.gear-ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); pointer-events: none; transform: rotate(-90deg); }
.gear-ring circle { fill: none; stroke: var(--sun-deep); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 210; stroke-dashoffset: 210; }
.btn-gear.holding .gear-ring circle { transition: stroke-dashoffset 3s linear; stroke-dashoffset: 0; }

/* ---------- start ---------- */
.start-wrap {
  position: absolute; inset: 0;
  padding: calc(var(--safe-t) + 20px) calc(var(--safe-r) + 20px) calc(var(--safe-b) + 20px) calc(var(--safe-l) + 20px);
  display: grid;
  grid-template-areas: "logo" "pasha" "play";
  grid-template-rows: auto 1fr auto;
  justify-items: center; align-items: center;
}
.logo {
  grid-area: logo; margin: 12px 0 0;
  font-size: clamp(64px, 18vmin, 128px); line-height: 1; font-weight: 900; letter-spacing: .02em;
  color: var(--sun);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink);
}
.logo span { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.logo span:nth-child(2) { animation-delay: .2s; color: var(--coral); }
.logo span:nth-child(3) { animation-delay: .4s; color: var(--leaf); }
.logo span:nth-child(4) { animation-delay: .6s; color: var(--sky); }
.start-pasha { grid-area: pasha; height: 100%; max-height: 56vh; min-height: 0; width: auto; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(70,40,10,.25)); animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }
.btn-play {
  grid-area: play;
  width: clamp(120px, 30vmin, 170px); height: clamp(120px, 30vmin, 170px);
  border-radius: 50%; border: 6px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #8fe07a, var(--leaf) 60%, var(--leaf-deep));
  color: #fff; box-shadow: 0 9px 0 var(--ink), 0 0 0 0 rgba(255,255,255,.7);
  display: grid; place-items: center; padding: 0;
  animation: pulse 1.6s ease-in-out infinite;
}
.btn-play svg { width: 58%; height: 58%; margin-left: 8%; }
.btn-play:active { transform: translateY(6px) scale(.97); box-shadow: 0 3px 0 var(--ink); }
@media (orientation: landscape) {
  .start-wrap { grid-template-areas: "pasha logo" "pasha play"; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .start-pasha { max-height: 86vh; align-self: end; }
  .logo { align-self: end; margin-bottom: 10px; }
  .btn-play { align-self: start; margin-top: 10px; }
}

/* ---------- map ---------- */
.ladder {
  position: absolute; inset: 0;
  padding: calc(var(--safe-t) + 84px) calc(var(--safe-r) + 20px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 20px);
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: space-around;
}
.world-node {
  position: relative; border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.world-node:nth-child(even) { transform: translateX(22%); }
.world-node:nth-child(odd) { transform: translateX(-22%); }
.world-thumb {
  width: clamp(110px, 30vmin, 170px); aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid var(--ink);
  background-size: cover; background-position: center;
  box-shadow: 0 8px 0 var(--ink), 0 0 0 8px var(--node-color, #fff) inset;
  position: relative;
}
.world-node.current .world-thumb { animation: glow 1.8s ease-in-out infinite; }
.world-node.locked .world-thumb { filter: grayscale(.85) brightness(.85); }
.world-thumb .world-icon {
  position: absolute; left: 50%; top: 50%; width: 72%; height: 72%; object-fit: contain;
  transform: translate(-50%, -50%); filter: drop-shadow(0 4px 4px rgba(60,40,10,.35));
}
.world-node.locked .world-icon { opacity: .55; }
.world-node .badge-lock {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%);
  width: 46%; height: 46%; display: grid; place-items: center;
}
.world-node .world-stars, .level-node .level-stars {
  display: flex; align-items: center; gap: 4px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 12px; font-weight: 800; font-size: 20px;
}
.world-stars svg { width: 22px; height: 22px; }
.world-node.teaser .world-thumb { background: radial-gradient(circle at 40% 35%, #fff, #e8e1f7); display: grid; place-items: center; font-size: 64px; font-weight: 900; color: var(--plum); }
.ladder-path { position: absolute; inset: 0; pointer-events: none; }

.side-pasha {
  position: absolute; z-index: 3;
  left: calc(var(--safe-l) + 2px); bottom: calc(var(--safe-b) - 4px);
  height: 30vh; width: auto;
  filter: drop-shadow(0 8px 10px rgba(70,40,10,.25));
  transform-origin: 50% 100%;
}
@media (orientation: portrait) {
  #screen-map .side-pasha { left: auto; right: calc(var(--safe-r) + 2px); }
}
@media (orientation: landscape) {
  .ladder { flex-direction: row; align-items: flex-end; padding-left: calc(var(--safe-l) + 24vh); padding-top: calc(var(--safe-t) + 70px); }
  .world-node:nth-child(n) { transform: none; }
  .world-node:nth-child(1) { margin-bottom: 0; }
  .world-node:nth-child(2) { margin-bottom: 12vh; }
  .world-node:nth-child(3) { margin-bottom: 24vh; }
  .side-pasha { height: 62vh; }
}

/* ---------- levels ---------- */
.level-path {
  position: absolute; inset: 0;
  padding: calc(var(--safe-t) + 84px) calc(var(--safe-r) + 18px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 18px);
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: space-evenly;
}
.level-node { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.level-node:nth-child(4n+2) { transform: translateX(28%); }
.level-node:nth-child(4n+4) { transform: translateX(-28%); }
.level-stone {
  width: clamp(76px, 19vmin, 112px); aspect-ratio: 1; border-radius: 50%;
  border: 5px solid var(--ink); box-shadow: 0 7px 0 var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff6d6, var(--world) 70%);
  display: grid; place-items: center;
  font-size: clamp(40px, 10vmin, 60px); font-weight: 900; color: var(--ink);
}
.level-node.locked .level-stone { background: #d9d2c5; color: #9b8f80; }
.level-node.locked .level-stone svg { width: 50%; height: 50%; }
.level-node.current .level-stone { animation: glow 1.8s ease-in-out infinite; }
.level-node .level-stars { padding: 2px 8px; }
.level-stars svg { width: 20px; height: 20px; }
@media (orientation: landscape) {
  .level-path { flex-direction: row; align-items: center; padding-left: calc(var(--safe-l) + 24vh); padding-top: calc(var(--safe-t) + 60px); }
  .level-node:nth-child(n) { transform: none; }
  .level-node:nth-child(odd) { transform: translateY(14%); }
  .level-node:nth-child(even) { transform: translateY(-30%); }
}

/* ---------- play ---------- */
.play {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "scene scene" "pasha answers";
  padding: 0 calc(var(--safe-r) + 10px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 10px);
  gap: 8px;
}
.play-top { position: relative; grid-area: top; padding-left: 2px; padding-right: 2px; }
.top-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.timer {
  position: relative; width: 72px; height: 72px; border-radius: 50%;
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  display: grid; place-items: center; transition: opacity .3s;
}
.timer.off { opacity: 0; }
.timer svg { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); transform: rotate(-90deg); }
.t-track { fill: none; stroke: #e9e1d2; stroke-width: 7; }
.t-prog { fill: none; stroke: #5fae5a; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: calc(var(--p, 0) * 100); transition: stroke .3s; }
.t-num { position: relative; font-size: 34px; font-weight: 900; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer.late .t-prog { stroke: #ff5a4f; }
.timer.late .t-num { color: #e0332b; }
.timer.tick .t-num { animation: tick .35s ease-out; }
@keyframes tick { 0% { transform: scale(1.45); } 100% { transform: scale(1); } }
.task-dots { display: flex; gap: 7px; }
.task-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,253,246,.8); border: 3px solid var(--ink); }
.task-dots i.done { background: var(--sun); }
.task-dots i.miss { background: #cfc6b8; }
.task-dots i.now { transform: scale(1.3); background: #fff; }

.scene-wrap {
  grid-area: scene; position: relative; min-height: 0;
  border-radius: 34px;
  background: rgba(255, 253, 244, .55);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.7), 0 10px 30px rgba(60,40,10,.12);
  -webkit-backdrop-filter: blur(3px) saturate(.9);
  backdrop-filter: blur(3px) saturate(.9);
}
.scene { position: absolute; inset: 12px; }
.item {
  position: absolute; border: 0; padding: 0; background: none;
  transform: translate(-50%, -50%);
}
.item img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 6px 5px rgba(60,40,10,.28));
  transform: rotate(var(--rot, 0deg)) scaleX(var(--flip, 1));
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), filter .25s;
}
.item.pop { animation: popin .45s cubic-bezier(.3,1.6,.5,1) both; }
.item.lit img { transform: rotate(0deg) scale(1.18) scaleX(var(--flip, 1)); filter: drop-shadow(0 0 10px #fff3a0) drop-shadow(0 0 18px #ffd23f); }
.item.wiggle img { animation: wiggle .4s ease; }
.item .num {
  position: absolute; left: 50%; top: -6%;
  transform: translate(-50%, -50%) scale(0);
  min-width: 46px; height: 46px; border-radius: 23px; padding: 0 8px;
  background: var(--sun); border: 4px solid var(--ink);
  font-size: 28px; font-weight: 900; line-height: 38px; text-align: center;
  transition: transform .3s cubic-bezier(.3,1.6,.5,1);
}
.item.marked .num, .item.lit .num { transform: translate(-50%, -50%) scale(1); }
.item.leave { animation: popout .35s ease-in both; }
/* addition: the second group flies in from above, a big "+" sits between the groups */
.item.arriving.pop { animation: arrive .6s cubic-bezier(.3,1.4,.5,1) both; }
.scene .plus {
  position: absolute; transform: translate(-50%, -50%) scale(0);
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--sun); border: 5px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  font-size: 52px; font-weight: 900; line-height: 50px; text-align: center; color: var(--ink);
  transition: transform .35s cubic-bezier(.3,1.6,.5,1); pointer-events: none; z-index: 2;
}
.scene .plus.show { transform: translate(-50%, -50%) scale(1); }
@keyframes arrive { 0% { transform: translate(-50%, calc(-50% - 160px)) scale(.6); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

.pasha-btn {
  grid-area: pasha; position: relative; border: 0; background: none; padding: 0;
  min-height: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center;
}
.pasha-btn img { height: 100%; max-height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 8px rgba(70,40,10,.25)); transform-origin: 50% 100%; }
[data-pasha].talking, .pasha-btn.talking img { animation: talk .5s ease-in-out infinite; }
[data-pasha].happy, .pasha-btn.happy img { animation: jump .6s cubic-bezier(.3,1.6,.5,1) 2; }
.pasha-btn.think img { transform: rotate(-4deg); transition: transform .4s; }

.answers {
  grid-area: answers; align-self: center;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 4px 4px 8px;
}
.answers.n3 .ans:last-child { grid-column: span 2; justify-self: center; width: calc(50% - 7px); }
.ans {
  aspect-ratio: 1.08; min-height: 86px;
  border-radius: 28px; border: 5px solid var(--ink);
  background: var(--c, var(--sun)); box-shadow: 0 8px 0 var(--ink);
  font-size: clamp(54px, 13vmin, 84px); font-weight: 900; line-height: 1; color: var(--ink);
  display: grid; place-items: center; padding: 0;
  transition: transform .12s ease, box-shadow .12s ease, opacity .3s, filter .3s;
}
.ans:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.ans:disabled { cursor: default; }
.ans.gone { opacity: .28; filter: grayscale(1); animation: shake .45s ease; }
.ans.right { background: #8fe07a; animation: bigpop .6s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 8px 0 var(--ink), 0 0 0 8px rgba(255,255,255,.8), 0 0 30px 10px #fff59a; }
.ans.hintme { animation: pulse 1.2s ease-in-out infinite; }

@media (orientation: landscape) {
  .play {
    grid-template-columns: minmax(0, .62fr) minmax(0, 1.7fr) minmax(0, .9fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top top" "pasha scene answers";
  }
  .answers { gap: 12px; align-self: center; }
  .ans { min-height: 0; width: 100%; height: auto; aspect-ratio: 1; }
  .play-top { padding-top: 0; }
}

/* effects */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.spark { position: absolute; width: 30px; height: 30px; animation: burst 1s ease-out forwards; }
.spark svg { width: 100%; height: 100%; }

/* ---------- result ---------- */
.result {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: end;
  padding: calc(var(--safe-t) + 20px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 20px) calc(var(--safe-l) + 16px);
}
.result-pasha { height: 46vh; width: auto; filter: drop-shadow(0 10px 12px rgba(70,40,10,.3)); transform-origin: 50% 100%; }
.result-card {
  background: rgba(255, 253, 246, .92); border: 5px solid var(--ink); border-radius: 36px; box-shadow: 0 10px 0 var(--ink);
  padding: 18px 22px 22px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.result-stars { display: flex; gap: 10px; align-items: flex-end; }
.result-stars .slot { width: clamp(70px, 20vmin, 100px); height: clamp(70px, 20vmin, 100px); position: relative; }
.result-stars .slot:nth-child(2) { transform: translateY(-14px); width: clamp(84px, 24vmin, 120px); height: clamp(84px, 24vmin, 120px); }
.result-stars .slot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.result-stars .slot .full { transform: scale(0); }
.result-stars .slot.on .full { animation: starin .6s cubic-bezier(.3,1.6,.5,1) forwards; }
.result-actions { display: flex; gap: 18px; align-items: center; }
@media (orientation: landscape) {
  .result { grid-template-columns: 1fr 1.3fr; grid-template-rows: 1fr; align-items: center; }
  .result-pasha { height: 80vh; align-self: end; }
}

/* ---------- modals (adults) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(60, 40, 20, .45);
  display: grid; place-items: center;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 12px);
}
.modal[hidden] { display: none; }
.card {
  position: relative;
  background: var(--paper); border: 5px solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink);
  padding: 20px; width: min(440px, 100%); max-height: 100%; overflow: auto;
  -webkit-user-select: none; user-select: none;
}
.card h2 { margin: 0 0 10px; font-size: 26px; }
.close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font-size: 28px; line-height: 1; padding: 0; }
.gate-q { font-size: 22px; margin: 0 0 10px; }
.gate-input { height: 60px; border-radius: 16px; border: 4px solid var(--ink); background: #fff; font-size: 40px; font-weight: 900; display: grid; place-items: center; margin-bottom: 12px; letter-spacing: .1em; }
.gate-input.bad { animation: shake .45s ease; background: #ffe0d8; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; border-radius: 16px; border: 4px solid var(--ink); background: var(--cream); font-size: 28px; font-weight: 800; box-shadow: 0 4px 0 var(--ink); }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.keypad .ok { background: var(--leaf); color: #fff; }
.set-row { margin: 14px 0; }
.set-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-label { display: block; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.set-inline .set-label { margin: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 0 auto; min-width: 64px; height: 48px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; font-size: 17px; font-weight: 800; }
.seg button[aria-pressed="true"] { background: var(--sun); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
input[type=range] { width: 100%; height: 36px; accent-color: var(--sun-deep); }
.switch { appearance: none; -webkit-appearance: none; width: 64px; height: 36px; border-radius: 18px; background: #d8cfc2; border: 3px solid var(--ink); position: relative; transition: background .2s; flex: 0 0 auto; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .2s; }
.switch:checked { background: var(--leaf); }
.switch:checked::after { transform: translateX(28px); }
.btn-text { height: 50px; padding: 0 18px; border-radius: 16px; border: 4px solid var(--ink); background: #fff; font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 var(--ink); }
.btn-text.danger { background: #ffe1d8; }
.btn-text.danger.confirm { background: var(--coral); color: #fff; }
.btn-text.primary { background: var(--leaf); color: #fff; }
.btn-text.wide { width: 100%; margin-top: 8px; }
@media (orientation: landscape) and (max-height: 560px) {
  .settings-card { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
  .settings-card h2, .settings-card .btn-text.wide { grid-column: 1 / -1; }
  .settings-card { padding: 14px 20px; }
  .settings-card h2 { margin-bottom: 2px; font-size: 22px; }
  .settings-card .set-row { margin: 6px 0; }
  .settings-card .seg button { height: 40px; }
  .settings-card .btn-text { height: 44px; }
  .gate-card { width: min(620px, 100%); display: grid; grid-template-columns: 1fr 1.1fr; column-gap: 18px; align-items: start; padding: 14px 18px; }
  .gate-card h2, .gate-card .gate-q { grid-column: 1; }
  .gate-card .gate-input { grid-column: 1; }
  .gate-card .keypad { grid-column: 2; grid-row: 1 / span 3; margin-top: 40px; }
  .gate-card .keypad button { height: 50px; }
}

/* ---------- motion ---------- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sway { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes talk { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-4px) scaleY(1.015); } }
@keyframes jump { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-26px) scale(1.04, .98); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes glow { 0%,100% { box-shadow: 0 7px 0 var(--ink), 0 0 0 0 rgba(255,236,120,.9); } 50% { box-shadow: 0 7px 0 var(--ink), 0 0 0 14px rgba(255,236,120,.0), 0 0 26px 8px rgba(255,236,120,.9); } }
@keyframes popin { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes popout { to { transform: translate(-50%, -50%) scale(0); opacity: 0; } }
@keyframes wiggle { 0%,100% { transform: rotate(var(--rot, 0deg)); } 30% { transform: rotate(calc(var(--rot, 0deg) - 10deg)); } 60% { transform: rotate(calc(var(--rot, 0deg) + 10deg)); } }
@keyframes shake { 0%,100% { translate: 0; } 20% { translate: -8px; } 40% { translate: 8px; } 60% { translate: -5px; } 80% { translate: 5px; } }
@keyframes bigpop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1.06); } }
@keyframes burst { 0% { transform: translate(0,0) scale(.4) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(200deg); opacity: 0; } }
@keyframes starin { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  .logo span, .start-pasha, .btn-play, .world-node.current .world-thumb, .level-node.current .level-stone { animation: none; }
}
