/* v8: scene-first presentation; controls remain actual HTML controls. */
#app[data-view="game"] .top,#app[data-view="flight"] .top{padding:10px 18px}.top .pill{font-size:10px}#app[data-view="game"] .switch{margin-bottom:8px}#app[data-view="game"] main{padding:0 12px 110px}#app[data-view="game"] h1{font-size:25px;margin:6px 0 10px}#app[data-view="game"] .eyebrow{font-size:10px}#app[data-view="game"] .back{margin:8px 0;font-size:11px}#app[data-view="game"] .sector-label{display:none}#app[data-view="game"] .wallet{margin:8px 0}.world-shortcuts{display:flex;gap:5px;margin:0 0 8px}.world-shortcuts button{min-height:44px;flex:1;padding:8px 3px;border:1px solid #a99363;border-radius:12px;background:linear-gradient(#fff6da,#e6d1a3);color:#4e4029;font-size:12px;font-weight:700;box-shadow:0 3px 0 #92774d}.space .world-shortcuts button{background:linear-gradient(#203e51,#0a1e30);border-color:#47788a;color:#c9f5ec;box-shadow:0 3px 0 #071420;border-radius:5px}.scene-tools{margin:12px 0;border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:0 12px}.scene-tools summary{cursor:pointer;min-height:50px;padding:16px 2px;font-size:14px;font-weight:700;list-style:none}.scene-tools summary span{float:right;font-size:11px;opacity:.7}.scene-tools[open] summary{border-bottom:1px solid var(--line);margin-bottom:12px}#app[data-view="game"] .play-wrap canvas{height:clamp(400px,58svh,620px)}#app[data-view="game"] .play-wrap{border:3px solid #cfbd8d;border-radius:22px;box-shadow:0 8px 20px #3f58334a}.map-tools button{min-width:44px;min-height:44px}.ship-stage{height:clamp(400px,56svh,600px);background:linear-gradient(#08122211,#08122233),url('assets/v8/mobile/hangar.webp') center/cover;box-shadow:inset 0 0 45px #04101b;border-radius:12px}.ship-stage:before{display:none}.ship-stage>svg{width:100%;height:88%;position:absolute;top:7%;left:0;filter:drop-shadow(0 18px 10px #0009)}.orbit-ring{bottom:12%;border-color:#97f9f9;opacity:.5}.dock-id{padding:7px 10px;background:#081824b8}.ship-label{bottom:12px;left:12px;right:12px;text-align:center;background:#09192ddd}.space .primary{background:linear-gradient(#f1d28e,#c49447);color:#241d17;border-color:#ffdf9c;box-shadow:0 3px 0 #735128}.form-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.form-list button{width:auto!important;min-width:0!important;font-size:10px;padding:10px 2px}.material-art{width:76px;height:76px;object-fit:contain;float:right;margin:0 0 8px 10px}.room-scene.furnished{height:440px;background:url('assets/v8/mobile/reading-room.webp') center/cover}.furnished .room-window,.furnished .room-shelf,.furnished .room-rug,.furnished .room-chair{display:none}.room-person{background:url('assets/v8/mobile/girl.webp') center/contain no-repeat;font-size:0;width:95px;height:160px;bottom:20px;left:35%}.room-person.seated{right:28px;bottom:36px;height:145px;left:auto}.scanner-scene{height:360px;background:url('assets/v8/mobile/hangar.webp') center/cover}#app[data-view="flight"] .switch,#app[data-view="flight"] .bottom{display:none}#app[data-view="flight"] main{padding:0 10px 12px}#app[data-view="flight"] h1{font-size:21px;margin:8px 0}#app[data-view="flight"] .flight-wrap canvas{height:clamp(430px,68svh,850px)}.flight-overlay{background:#07111bb5}.flight-controls{margin:8px 0}.flight-controls button{background:linear-gradient(#193647,#0d202f);border:1px solid #406e7d}.bottom button{min-height:50px}@media(prefers-reduced-motion:reduce){.ship-stage>svg{animation:none!important}}
#app[data-view="game"] main>.eyebrow{display:none}#app[data-view="game"] main>.back{display:inline-block;margin:5px 0;padding:0;min-height:24px}#app[data-view="game"] main>h1{font-size:24px;margin:2px 0 6px}#app[data-view="game"] .play-wrap canvas{height:clamp(360px,53svh,560px)}
.room-person{width:125px;height:210px;left:30%;bottom:20px}.room-person.seated{background-image:url('assets/v8/mobile/girl-seated.webp');width:125px;height:185px;right:20px;bottom:18px}
.ship-stage #battle{position:absolute;z-index:3;bottom:53px;left:16px;width:calc(100% - 32px);margin:0;font-size:14px;min-height:46px}.ship-stage>svg{height:78%;top:3%}

/* v10 movement controls remain separate from construction selection. */
.walk-controls{padding:12px 0}.walk-controls .map-controls{display:flex;gap:8px}.walk-controls [data-walk]{flex:1;min-height:44px}.walk-controls #walk-position{display:block;text-align:center}.walk-controls #walk-stop{margin:8px 0}.walk-controls .game-log{margin:8px 0}.walk-controls .textbutton{min-height:44px}#town-canvas{touch-action:none}
/* v11: town scene fills the first screen; the controls below remain available. */
#app[data-view="game"]:not(.space)>.top{display:none}
#app[data-view="game"]:not(.space)>.switch{margin:0;padding:4px 10px;border-radius:0;background:#eee5cd;border-bottom:1px solid #c4b48c;min-height:42px}
#app[data-view="game"]:not(.space)>.switch button{padding:6px 4px;min-height:36px;font-size:12px}
#app[data-view="game"]:not(.space) main{padding:0 0 92px;animation:none}
#app[data-view="game"]:not(.space) main>.back,#app[data-view="game"]:not(.space) main>h1,#app[data-view="game"]:not(.space) main>.wallet,#app[data-view="game"]:not(.space) main>.eyebrow{display:none}
#app[data-view="game"]:not(.space) .town-stage{border:0;border-radius:0;box-shadow:none;background:#91a56a;isolation:isolate}
#app[data-view="game"]:not(.space) .town-stage canvas{height:calc(100svh - 123px);min-height:500px;max-height:940px}
.town-hud{position:absolute;z-index:2;left:12px;right:12px;top:16px;display:flex;align-items:center;gap:7px;pointer-events:none}
.town-hud button{pointer-events:auto}
.town-avatar{flex:none;width:52px;height:56px;padding:0;border-radius:50%;border:3px solid #fff0c8;background:#bda57d;box-shadow:0 3px 0 #795e3b,0 5px 10px #302f3444;overflow:hidden}
.town-avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 0;transform:scale(1.9);transform-origin:50% 15%}
.town-title{flex:1;min-width:0;background:linear-gradient(110deg,#fff5d8,#e8cea0);border:1px solid #9f8155;border-radius:9px 4px 9px 4px;box-shadow:0 3px 0 #92704766;padding:4px 11px;color:#60452e;text-align:center}
.town-title small{font-size:9px;letter-spacing:1px;display:block;color:#86704e}.town-title strong{font-family:serif;font-size:23px;white-space:nowrap;letter-spacing:2px}
.town-resources{display:grid;gap:5px;min-width:72px}.town-resources button{display:flex;align-items:center;justify-content:space-between;gap:3px;padding:2px 8px 2px 2px;border:1px solid #d4b675;border-radius:18px;background:#604b30d9;color:#fff4cf;min-height:28px;font-size:12px;box-shadow:0 2px 4px #28332933}.town-resources img{height:25px;width:25px;object-fit:contain}
.town-stage .map-tools{top:94px;right:12px;z-index:2;display:grid;gap:6px}.town-stage .map-tools button{min-width:44px;min-height:44px;background:#fff1d4ec;color:#685436;border:1px solid #bda577;box-shadow:0 3px 0 #74593955;font-size:17px}.town-stage #recenter{font-size:11px}
.town-stage .map-stop{position:absolute;top:94px;left:12px;z-index:2;min-height:44px;padding:8px 11px;border-radius:18px;background:#f9edd4ed;border:1px solid #bda577;color:#63492d;box-shadow:0 3px 0 #74593944}
.town-stage .map-stop:disabled{opacity:0;pointer-events:none}
.town-action-area{position:absolute;z-index:2;bottom:12px;left:12px;right:12px;pointer-events:none}
.town-action-area .map-caption{position:static;background:#fdf5dfef;border:1px solid #c3b087;box-shadow:0 3px 12px #263a3133;color:#4c563e;font-size:12px;line-height:1.5;padding:8px 12px;border-radius:12px;text-align:center;margin:0 auto 12px;max-width:330px;min-height:35px;pointer-events:auto}
.town-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.town-actions button{pointer-events:auto;min-height:74px;border:1px solid #927348;border-radius:17px 17px 14px 14px;background:linear-gradient(#fff4cf,#d7c49b);box-shadow:0 4px 0 #795b35,0 6px 10px #31433155;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3px;color:#5b442c;font-weight:700;font-size:13px;text-shadow:0 1px #fff6df}.town-actions button:first-child{background:linear-gradient(#dbe8b3,#8eaa62);color:#34462a}.town-actions img{width:44px;height:43px;object-fit:contain;filter:drop-shadow(0 2px 1px #483b2844)}
#app[data-view="game"]:not(.space) .bottom{padding-top:5px;padding-bottom:max(8px,env(safe-area-inset-bottom));background:#fff9e8f5;border-color:#c8b994;backdrop-filter:blur(8px)}
#app[data-view="game"]:not(.space) .bottom button{min-width:0;min-height:48px;flex:1;padding:3px;font-size:10px}.town-stage button:focus-visible{outline:3px solid #264f42;outline-offset:3px}
#app[data-view="game"]:not(.space) main>.walk-controls,#app[data-view="game"]:not(.space) main>.scene-tools,#app[data-view="game"]:not(.space) main>.card{margin-left:14px;margin-right:14px}
@media(max-width:350px){.town-hud{left:9px;right:9px;gap:5px}.town-title{padding:6px}.town-title strong{font-size:19px;letter-spacing:1px}.town-avatar{width:46px;height:50px}.town-resources{min-width:62px}.town-actions{gap:9px}.town-title small{font-size:8px}}

.town-resources button{min-height:44px}.town-stage .map-tools,.town-stage .map-stop{top:124px}
/* Grade pilot study pages share the active child's existing palette. */
.study-banner{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--soft);font-size:12px;line-height:1.6;margin:12px 0;color:var(--text)}.study-shortcuts{display:flex;gap:8px;flex-wrap:wrap}.study-shortcuts button{flex:1;min-width:95px;font-size:12px}.study-repair h2{margin:8px 0}.study-question{font-size:19px;line-height:1.8}.study-repair select{width:100%}#study-task-form label{display:block;margin-top:12px}#study-task-form input,#study-task-form select{width:100%}#study-note-list .task,#app .card.task{text-align:left}#study-answer{font-size:20px}#task-evidence{min-height:130px}
