﻿:root {
  --ink: #332938;
  --muted: #7f6b76;
  --paper: #fffaf1;
  --cream: #fff1c9;
  --pink: #ff8daf;
  --rose: #ff6f84;
  --coral: #ff8a62;
  --sun: #ffd96f;
  --mint: #8adbbc;
  --green: #77c96f;
  --sky: #91d7f2;
  --blue: #5aa6dc;
  --purple: #b39ae8;
  --brown: #7a5662;
  --shadow: rgba(107, 74, 92, 0.24);
  --stage-width: 390px;
  --stage-height: 844px;
  --stage-scale: 1;
  --stage-gutter: 8px;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: #ffe8c7;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100svh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--stage-gutter);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stage-frame {
  position: relative;
  flex: 0 0 auto;
  width: var(--stage-width);
  height: var(--stage-height);
  overflow: visible;
  transform: scale(var(--stage-scale));
  transform-origin: top center;
}

.game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 141, 175, 0.32), transparent 15rem),
    radial-gradient(circle at 88% 18%, rgba(145, 215, 242, 0.35), transparent 16rem),
    linear-gradient(160deg, #fff5ce, #ffe4eb 52%, #dff7ee);
  box-shadow: 0 0 70px rgba(107, 74, 92, 0.22);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.screen.is-active {
  display: block;
  animation: screenIn 0.42s ease both;
}

.intro-screen {
  background: linear-gradient(#f0f0ef 0 45%, #fff8df 74%, #f0faf1);
}

.intro-sky {
  position: absolute;
  inset: 0;
}

.cloud {
  position: absolute;
  width: 94px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    28px -10px 0 3px rgba(255, 255, 255, 0.9),
    54px 5px 0 -5px rgba(255, 255, 255, 0.9);
}

.cloud-a {
  left: 22px;
  top: 64px;
}

.cloud-b {
  right: 48px;
  top: 128px;
  transform: scale(0.72);
}

.sun-face {
  position: absolute;
  right: 36px;
  top: 58px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ae6247;
  font-size: 58px;
  line-height: 1;
  background: var(--sun);
  box-shadow: 0 14px 28px rgba(255, 170, 73, 0.28);
}

.intro-city {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 135px;
  height: 320px;
  filter: grayscale(1);
  opacity: 0.74;
}

.intro-city span {
  position: absolute;
  display: block;
}

.city-river {
  left: -40px;
  right: -40px;
  bottom: 32px;
  height: 98px;
  border-radius: 50%;
  background: repeating-linear-gradient(-8deg, #bfc4c7 0 12px, #e2e3e3 12px 24px);
}

.city-bridge {
  left: 98px;
  right: 24px;
  bottom: 126px;
  height: 22px;
  border-top: 8px solid #aeb2b4;
  border-bottom: 5px solid #aeb2b4;
}

.city-bridge::before,
.city-bridge::after {
  position: absolute;
  bottom: -46px;
  width: 14px;
  height: 50px;
  content: "";
  background: #aeb2b4;
}

.city-bridge::before {
  left: 24%;
}

.city-bridge::after {
  right: 18%;
}

.city-tower {
  left: 26px;
  bottom: 132px;
  width: 108px;
  height: 170px;
  background: #bababa;
  clip-path: polygon(50% 0, 80% 18%, 68% 18%, 78% 36%, 64% 36%, 74% 56%, 60% 56%, 66% 100%, 34% 100%, 40% 56%, 26% 56%, 36% 36%, 22% 36%, 32% 18%, 20% 18%);
}

.city-block {
  bottom: 128px;
  width: 54px;
  border-radius: 10px 10px 0 0;
  background: #c9c9c9;
}

.block-a {
  right: 78px;
  height: 108px;
}

.block-b {
  right: 20px;
  height: 144px;
}

.q-hero,
.map-hero {
  position: absolute;
  z-index: 6;
  width: 62px;
  height: 88px;
  pointer-events: none;
}

.intro-hero {
  left: calc(50% - 31px);
  top: 374px;
  animation: bob 2.6s ease-in-out infinite;
}

.hero-head {
  position: absolute;
  left: 11px;
  top: 0;
  width: 40px;
  height: 40px;
  border: 4px solid #4b3742;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 44%, #4b3742 0 2px, transparent 3px),
    radial-gradient(circle at 70% 44%, #4b3742 0 2px, transparent 3px),
    #ffe0bd;
}

.hero-head::after {
  position: absolute;
  left: 12px;
  top: 21px;
  width: 13px;
  height: 8px;
  content: "";
  border-bottom: 3px solid #4b3742;
  border-radius: 50%;
}

.hero-body {
  position: absolute;
  left: 8px;
  top: 36px;
  width: 46px;
  height: 52px;
  border: 4px solid #4b3742;
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(#ff8daf, #ffbd71);
}

.hero-bag {
  position: absolute;
  right: 0;
  top: 48px;
  width: 22px;
  height: 26px;
  border: 3px solid #4b3742;
  border-radius: 8px;
  background: #7cc483;
}

.intro-copy {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 42px;
  z-index: 7;
}

.label,
.level-kicker,
.archive-head p {
  margin: 0 0 8px;
  color: #da5f83;
  font-size: 13px;
  font-weight: 950;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(48px, 16vw, 74px);
  line-height: 0.94;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 14px;
  font-size: 19px;
  font-weight: 950;
}

.intro-text {
  width: min(100%, 19em);
  margin-bottom: 22px;
  color: #5c4a55;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.72;
}

.main-btn {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 13px 26px rgba(255, 120, 112, 0.28);
}

.main-btn.full {
  width: 100%;
}

.map-screen {
  background: linear-gradient(#ffe9bb, #fff7dd 45%, #dff5ef);
}

.game-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  top: max(14px, env(safe-area-inset-top));
  z-index: 20;
  min-height: 60px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(120, 83, 96, 0.16);
  backdrop-filter: blur(10px);
}

.game-hud p {
  margin: 0;
  color: #d75f82;
  font-size: 12px;
  font-weight: 950;
}

.game-hud strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.sound-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff0a8;
  box-shadow: inset 0 0 0 3px #fff;
}

.sound-btn::before {
  content: "♪";
  color: #8a6070;
  font-size: 24px;
  font-weight: 950;
}

.sound-btn.is-muted::after {
  position: absolute;
  width: 28px;
  height: 3px;
  content: "";
  margin: 20px 0 0 -28px;
  background: var(--rose);
  transform: rotate(-38deg);
}

.chapter-card {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 92px;
  z-index: 18;
  padding: 14px 16px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  color: #5d4b56;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 12px 26px rgba(120, 83, 96, 0.14);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.chapter-card.is-hidden {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.chapter-card p {
  margin-bottom: 4px;
  line-height: 1.5;
}

.world-map {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 92px;
  bottom: 72px;
  min-height: 540px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  overflow: hidden;
  background: #ececea;
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.38),
    0 22px 45px rgba(107, 74, 92, 0.22);
  filter: grayscale(1);
  transition: filter 0.7s ease, background 0.7s ease;
}

.world-map.has-light {
  filter: grayscale(0);
  background: linear-gradient(#fff9db, #ecfaef);
}

.map-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(132, 95, 111, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 95, 111, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
}

.route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.route-shadow,
.route-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-shadow {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 25;
}

.route-path {
  stroke: #ffd98a;
  stroke-width: 14;
  stroke-dasharray: 9 13;
}

.river-band {
  position: absolute;
  left: -40px;
  right: -40px;
  top: 334px;
  z-index: 1;
  height: 94px;
  border-radius: 50%;
  background: repeating-linear-gradient(-10deg, rgba(90, 166, 220, 0.72) 0 13px, rgba(255, 255, 255, 0.72) 13px 26px);
  transform: rotate(-8deg);
  transition: box-shadow 0.55s ease, filter 0.55s ease;
}

.river-band.is-lit {
  box-shadow: 0 0 36px rgba(90, 166, 220, 0.74);
  filter: brightness(1.15);
}

.district {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.district.is-lit {
  opacity: 1;
  transform: scale(1);
  mix-blend-mode: multiply;
  filter: saturate(1.25) brightness(1.08);
}

.district-park {
  left: -30px;
  bottom: 10px;
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, rgba(119, 201, 111, 0.5), transparent 70%);
}

.district-jianghan {
  left: 60px;
  top: 250px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 141, 175, 0.46), transparent 70%);
}

.district-riverbank {
  left: 150px;
  top: 104px;
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, rgba(90, 166, 220, 0.42), transparent 70%);
}

.district-optics {
  right: -42px;
  top: -22px;
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, rgba(179, 154, 232, 0.48), transparent 70%);
}

.level {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 8;
  width: 110px;
  min-height: 112px;
  border: 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  padding: 10px 8px;
  color: #594753;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(107, 74, 92, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.level:not(.is-unlocked):not(.is-done) {
  filter: grayscale(1) opacity(0.62);
}

.level.is-unlocked {
  animation: pulse 1.5s ease-in-out infinite;
}

.level.is-done {
  color: #5d3b1d;
  background: linear-gradient(180deg, #fff8bd, #fff3d7);
  box-shadow:
    0 0 0 6px rgba(255, 217, 111, 0.62),
    0 0 34px rgba(255, 217, 111, 0.92),
    0 14px 26px rgba(107, 74, 92, 0.18);
}

.level.is-done .pin {
  background: #f5b832;
}

.level.just-lit {
  animation: levelLightPop 0.9s ease both;
}

.level strong {
  font-size: 15px;
}

.level small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.pin {
  position: absolute;
  left: -8px;
  top: -10px;
  width: 32px;
  height: 32px;
  border: 3px solid #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 950;
  background: var(--rose);
}

.place-icon {
  position: relative;
  width: 62px;
  height: 46px;
  display: block;
}

.park-icon::before {
  position: absolute;
  left: 4px;
  top: 9px;
  width: 52px;
  height: 28px;
  border: 4px solid #85565f;
  border-radius: 4px;
  content: "";
  background: #fff4d2;
}

.park-icon::after {
  position: absolute;
  left: 11px;
  top: 0;
  width: 40px;
  height: 20px;
  border-radius: 18px 18px 0 0;
  content: "";
  background: var(--green);
}

.street-icon::before {
  position: absolute;
  inset: 8px 3px 4px;
  border-radius: 7px;
  content: "";
  background: repeating-linear-gradient(90deg, #ffcf63 0 13px, #ff8daf 13px 26px);
  border: 4px solid #85565f;
}

.street-icon::after {
  position: absolute;
  left: 8px;
  top: 0;
  width: 48px;
  height: 16px;
  content: "";
  border-radius: 12px 12px 2px 2px;
  background: #ff6f84;
}

.river-icon::before {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 20px;
  content: "";
  border-radius: 50%;
  background: var(--blue);
}

.river-icon::after {
  position: absolute;
  left: 10px;
  top: 4px;
  width: 40px;
  height: 26px;
  border-radius: 6px 6px 18px 18px;
  content: "";
  background: #fff;
  border-bottom: 7px solid #7ac9ec;
}

.optics-icon::before {
  position: absolute;
  left: 8px;
  top: 0;
  width: 46px;
  height: 46px;
  border: 6px solid #fff;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, var(--pink), var(--purple));
}

.map-hero {
  left: 49px;
  top: 500px;
  z-index: 40;
  transition: left 0.8s cubic-bezier(0.34, 1.4, 0.64, 1), top 0.8s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.map-hero.is-path-walking {
  transition: none;
}

.map-hero.is-walking .hero-body {
  animation: walk 0.32s ease-in-out infinite;
}

.map-props span {
  position: absolute;
  z-index: 4;
  display: block;
}

.tree {
  width: 42px;
  height: 64px;
  border-radius: 50% 50% 44% 44%;
  background: #73c768;
  border: 4px solid #3d7650;
  cursor: pointer;
  pointer-events: auto;
}

.tree::after {
  position: absolute;
  left: 15px;
  bottom: -18px;
  width: 10px;
  height: 24px;
  content: "";
  border-radius: 6px;
  background: #76513d;
}

body.admin-mode .tree {
  filter: drop-shadow(0 0 8px rgba(255, 141, 175, 0.55));
}

body:not(.admin-mode) .visual-editor,
body:not(.admin-mode) .story-edit-toggle,
body:not(.admin-mode) .story-edit-panel,
body:not(.admin-mode) .archive-edit-panel {
  display: none !important;
}

.t1 {
  left: 20px;
  top: 420px;
}

.t2 {
  left: 34px;
  top: 370px;
  transform: scale(0.86);
}

.t3 {
  right: 34px;
  top: 205px;
  transform: scale(0.78);
}

.noodle {
  right: 22px;
  bottom: 26px;
  width: 72px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffb32d 0 22px, #fff 23px 100%);
  border: 4px solid #86525b;
}

.noodle::before {
  position: absolute;
  right: 8px;
  top: -10px;
  width: 4px;
  height: 42px;
  content: "";
  border-radius: 99px;
  background: #86525b;
  transform: rotate(44deg);
  box-shadow: 9px -5px 0 #86525b;
}

.ferry {
  left: 198px;
  top: 346px;
  width: 72px;
  height: 34px;
  border-radius: 6px 6px 22px 22px;
  background: #fff;
  border-bottom: 8px solid var(--blue);
}

.flower {
  color: var(--pink);
  font-size: 24px;
}

.f1 {
  left: 280px;
  top: 292px;
}

.f2 {
  left: 70px;
  top: 250px;
}

.task-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.task-progress span {
  min-height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #796370;
  font-size: 11px;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(107, 74, 92, 0.11);
}

.task-progress span.is-done {
  color: #fff;
  background: linear-gradient(135deg, #45b85f, #66dcb3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72), 0 0 24px rgba(102, 220, 179, 0.72);
}

.level-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
}

.level-modal.is-open {
  display: grid;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(75, 55, 66, 0.28);
  backdrop-filter: blur(4px);
}

.level-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 410px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 16px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background:
    linear-gradient(transparent 23px, rgba(214, 154, 180, 0.12) 24px),
    linear-gradient(90deg, transparent 23px, rgba(214, 154, 180, 0.12) 24px),
    rgba(255, 250, 241, 0.94);
  background-size: 24px 24px;
  box-shadow: 0 24px 70px rgba(72, 50, 62, 0.32);
  animation: panelIn 0.36s ease both;
}

.level-panel::before {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  content: "";
  border: 2px dashed rgba(255, 141, 175, 0.5);
  border-radius: 22px;
  pointer-events: none;
}

.level-scene {
  position: relative;
  min-height: 250px;
  border-radius: 24px;
  overflow: hidden;
  background: #dff6ff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.68);
}

.park-scene {
  background:
    radial-gradient(circle at 18% 70%, #78ca73 0 60px, transparent 61px),
    radial-gradient(circle at 82% 64%, #9ad66f 0 65px, transparent 66px),
    linear-gradient(#ccefff 0 52%, #9edb79 52%);
}

.park-gate {
  position: absolute;
  left: 34px;
  top: 42px;
  width: 146px;
  height: 86px;
  border: 5px solid #7b4f58;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #7b4f58;
  font-size: 20px;
  font-weight: 950;
  background: #fff3d2;
}

.park-gate::before {
  position: absolute;
  left: -10px;
  right: -10px;
  top: -24px;
  height: 30px;
  content: "";
  border-radius: 20px 20px 4px 4px;
  background: #ef8367;
  border: 5px solid #7b4f58;
}

.trash-target,
.cartoon-trash {
  position: absolute;
  right: 38px;
  bottom: 28px;
  width: 112px;
  height: 118px;
  padding-top: 42px;
  border: 4px solid #4b5b61;
  border-radius: 16px 16px 24px 24px;
  text-align: center;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(#66c7df, #4485c8);
}

.trash-target::before {
  position: absolute;
  left: 10px;
  right: 10px;
  top: -16px;
  height: 26px;
  content: "";
  border-radius: 18px;
  background: #4b5b61;
}

.trash-target.is-glow,
.praise-box.is-glow,
.optics-orb.is-glow {
  box-shadow: 0 0 0 12px rgba(255, 217, 111, 0.42), 0 0 40px rgba(255, 217, 111, 0.8);
}

.drag-paper {
  position: absolute;
  left: 42px;
  bottom: 44px;
  width: 116px;
  height: 76px;
  border: 3px solid #fff8d6;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #7d5966;
  font-weight: 950;
  background: #fff0a8;
  box-shadow: 0 10px 22px rgba(92, 63, 75, 0.2);
  transform: rotate(-8deg);
  touch-action: none;
  cursor: grab;
}

.drag-paper.is-flying {
  animation: throwPaper 0.78s ease-in forwards;
}

.level-copy {
  position: relative;
  z-index: 2;
  padding: 18px 8px 8px;
  text-align: center;
}

.level-copy h2 {
  margin-bottom: 10px;
  font-size: 27px;
  line-height: 1.2;
}

.level-copy p:not(.level-kicker),
.modal-tip {
  color: var(--muted);
  line-height: 1.65;
}

.choice-pills {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.choice-pills button {
  min-height: 36px;
  border: 2px solid rgba(125, 89, 102, 0.14);
  border-radius: 999px;
  padding: 0 12px;
  color: #715b66;
  font-weight: 950;
  background: #fff;
}

.choice-pills button.is-picked {
  color: #fff;
  border-color: transparent;
  background: var(--pink);
}

input {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 46px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 2px solid rgba(125, 89, 102, 0.14);
  border-radius: 15px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

input:focus {
  border-color: rgba(255, 141, 175, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 141, 175, 0.15);
}

.modal-tip {
  position: relative;
  z-index: 2;
  margin: 10px 0 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.street-scene {
  background: linear-gradient(#bfe8ff 0 52%, #ffd98f 52%);
}

.street-scene::before {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 72px;
  height: 82px;
  border: 4px solid #7b4f58;
  border-radius: 14px;
  content: "";
  background: repeating-linear-gradient(90deg, #ffeab6 0 30px, #ffabc0 30px 60px);
}

.street-store {
  position: absolute;
  left: 30px;
  top: 32px;
  padding: 8px 18px;
  border-radius: 12px;
  color: #fff;
  font-weight: 950;
  background: var(--rose);
}

.praise-box {
  position: absolute;
  left: calc(50% - 68px);
  bottom: 34px;
  width: 136px;
  height: 112px;
  border: 4px solid #76515d;
  border-radius: 22px;
  color: #76515d;
  font-size: 21px;
  font-weight: 950;
  background: #ffe1ed;
}

.praise-box::before {
  position: absolute;
  left: 20px;
  right: 20px;
  top: -18px;
  height: 30px;
  border: 4px solid #76515d;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  content: "";
}

.praise-paper {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 44px;
  z-index: 4;
  min-height: 154px;
  padding: 18px;
  border: 3px solid #fff6d4;
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  background: #fff9e8;
  box-shadow: 0 18px 36px rgba(91, 62, 75, 0.22);
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  pointer-events: none;
}

.praise-paper.is-open {
  animation: openPaper 0.44s ease forwards;
}

.praise-paper span {
  color: #d75f82;
  font-weight: 950;
}

.praise-paper strong {
  font-size: 22px;
  line-height: 1.42;
}

.story-copy {
  padding-top: 8px;
}

.people-stage {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}

.people-stage button {
  min-height: 112px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(97, 70, 84, 0.16);
}

.people-stage button.is-seen {
  outline: 5px solid rgba(138, 219, 188, 0.54);
}

.people-stage span {
  width: 74px;
  height: 74px;
  border: 4px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: #fff0b1;
}

.people-stage span.has-image {
  background: #fff;
}

.people-stage span img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.people-stage strong {
  display: block;
  font-size: 20px;
}

.people-stage small {
  display: block;
  color: var(--muted);
  font-weight: 900;
}

.riverbank-result {
  position: relative;
  z-index: 2;
  margin: 14px 0 0;
  padding: 13px;
  border-radius: 16px;
  text-align: center;
  color: #5e7180;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.76);
}

.riverbank-result.is-on {
  margin: 10px 0 0;
  padding: 0;
  color: #6a5661;
  background: transparent;
  box-shadow: none;
}

.story-edit-toggle {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 2px dashed rgba(125, 89, 102, 0.22);
  border-radius: 14px;
  color: #7b6c78;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.58);
}

.story-edit-panel {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  display: grid;
  gap: 10px;
  text-align: left;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: inset 0 0 0 2px rgba(255, 175, 202, 0.24);
}

.story-edit-panel[hidden] {
  display: none;
}

.story-edit-panel label {
  display: grid;
  gap: 6px;
  color: #604b58;
  font-size: 12px;
  font-weight: 950;
}

.story-edit-panel input,
.story-edit-panel textarea {
  width: 100%;
  border: 2px solid rgba(125, 89, 102, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  background: #fff;
}

.story-edit-panel textarea {
  resize: vertical;
}

.story-edit-panel button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 950;
  background: #7b6c78;
}

.optics-scene {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 217, 111, 0.4), transparent 8rem),
    linear-gradient(#a8e0ff, #d8bbff 58%, #ffe0aa);
}

.optics-orb {
  width: 164px;
  height: 164px;
  border: 8px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 23px;
  font-weight: 950;
  text-shadow: 0 2px 8px rgba(73, 61, 92, 0.26);
  background: radial-gradient(circle, var(--pink), var(--purple));
}

.wish-sky span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff7a8;
  box-shadow: 0 0 14px #fff7a8;
  animation: flyWish 1.2s ease-out forwards;
}

.finale-screen {
  background: #e8e9e8;
  text-align: center;
}

.finale-screen.is-lit {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 217, 111, 0.48), transparent 12rem),
    linear-gradient(#bfe9ff, #fff2c4 56%, #e5f8ee);
}

.final-city {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 88px;
  height: 382px;
  filter: grayscale(1);
  opacity: 0.72;
  transition: filter 0.9s ease, opacity 0.9s ease;
}

.finale-screen.is-lit .final-city {
  filter: grayscale(0);
  opacity: 1;
}

.final-city span {
  position: absolute;
  display: block;
}

.final-river {
  left: -60px;
  right: -60px;
  bottom: 38px;
  height: 116px;
  border-radius: 50%;
  background: repeating-linear-gradient(-8deg, #5aa6dc 0 14px, #ebfbff 14px 28px);
  box-shadow: 0 0 42px rgba(90, 166, 220, 0.7);
}

.final-bridge {
  left: 118px;
  right: 28px;
  bottom: 152px;
  height: 24px;
  border-top: 9px solid var(--coral);
  border-bottom: 5px solid var(--coral);
}

.final-tower {
  left: 42px;
  bottom: 134px;
  width: 124px;
  height: 194px;
  background: var(--sun);
  clip-path: polygon(50% 0, 80% 18%, 68% 18%, 78% 36%, 64% 36%, 74% 56%, 60% 56%, 66% 100%, 34% 100%, 40% 56%, 26% 56%, 36% 36%, 22% 36%, 32% 18%, 20% 18%);
}

.final-building {
  bottom: 154px;
  width: 58px;
  border-radius: 10px 10px 0 0;
  background: #9bd6e8;
}

.final-building.a {
  right: 82px;
  height: 118px;
}

.final-building.b {
  right: 20px;
  height: 150px;
}

.petal {
  color: var(--pink);
  font-size: 24px;
  animation: petal 3s ease-in-out infinite;
}

.p1 {
  left: 30px;
  top: 28px;
}

.p2 {
  right: 40px;
  top: 70px;
  animation-delay: 0.4s;
}

.p3 {
  left: 52%;
  top: 18px;
  animation-delay: 0.9s;
}

.p4 {
  right: 104px;
  top: 150px;
  animation-delay: 1.4s;
}

.final-copy {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 54px;
  z-index: 90;
}

.final-copy p {
  color: #6a5661;
  font-weight: 900;
  line-height: 1.7;
}

.final-copy h2 {
  margin-bottom: 16px;
  font-size: 31px;
  line-height: 1.22;
}

.archive-screen {
  overflow: auto;
  background: linear-gradient(#fff8d7, #e6f7f0);
}

.archive-head {
  padding: 26px 6px 14px;
  text-align: center;
}

.archive-head h2 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.2;
}

.archive-head span {
  color: var(--muted);
  line-height: 1.6;
  font-weight: 800;
}

.archive-wall {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-bottom: 18px;
}

.archive-wall button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  box-shadow: 0 10px 22px rgba(98, 74, 88, 0.17);
}

.archive-wall img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.archive-screen > .main-btn {
  width: 100%;
  margin-bottom: 18px;
}

.end-screen {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 217, 111, 0.55), transparent 11rem),
    linear-gradient(#e6f7f0, #fff0c6);
}

.end-screen.is-active {
  display: flex;
  flex-direction: column;
}

.end-badge {
  margin-bottom: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  background: var(--green);
}

.end-screen h2 {
  margin-bottom: 12px;
  font-size: 32px;
}

.end-screen ul {
  width: min(100%, 285px);
  margin: 12px auto 18px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.end-screen li {
  min-height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #5e4d58;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.78);
}

.end-screen p {
  max-width: 19em;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.75;
}

.text-dialog {
  width: min(86vw, 360px);
  border: 0;
  border-radius: 24px;
  padding: 24px;
  color: var(--ink);
  background: #fffaf1;
  box-shadow: 0 22px 70px rgba(62, 45, 54, 0.34);
}

.text-dialog::backdrop {
  background: rgba(47, 42, 54, 0.38);
  backdrop-filter: blur(4px);
}

.text-dialog button {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  background: var(--pink);
}

.text-dialog p {
  color: #d75f82;
  font-weight: 950;
}

.text-dialog h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.45;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes walk {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes throwPaper {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(-8deg) scale(1);
  }
  74% {
    opacity: 1;
    transform: translate(calc(var(--paper-fly-x, 138px) * 0.82), calc(var(--paper-fly-y, -22px) * 0.82)) rotate(18deg) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(var(--paper-fly-x, 138px), var(--paper-fly-y, -22px)) rotate(26deg) scale(0.18);
  }
}

@keyframes levelLightPop {
  0% {
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(1);
  }
  42% {
    transform: translate(-50%, -50%) scale(1.13);
    filter: brightness(1.18);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(1.06) saturate(1.08);
  }
}

@keyframes openPaper {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes flyWish {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.28);
  }
}

@keyframes petal {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(20px) rotate(22deg);
  }
}

@media (max-height: 720px) {
  .game {
    min-height: 100dvh;
  }

  .world-map {
    top: 86px;
    bottom: 62px;
    min-height: auto;
  }

  .chapter-card {
    display: none;
  }

  .level-panel {
    max-height: calc(100dvh - 28px);
  }
}

/* Wuhan asset pass: replace placeholder drawing with supplied city illustrations. */
.intro-screen {
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 217, 111, 0.52), transparent 8rem),
    radial-gradient(circle at 14% 24%, rgba(255, 141, 175, 0.28), transparent 10rem),
    linear-gradient(#bfeeff 0 46%, #fff5ce 72%, #e3f8ee);
}

.intro-city {
  top: 92px;
  height: 404px;
  filter: none;
  opacity: 1;
}

.intro-city img {
  position: absolute;
  display: block;
  object-fit: contain;
}

.intro-logo {
  right: 2px;
  top: 10px;
  width: 190px;
  filter: drop-shadow(0 12px 18px rgba(116, 74, 88, 0.16));
}

.intro-crane {
  left: 10px;
  top: 30px;
  width: 172px;
  filter: drop-shadow(0 12px 18px rgba(116, 74, 88, 0.14));
}

.intro-bridge {
  left: 82px;
  right: 0;
  bottom: 76px;
  width: 285px;
  opacity: 0.96;
}

.intro-ferry {
  right: 44px;
  bottom: 42px;
  width: 106px;
  animation: ferryDrift 3.8s ease-in-out infinite;
}

.intro-sakura {
  left: -10px;
  bottom: 2px;
  width: 126px;
}

.intro-hero {
  top: 386px;
}

.intro-copy {
  bottom: 34px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.74);
  box-shadow: 0 16px 34px rgba(107, 74, 92, 0.14);
  backdrop-filter: blur(8px);
}

.map-screen {
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 141, 175, 0.24), transparent 9rem),
    radial-gradient(circle at 82% 74%, rgba(138, 219, 188, 0.3), transparent 10rem),
    linear-gradient(#ffedbf, #fff8df 44%, #dff7ee);
}

.world-map {
  background:
    radial-gradient(circle at 20% 76%, rgba(119, 201, 111, 0.28), transparent 8rem),
    radial-gradient(circle at 76% 23%, rgba(179, 154, 232, 0.26), transparent 7rem),
    linear-gradient(#fff9d9, #f7fbef);
  filter: none;
}

.world-map.has-light {
  background:
    radial-gradient(circle at 20% 76%, rgba(119, 201, 111, 0.44), transparent 8rem),
    radial-gradient(circle at 46% 48%, rgba(255, 141, 175, 0.32), transparent 8rem),
    radial-gradient(circle at 76% 23%, rgba(179, 154, 232, 0.42), transparent 7rem),
    linear-gradient(#fff9d9, #e9fbef);
}

.level {
  width: 122px;
  min-height: 128px;
  padding: 8px 8px 10px;
  background: rgba(255, 255, 255, 0.92);
}

.place-icon {
  display: none;
}

.place-art {
  width: 82px;
  height: 66px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgba(107, 74, 92, 0.15));
}

.level-park {
  --x: 76px !important;
}

.level-jianghan {
  --x: 132px !important;
}

.level-riverbank {
  --x: 210px !important;
}

.level-optics {
  --x: 282px !important;
  --y: 70px !important;
}

.map-food,
.map-ferry,
.map-car {
  position: absolute;
  z-index: 5;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgba(107, 74, 92, 0.13));
}

.noodle-img {
  right: 10px;
  bottom: 14px;
  width: 74px;
}

.doupi-img {
  left: 12px;
  bottom: 188px;
  width: 68px;
  transform: rotate(-8deg);
}

.map-ferry {
  left: 198px;
  top: 350px;
  width: 88px;
}

.map-car {
  right: 18px;
  top: 246px;
  width: 58px;
}

.ferry,
.noodle {
  display: none !important;
}

.level-scene {
  min-height: 268px;
  background: #fff2cf;
}

.scene-bg-art {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 18px rgba(107, 74, 92, 0.13));
}

.park-art {
  left: -8px;
  top: -10px;
  width: 205px;
}

.customs-art {
  left: 12px;
  top: 6px;
  width: 172px;
  opacity: 0.96;
}

.optics-art {
  right: -8px;
  top: 6px;
  width: 178px;
}

.trash-target {
  right: 28px;
  bottom: 22px;
  width: 142px;
  height: 104px;
  padding: 0;
  border: 0;
  background: transparent;
}

.trash-target::before {
  display: none;
}

.trash-target img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.street-scene::before {
  opacity: 0.45;
}

.praise-box {
  bottom: 26px;
  background:
    radial-gradient(circle at 50% 26%, #fff 0 15px, transparent 16px),
    linear-gradient(#ffe1ed, #ffc0d2);
}

.optics-scene {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 217, 111, 0.4), transparent 8rem),
    linear-gradient(#c5ecff, #e0c9ff 58%, #ffe0aa);
}

.finale-screen {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 217, 111, 0.58), transparent 10rem),
    linear-gradient(#bdeeff, #fff6cf 55%, #e4f8ee);
}

.final-city {
  left: 16px;
  right: 16px;
  top: 64px;
  height: 440px;
  filter: none;
  opacity: 1;
}

.final-city img,
.final-city span {
  position: absolute;
  display: block;
}

.final-logo {
  right: 20px;
  top: 12px;
  width: 190px;
  filter: drop-shadow(0 14px 18px rgba(107, 74, 92, 0.15));
}

.final-crane {
  left: 18px;
  top: 64px;
  width: 168px;
  z-index: 2;
}

.final-bridge-img {
  left: 72px;
  right: 0;
  bottom: 72px;
  width: 302px;
  z-index: 1;
}

.final-ferry {
  right: 38px;
  bottom: 38px;
  width: 128px;
  z-index: 3;
  animation: ferryDrift 3.4s ease-in-out infinite;
}

.final-sakura-tree {
  left: -10px;
  bottom: 14px;
  width: 126px;
  z-index: 4;
}

.final-river,
.final-bridge,
.final-tower,
.final-building {
  display: none !important;
}

.final-copy {
  left: 22px;
  right: 22px;
  bottom: 34px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 16px 36px rgba(107, 74, 92, 0.17);
  backdrop-filter: blur(8px);
}

.final-copy h2 {
  font-size: 28px;
}

.archive-wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.archive-wall button {
  aspect-ratio: 1.08;
  background: #fffaf1;
}

.archive-wall img {
  object-fit: contain;
  padding: 6px;
}

.end-screen {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 217, 111, 0.5), transparent 10rem),    linear-gradient(#c7efff, #fff2c7 54%, #e7f8ef);
}

.end-screen h2,
.end-screen p,
.end-screen ul,
.end-badge,
.end-screen .main-btn {
  position: relative;
  z-index: 2;
}

.end-screen::before {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 34px;
  height: 410px;
  border-radius: 28px;
  content: "";
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 16px 36px rgba(107, 74, 92, 0.16);
}

@keyframes ferryDrift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-12px);
  }
}

/* Editorial polish pass: news-interactive, mobile typography, archive, and state clarity. */
h1,
h2,
h3,
.level strong,
.task-progress span,
.main-btn {
  overflow-wrap: normal;
  word-break: keep-all;
  text-wrap: balance;
}

p,
span,
small,
li,
input,
button {
  overflow-wrap: break-word;
}

h1 {
  width: max-content;
  max-width: 100%;
  font-size: clamp(40px, 12.4vw, 58px);
  white-space: nowrap;
}

.subtitle {
  font-size: clamp(17px, 4.7vw, 20px);
  line-height: 1.35;
}

.intro-text {
  width: 100%;
  font-size: 15px;
  line-height: 1.68;
}

.intro-copy {
  left: 18px;
  right: 18px;
  bottom: 24px;
  padding: 16px;
}

.main-btn {
  min-height: 46px;
  border-radius: 15px;
  line-height: 1.2;
  text-align: center;
}

.game-hud strong {
  white-space: nowrap;
}

.chapter-card {
  top: 86px;
}

.world-map {
  top: 84px;
  bottom: 76px;
}

.level {
  opacity: 0.72;
}

.level.is-current {
  opacity: 1;
  z-index: 12;
  outline: 5px solid rgba(255, 217, 111, 0.58);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.55), 0 16px 30px rgba(107, 74, 92, 0.22);
}

.level.is-done {
  opacity: 1;
  filter: brightness(1.06) saturate(1.08);
}

.level.is-locked {
  opacity: 0.52;
  filter: grayscale(0.55);
}

.level.is-locked .pin {
  background: #aaa;
}

.task-progress span {
  padding: 4px 3px;
  line-height: 1.18;
}

.task-progress span.is-current {
  color: #7b4f00;
  background: #fff0a8;
  box-shadow: 0 0 0 3px rgba(255, 217, 111, 0.35);
}

.task-progress span.is-done::after {
  content: " ✓";
}

.level-panel {
  width: min(100%, 398px);
  padding: 15px;
}

.level-copy h2 {
  font-size: clamp(23px, 6.4vw, 28px);
  line-height: 1.22;
}

.level-copy p:not(.level-kicker),
.modal-tip {
  font-size: 14px;
  line-height: 1.65;
}

.praise-paper {
  left: 20px;
  right: 20px;
  padding: 16px;
}

.praise-paper strong {
  font-size: clamp(18px, 5.1vw, 22px);
  line-height: 1.48;
}

.people-stage button {
  grid-template-columns: 72px 1fr;
  min-height: 102px;
}

.people-stage span {
  width: 66px;
  height: 66px;
}

.final-city {
  top: 42px;
  height: 420px;
}

.final-copy {
  bottom: 28px;
  padding: 18px;
}

.final-copy p {
  margin-bottom: 8px;
  font-size: 15px;
}

.final-copy h2 {
  margin-bottom: 16px;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.28;
}

.archive-screen {
  padding: 20px 16px 18px;
}

.archive-head {
  padding: 14px 4px 14px;
}

.archive-head h2 {
  max-width: 13em;
  margin: 0 auto 10px;
  font-size: clamp(23px, 6.4vw, 30px);
  line-height: 1.25;
}

.archive-head span {
  display: block;
  max-width: 21em;
  margin: 0 auto;
  font-size: 14px;
}

.archive-wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 18px;
}

.archive-wall button {
  aspect-ratio: 16 / 10.8;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 20px rgba(98, 74, 88, 0.13);
}

.archive-wall img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  transform-origin: center;
  transition: transform 0.18s ease;
}

.archive-screen > .main-btn {
  margin-top: 2px;
}

.text-dialog {
  width: min(90vw, 380px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 22px;
}

.text-dialog.image-preview {
  padding-top: 18px;
}

.preview-frame {
  width: 100%;
  aspect-ratio: 16 / 10.8;
  margin: 6px 0 14px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.preview-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
}

.text-dialog h3 {
  font-size: clamp(19px, 5.5vw, 24px);
  line-height: 1.45;
}

.archive-edit-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(125, 89, 102, 0.22);
  display: grid;
  gap: 10px;
  text-align: left;
}

.archive-edit-panel[hidden] {
  display: none;
}

.archive-edit-panel label {
  display: grid;
  gap: 6px;
  color: #604b58;
  font-size: 12px;
  font-weight: 950;
}

.archive-edit-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  border: 2px solid rgba(125, 89, 102, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  background: #fff;
}

.archive-edit-panel input[type="range"] {
  width: 100%;
}

.archive-edit-panel button {
  position: static;
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 950;
  background: #7b6c78;
}

.end-screen {
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 217, 111, 0.46), transparent 9rem),
    linear-gradient(#c7efff, #fff2c7 54%, #e7f8ef);
}

.end-screen::before {
  top: 86px;
  bottom: 24px;
  height: auto;
}

.end-badge {
  margin-top: 34px;
}

.end-screen h2 {
  font-size: clamp(28px, 7.8vw, 34px);
  white-space: nowrap;
}

.end-screen ul {
  width: min(100%, 300px);
}

.end-screen li {
  justify-content: start;
  padding: 0 16px;
  text-align: left;
}

.end-screen p {
  max-width: 18em;
  font-size: 15px;
  line-height: 1.75;
}

@media (max-width: 390px) {
  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .intro-copy {
    left: 14px;
    right: 14px;
  }

  h1 {
    font-size: 40px;
  }

  .level {
    width: 112px;
    min-height: 120px;
  }

  .place-art {
    width: 76px;
    height: 60px;
  }

  .level-park {
    --x: 70px !important;
  }

  .level-jianghan {
    --x: 126px !important;
  }

  .level-riverbank {
    --x: 202px !important;
  }

  .level-optics {
    --x: 274px !important;
  }

  .archive-wall {
    gap: 9px;
  }
}

/* Local visual tuning panel for manual layout adjustments. */
.visual-editor {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 200;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

.editor-toggle {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 14px 28px rgba(107, 74, 92, 0.28);
}

.editor-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(330px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 96px));
  overflow: auto;
  padding: 14px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  display: none;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 18px 52px rgba(72, 50, 62, 0.3);
  backdrop-filter: blur(10px);
}

.visual-editor.is-open .editor-panel {
  display: block;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.editor-head strong {
  font-size: 18px;
}

.editor-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  background: var(--pink);
}

.editor-panel label {
  display: grid;
  gap: 7px;
  margin: 11px 0;
  color: #604b58;
  font-size: 13px;
  font-weight: 950;
}

.editor-panel select,
.editor-panel input[type="range"] {
  width: 100%;
}

.editor-panel select {
  min-height: 38px;
  border: 2px solid rgba(125, 89, 102, 0.16);
  border-radius: 12px;
  padding: 0 10px;
  background: #fff;
}

.editor-check {
  grid-template-columns: 22px 1fr;
  align-items: center;
}

.editor-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

#editorSavePublished {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--coral), var(--pink));
}

.quick-save-published {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 320;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  display: none;
  padding: 0 18px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 14px 28px rgba(107, 74, 92, 0.28);
}

body.admin-mode .quick-save-published {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-actions button,
.editor-upload button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 950;
  background: #7b6c78;
}

.editor-upload {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(125, 89, 102, 0.22);
}

.editor-upload input[type="file"] {
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
}

.editor-upload button {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #7b6c78, #b2778e);
}

.editor-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.editor-selected {
  outline: 0 !important;
  outline-offset: 0;
}

.editor-draggable-target {
  pointer-events: auto !important;
  cursor: grab;
  touch-action: none;
}

.editor-draggable-target.editor-selected {
  cursor: move;
}

.editor-resize-handle {
  position: fixed;
  z-index: 260;
  width: 24px;
  height: 24px;
  display: none;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 10px 22px rgba(107, 74, 92, 0.32);
  cursor: nwse-resize;
  touch-action: none;
}

.editor-resize-handle.is-visible {
  display: block;
}

.custom-editor-image {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 35;
  width: 150px;
  height: auto;
  object-fit: contain;
  cursor: move;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 16px rgba(107, 74, 92, 0.16));
}

/* Focused storytelling pass: fewer competing visuals, slower moments, clearer completion. */
.intro-logo {
  right: 6px;
  top: 2px;
  width: 170px;
}

.intro-crane {
  left: 12px;
  top: 54px;
  width: 178px;
}

.intro-ferry {
  right: 34px;
  bottom: 34px;
  width: 104px;
}

.intro-sakura {
  left: -4px;
  bottom: 26px;
  width: 112px;
  opacity: 0.88;
}

.intro-hero {
  top: 372px;
}

.intro-copy {
  bottom: 28px;
  padding: 20px 18px;
}

.intro-text {
  margin-bottom: 22px;
  line-height: 1.82;
}

.subtitle {
  display: none;
}

.park-art {
  left: 8px;
  top: 8px;
  width: 156px;
  opacity: 0.9;
}

.park-gate {
  left: 26px;
  top: 34px;
  transform: scale(0.78);
  transform-origin: left top;
}

.trash-target {
  right: 28px;
  bottom: 32px;
  width: 116px;
  height: 118px;
  border: 4px solid #5d6970;
  border-radius: 18px 18px 26px 26px;
  display: grid;
  place-items: center;
  padding-top: 20px;
  color: #fff;
  text-align: center;
  font-weight: 950;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.32), transparent 24px),
    linear-gradient(#72cfe4, #4989c8);
}

.trash-target::before {
  left: 10px;
  right: 10px;
  top: -16px;
  height: 26px;
  border-radius: 18px;
  display: block;
  background: #5d6970;
}

.trash-target::after {
  position: absolute;
  inset: 26px 22px auto;
  height: 38px;
  content: "";
  border-left: 4px solid rgba(255, 255, 255, 0.5);
  border-right: 4px solid rgba(255, 255, 255, 0.5);
}

.trash-target img {
  display: none;
}

.drag-paper {
  left: 30px;
  bottom: 28px;
  width: 104px;
  height: 68px;
  z-index: 4;
}

.praise-paper {
  top: 40px;
  transform: translateY(64px) scale(0.42);
  transform-origin: 50% 100%;
}

.praise-paper.is-open {
  animation: letterUnfold 0.86s cubic-bezier(0.2, 0.82, 0.18, 1) forwards;
}

.praise-paper strong {
  max-height: 7.6em;
  overflow: hidden;
}

.optics-art {
  right: -18px !important;
  top: 18px !important;
  width: 190px !important;
  max-height: 150px;
  opacity: 0.9;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(87, 91, 150, 0.16));
}

.wish-sky span {
  width: 14px;
  height: 14px;
  background: #fff6a6;
  box-shadow: 0 0 16px #fff6a6, 0 0 28px rgba(255, 217, 111, 0.72);
}

.wish-sky span::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  content: "";
  background: rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%) rotate(45deg);
}

.wish-sky span::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 20px;
  content: "";
  background: rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%) rotate(45deg);
}

.final-city {
  top: 54px;
  height: 390px;
  filter: grayscale(1);
  opacity: 0.76;
}

.finale-screen {
  background: linear-gradient(#e9e9e4, #f7f1dd 58%, #e6eee7);
}

.finale-screen.is-lit {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 217, 111, 0.58), transparent 10rem),
    linear-gradient(#bdeeff, #fff6cf 55%, #e4f8ee);
}

.finale-screen.is-lit .final-city {
  filter: none;
  opacity: 1;
}

.final-logo,
.final-ferry,
.final-sakura-tree {
  display: none !important;
}

.final-crane {
  left: 28px;
  top: 58px;
  width: 168px;
}

.final-bridge-img {
  left: 80px;
  bottom: 54px;
  width: 286px;
  opacity: 0.95;
}

.final-city::before {
  position: absolute;
  left: -42px;
  right: -42px;
  bottom: 10px;
  height: 112px;
  border-radius: 50%;
  content: "";
  background: repeating-linear-gradient(-8deg, #5aa6dc 0 14px, #ebfbff 14px 28px);
  box-shadow: 0 0 42px rgba(90, 166, 220, 0.72);
}

.final-copy {
  bottom: 34px;
}

.archive-wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
}

.archive-wall img {
  object-fit: cover;
  background: #fff;
}

.dialog-continue {
  display: none;
}

.text-dialog.is-completion #dialogClose {
  display: none;
}

.text-dialog.is-completion .dialog-continue {
  position: static;
  width: 100%;
  min-height: 44px;
  height: auto;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--coral), var(--pink));
}

.end-badge {
  display: none;
}

.end-screen ul {
  order: 1;
}

.end-screen h2 {
  order: 2;
  margin-top: 14px;
}

.end-screen p {
  order: 3;
}

.end-screen .main-btn {
  order: 4;
}

.end-screen::before {
  top: 92px;
}

.end-badge,
.end-screen h2,
.end-screen li,
.end-screen p,
.end-screen .main-btn {
  opacity: 1;
}

.end-screen.is-complete .end-screen {
  opacity: 1;
}

.end-screen.is-complete li,
.end-screen.is-complete .end-badge,
.end-screen.is-complete h2,
.end-screen.is-complete p,
.end-screen.is-complete .main-btn {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.end-screen.is-complete li:nth-child(1) {
  animation-delay: 0.2s;
}

.end-screen.is-complete li:nth-child(2) {
  animation-delay: 0.4s;
}

.end-screen.is-complete li:nth-child(3) {
  animation-delay: 0.6s;
}

.end-screen.is-complete li:nth-child(4) {
  animation-delay: 0.8s;
}

.end-screen.is-complete h2 {
  animation-delay: 1.15s;
}

.end-screen.is-complete p {
  animation-delay: 1.45s;
}

.end-screen.is-complete .main-btn {
  animation-delay: 1.7s;
}

.level-continue-btn[hidden] {
  display: none;
}

.level-continue-btn.is-ready {
  animation: fadeUp 0.42s ease forwards;
}

#drawPraiseBtn[hidden],
.modal-tip.is-hidden {
  display: none;
}

.main-btn.is-ready {
  animation: fadeUp 0.42s ease forwards;
}

.finale-screen .final-city {
  filter: none !important;
  opacity: 1 !important;
}

.finale-screen .finale-light-item {
  filter: grayscale(1) saturate(0.42) brightness(0.96);
  opacity: 0.58;
  transition: none;
}

.finale-screen.is-lit .finale-light-item {
  animation: landmarkLight 0.82s ease forwards;
  animation-delay: var(--light-delay, 0.2s);
}

.end-screen li {
  justify-content: center !important;
  padding: 0 14px !important;
  text-align: center !important;
}

@keyframes letterUnfold {
  0% {
    opacity: 0;
    transform: translateY(54px) scale(0.72) rotate(-2deg);
  }
  52% {
    opacity: 1;
    transform: translateY(8px) scale(1.02) rotate(0.4deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes landmarkLight {
  0% {
    filter: grayscale(1) saturate(0.42) brightness(0.96);
    opacity: 0.58;
  }
  45% {
    filter: grayscale(0.35) saturate(1.12) brightness(1.08);
    opacity: 0.9;
  }
  100% {
    filter: grayscale(0) saturate(1) brightness(1);
    opacity: 1;
  }
}

@keyframes letterOut {
  0% {
    opacity: 0;
    transform: translateY(68px) scale(0.38);
  }
  42% {
    opacity: 1;
    transform: translateY(26px) scale(0.62);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Final cartoon asset replacement pass. Keep only necessary Wuhan visuals. */
.intro-logo,
.intro-bridge,
.intro-ferry,
.intro-sakura,
.final-logo,
.final-bridge-img,
.final-ferry,
.final-sakura-tree,
.doupi-img,
.map-ferry,
.map-car {
  display: none !important;
}

.intro-city {
  top: 74px;
  height: 360px;
}

.intro-crane {
  left: 18px !important;
  top: 24px !important;
  width: 158px !important;
  filter: drop-shadow(0 14px 20px rgba(107, 74, 92, 0.16));
}

.intro-customs {
  position: absolute;
  right: 18px;
  top: 94px;
  width: 128px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(107, 74, 92, 0.16));
}

.intro-hero {
  top: 340px !important;
}

.intro-copy {
  bottom: 26px;
}

.place-art {
  width: 76px !important;
  height: 70px !important;
  object-fit: contain;
}

.optics-symbol {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 13px, transparent 14px),
    radial-gradient(circle at 50% 50%, #ff8daf 0 36px, #b39ae8 37px 100%);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.76), 0 8px 9px rgba(107, 74, 92, 0.15);
}

.level-optics .place-art {
  width: 84px !important;
  height: 64px !important;
}

.optics-scene {
  place-items: end start;
  padding: 0 0 28px 26px;
}

.optics-orb {
  position: relative;
  z-index: 2;
  width: 132px;
  height: 132px;
  font-size: 20px;
}

.noodle-img {
  right: 16px;
  bottom: 18px;
  width: 64px;
  opacity: 0.82;
}

.park-art {
  left: 10px !important;
  top: 4px !important;
  width: 124px !important;
  opacity: 0.82;
}

.customs-art {
  left: 22px !important;
  top: 12px !important;
  width: 112px !important;
  opacity: 0.88;
}

.final-city {
  top: 58px;
  height: 380px;
}

.final-crane {
  left: 36px !important;
  top: 42px !important;
  width: 168px !important;
}

.final-customs {
  position: absolute;
  right: 38px;
  top: 126px;
  width: 118px;
  z-index: 2;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(107, 74, 92, 0.16));
}

@media (max-width: 390px) {
  .intro-crane {
    width: 146px !important;
  }

  .intro-customs {
    width: 116px;
    right: 16px;
  }

  .final-crane {
    width: 154px !important;
  }

  .final-customs {
    width: 108px;
    right: 28px;
  }
}

/* Keep finale landmarks gray on entry, then light them one by one. */
#finaleScreen:not(.is-lit) .finale-light-item {
  filter: grayscale(1) saturate(0.42) brightness(0.96) !important;
  opacity: 0.58 !important;
}

#finaleScreen.is-lit .finale-light-item {
  animation: landmarkLight 0.82s ease forwards;
  animation-delay: var(--light-delay, 0.2s);
}

/* Fixed mobile canvas: scale the original 390px composition instead of relaying it out. */
.chapter-card {
  display: block;
}

.world-map {
  top: 84px;
  bottom: 76px;
}

.level-panel {
  max-height: calc(var(--stage-height) - 36px);
}

/* Type lock: keep text metrics stable across mobile browsers. */
h1 {
  font-size: 40px;
}

.subtitle {
  font-size: 17px;
}

.intro-text {
  font-size: 15px;
}

.level-copy h2 {
  font-size: 23px;
}

.level-copy p:not(.level-kicker),
.modal-tip {
  font-size: 14px;
}

.praise-paper strong {
  font-size: 18px;
}

.final-copy h2,
.archive-head h2 {
  font-size: 24px;
}

.text-dialog h3 {
  font-size: 19px;
}

.end-screen h2 {
  font-size: 28px;
}


