:root {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: "DM Sans", "Avenir Next", "PingFang SC", system-ui, sans-serif;
  color: #263927;
  background: #f8f7f0;
  --green: #31533a;
  --ink: #263927;
  --muted: #536452;
  --border: #dddcd0;
  --display: "DM Serif Text", "Iowan Old Style", Georgia, "Songti SC", serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button { font: inherit; cursor: pointer; color: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #744cac; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; }
h1:focus { outline: none; }
p { line-height: 1.55; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: 8px; padding: 12px; z-index: 2; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid #e8e6db; background: #fdfcf7; }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { background: none; border: 0; padding: 0; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 700; text-align: left; }
.brand-mark { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: #e5ecd9; font: 1.15rem system-ui; }
#nav { display: flex; align-items: center; gap: 8px; }
.nav-button, .soft-button, .close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 44px;
  background: #fffef9;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  font-size: .875rem;
}
.nav-button:hover, .soft-button:hover, .close-button:hover { background: #eef0e4; border-color: #aabb9f; }
.badge-star { color: #806229; }
.nav-count { background: #e9eedf; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.sound-button { min-width: 44px; padding-inline: 8px; }
.sound-icon { position: relative; font-size: 1.25rem; line-height: 1; }
.sound-button[aria-pressed="false"] { color: var(--muted); background: #f2f1e9; }
.sound-button[aria-pressed="false"] .sound-icon::after {
  content: '';
  position: absolute;
  inset: 50% -3px auto;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  box-shadow: 0 1px #f2f1e9;
}
.language { min-width: 56px; }
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #284732;
  border-radius: 13px;
  min-height: 51px;
  padding: 11px 20px;
  background: var(--green);
  color: #fffef7;
  box-shadow: 0 3px 0 #223d2a;
  font-weight: 750;
}
.primary:hover { background: #24472d; }
.primary:active { box-shadow: 0 1px 0 #223d2a; transform: translateY(2px); }

.hero {
  margin-top: 32px;
  min-height: 416px;
  display: grid;
  grid-template-columns: 43% 57%;
  overflow: hidden;
  border-radius: 24px;
  background: #f0efd9;
  border: 1px solid #dcdcc4;
  box-shadow: 0 8px 22px #2639270d;
}
.hero-image {
  grid-column: 2;
  grid-row: 1;
  background: #d5d7a8 url("./assets/village-kittens.jpg") center center / cover no-repeat;
}
.hero-content { grid-row: 1; grid-column: 1; align-self: center; padding: clamp(24px, 4vw, 51px); }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: #45583b; background: #e4e8ce; border-radius: 999px; padding: 5px 11px; font-weight: 750; font-size: .875rem; }
.hero-kicker span { color: #826027; }
.hero h1 { margin: 16px 0 14px; font-size: clamp(2.5rem, 5.65vw, 4.8rem); line-height: .98; letter-spacing: -.059em; }
[lang="zh-Hans"] .hero h1 { font-size: clamp(2.25rem, 5vw, 4.2rem); line-height: 1.15; letter-spacing: -.05em; }
.hero-description { max-width: 31ch; font-size: 1.05rem; color: #495744; }
.hero .primary { margin-top: 23px; }

.map { margin: 38px 0 48px; }
.map-header { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.map-header h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -.035em; }
.map-header p { margin-top: 4px; color: var(--muted); }
.progress-summary { display: grid; gap: 7px; min-width: 156px; font-size: .875rem; color: var(--muted); }
.progress-summary span { display: flex; justify-content: space-between; gap: 12px; }
progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: #e9e8de; color: var(--green); }
progress::-webkit-progress-bar { background: #e9e8de; border-radius: 999px; }
progress::-webkit-progress-value { background: #597b4e; border-radius: 999px; }
progress::-moz-progress-bar { background: #597b4e; border-radius: 999px; }

.lavender { --tint: #eae2f8; --accent: #624094; --disc: #d7c5f0; }
.peach { --tint: #fae5d4; --accent: #864723; --disc: #f2c8ad; }
.mint { --tint: #e3efdd; --accent: #38633e; --disc: #c7dfc4; }
.sky { --tint: #e1edf5; --accent: #365d83; --disc: #c7dff0; }
.rose { --tint: #f6e3eb; --accent: #88486b; --disc: #ecc7da; }
.lemon { --tint: #f7edce; --accent: #745a1d; --disc: #f1dda4; }
.station-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; list-style: none; margin: 0; padding: 0; }
.station-card { border: 1px solid var(--border); border-radius: 18px; background: #fffefa; overflow: hidden; box-shadow: 0 2px 4px #26392708; }
.station-art { position: relative; height: 100px; background: var(--tint); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.station-number { position: absolute; top: 10px; left: 12px; border-radius: 9px; padding: 3px 8px; color: var(--accent); background: #ffffff8c; font-size: .8rem; font-weight: 750; }
.badge {
  display: grid;
  place-items: center;
  width: 63px;
  height: 63px;
  border: 3px solid #fffd;
  border-radius: 22px;
  box-shadow: 0 3px 0 #26392724;
  color: var(--accent);
  background: var(--disc);
  font: 700 2rem/1 system-ui;
  transform: rotate(-8deg);
}
.badge.rose { letter-spacing: -.12em; font-size: 1.25rem; padding-right: 3px; }
.art-star { position: absolute; right: 17%; top: 13px; color: var(--accent); font-size: 25px; opacity: .65; }
.station-details { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 13px; min-height: 84px; }
.station-details h3 { font-size: 1.05rem; line-height: 1.25; }
.station-details p { color: var(--muted); margin-top: 4px; font-size: .875rem; }
.station-button { border: 1px solid var(--green); border-radius: 10px; min-height: 44px; padding: 5px 13px; font-size: .875rem; font-weight: 750; background: var(--green); color: #fffefa; }
.station-button:hover:not(:disabled) { background: #24472d; }
.station-button:disabled { background: #f2f1e9; color: #5b6156; border-color: #e6e4d9; }
.locked .badge { box-shadow: none; opacity: .72; }

.play-shell { max-width: 820px; margin: 28px auto 48px; }
.game-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; font-size: .875rem; font-weight: 750; }
.game-header > span { text-align: right; color: var(--accent); }
.play-panel { padding: clamp(18px, 5vw, 46px); border: 1px solid var(--border); border-radius: 25px; background: #fffefa; text-align: center; box-shadow: 0 8px 26px #2639270d; }
.story { background: linear-gradient(var(--tint), #fffefa 64%); padding-block: 48px; }
.story .badge { margin: 0 auto 24px; width: 94px; height: 94px; border-radius: 29px; font-size: 3rem; }
.story .badge.rose { font-size: 1.85rem; }
.story h1, .challenge h1 { font-size: clamp(1.55rem, 5vw, 2.9rem); line-height: 1.13; letter-spacing: -.025em; }
.story p { max-width: 43ch; margin: 13px auto 24px; color: var(--muted); font-size: 1.05rem; }
.round-progress { display: grid; gap: 7px; max-width: 245px; margin: 0 auto 22px; color: var(--muted); font-size: .875rem; font-weight: 750; }
.formula, .model { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35em; margin: 20px auto 0; }
.formula { font-size: clamp(1.5rem, 5.5vw, 3.25rem); font-weight: 750; }
.formula span { min-width: 1em; }
.formula .blank { min-width: 1.35em; padding: 0 .1em; border-radius: .22em; color: var(--accent); background: var(--tint); }
.formula.sequence { font-size: clamp(1.3rem, 5vw, 2.5rem); }
.sequence span { border: 1px solid var(--disc); padding: .2em .35em; border-radius: .5em .5em .7em .7em; background: var(--tint); }
.model { gap: 8px; }
.object-group { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 8px; background: var(--tint); border-radius: 14px; }
.object-group.plate { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--disc); padding: 8px; border-radius: 50%; }
.object {
  display: grid;
  place-items: center;
  width: clamp(30px, 9vw, 44px);
  height: clamp(36px, 9vw, 44px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  position: relative;
}
.object-group.countable { grid-template-columns: repeat(5, 44px); }
.object.star { width: 44px; height: 44px; color: #694197; border: 1px solid #69419736; }
.object.star:hover { background: #e0cff4; }
.object.star[aria-pressed=true] { color: #ffe593; background: #694197; animation: arrive .19s ease-out both; }
.plate .object { width: 26px; height: 26px; }
.scene-instructions { margin: 9px auto 14px; max-width: 53ch; color: var(--muted); }
.orchard-trees, .bakery-trays { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 490px; margin: 0 auto; }
.apple-tree {
  display: grid;
  gap: 5px;
  min-height: 94px;
  border: 1px solid #a5ba92;
  border-radius: 28px 28px 13px 13px;
  background: #e4edcf;
  padding: 8px;
  font-weight: 700;
}
.apple-tree:hover:not(:disabled) { border-color: #507046; }
.apple-tree[aria-pressed="true"] { background: #eff1e3; }
.tree-canopy, .apple-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  align-content: center;
  justify-items: center;
  min-height: 48px;
  font-size: clamp(1rem, 3.6vw, 1.38rem);
}
.leaves { grid-column: 1 / -1; }
.apple-basket { max-width: 280px; margin: 10px auto 0; padding: 8px 12px; border: 2px solid #d3a974; border-radius: 12px 12px 24px 24px; background: #f7e6cd; font-weight: 750; }
.apple-grid .apple { animation: arrive .19s ease-out both; }
.apple-basket .empty { display: block; }
.empty { color: var(--muted); font-size: .9rem; font-weight: 500; }
.bun-tray { min-height: 102px; padding: 8px; border: 2px solid #d2c69c; background: #f6f0dc; border-radius: 16px; }
.bun-tray + .bun-tray { border-color: #d0a477; background: #f7e6d2; }
.bun-tray .empty { display: block; margin-top: 14px; }
.bun-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 6px; }
.bun-piece {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dbc8a1;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 1.3rem;
}
.bun-piece:hover:not(:disabled) { border-color: #917759; background: #fff3d6; }
.lantern-lane {
  position: relative;
  min-height: 116px;
  margin: 13px auto 0;
  border-radius: 15px;
  overflow: hidden;
  max-width: 560px;
  background: #3f3d67 url("./assets/lantern-lane.jpg") center 56% / cover no-repeat;
}
.lantern-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 9px;
  color: #fff5dd;
  background: #302b49;
  font-size: .875rem;
  text-align: left;
  font-weight: 700;
}
.lantern-lights { color: #ffd273; letter-spacing: .04em; font-size: 1.08rem; line-height: 1; }
.lantern-cloud {
  position: absolute;
  top: 3px;
  right: calc(32% - var(--lit) * 4%);
  font-size: calc(3.7rem - var(--lit) * .26rem);
  filter: drop-shadow(0 3px 0 #2f2f49);
}
.lantern-flash .lantern-cloud { animation: retreat .42s ease-out both; }
.lantern-flash .lantern-count { animation: arrive .25s ease-out both; }
.lantern-cloud.cloud-cleared { visibility: hidden; }
@keyframes arrive { from { transform: scale(.82); } to { transform: scale(1); } }
@keyframes retreat { from { transform: translateX(-22px) scale(1.15); } to { transform: translateX(0) scale(1); } }
.answer-options { display: flex; justify-content: center; gap: 9px; margin: 25px auto 13px; }
.answer { border: 2px solid var(--disc); border-radius: 13px; width: min(21%, 86px); min-height: 56px; font: 750 clamp(1.3rem, 4.5vw, 1.85rem) system-ui; background: #fffefa; }
.answer:hover:not(:disabled) { background: var(--tint); border-color: var(--accent); }
.answer:disabled:not(.right):not(.tried) { color: var(--muted); background: #f3f1e9; }
.answer.right { background: #dcefd9; border-color: #568452; color: #285432; }
.answer.tried { color: #814134; background: #fce8e1; border-color: #e4beb0; text-decoration: line-through; }
.challenge-feedback { min-height: 26px; color: var(--muted); }
.hint, .right-message { margin-top: 5px; }
.right-message { color: #315b33; }
.try-message { color: #833f31; font-weight: 700; }
.challenge-controls { min-height: 53px; margin-top: 10px; }
.reward-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.reward .badge { animation: pop .35s ease-out both; }
@keyframes pop { from { transform: scale(.65) rotate(-16deg); } to { transform: scale(1) rotate(-8deg); } }

dialog { color: var(--ink); padding: 22px; border: 1px solid var(--border); border-radius: 22px; background: #fffefa; width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); }
dialog::backdrop { background: #2235279e; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-header h2 { font-size: 2rem; }
.close-button { width: 44px; font-size: 1.3rem; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; text-align: center; }
.badge-grid li { display: flex; align-items: center; flex-direction: column; gap: 5px; border-radius: 13px; padding: 11px 3px; background: #f4f3e9; font-size: .85rem; }
.badge-grid .badge { margin-bottom: 5px; width: 47px; height: 47px; border-radius: 14px; font-size: 1.5rem; }
.badge-grid .rose { font-size: .9rem; }
.badge-grid .unearned .badge { opacity: .58; }
.badge-grid li > span:last-child { color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 15px 0 22px; border-top: 1px solid var(--border); font-size: .875rem; color: var(--muted); }

@media (max-width: 950px) {
  .shell { width: calc(100% - 48px); }
  .hero { min-height: 340px; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
  .hero-image { background-position: 70% center; }
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 36px); }
  .hero { display: flex; flex-direction: column; margin-top: 16px; min-height: 0; }
  .hero-image { order: 1; aspect-ratio: 1.72; background-position: center 55%; }
  .hero-content { align-self: stretch; padding: clamp(20px, 4vw, 30px); }
  .hero h1 br { display: none; }
  .hero h1 { margin: 11px 0; }
  .hero .primary { margin-top: 15px; }
}
@media (max-width: 550px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 62px; }
  .brand { gap: 6px; }
  .brand-mark { flex-basis: 30px; width: 30px; height: 30px; font-size: .88rem; }
  #nav { gap: 5px; }
  .nav-button { padding: 6px; gap: 4px; }
  .badge-star { display: none; }
  .language { min-width: 44px; }
  .map { margin: 25px 0; }
  .map-header { flex-direction: column; align-items: stretch; }
  .station-grid { gap: 9px; }
  .station-details { flex-direction: column; align-items: stretch; gap: 9px; }
  .station-details > div { min-height: 52px; }
  .station-details h3 { font-size: 1rem; }
  .station-art { height: 84px; }
  .station-number { top: 6px; left: 6px; }
  .station-art .badge { width: 49px; height: 49px; border-radius: 16px; }
  .game-header { gap: 6px; }
}
@media (max-width: 420px) {
  .badge-label { display: none; }
  .bakery-trays { grid-template-columns: 1fr; }
  .bun-tray { min-height: 74px; }
}
@media (max-width: 359px) {
  .object-group.countable { grid-template-columns: repeat(4, 44px); }
}
@media (prefers-reduced-motion: reduce) {
  .reward .badge, .object.star, .apple-grid .apple, .lantern-flash .lantern-cloud, .lantern-flash .lantern-count { animation: none; }
}
