:root { --ink:#302338; --cream:#fff5d5; --green:#58a47a; }
body { min-height:100svh; background:#bde5e1; color:var(--ink); }
#village { width:min(1120px,100%); margin:auto; padding:12px clamp(10px,2.6vw,35px) 30px; }
#village header { display:flex; align-items:center; justify-content:space-between; padding:14px 5px 4px; }
#village h1 { font-size:clamp(36px,7vw,89px); margin:0; letter-spacing:-.065em; line-height:1.03; text-shadow:3px 3px #fff1c9; }
.round { display:grid; place-items:center; background:#fff5d5; border:3px solid var(--ink); border-radius:50%; width:47px; height:47px; flex:none; box-shadow:0 3px var(--ink); font-weight:900; font-size:24px; }
#map { position:relative; margin-top:12px; border-radius:18px; overflow:hidden; background:#8fbc7f; border:4px solid var(--ink); box-shadow:0 5px var(--ink); }
#map img { width:100%; display:block; }
.map-stop { position:absolute; translate:-50% -50%; min-height:44px; padding:6px 13px; border:3px solid var(--ink); border-radius:18px 8px 18px 8px; background:#fff1b6; font-size:clamp(12px,1.9vw,23px); font-weight:900; white-space:nowrap; box-shadow:0 3px var(--ink); }
.map-stop:hover,.map-stop:focus-visible { background:#ffd978; }
#visits { position:relative; margin-top:20px; padding:20px clamp(15px,5vw,60px) 35px; background:#8fbc7f; border:4px solid var(--ink); border-radius:26px; box-shadow:0 5px var(--ink); }
#visit-name { font-size:clamp(27px,6vw,56px); margin:10px 0 20px; }
#adventures { display:flex; flex-wrap:wrap; gap:20px; }
.adventure { display:flex; align-items:center; gap:8px; max-width:100%; }
.adventure .leaf { font-size:clamp(19px,2.7vw,34px); padding:12px 22px; border:3px solid var(--ink); border-radius:24px 10px 24px 10px; box-shadow:0 4px var(--ink); }
#play-space { width:100%; min-height:100svh; display:grid; place-items:center; background:#477268; }
#art { position:absolute; inset:0; }
#stage { display:block; width:100%; height:100%; }
#lesson-name { left:35%; right:8%; overflow-wrap:anywhere; }
#math { top:13%; }
#math span { min-width:0; }
.measure { font-size:36px; font-family:"Trebuchet MS",sans-serif;font-weight:900; fill:#302338; stroke:#fff0bc; stroke-width:5; paint-order:stroke fill; }
.object .glow { opacity:0; }
.object.lit .glow { opacity:1; }
.object.pending { visibility:hidden; }
.attention:not(.object) { stroke:#fff1b9; stroke-width:9; }
.bubble svg { width:87%; height:87%; overflow:visible; }
#answers { height:16%; top:76.6%; z-index:2; }
#controls { bottom:3%; z-index:4; }
#controls button { min-width:44px; min-height:44px; }
#controls button:disabled { opacity:.48; }
#next { z-index:5; }
#caption:not(.sr-only) { position:absolute; bottom:17%; left:30%; width:62%; text-align:center; font-size:clamp(12px,2.1cqw,26px); color:var(--ink); padding:4px 9px; background:#fff7d7; border:2px solid var(--ink); border-radius:9px; z-index:6; pointer-events:none; }
#paused { z-index:20; }
#settings { width:min(420px,calc(100vw - 26px)); border:3px solid var(--ink); border-radius:18px; background:var(--cream); padding:23px; }
#settings::backdrop { background:#233c39a0; }
#settings label { display:flex; justify-content:space-between; gap:12px; margin:15px 0; }
#settings button,#settings select { border:2px solid var(--ink); border-radius:8px; padding:8px 10px; background:#fff5d5; }
#settings .settings-actions { margin-top:16px; display:flex; justify-content:space-between; gap:10px; }
body[data-place=orchard] #stage > path:first-of-type { fill:#e2e7bc; }
body[data-place=market] #stage > path:first-of-type { fill:#efdfad; }
body[data-place=workshop] #stage > path:first-of-type { fill:#d9e7d1; }
body[data-place=path] #stage > path:first-of-type { fill:#d5eaf2; }
body[data-place=farm] #stage > path:first-of-type { fill:#eddbc9; }
@media(max-width:600px) and (orientation:portrait){
  #map { min-height:450px; }
  #map img { aspect-ratio:1/1.1; object-fit:fill; }
  .map-stop { padding:5px; font-size:clamp(10px,3.4vw,16px); }
  #world { aspect-ratio:1/1.13; background:#8fbc7f; }
  #art { top:13%;bottom:20%; }
  #lesson-name { top:6%; left:6%; right:6%; font-size:6cqw; }
  #math { top:19%; left:5%; right:5%; font-size:10cqw; gap:2.6cqw; }
  #answers { top:63%; left:6%; right:6%; gap:8%; }
  .bubble { width:17cqw; min-width:44px; font-size:9cqw; }
  #controls { bottom:6%; left:5%; gap:6px; }
  #next { bottom:7%; font-size:5cqw; min-height:44px; min-width:85px; }
  #caption:not(.sr-only) { bottom:23%; left:4%; width:92%; }
  #resume { font-size:6cqw; min-height:48px; }
}
