/* 布局：从上往下看的一片池塘。棋盘像一块漂着的木筏，关卡是荷叶，泡泡是画面里最亮的颜色。 */
:root {
  --pond: #cdeee6;
  --pond-deep: #a9ddd1;
  --panel: #fffdf6;
  --ink: #1f3a3d;
  --ink-soft: #52706f;
  --leaf: #6fbf63;
  --leaf-deep: #3f8f45;
  --sun: #ffc93c;
  --sun-deep: #d99a00;
  --bubble: #4fb0ee;
  --berry: #f2729f;
  --line: rgba(31, 58, 61, 0.14);
  --shadow: rgba(20, 70, 70, 0.18);
  --scrim: rgba(16, 48, 58, 0.45);
  --wood: #f2c27a;
  --wood-line: #7a4a22;
  --font-display: "ZCOOL KuaiLe", "Hannotate SC", "HanziPen SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "Baloo 2", "Arial Rounded MT Bold", var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pond: #0f2f38; --pond-deep: #0b252d; --panel: #1b3f49; --ink: #eaf6f2; --ink-soft: #a7c6c1;
    --leaf: #5aa953; --leaf-deep: #8fd486; --sun: #ffcf4d; --sun-deep: #c48a00; --bubble: #6cc0f5; --berry: #f58bb2;
    --line: rgba(234, 246, 242, 0.16); --shadow: rgba(0, 0, 0, 0.35); --scrim: rgba(3, 15, 20, 0.6);
    --wood: #e2b06a; --wood-line: #6b3f1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --pond: #0f2f38; --pond-deep: #0b252d; --panel: #1b3f49; --ink: #eaf6f2; --ink-soft: #a7c6c1;
  --leaf: #5aa953; --leaf-deep: #8fd486; --sun: #ffcf4d; --sun-deep: #c48a00; --bubble: #6cc0f5; --berry: #f58bb2;
  --line: rgba(234, 246, 242, 0.16); --shadow: rgba(0, 0, 0, 0.35); --scrim: rgba(3, 15, 20, 0.6);
  --wood: #e2b06a; --wood-line: #6b3f1c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--pond);
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 20%, var(--pond-deep) 0, transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 85%, var(--pond-deep) 0, transparent 70%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 4px solid var(--bubble); outline-offset: 3px; }

#app {
  height: 100%;
  position: relative;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.screen { height: 100%; display: flex; flex-direction: column; padding-block: 12px; min-height: 0; }

/* ——图标和按钮—— */
.ic { display: inline-flex; width: 26px; height: 26px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic svg .fill { fill: currentColor; }
.icon-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 0; flex: none;
  display: grid; place-items: center;
  background: var(--panel); color: var(--ink);
  box-shadow: 0 4px 0 var(--line), 0 6px 14px var(--shadow);
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.act-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--panel); color: var(--ink);
  font-family: var(--font-display); font-size: 20px; letter-spacing: 0.02em;
  box-shadow: 0 5px 0 var(--line), 0 8px 16px var(--shadow);
  transition: transform 0.08s;
}
.act-btn.primary { background: var(--sun); color: #3a2a00; box-shadow: 0 5px 0 var(--sun-deep), 0 8px 16px var(--shadow); }
.act-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.act-btn.small { min-height: 46px; font-size: 17px; padding: 0 18px; }
.muted { color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

/* ——开始页—— */
.title-screen { position: relative; overflow: hidden; align-items: center; justify-content: center; }
.title-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 560px; }
.title-art { display: flex; gap: 6px; justify-content: center; }
.title-art .stone-icon { width: clamp(92px, 18vmin, 150px); height: auto; animation: bob 2.6s ease-in-out infinite; overflow: visible; }
.title-art .stone-icon + .stone-icon { animation-delay: -1.3s; }
.logo { font-family: var(--font-display); font-weight: 400; font-size: clamp(54px, 11vmin, 104px); margin: 0; line-height: 1; letter-spacing: 0.06em; color: var(--ink); text-shadow: 0 4px 0 var(--panel); }
.logo.small { font-size: 30px; text-shadow: none; letter-spacing: 0.04em; white-space: nowrap; }
.tagline { margin: 0; font-family: var(--font-display); font-size: clamp(18px, 3vmin, 24px); color: var(--ink-soft); }
.start-btn {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 10px;
  min-height: 84px; padding: 0 48px 0 36px; border: 0; border-radius: 999px;
  background: var(--sun); color: #3a2a00; font-family: var(--font-display); font-size: 40px; letter-spacing: 0.1em;
  box-shadow: 0 8px 0 var(--sun-deep), 0 14px 26px var(--shadow);
  animation: breathe 2.2s ease-in-out infinite;
}
.start-btn .ic { width: 40px; height: 40px; }
.start-btn .ic svg { fill: currentColor; }
.start-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--sun-deep); }
.parent-tip { margin: 6px 0 0; max-width: 34em; font-size: 14px; line-height: 1.6; color: var(--ink-soft); text-wrap: balance; }
.float-bubble {
  position: absolute; bottom: -80px; width: calc(46px * var(--s, 1)); height: calc(46px * var(--s, 1)); border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #d6f1ff 32%, rgba(79, 176, 238, 0.7) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  animation: rise 10s linear infinite; opacity: 0.85;
}

/* ——地图—— */
.map-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo guide actions"; align-items: center; gap: 12px; }
.map-top .logo { grid-area: logo; }
.map-top .top-actions { grid-area: actions; }
.map-guide { grid-area: guide; display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 640px) {
  .map-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "logo actions" "guide guide"; gap: 8px 12px; }
}
.map-frog { width: 64px; height: 58px; border: 0; background: none; padding: 0; flex: none; }
.map-caption {
  margin: 0; flex: 1; min-width: 0; padding: 10px 16px; border-radius: 18px; background: var(--panel);
  font-size: 17px; font-weight: 600; line-height: 1.45; box-shadow: 0 4px 12px var(--shadow);
}
.top-actions { display: flex; gap: 10px; }
.pond { position: relative; flex: 1; min-height: 300px; margin-top: 12px; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pond-inner { position: relative; width: 100%; height: 100%; }
.pond-path { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.pond-path path { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pad {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0; --pad: clamp(84px, 13vmin, 120px); width: var(--pad);
}
.leaf {
  position: relative; display: grid; place-items: center; width: var(--pad); height: var(--pad); border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.35), transparent 55%), var(--leaf);
  -webkit-mask: conic-gradient(from 25deg, transparent 0 26deg, #000 26deg);
  mask: conic-gradient(from 25deg, transparent 0 26deg, #000 26deg);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
}
.pad .pad-icon { width: 54%; display: grid; place-items: center; }
.pad .pad-icon svg { width: 100%; height: auto; }
.pad-num {
  position: absolute; left: 12%; top: 12%; width: 30%; height: 30%; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); color: var(--ink); font-family: var(--font-num); font-weight: 800; font-size: clamp(14px, 2.2vmin, 19px);
}
.leaf > .ic { position: absolute; right: 16%; bottom: 14%; width: 26%; height: 26%; color: #fff; }
.pad-name {
  font-family: var(--font-display); font-size: 17px; white-space: nowrap; padding: 2px 10px; border-radius: 999px;
  background: var(--panel); box-shadow: 0 3px 8px var(--shadow);
}
.pad-stars { display: flex; gap: 2px; }
.pad-stars i { width: 14px; height: 14px; background: var(--line); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.pad-stars i.on { background: var(--sun); }
.pad.locked .leaf, .pad.future .leaf { filter: grayscale(0.75) brightness(1.05); opacity: 0.6; }
.pad.locked .pad-name, .pad.future .pad-name { opacity: 0.7; }
.pad.current { animation: padglow 1.8s ease-in-out infinite; }
.pad .frog.mini { position: absolute; width: 70%; top: -40%; left: 15%; pointer-events: none; animation: hopfrog 2.4s ease-in-out infinite; }
.pad:active .leaf { transform: scale(0.95); }
.map-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding-top: 10px; }
#btn-practice.badge { position: relative; }
#btn-practice.badge::after { content: ""; position: absolute; top: 4px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--berry); box-shadow: 0 0 0 3px var(--panel); }

/* ——上课和下棋—— */
.play-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel); color: var(--ink-soft); font-family: var(--font-display); font-size: 16px; opacity: 0.8;
}
.step .ic { width: 22px; height: 22px; }
.step.now { background: var(--sun); color: #3a2a00; opacity: 1; transform: scale(1.06); box-shadow: 0 4px 0 var(--sun-deep); }
.step.done { background: var(--leaf); color: #fff; opacity: 1; }

.play-main {
  flex: 1; min-height: 0; display: grid; gap: 12px; padding-top: 10px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "guide" "board" "side";
}
.guide { grid-area: guide; display: flex; align-items: center; gap: 10px; min-width: 0; }
.frog-wrap { width: 78px; flex: none; }
.speech {
  position: relative; flex: 1; min-width: 0; background: var(--panel); border-radius: 22px; padding: 12px 18px;
  box-shadow: 0 6px 16px var(--shadow); min-height: 64px; display: flex; align-items: center;
}
.speech::before {
  content: ""; position: absolute; left: -12px; top: 50%; margin-top: -10px;
  border: 10px solid transparent; border-right: 14px solid var(--panel); border-left: 0;
}
.speech p { margin: 0; font-size: clamp(17px, 1.6vmin + 10px, 25px); font-weight: 600; line-height: 1.5; text-wrap: pretty; }
.speech.pulse { animation: speechpop 0.3s ease-out; }
.board-host { grid-area: board; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.board-svg { display: block; touch-action: none; filter: drop-shadow(0 12px 18px var(--shadow)); overflow: visible; }
.board-host.waiting .board-svg { cursor: pointer; }
.side { grid-area: side; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; min-width: 0; }
.side:empty, .side > :only-child:empty { display: none; }

@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  .play-main {
    grid-template-columns: minmax(250px, 32%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "guide board" "side board";
    gap: 16px 22px;
  }
  .guide { flex-direction: column; align-items: stretch; gap: 14px; }
  .frog-wrap { width: 108px; margin-left: 6px; }
  .speech { min-height: 120px; }
  .speech::before { left: 40px; top: -12px; margin-top: 0; border: 10px solid transparent; border-bottom: 14px solid var(--panel); border-top: 0; }
  .side { flex-direction: column; align-items: stretch; justify-content: flex-start; align-self: start; }
  .baskets { flex-direction: column; }
  .baskets .basket { flex: none; }
}

/* 篮子 */
.baskets { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.basket {
  flex: 1 1 180px; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
  padding: 8px 12px; border-radius: 20px; border: 3px solid #c99a5b;
  background-color: #f3d39a;
  background-image: repeating-linear-gradient(45deg, rgba(160, 110, 50, 0.18) 0 6px, transparent 6px 12px), repeating-linear-gradient(-45deg, rgba(160, 110, 50, 0.18) 0 6px, transparent 6px 12px);
  color: #4a3214; transition: box-shadow 0.2s, transform 0.2s;
}
.basket.active { box-shadow: 0 0 0 5px var(--sun), 0 8px 16px var(--shadow); }
.basket-owner { position: relative; width: 48px; height: 48px; }
.basket-owner .stone-icon { width: 100%; height: 100%; overflow: visible; }
.basket.thinking .think { position: absolute; right: -8px; top: -10px; background: #fff; border-radius: 10px; padding: 0 6px; font-weight: 800; letter-spacing: 1px; color: #4a3214; }
.basket.thinking .think::after { content: "···"; animation: dots 0.9s steps(3) infinite; }
.basket-body { display: flex; gap: 5px; flex-wrap: wrap; min-height: 34px; align-items: center; }
.slot { width: 34px; height: 34px; border-radius: 50%; border: 2.5px dashed rgba(110, 70, 20, 0.45); background: rgba(255, 255, 255, 0.4); }
.slot.full { border-color: transparent; background: none; }
.slot .stone-icon { width: 100%; height: 100%; overflow: visible; }
.basket-name { grid-column: 1 / -1; font-size: 13px; font-weight: 600; }

/* 做题进度 */
.counter { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cdot { width: 38px; height: 38px; border-radius: 50%; background: var(--panel); border: 3px solid var(--line); display: grid; place-items: center; color: #fff; }
.cdot .ic { width: 22px; height: 22px; }
.cdot.star { background: var(--sun); border-color: var(--sun-deep); color: #6b4a00; }
.cdot.star .ic svg { fill: currentColor; }
.cdot.check { background: var(--leaf); border-color: var(--leaf-deep); }
.cdot .stone-icon { width: 34px; height: 34px; overflow: visible; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.actions:empty { display: none; }

/* 青蛙老师 */
.frog svg { width: 100%; height: auto; display: block; overflow: visible; }
.fr-skin { fill: #7dd37a; stroke: #4f9e4e; stroke-width: 3; }
.fr-body { fill: #6cc56b; stroke: #4f9e4e; stroke-width: 3; }
.fr-pad { fill: var(--leaf-deep); opacity: 0.35; }
.fr-mouth { fill: none; stroke: #2d5a2f; stroke-width: 3.5; stroke-linecap: round; }
.fr-open { fill: #c2405a; display: none; transform-box: fill-box; transform-origin: center; }
.frog.talking .fr-open { display: inline; animation: talk 0.2s ease-in-out infinite alternate; }
.frog.talking .fr-mouth { display: none; }
.fr-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.4s infinite; }
.frog { animation: bob 3.2s ease-in-out infinite; }
.frog.sleep .fr-eye { animation: none; transform: scaleY(0.15); }
.frog.sleep { animation: breathe 3.6s ease-in-out infinite; }

/* ——棋盘里的东西—— */
.stone-shadow { fill: rgba(60, 35, 10, 0.22); }
.stone .face { display: none; }
.stone.m-normal .f-normal, .stone.m-scared .f-scared, .stone.m-happy .f-happy, .stone.m-dizzy .f-dizzy { display: inline; }
.stone-body { transform-box: fill-box; transform-origin: 50% 60%; }
.stone.m-scared .stone-body { animation: shiver 0.34s linear infinite; }
.stone .eye { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; animation-delay: var(--blink-delay, 0s); }
.link { stroke-width: 24; stroke-linecap: round; }
.link.black { stroke: #30353e; }
.link.white { stroke: #e3eae8; }
.bubble-in, .bubble-bob { transform-box: fill-box; transform-origin: center; }
.bubble-bob { animation: bubblebob 3s ease-in-out infinite; }
.bub-disc { stroke: #ffffff; stroke-width: 2.5; }
.bubble.of-black .bub-disc { fill: url(#g-bub-b); }
.bubble.of-white .bub-disc { fill: url(#g-bub-w); }
.bubble.alarm .bub-disc { fill: url(#g-bub-alarm); }
.bubble.alarm .bubble-bob { animation: alarm 0.7s ease-in-out infinite; }
.bub-label { font-family: var(--font-num); font-weight: 800; font-size: 26px; fill: #0f3f5c; }
.droplet { fill: #bfe9ff; }
.hl { fill: rgba(255, 210, 63, 0.16); stroke: #ffd23f; stroke-width: 6; transform-box: fill-box; transform-origin: center; animation: hlpulse 1.2s ease-in-out infinite; }
.hl.small { fill: rgba(255, 210, 63, 0.45); stroke-width: 5; }
.hl.group { stroke: #ff9f1c; fill: rgba(255, 159, 28, 0.14); }
.star-in { transform-box: fill-box; transform-origin: center; animation: starpulse 1.1s ease-in-out infinite; }
.hand-in { animation: handtap 1.1s ease-in-out infinite; }
.hand-ripple { fill: none; stroke: #ffffff; stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: ripple 1.1s ease-out infinite; }
.seg { stroke: #ffd23f; stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100; }
.nope circle { fill: rgba(70, 82, 88, 0.55); }
.nope path { stroke: #ffffff; stroke-width: 4; stroke-linecap: round; }
.wave-dot { fill: #ffd23f; opacity: 0; transform-box: fill-box; transform-origin: center; animation: wave 1.8s ease-out both; }
.gl { transition: stroke 0.25s, stroke-width 0.25s; }
.gl.flash { stroke: #ff9f1c; stroke-width: 10; }
.ghost circle { opacity: 0.45; }
.ghost.black circle { fill: #2b3038; }
.ghost.white circle { fill: #ffffff; stroke: #b9c4c2; stroke-width: 3; }

#fly-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.flyer { position: fixed; pointer-events: none; }
.flyer svg { overflow: visible; }
.confetti { position: fixed; top: 0; width: 11px; height: 15px; }

/* ——弹出卡片—— */
#overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; place-items: center; background: var(--scrim);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.card {
  width: min(540px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border-radius: 32px;
  padding: 26px 24px 24px; text-align: center; box-shadow: 0 20px 50px var(--shadow); animation: popin 0.32s cubic-bezier(.3, 1.4, .5, 1);
}
.card-art { display: flex; justify-content: center; }
.result-art .stone-icon { width: 120px; height: 120px; overflow: visible; animation: bob 1.6s ease-in-out infinite; }
.sticker-big { font-size: 96px; line-height: 1.15; animation: wobble 1.6s ease-in-out infinite; }
.card-title { font-family: var(--font-display); font-weight: 400; font-size: 36px; margin: 6px 0 4px; letter-spacing: 0.04em; }
.card-text { margin: 0 auto; font-size: 18px; line-height: 1.55; color: var(--ink-soft); max-width: 28em; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.card-actions:empty { display: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 14px; border-radius: 22px;
  border: 3px solid var(--line); background: var(--pond); color: var(--ink);
}
.choice strong { font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.choice span:last-child { font-size: 15px; color: var(--ink-soft); }
.choice:active { transform: scale(0.97); }
.mini-board {
  display: block; width: 66px; height: 66px; margin: 10px; border-radius: 2px;
  background-color: #f2c27a;
  background-image: linear-gradient(to right, #7a4a22 2px, transparent 2px), linear-gradient(to bottom, #7a4a22 2px, transparent 2px);
  border-right: 2px solid #7a4a22; border-bottom: 2px solid #7a4a22;
  box-shadow: 0 0 0 9px #f2c27a, 0 6px 0 9px #d29a50;
}
.mini-board.s5 { background-size: 25% 25%; }
.mini-board.s7 { background-size: calc(100% / 6) calc(100% / 6); }

/* 家长关卡的数字键 */
.gate { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 12px; }
.gate-input { min-width: 140px; min-height: 56px; border-radius: 16px; background: var(--pond); font-family: var(--font-num); font-weight: 800; font-size: 34px; display: grid; place-items: center; letter-spacing: 0.1em; }
.gate-input.shake { animation: shiver 0.12s linear 3; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.key { height: 60px; border-radius: 16px; border: 0; background: var(--pond); font-family: var(--font-num); font-weight: 800; font-size: 24px; color: var(--ink); }
.key:active { transform: translateY(2px); background: var(--sun); }

/* ——贴纸册和家长页（可以上下滑）—— */
.page-screen { overflow: hidden; }
.page-top { display: flex; align-items: center; gap: 14px; }
.page-top h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0; }
.page-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 2px 24px; -webkit-user-select: text; user-select: text; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border-radius: 22px; background: var(--panel); text-align: center; border: 3px dashed var(--line); }
.sticker.got { border: 3px solid var(--sun); box-shadow: 0 6px 14px var(--shadow); }
.sticker-art { font-size: 56px; line-height: 1.2; width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%; }
.sticker:not(.got) .sticker-art { background: var(--pond); color: var(--ink-soft); font-family: var(--font-num); font-weight: 800; font-size: 38px; }
.sticker strong { font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.sticker-how { font-size: 13px; color: var(--ink-soft); }
.album-sub { font-family: var(--font-display); font-weight: 400; font-size: 22px; margin: 26px 0 10px; }
.album-daily { display: flex; flex-wrap: wrap; gap: 10px; }
.daily-sticker { position: relative; font-size: 40px; width: 64px; height: 64px; display: grid; place-items: center; background: var(--panel); border-radius: 18px; }
.daily-sticker i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 13px; font-weight: 800; background: var(--sun); color: #3a2a00; border-radius: 999px; padding: 0 6px; }

.parent-body { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-content: start; }
.p-card { background: var(--panel); border-radius: 22px; padding: 18px 20px; min-width: 0; box-shadow: 0 4px 12px var(--shadow); }
.p-card h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.summary p { margin: 0 0 8px; font-size: 16px; line-height: 1.65; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; }
.bar { display: block; width: 100%; max-width: 160px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.bar-note { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row > span { display: flex; flex-direction: column; gap: 2px; font-size: 16px; font-weight: 600; min-width: 0; }
.row small { font-size: 13px; font-weight: 400; color: var(--ink-soft); line-height: 1.5; }
.row input[type="checkbox"] { width: 28px; height: 28px; accent-color: var(--leaf-deep); flex: none; }
.row select { font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--pond); color: var(--ink); max-width: 50%; }
.how { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 15px; line-height: 1.65; }
.confirm { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--pond); }
.confirm p { margin: 0 0 10px; }
.confirm-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ——休息—— */
.rest-screen { align-items: center; justify-content: center; text-align: center; }
.rest-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 460px; }
.rest-frog { position: relative; width: 170px; }
.rest-frog .zzz { position: absolute; right: -20px; top: -18px; font-family: var(--font-num); font-weight: 800; font-size: 30px; color: var(--ink-soft); animation: bob 2.4s ease-in-out infinite; }
.rest-frog .zzz i { font-style: normal; font-size: 0.7em; margin-left: 2px; }
.rest-inner h2 { font-family: var(--font-display); font-weight: 400; font-size: 44px; margin: 0; }
.rest-inner p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-soft); }

/* ——小屏幕—— */
@media (max-width: 560px) {
  .logo.small { font-size: 24px; }
  .map-caption { font-size: 15px; }
  .step:not(.now) .step-label { display: none; }
  .step { padding: 6px 9px; }
  .icon-btn { width: 50px; height: 50px; }
  .act-btn { font-size: 18px; padding: 0 18px; }
  .basket { flex-basis: 140px; padding: 6px 8px; }
  .basket-owner { width: 38px; height: 38px; }
  .slot { width: 28px; height: 28px; }
  .pad-name { font-size: 15px; }
  .frog-wrap { width: 62px; }
}
/* 横着拿的手机：屏幕很矮，所有东西都收紧一点 */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .screen { padding-block: 6px; }
  .play-main { padding-top: 6px; gap: 8px 16px; }
  .icon-btn { width: 46px; height: 46px; }
  .guide { flex-direction: row !important; align-items: center !important; }
  .frog-wrap { width: 54px !important; margin-left: 0 !important; }
  .speech { min-height: 0 !important; padding: 8px 12px; }
  .speech p { font-size: 15px; }
  .speech::before { left: -12px !important; top: 50% !important; margin-top: -10px !important; border: 10px solid transparent !important; border-right: 14px solid var(--panel) !important; border-left: 0 !important; }
  .baskets { gap: 6px; }
  .basket { padding: 4px 8px; gap: 2px 8px; }
  .basket-name { display: none; }
  .basket-owner { width: 34px; height: 34px; }
  .slot { width: 24px; height: 24px; }
  .cdot { width: 30px; height: 30px; }
  .act-btn.small { min-height: 40px; }
  .map-top .logo.small { font-size: 22px; }
  .map-caption { font-size: 14px; padding: 6px 12px; }
  .map-frog { width: 48px; height: 44px; }
  .pond { margin-top: 4px; min-height: 0; }
  .pad { --pad: clamp(56px, 17vh, 84px); }
  .pad-name { font-size: 13px; }
  .pad-stars { display: none; }
  .map-actions { padding-top: 4px; gap: 8px; }
  .map-actions .act-btn { min-height: 42px; font-size: 16px; padding: 0 14px; }
}

/* ——动画—— */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-120vh); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes shiver { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes bubblebob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes alarm { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
@keyframes hlpulse { 0%, 100% { opacity: 0.65; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes starpulse { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.18) rotate(12deg); } }
@keyframes handtap { 0%, 100% { transform: translate(0, 10px); } 50% { transform: translate(0, 0); } }
@keyframes ripple { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes wave { 0% { opacity: 0; transform: scale(0.3); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0.0; transform: scale(1); } }
@keyframes talk { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
@keyframes speechpop { 0% { transform: scale(0.97); } 100% { transform: scale(1); } }
@keyframes popin { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes padglow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 201, 60, 0)); } 50% { filter: drop-shadow(0 0 12px rgba(255, 201, 60, 0.95)); } }
@keyframes hopfrog { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-14px); } 90% { transform: translateY(0); } }
@keyframes dots { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

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