:root {
  color-scheme: light;
  --forest: #173b2d;
  --dark: #1d3329;
  --muted: #51645a;
  --paper: #f8f9ee;
  --edge: #dce4d3;
  --lime: #cbef62;
  --font: "Trebuchet MS", "Aptos", system-ui, sans-serif;
  --chinese: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--dark); font-family: var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
button[disabled] { cursor: default; }
button:focus-visible { outline: 3px solid #17738d; outline-offset: 4px; }
h1:focus { outline: none; }
h1,h2,h3,p { margin: 0; }
img { display: block; max-width: 100%; }
.han,[lang="zh-Hans"] { font-family: var(--chinese); }
.frame { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--forest); color: #fff; border-bottom: 4px solid #52714b; }
.masthead { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; text-align: left; gap: 10px; padding: 0; border: 0; background: transparent; }
.brand img { border-radius: 13px; border: 2px solid #d8f774; object-fit: cover; }
.brand strong { display: block; font-size: 1.07rem; font-weight: 900; white-space: nowrap; line-height: 1.1; }
.brand small { display: block; color: #c7e696; margin-top: 4px; font-size: .77rem; letter-spacing: .04em; }
.masthead nav { display: flex; align-items: center; gap: 6px; }
.nav-button { border: 0; background: transparent; color: #e5eedc; padding: 9px 15px; min-height: 44px; border-radius: 12px; }
.nav-button span { font-weight: 900; font-size: 1.25rem; margin-inline-end: 3px; }
.nav-button[aria-current="page"], .nav-button:hover { background: #345543; color: #e6ff9b; }
.bolt-total { background: #fff1a8; color: #4b3d1d; border: 0; border-radius: 30px; padding: 9px 14px; min-height: 40px; white-space: nowrap; }
.bolt-total strong { font-weight: 900; }
.top button:focus-visible { outline-color: #f4ffb3; }

main { min-height: 67vh; }
.hero,.garage-stage { display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; border-radius: 29px; border: 1px solid #d5e1b9; margin-top: 29px; background: #e8f2ca; }
.hero-copy,.garage-copy { padding: clamp(28px, 5vw, 70px); align-self: center; }
.hero-copy { padding-right: 18px; }
.eyebrow { display: inline-block; background: #d6e6a9; border: 1px solid #c6d699; border-radius: 99px; padding: 8px 12px; font-weight: 900; font-size: .78rem; letter-spacing: .11em; color: #354f2a; }
.eyebrow span { color: #527321; margin-inline-end: 3px; }
h1 { color: #17392b; font-size: clamp(2.75rem, 5.4vw, 5.25rem); letter-spacing: -.07em; font-weight: 900; line-height: .98; }
.hero h1,.garage-stage h1 { margin: 18px 0 15px; }
.hero em { color: #486725; font-style: normal; }
.hero p,.garage-stage p { max-width: 32rem; color: #405844; font-size: clamp(.99rem, 1.55vw, 1.17rem); line-height: 1.5; }
.primary,.secondary,.sound { min-height: 48px; border-radius: 14px; font-size: 1rem; font-weight: 900; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary { background: var(--lime); color: #24431c; border: 1px solid #8fab36; box-shadow: 0 4px 0 #789633; }
.primary:hover { background: #dcfc82; transform: translateY(-1px); }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #789633; }
.secondary { border: 1px solid #cbd8c7; background: #fff; color: #2a4938; }
.secondary:hover:not(:disabled) { background: #f2f8e8; border-color: #8ead7f; }
.secondary:disabled { opacity: .46; }
.hero .primary,.garage-stage .primary { margin-top: 22px; }
.hero-art,.garage-art { min-width: 0; min-height: 270px; position: relative; isolation: isolate; background: #71c4ec; }
.hero-art img,.garage-art img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: 59% center; }
.name-tag { position: absolute; right: 16px; bottom: 15px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d5be6f; border-radius: 11px; background: #fff3bc; color: #62441e; padding: 8px 11px; font-size: .79rem; font-weight: 900; box-shadow: 0 3px 0 #574b3024; }
.name-tag span { font-size: .84rem; }

.route { margin: 32px auto 46px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-head h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.045em; font-weight: 900; line-height: 1.08; }
.section-head p { color: var(--muted); margin-top: 6px; }
.progress-badge { white-space: nowrap; background: #fff3c1; border: 1px solid #f0dda0; color: #60491f; padding: 8px 13px; border-radius: 50px; font-size: .91rem; font-weight: 900; }
.worlds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.world-button { border: 1px solid var(--edge); border-radius: 12px; background: #fff; color: var(--forest); font-weight: 800; min-height: 44px; padding: 8px 13px; }
.world-button[aria-pressed="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
.world-button:hover:not([aria-pressed="true"]) { border-color: #9bae8d; background: #eef4e5; }
.chapter-grid,.gear-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.chapter { display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 19px; border: 1px solid var(--edge); box-shadow: 0 3px 0 #eaf0de; }
.chapter-active { border-color: #97b34f; box-shadow: 0 3px 0 #dfecc0; }
.lime { --tile: #e2f0bd; --tile-accent: #c9de94; --tile-ink: #3c542c; }
.sky { --tile: #dbeefa; --tile-accent: #b8deef; --tile-ink: #244d5c; }
.violet { --tile: #ede4fa; --tile-accent: #dbc6f3; --tile-ink: #574270; }
.sun { --tile: #fff0bd; --tile-accent: #f8dd90; --tile-ink: #674c25; }
.mint { --tile: #d9f1df; --tile-accent: #b4e6c4; --tile-ink: #345a46; }
.coral { --tile: #ffe3d6; --tile-accent: #fad0b9; --tile-ink: #774731; }
.chapter-art { position: relative; min-height: 98px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 95%, var(--tile-accent) 0 24%, transparent 25%), var(--tile); color: var(--tile-ink); }
.chapter-icon { font-size: 3.2rem; line-height: 1; transform: rotate(-8deg); filter: drop-shadow(0 4px 0 #2e44321a); }
.chapter-number,.chapter-state { position: absolute; top: 10px; font-weight: 900; background: #ffffffa8; border-radius: 50px; padding: 5px 9px; font-size: .78rem; }
.chapter-number { left: 10px; min-width: 30px; text-align: center; }
.chapter-state { right: 10px; }
.chapter-content { padding: 14px 15px 15px; }
.chapter-content h3 { font-size: clamp(1.1rem, 2.1vw, 1.42rem); line-height: 1.1; letter-spacing: -.03em; }
.chapter-content p { color: #576359; margin: 5px 0 10px; font-size: .96rem; }
.chapter-stops { display: flex; flex-wrap: wrap; gap: 6px; }
.stop { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dce5d4; border-radius: 10px; background: #f5f8f1; padding: 5px 9px; text-align: left; font-size: .91rem; font-weight: 800; }
.stop span { color: #5b783a; font-size: .82rem; }
.stop:hover { background: var(--tile); border-color: var(--tile-accent); }

.garage-stage { margin-top: 29px; background: #e2edd1; }
.garage-art { min-height: 320px; }
.garage-copy strong { display: inline-block; margin-top: 4px; }
meter { display: block; width: min(100%, 330px); height: 16px; margin-top: 18px; accent-color: #568826; }
.gear-pin { position: absolute; left: 60%; top: 38%; background: #fff6bf; border: 3px solid #fff; box-shadow: 0 3px 12px #173b2d7d; padding: 8px; border-radius: 17px; font-size: 2rem; transform: rotate(-8deg); }
.gear-grid { grid-template-columns: repeat(4,minmax(0, 1fr)); }
.gear-card { display: grid; justify-items: center; gap: 7px; border: 1px solid #d6e2c9; min-height: 128px; border-radius: 18px; background: #fff; padding: 14px 7px; box-shadow: 0 3px 0 #eaf0de; }
.gear-card strong { font-size: 1.05rem; }
.gear-card span:last-child { color: #50634e; }
.gear-card .gear-icon { font-size: 2rem; }
.gear-card[aria-pressed="true"] { background: #e8f5be; border-color: #92ad45; }
.gear-card:disabled { background: #f0f2eb; }
.gear-card:disabled .gear-icon { filter: grayscale(.85); opacity: .7; }
.gear-card:hover:not(:disabled) { border-color: #8fa659; }

.mission-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); align-items: start; gap: 20px; margin-block: 29px 42px; }
.mission-sidebar { border: 1px solid var(--tile-accent); border-radius: 23px; background: var(--tile); padding: 16px; overflow: hidden; }
.mission-sidebar .back-map { min-height: 44px; width: 100%; font-size: .94rem; }
.mission-sidebar img { margin: 16px auto 10px; width: 128px; border-radius: 23px; border: 3px solid #fff; box-shadow: 0 3px 0 #23382220; }
.mission-sidebar-copy { display: grid; gap: 4px; text-align: center; }
.mission-sidebar-copy strong { font-size: 1.25rem; }
.mission-sidebar-copy small { color: var(--tile-ink); font-size: .93rem; }
.steps { display: grid; list-style: none; gap: 7px; padding: 0; margin: 19px 0 0; }
.steps li { display: flex; align-items: center; gap: 9px; color: var(--tile-ink); font-weight: 800; padding: 7px 9px; border-radius: 11px; }
.steps li span { display: inline-grid; place-items: center; background: #ffffffb5; color: #375d37; border-radius: 50%; width: 25px; height: 25px; flex-shrink: 0; }
.steps li[data-state="active"] { color: #fff; background: var(--forest); }
.steps li[data-state="done"] span { background: #c8ed73; }
.mission-board { border: 1px solid var(--edge); background: #fff; border-radius: 23px; min-height: 430px; padding: clamp(16px, 3vw, 30px); }
.mission-title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.mission-title > span { font-size: clamp(1.55rem, 3.1vw, 2.15rem); }
.mission-title h1 { font-size: clamp(1.8rem, 4.1vw, 3rem); letter-spacing: -.055em; }
.mission-story { font-size: 1.06rem; line-height: 1.45; color: var(--muted); margin-bottom: 14px; }
.learn-card { display: grid; grid-template-columns: 1fr 1fr; text-align: center; align-items: stretch; min-height: 220px; background: var(--tile); border: 1px solid var(--tile-accent); border-radius: 20px; overflow: hidden; }
.word-picture { display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at center, #ffffff75 0 38%, transparent 39%), radial-gradient(circle at center, #ffffff46 0 52%, transparent 53%); font-size: clamp(3rem, 8.2vw, 7rem); }
.word-picture > span { filter: drop-shadow(0 5px 0 #23382219); animation: bob 3s ease-in-out infinite; }
.word-picture .stars,.choice-picture .stars,.prompt-picture .stars { color: #ae681a; font-size: .55em; line-height: 1; text-shadow: 0 2px 0 #fff5ba; text-align: center; }
.stars { display: grid; align-content: center; }
@keyframes bob { 50% { transform: translateY(-7px) rotate(-2deg); } }
.word-copy { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 18px 10px; background: #ffffff91; }
.word-copy strong { font-size: clamp(2rem, 6vw, 4rem); line-height: 1.14; }
.pinyin { color: #3c5e47; font-weight: 800; font-size: 1.15rem; }
.word-copy p,.speech-card p { color: #465c4b; font-size: 1.05rem; }
.sound { background: #235b48; border: 1px solid #1e483a; color: white; margin-top: 7px; }
.sound span { font-size: 1.27rem; line-height: 1; }
.sound:hover,.sound.playing { background: #38785e; }
.sound.playing span { animation: bob .5s ease-in-out infinite; }
.task-controls { display: flex; flex-wrap: wrap; gap: 9px; justify-content: space-between; align-items: center; margin-top: 17px; font-weight: 800; }
.task-controls.center { justify-content: center; }
.text-button { border: 0; min-height: 44px; background: transparent; color: #2c654d; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
.text-button:disabled { color: #75897a; text-decoration: none; }
.quiz-prompt,.speech-card { text-align: center; border-radius: 19px; background: var(--tile); border: 1px solid var(--tile-accent); color: var(--tile-ink); padding: 13px; }
.quiz-count { font-weight: 800; font-size: .93rem; }
.quiz-prompt h2 { font-size: clamp(1.18rem, 3vw, 1.56rem); margin: 3px 0 6px; }
.prompt-picture { font-size: 2.55rem; line-height: 1.1; }
.hint-show { margin-top: 9px; font-weight: 800; }
.choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.choice { display: grid; align-content: center; justify-items: center; gap: 4px; min-height: 98px; padding: 8px 3px; border: 1px solid #cadac8; border-radius: 14px; background: #f8fbf5; box-shadow: 0 3px 0 #dfebd7; overflow-wrap: anywhere; }
.choice:not(:disabled):hover { background: #eaf5d7; border-color: #9ab77a; }
.choice .han { font-size: clamp(1.12rem, 3.65vw, 2.4rem); line-height: 1.15; }
.choice-picture { font-size: clamp(1.75rem, 5vw, 2.55rem); line-height: 1; }
.choice.wrong { background: #fff0e8; border-color: #e9c4b7; box-shadow: 0 3px 0 #f8e5db; }
.choice.right { background: #e6f7bc; border-color: #a7c16f; box-shadow: 0 3px 0 #cfe5a2; }
.quiz-controls { min-height: 51px; }
.feedback { color: #785134; font-size: .93rem; }
.feedback.good { color: #355c2b; }
.speech-card { display: grid; justify-items: center; gap: 8px; padding: 20px 12px; }
.speech-card .say-prompt { font-weight: 800; }
.speech-card .han { font-size: clamp(1.75rem, 4.7vw, 3.5rem); line-height: 1.25; }
.speech-tip { margin: 11px 0; text-align: center; color: var(--muted); }
.audio-notice:not(:empty) { margin-top: 12px; color: #785134; }
.victory { display: grid; text-align: center; justify-items: center; gap: 10px; border: 1px solid #eddb92; background: #fff4c0; border-radius: 19px; padding: 25px; font-size: 1.28rem; font-weight: 900; color: #58441d; }
.victory-stars { font-size: clamp(2.4rem, 8vw, 5rem); color: #ac6914; animation: bob 2.8s ease-in-out infinite; }
.unlocks { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.unlocks span { padding: 7px 10px; border-radius: 13px; background: #fff; border: 1px solid #ecdc9a; font-size: .95rem; }
.footer { min-height: 67px; border-top: 1px solid var(--edge); color: #50634e; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .88rem; }
dialog { max-width: min(530px,calc(100% - 30px)); padding: 26px; border: 1px solid #b2c8a7; border-radius: 20px; background: #fff; color: var(--dark); }
dialog::backdrop { background: #112d24a0; }
dialog h2 { font-size: 1.85rem; }
dialog h3 { margin-top: 16px; }
dialog p { margin-top: 9px; line-height: 1.55; color: #486050; }
.close { float: right; border: 1px solid #dce6d5; background: #eff4e8; border-radius: 11px; font-size: 1.7rem; width: 42px; height: 42px; line-height: 1; }

@media (max-width: 900px) {
  .frame { width: calc(100% - 36px); }
  .hero-copy,.garage-copy { padding: 28px 15px 28px 28px; }
  .wide { display: none; }
  .mission-layout { grid-template-columns: 196px minmax(0,1fr); gap: 12px; }
}

@media (max-width: 650px) {
  .frame { width: calc(100% - 24px); }
  .masthead { min-height: 65px; gap: 4px; }
  .brand { gap: 6px; }
  .brand img { width: 34px; height: 34px; border-radius: 10px; }
  .brand strong { font-size: .86rem; }
  .brand small { font-size: .68rem; }
  .masthead nav { gap: 1px; }
  .nav-button { padding: 7px; min-height: 44px; font-size: .84rem; }
  .nav-button span { display: none; }
  .bolt-total { padding: 6px 8px; }
  .bolt-word { display: none; }
  .hero,.garage-stage { grid-template-columns: minmax(0,1fr); margin-top: 15px; border-radius: 22px; }
  .hero-copy,.garage-copy { padding: 19px 19px 21px; }
  .hero h1,.garage-stage h1 { margin: 13px 0 9px; }
  .hero .primary,.garage-stage .primary { margin-top: 14px; }
  .hero-art,.garage-art { min-height: 200px; height: 54vw; max-height: 310px; }
  .hero-art img,.garage-art img { object-position: center 59%; }
  .route { margin-top: 24px; }
  .progress-badge { padding: 7px 8px; font-size: .78rem; }
  .worlds { gap: 5px; }
  .world-button { padding: 6px 7px; font-size: .82rem; }
  .chapter-grid,.gear-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .chapter-content { padding: 10px; }
  .chapter-art { min-height: 83px; }
  .chapter-icon { font-size: 2.45rem; }
  .chapter-number,.chapter-state { top: 7px; padding: 4px 6px; font-size: .72rem; }
  .chapter-number { left: 6px; min-width: 23px; }
  .chapter-state { right: 6px; }
  .mission-layout { grid-template-columns: minmax(0,1fr); margin-top: 12px; }
  .mission-sidebar { padding: 9px; display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
  .mission-sidebar img { display: none; }
  .mission-sidebar .back-map { width: auto; padding: 5px 8px; font-size: .82rem; }
  .mission-sidebar-copy { text-align: right; gap: 1px; }
  .mission-sidebar-copy strong { font-size: .95rem; }
  .mission-sidebar-copy span,.mission-sidebar-copy small { font-size: .77rem; }
  .steps { grid-template-columns: repeat(3,1fr); grid-column: 1 / -1; gap: 3px; margin: 1px 0 0; }
  .steps li { gap: 3px; padding: 5px; font-size: .76rem; }
  .steps li span { width: 19px; height: 19px; }
  .mission-board { padding: 13px; min-height: 380px; }
  .learn-card { min-height: 164px; }
  .word-copy { padding-inline: 4px; }
  .word-picture { padding: 5px; }
  .task-controls .primary,.task-controls .secondary { padding-inline: 10px; font-size: .9rem; }
  .task-controls { font-size: .86rem; gap: 5px; }
  .choice span { font-size: .84rem; }
  .choice strong { font-size: .88rem; }
  .choices { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; scroll-behavior: auto !important; }
}
