/* Immersive game scenes and a consistent chapter structure. */
.world-game { --gold:#f6d38c; --cream:#fff6dc; --night:#183747; max-width:1400px; margin:auto; }
body:has(.world-game) .console-main { max-width:1500px; padding:12px 28px 0; }
body:has(.world-game) .console-header { min-height:64px; max-width:1500px; }
body:has(.world-game) .console-footer { padding-top:12px; padding-bottom:12px; }
.world-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 14px; }
.world-heading h1 { font-size:25px; }
.world-heading .eyebrow { margin:0 0 5px; font-size:8px; }
.world-tools { display:flex; gap:7px; }
.world-tool { min-width:48px; min-height:44px; border:1px solid #bcc8bb; border-radius:12px; background:#fffcf4; padding:9px 14px; color:#294d47; font:750 12px Nunito,sans-serif; display:inline-flex; align-items:center; justify-content:center; }
.world-tool:disabled { opacity:.45; }
.world-stage { width:100%; aspect-ratio:5/3; max-height:calc(100svh - 225px); min-height:360px; background:#183443; border:5px solid #fffaf0; border-radius:26px; overflow:hidden; position:relative; box-shadow:0 16px 45px #243b3822,0 0 0 1px #d9d6c9; }
#worldCanvas { display:block; width:100%; height:100%; touch-action:none; outline-offset:-6px; }
.world-hud { position:absolute; top:14px; left:17px; right:17px; display:flex; align-items:start; gap:12px; pointer-events:none; }
.world-hud button { pointer-events:auto; margin-left:auto; background:#fdf5dfef; box-shadow:0 4px 12px #00151c26; }
.mission-card { min-width:230px; max-width:63%; border:1px solid #fff3ca66; border-radius:13px; background:#183a42ed; padding:10px 15px; box-shadow:0 6px 18px #03161e30; color:#fff7df; }
.mission-card>span { display:block; font-size:8px; font-weight:850; letter-spacing:1.3px; color:#f3d08a; text-transform:uppercase; }
.mission-card strong { display:block; font-size:12px; line-height:1.4; margin:3px 0 7px; }
.mission-track { background:#ffffff24; border-radius:8px; height:4px; overflow:hidden; }
.mission-track span { display:block; background:#f3d48b; height:100%; width:0; transition:width .3s; }
.world-counter { color:#fff5d9; background:#143743e8; padding:10px 15px; border:1px solid #e4cf9470; border-radius:12px; font-size:15px; font-weight:850; white-space:nowrap; }
.world-lobby { position:absolute; inset:0; background-image:linear-gradient(90deg,#082c35f2 0%,#082c35d9 32%,#102e3640 68%,#09232c70),var(--scene-image); background-size:cover; background-position:center; display:grid; grid-template-columns:1.1fr 1fr; align-items:center; gap:30px; padding:45px; color:var(--cream); }
.lobby-copy { max-width:490px; }
.world-kicker { color:var(--gold); font-size:9px; font-weight:850; letter-spacing:1.8px; display:block; margin-bottom:14px; }
.lobby-copy h2 { font-size:clamp(28px,4vw,54px); font-weight:850; letter-spacing:-1.5px; line-height:1.04; text-shadow:0 5px 20px #061f3560; margin-bottom:17px; }
.lobby-copy>p { color:#f1eedc; font-size:14px; line-height:1.65; max-width:360px; }
.lobby-rule { display:flex; gap:13px; max-width:390px; font-size:11px; line-height:1.65; color:#d7e4d6; margin:20px 0 24px; }
.lobby-rule>span:first-child { color:#ffdd99; font-size:25px; }
.world-primary,.world-secondary { display:inline-flex; align-items:center; justify-content:center; gap:18px; min-height:50px; border-radius:14px; padding:13px 22px; border:1px solid #ffeab6; font:850 13px Nunito,sans-serif; background:linear-gradient(#ffdf9c,#eab866); color:#4b3524; box-shadow:0 4px 0 #8d693e,0 8px 20px #091f3030; }
.world-primary:hover { filter:brightness(1.06); transform:translateY(-1px); }
.world-primary:active { transform:translateY(2px); box-shadow:0 2px 0 #8d693e; }
.chapter-selection { margin-left:auto; max-width:350px; width:100%; background:#16333bd1; border:1px solid #ead2a64f; padding:24px; border-radius:22px; box-shadow:0 15px 40px #051a3533; backdrop-filter:blur(12px); }
.chapter-list { display:flex; flex-direction:column; gap:12px; }
.chapter-choice { display:flex; gap:12px; align-items:center; text-align:left; border:1px solid #ffffff35; background:#e8f1e212; color:#fdf6df; border-radius:13px; padding:13px; min-height:72px; }
.chapter-choice[aria-pressed=true] { border-color:#f2cf87; background:#f1d79620; box-shadow:0 0 0 2px #f4d89613; }
.chapter-choice:disabled { opacity:.45; }
.chapter-number { min-width:30px; font-size:21px; font-weight:850; color:#f9d995; }
.chapter-choice strong { display:block; font-size:13px; }
.chapter-choice small { display:block; font-size:10px; color:#d0dbcc; margin-top:5px; line-height:1.4; }
.chapter-save-note { font-size:9px; color:#cfdbcf; margin-top:17px; }
.world-modal { position:absolute; inset:0; display:grid; place-items:center; background:#0d263bb8; backdrop-filter:blur(8px); padding:20px; overflow:auto; }
.world-modal-card { border:1px solid #f1d6948c; border-radius:25px; background:linear-gradient(140deg,#264856,#102c40); padding:30px; width:440px; max-width:100%; text-align:center; box-shadow:0 20px 80px #05182c88; color:var(--cream); }
.world-modal-card h2 { font-size:32px; margin:10px 0 15px; }
.world-modal-card p { font-size:13px; line-height:1.65; color:#dfe8d9; margin-bottom:20px; }
.world-modal-card button { width:100%; margin-top:10px; }
.world-secondary { background:#ffffff0a; color:#fff4db; border-color:#f6e0ad4f; box-shadow:none; min-height:44px; }
.world-done { display:block; padding:15px 5px 0; font-size:11px; color:#d3e0d8; }
.chapter-medal { width:66px; height:66px; display:grid; place-items:center; margin:0 auto 20px; font-size:42px; background:linear-gradient(#f8dfa0,#d59b51); color:#966538; border:4px double #fff3c2; border-radius:50%; box-shadow:0 6px 0 #795938,0 0 40px #ffc87126; }
.world-control-deck { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:14px 0 0; min-height:54px; }
.world-control-deck>p { font-size:12px; color:#5d6f63; max-width:460px; line-height:1.5; }
.world-controls { display:flex; gap:7px; flex-wrap:wrap; justify-content:end; }
.world-control { min-height:48px; min-width:50px; padding:10px 18px; border:1px solid #bfd0c0; border-bottom:3px solid #a0b7a5; border-radius:12px; background:#fffaf0; color:#35594f; font:800 12px Nunito,sans-serif; touch-action:none; }
.world-control.is-primary { background:#365e50; color:#fff5d7; border-color:#284939; }
.world-control:active { transform:translateY(2px); border-bottom-width:1px; }
.world-save-status { font-size:10px; color:#718074; text-align:center; margin:12px 0 0; min-height:15px; }
.world-load-status { font-size:10px!important; margin-top:14px; min-height:16px; }
.world-stage:fullscreen { width:100vw; height:100vh; max-height:none; border:0; border-radius:0; }
.world-stage:fullscreen .world-lobby { padding:6vw; }
.brand { font-size:23px; letter-spacing:-.7px; }
.brand-small { letter-spacing:6px; }
.village-feature { min-height:420px; }
.village-art { width:100%; right:0; }
.village-feature:before { background:linear-gradient(90deg,#163d36e8,#153c3699 42%,transparent 75%); }
.village-feature .feature-copy h2 { color:#fff5d8; text-shadow:0 3px 10px #17392330; }
.village-feature .feature-copy p { color:#e8f0d9; }
.village-feature .small-pill { background:#f9dc9b; color:#4e513c; }
.village-feature .primary-button { background:#f5d38e; color:#4d462b; border-color:#f5d38e; box-shadow:0 3px 0 #aa834b; }
@media(max-width:950px){.world-lobby{padding:28px;gap:20px}.chapter-selection{padding:17px}.lobby-copy h2{font-size:36px}.lobby-copy>p{font-size:12px}.lobby-rule{font-size:10px;margin:13px 0 17px}.chapter-choice{padding:10px;min-height:65px}.chapter-list{gap:8px}.chapter-choice small{font-size:9px}.chapter-choice strong{font-size:11px}.world-heading h1{font-size:21px}.world-tool{padding:9px 11px}.world-primary{font-size:11px;padding:12px 16px}.world-control-deck{flex-direction:column;gap:10px}.world-control-deck>p{max-width:none;text-align:center}.world-controls{justify-content:center}.world-stage{max-height:calc(100svh - 240px)}}
@media(max-width:650px){body:has(.world-game) .console-main{padding:12px 10px 0}.world-heading{flex-wrap:wrap;gap:10px;margin-bottom:12px}.world-heading h1{font-size:23px}.world-heading .eyebrow{font-size:7px}.world-tools{width:100%;justify-content:space-between}.world-tool{font-size:11px;min-height:44px;padding:9px 12px}.world-stage{min-height:360px;max-height:none;aspect-ratio:1/1;border-width:3px;border-radius:19px}.world-lobby{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:20px;gap:15px;overflow:auto;background-image:linear-gradient(#0c303acc,#0b2a38e8),var(--scene-image)}.lobby-copy h2{font-size:29px;margin-bottom:10px}.world-kicker{font-size:7px;margin-bottom:8px}.lobby-copy>p{font-size:11px;line-height:1.5}.lobby-rule{display:none}.lobby-copy .world-primary{margin-top:13px;min-height:45px}.world-load-status{display:none}.chapter-selection{background:transparent;border:0;box-shadow:none;backdrop-filter:none;padding:0;max-width:none;margin:0}.chapter-selection>.world-kicker,.chapter-save-note{display:none}.chapter-list{flex-direction:row;gap:7px}.chapter-choice{flex:1;min-width:0;padding:9px 6px;flex-direction:column;gap:3px;text-align:center;min-height:75px}.chapter-choice small{display:none}.chapter-choice strong{font-size:9px;line-height:1.3}.chapter-number{font-size:17px}.world-hud{left:8px;right:8px;top:8px;gap:5px}.mission-card{min-width:0;max-width:none;flex:1;padding:8px 10px;border-radius:9px}.mission-card>span{font-size:6px;letter-spacing:.6px}.mission-card strong{font-size:9px;line-height:1.3;margin:3px 0 5px}.world-counter{font-size:10px;padding:8px;min-width:42px;text-align:center}.world-hud .world-tool{font-size:9px;min-height:43px;padding:8px}.world-control{padding:9px 12px;font-size:11px;min-height:48px}.world-control-deck>p{font-size:11px}.world-control-deck{margin-top:10px}.world-modal{padding:14px}.world-modal-card{padding:22px}.world-modal-card h2{font-size:26px}.world-modal-card p{font-size:11px;margin-bottom:10px}.world-modal-card button{margin-top:8px;min-height:43px}.chapter-medal{width:45px;height:45px;font-size:29px;margin-bottom:14px}.world-save-status{font-size:9px}.brand{font-size:20px}}
@media(max-height:600px) and (min-width:651px){body:has(.world-game) .console-header{display:none}.world-stage{min-height:300px;max-height:calc(100svh - 140px)}.world-lobby{padding:20px}.lobby-copy h2{font-size:30px}.lobby-copy>p,.lobby-rule{font-size:10px}.chapter-selection{padding:13px}.chapter-choice{min-height:53px}.world-control-deck>p{display:none}.world-heading h1{font-size:18px}.world-control-deck{margin-top:8px}.world-save-status,body:has(.world-game) .console-footer{display:none}}

.world-game:fullscreen{overflow:auto;background:#102c35;padding:16px}.world-game:fullscreen .world-stage{max-height:calc(100dvh - 210px)}
/* A real WebGL scene sits below the shared accessible HUD and input canvas. */
.world-stage .village-three{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.world-stage:has(.village-three) #worldCanvas{position:relative;z-index:1}
.world-stage:has(.village-three) .world-hud{z-index:3}
.world-stage:has(.village-three) .world-lobby,.world-stage:has(.village-three) .world-modal{z-index:4}
.village-panel{position:absolute;inset:12px;z-index:8;overflow:auto;background:#fffcf1;color:#25474b;border:2px solid #e9d5a4;border-radius:20px;padding:22px;box-shadow:0 12px 60px #102c3577}.village-panel[hidden]{display:none}.village-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.village-panel h2{font-size:24px;margin:0}.village-panel p{line-height:1.6}.village-passport{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.village-passport section{background:#ecf0df;border-radius:14px;padding:12px}.village-passport h3{font-size:16px}.village-passport button{width:100%;text-align:left;margin:5px 0;font-size:13px}.activity-options{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}.activity-options button{min-width:100px;min-height:56px}.activity-feedback{background:#ecf0df;padding:12px;border-radius:12px}.world-game[data-kind=village] .world-controls{flex-wrap:wrap}.world-game[data-kind=village] .world-control-deck{flex-wrap:wrap}
.village-panel .world-secondary{background:#fffaf0;color:#25474b;border-color:#718b7c}.village-panel .world-secondary:hover{background:#dce8d8;color:#193b3f}.village-panel .world-secondary:focus-visible{outline:3px solid #25474b;outline-offset:2px}.village-panel .world-secondary:disabled{color:#52655c;background:#e3e7dc;border-color:#95a492;opacity:1}
@media(max-width:650px){.village-panel{inset:5px;padding:12px}.village-panel h2{font-size:19px}.village-passport{grid-template-columns:1fr}.village-panel-heading .world-secondary{min-width:75px}.world-game[data-kind=village] .world-stage{min-height:420px}}
.village-map-labels{position:absolute;inset:0;z-index:2;pointer-events:none}.village-map-labels[hidden]{display:none}.village-map-labels button{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;border:1px solid #e5d7b3;border-radius:9px;background:#214b50ed;color:#fff4d8;padding:7px 10px;font:700 12px Nunito,sans-serif;white-space:nowrap;box-shadow:0 3px 8px #18374733}@media(max-width:650px){.village-map-labels button{font-size:9px;padding:6px 4px}}

.school-workbench{position:absolute;right:18px;bottom:18px;width:min(420px,calc(100% - 36px));max-height:65%;overflow:auto;padding:18px;background:#fff7e9f2;border:2px solid #e9cf9d;border-radius:22px;box-shadow:0 12px 40px #1b3d4b33;color:#31565b;z-index:5}.school-workbench p{margin:0 0 12px;font-weight:800}.school-workbench button{margin:4px;font-size:14px}.school-workbench[hidden]{display:none}
/* Large two-tap atlas letters preserve readable mobile exploration. */
.atlas-touch-board{display:none}
@media(max-width:650px){.atlas-touch-board{display:block;margin-top:16px;padding:10px;border-radius:16px;background:#eee7d5;color:#31545c}.atlas-touch-board p{margin:0 0 10px;font-size:14px;font-weight:800}.atlas-touch-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px}.atlas-touch-grid button{min-width:0;min-height:42px;padding:0;border:1px solid #cad3c0;border-radius:6px;background:#faf3e4;color:#31545c;font:800 19px Nunito,sans-serif}.atlas-touch-grid button.is-found{background:#aed2be}.atlas-touch-grid button.is-selected,.atlas-touch-grid button.is-hint{background:#edc981;border-color:#997944}}

.castle-journal{width:min(560px,90vw);max-height:85vh;overflow:auto;border:2px solid #d7bf87;border-radius:20px;padding:24px;background:#fff6df;color:#294b50}.castle-journal::backdrop{background:#142d416e}.castle-journal article{padding:8px 14px;margin:12px 0;background:#e9eddd;border-radius:12px}.castle-journal p{line-height:1.6}

/* Willowbrook city: readable navigation and a personal block avatar. */
.city-ui{position:absolute;inset:0;z-index:2;pointer-events:none}.city-ui[hidden],.city-editor[hidden]{display:none}.city-minimap{position:absolute;right:14px;top:100px;width:112px;height:112px;border:4px solid white;border-radius:22px;box-shadow:0 5px 0 #263b6a44}.city-badge{position:absolute;left:14px;bottom:15px;background:#253f75;color:white;border:2px solid #ffffff;border-radius:12px;padding:10px 14px;font:bold 12px sans-serif;letter-spacing:1px}.city-editor{position:absolute;inset:12px;z-index:6;background:#f3f7ff;color:#223963;border:4px solid white;border-radius:24px;padding:18px;overflow:auto;box-shadow:0 12px 50px #13244866;display:grid;grid-template-columns:190px 1fr;gap:10px 24px;align-content:start}.city-editor h2{grid-column:1/-1;font:900 25px sans-serif;margin:0;letter-spacing:2px}.city-editor canvas{border-radius:18px;max-width:100%}.city-avatar-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.city-avatar-fields label{display:flex;flex-direction:column;gap:5px;font:bold 13px sans-serif}.city-avatar-fields select{min-width:0;width:100%;padding:10px;border:2px solid #c6d5f0;background:white;color:#223963;border-radius:10px;font:inherit;min-height:44px}.city-editor p{grid-column:1/-1;margin:0;font-size:12px}.city-editor>button{grid-column:1/-1;min-height:44px;border:0;border-radius:12px;background:#6355e8;color:white;font-weight:bold}.city-joystick,.city-touch-actions{display:none}.city-editor :focus-visible{outline:3px solid #e58b12;outline-offset:2px}
@media(pointer:coarse),(max-width:650px){.city-minimap{top:85px;right:10px;width:75px;height:75px;border-radius:16px}.city-badge{top:82px;bottom:auto;left:9px;font-size:8px;padding:8px}.city-joystick{display:block;pointer-events:auto;position:absolute;left:15px;bottom:20px;width:90px;height:90px;border:3px solid #ffffffaa;border-radius:50%;background:#243f7577;color:white;font:bold 10px sans-serif;touch-action:none}.city-joystick:after{content:'';position:absolute;inset:24px;border-radius:50%;background:#fff9;transform:translate(var(--jx,0px),var(--jy,0px))}.city-touch-actions{display:flex;gap:10px;position:absolute;right:14px;bottom:25px;pointer-events:auto}.city-touch-actions button{width:58px;height:58px;border:3px solid white;border-radius:50%;background:#6a52e8;color:white;font-weight:bold;touch-action:manipulation}.city-editor{padding:12px;gap:9px;grid-template-columns:100px 1fr;inset:6px}.city-editor canvas{width:100px!important;height:100px!important}.city-editor h2{font-size:18px}.city-avatar-fields{grid-template-columns:1fr;gap:6px}.city-avatar-fields label{font-size:11px}.city-avatar-fields select{padding:6px}.city-editor>button,.city-editor p{grid-column:1/-1}}
@media(pointer:coarse),(max-width:650px){.world-game[data-kind=village] .world-controls [data-action=left],.world-game[data-kind=village] .world-controls [data-action=right],.world-game[data-kind=village] .world-controls [data-action=up],.world-game[data-kind=village] .world-controls [data-action=down],.world-game[data-kind=village] .world-controls [data-action=jump],.world-game[data-kind=village] .world-controls [data-action=interact]{display:none}}
