@font-face{font-family:Baloo;src:url('assets/baloo.woff2') format('woff2');font-display:swap}
:root{--cream:#fff8e6;--ink:#205d58;--teal:#167f7b;--fern:#e1eccb;--header:76px;--dock:148px}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{font-family:'Avenir Next',ui-rounded,system-ui,sans-serif;color:var(--ink);background:var(--cream)}button{font:inherit;cursor:pointer;border:0;-webkit-tap-highlight-color:transparent;touch-action:manipulation;color:inherit}button:disabled{cursor:default}button svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;flex:none}button:focus-visible,canvas:focus-visible{outline:4px solid #f9bd50;outline-offset:-4px}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#app{height:100dvh;height:var(--app-height,100dvh);width:100%;min-height:320px;display:grid;grid-template-rows:calc(var(--header) + env(safe-area-inset-top)) minmax(0,1fr) calc(var(--dock) + env(safe-area-inset-bottom));isolation:isolate;overflow:hidden;position:relative}.topbar{grid-row:1;display:grid;grid-template-columns:52px minmax(0,1fr) 52px;gap:10px;align-items:center;padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:var(--cream);z-index:5}.round,.book-button,.about{width:48px;height:48px;min-width:44px;min-height:44px;border-radius:50%;display:grid;place-items:center;background:#e7efdb;color:var(--ink);padding:10px}.book-button{position:relative}.book-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8}.book-label,#book-dots{display:none}#route-title{font-family:Baloo,ui-rounded,sans-serif;text-align:center;font-weight:750;font-size:25px;line-height:1.03;white-space:normal}#route-title small{display:block;font-family:'Avenir Next',system-ui,sans-serif;font-weight:500;font-size:11px;line-height:1.5;color:#69847c;margin-top:4px}
#play-stage{grid-row:2;position:relative;min-height:0;overflow:hidden;isolation:isolate}.landscape,.shade,#world{position:absolute;inset:0;width:100%;height:100%}.landscape{background:url('assets/island.webp') 50% center/cover no-repeat;z-index:-3}.shade{background:linear-gradient(180deg,#24493205,transparent 70%,#17462725);z-index:-2}#world{z-index:-1;touch-action:none}.stage-glee{position:absolute;width:64px;left:8px;bottom:2px;pointer-events:none;filter:drop-shadow(0 3px 3px #284f4b33);z-index:3}.welcome{position:absolute;left:7%;top:5%;color:#fff9e5;text-shadow:0 2px 8px #124a32;pointer-events:none;max-width:85%}.brand{font-family:Baloo;font-size:28px}.welcome h1{font-family:Baloo;font-size:clamp(28px,5vw,58px);line-height:1.03;margin:0}.welcome p{font-size:16px;font-weight:650;margin:12px 0}#app:not([data-screen=welcome]) .welcome{display:none}#app[data-screen=welcome] #world{opacity:.95}#app[data-screen=welcome] #markers{display:none}#app[data-screen=welcome] .landscape:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#17482d66,transparent 70%)}
#markers,#features,#activity{position:absolute;inset:0;pointer-events:none}.path-marker{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;background:#fff8e9f5;border:2px solid #d4dfb9;color:var(--ink);border-radius:28px;min-width:88px;min-height:48px;padding:10px 15px;box-shadow:0 4px 0 #3d68565c;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;font-weight:750;font-size:15px}.path-marker svg{width:22px;height:22px}.feature-dot{pointer-events:auto;position:absolute;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:50%;border:3px solid #fff9d8;background:#177f7b75;box-shadow:0 0 0 6px #ffefab33;color:white;font-size:28px}.feature-dot.found{background:#177f7bd9;border-color:#f5dc91}.feature-dot.found:after{content:'✓';font-size:20px;position:absolute;inset:0;display:grid;place-items:center;background:inherit;border-radius:50%}
#play-dock{grid-row:3;position:relative;z-index:5;background:var(--cream);padding:8px max(16px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:4px;align-items:center}#guide{width:100%;padding:0 46px;min-height:50px;display:flex;align-items:center;justify-content:center}.speech{display:flex;align-items:center;justify-content:center;gap:3px;text-align:center;font-size:16px;font-weight:750;line-height:1.25;max-width:750px}#caption{max-height:60px;overflow:auto}#repeat-voice{background:transparent;flex:none;display:grid;place-items:center;width:44px;height:44px;padding:11px;color:#618b80}#repeat-voice svg{width:22px;height:22px}.quiet-tools{position:absolute;top:10px;left:9px;right:9px;display:flex;justify-content:space-between;pointer-events:none}.quiet-tools button{width:44px;height:44px;pointer-events:auto;background:transparent;padding:11px;color:#668b7f}.quiet-tools svg{width:22px;height:22px}.about{font-family:Georgia,serif;font-size:20px;font-weight:bold}.quiet-tools .about{opacity:.7}#actions{display:flex;align-items:stretch;justify-content:center;gap:12px;width:100%;max-width:650px;min-height:56px}#actions>button{flex:1;max-width:340px}.primary,.secondary,.leaf-choice,.capture{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:12px 18px;font-weight:700;font-size:17px;border-radius:21px;background:var(--fern);color:#58733b;box-shadow:0 4px 0 #b7c995}.primary,.capture,.leaf-choice:first-child{background:var(--teal);color:#fffcef;box-shadow:0 4px 0 #125d5a}.secondary:hover,.leaf-choice:hover{filter:brightness(1.04)}.leaf-choice:disabled{opacity:.72}.leaf-choice.done:after{content:'✓';font-weight:800}.capture-label{display:none}.orbit-controls{display:flex;justify-content:center;gap:30px;align-items:center}.orbit-controls button{width:72px;height:56px;border-radius:20px;background:#dceac8;box-shadow:0 4px 0 #b7c995}#path-rail{display:none!important}
.activity-card{position:absolute;pointer-events:auto;background:#fff4d8;border:4px solid #d5ad65;box-shadow:0 6px 0 #674c355e;border-radius:22px;padding:12px}.activity-card p{margin:0 0 8px;font-weight:750;font-size:15px;text-align:center}.activity-card:not(.dig-card){left:50%;top:62%;bottom:5%;transform:translateX(-50%);width:min(90%,420px);display:flex;flex-direction:column}.match-area{position:relative;flex:1;min-height:85px;border-radius:13px;background:#be9566;box-shadow:inset 0 4px 12px #71503840;touch-action:none}.print-target,.foot-piece{position:absolute;top:8px;width:78px;height:calc(100% - 16px);max-height:100px;min-height:55px}.print-target{right:12%;color:#795837}.foot-piece{left:10%;background:transparent;color:#e6b46f;filter:drop-shadow(0 4px 2px #7c5b36);padding:0;touch-action:none}.foot-piece svg,.print-target svg{width:100%;height:100%;stroke-width:1;fill:currentColor;stroke:#7e5b35}.foot-piece.selected{outline:3px solid var(--teal);border-radius:12px}.foot-piece.matched{left:auto!important;right:12%;top:8px!important;color:#f8e6a4}.match-area.matched{box-shadow:inset 0 0 0 3px #8fb77b}
.dig-card{left:4%;right:4%;top:39%;bottom:4%;padding:11px;border:10px solid #a97742;border-top-color:#c18b4f;border-bottom-color:#78522f;border-radius:30px;box-shadow:inset 0 0 0 3px #61482b,0 8px 0 #6248326b;display:flex;flex-direction:column;background:#b78650}.dig-area{position:relative;flex:1;min-height:0;isolation:isolate;background:radial-gradient(ellipse at 40% 35%,#dfb97e,#bb8a51);border-radius:14px;overflow:hidden;touch-action:none;box-shadow:inset 0 6px 20px #66482150}.dig-area>svg{width:100%;height:100%;position:absolute;inset:0;filter:drop-shadow(0 3px 1px #84633d)}.sand{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}.fossil-pieces{display:flex;justify-content:center;align-items:center;gap:16px;flex:none;padding-top:10px;height:72px}.fossil-pieces:empty{display:none}.fossil-piece{height:58px;width:72px;min-width:44px;min-height:44px;background:#ffedc6;border:2px solid #ead5a9;border-radius:15px;touch-action:none;box-shadow:0 3px 0 #785230;color:#967444}.fossil-piece svg{width:44px;height:42px;fill:#f0d6a3;stroke:#926f45;stroke-width:1.3}.fossil-piece.selected{outline:4px solid #197a77;outline-offset:-2px;background:#fff8e6}.fossil-piece.done{opacity:.65;background:#d6e3ad}.fossil-slot{position:absolute;border:2px dashed #826143;border-radius:12px;width:58px;height:52px;background:#efcd9350;pointer-events:auto;padding:4px}.fossil-slot.done{background:#f1dfa8;border-color:#88a560}.fossil-slot svg{width:42px;height:38px;fill:#f5dcad;stroke:#967347}
#load{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f4e8c7;z-index:20;font-size:20px;font-weight:750;transition:opacity .25s}#load img{width:160px}#load.loaded{opacity:0;pointer-events:none}.magnifier{position:absolute;border:6px solid #ecc567;border-radius:50%;width:140px;height:140px;box-shadow:0 4px 15px #324b4744;pointer-events:none;transform:translate(-50%,-50%);z-index:14;background:#e9f3d540}.magnifier canvas{width:100%;height:100%;border-radius:50%}.magnifier:after{content:'';position:absolute;right:-12px;bottom:-25px;width:15px;height:40px;border-radius:6px;background:#dca047;transform:rotate(-40deg)}.toast{position:absolute;left:50%;bottom:calc(16px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--teal);color:#fff8e5;pointer-events:none;padding:15px 26px;white-space:nowrap;border-radius:20px;font-family:Baloo;font-size:22px;z-index:7;animation:toast 2.4s both}@keyframes toast{0%,100%{opacity:0;transform:translate(-50%,12px)}12%,75%{opacity:1;transform:translate(-50%,0)}}.error-panel{padding:24px;background:#fff7e4}
/* Dialogs are the optional reading layer, outside the child's play stage. */
dialog{border:0;background:var(--cream);color:var(--ink);border-radius:26px;box-shadow:0 28px 100px #0e302c80;width:min(900px,94vw);max-height:90dvh;padding:0;overflow:hidden}dialog[open]{display:flex;flex-direction:column}dialog::backdrop{background:#143a3677;backdrop-filter:blur(6px)}.dialog-controls{flex:none;display:flex;justify-content:flex-end;min-height:62px;padding:8px 14px}dialog .close{width:44px;height:44px;font-size:28px}#dialog-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 24px 28px}dialog h2{font-family:Baloo;font-size:30px;line-height:1.1;margin:0 0 14px}dialog p{max-width:68ch;line-height:1.55}dialog a{color:var(--teal)}.adult-note{background:#efe6ca;border-radius:15px;padding:14px;font-size:14px}.book-intro{color:#6c8473}.book-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin-top:24px}.book-page{background:#f4e6c1;padding:15px;min-height:180px;border-radius:4px 18px 18px 4px;box-shadow:inset 7px 0 12px #8c74481a;border-left:3px solid #d5ba7f}.book-page img{width:100%;aspect-ratio:1.6;object-fit:cover;background:#cfdbb9;border-radius:8px}.book-page h3{font-family:Baloo;font-size:23px;line-height:1.1;margin:12px 0 6px}.book-page p{font-size:14px;margin:5px 0 14px}.book-page.empty{display:flex;align-items:center;justify-content:center;flex-direction:column;border:2px dashed #cdbc8d}.book-page.empty svg{width:42px;height:42px;fill:none;stroke:#768756;stroke-width:1.8;margin-bottom:12px}.book-page.empty span{font-weight:700}.book-page .secondary{font-size:14px;min-height:48px}
@media(min-width:1000px){#route-title{font-size:29px}#route-title small{font-size:13px}.stage-glee{width:86px}.dig-card{left:50%;right:8%;top:8%;bottom:8%}.activity-card:not(.dig-card){left:auto;right:8%;transform:none;width:35%;top:36%;bottom:10%}}
@media(max-width:600px){.topbar{gap:8px;padding-left:12px;padding-right:12px}#route-title{font-size:23px}#route-title small{font-size:10px}.speech{font-size:14px}#actions{gap:10px}.primary,.secondary,.leaf-choice,.capture{font-size:16px;padding:10px 14px;border-radius:19px;gap:7px}.book-grid{grid-template-columns:1fr}.stage-glee{width:56px}.welcome h1{font-size:34px}.path-marker{font-size:13px;padding:8px 12px;min-height:48px;min-width:82px}.path-marker svg{width:19px;height:19px}}
@media(max-height:520px) and (orientation:landscape){:root{--header:62px;--dock:104px}.topbar{padding-top:5px;padding-bottom:5px;grid-template-columns:48px minmax(0,1fr) 48px}.topbar .round,.book-button{width:44px;height:44px}#route-title{font-size:23px}#route-title small{margin-top:1px}#play-dock{padding-top:2px;padding-bottom:10px;gap:0}#guide{min-height:39px}.speech{font-size:14px}#repeat-voice{height:36px;width:44px;padding:9px}#actions{min-height:48px}.primary,.secondary,.leaf-choice,.capture{min-height:48px;font-size:15px;padding:8px 18px}.quiet-tools{top:1px}.dig-card{left:51%;right:3%;top:4%;bottom:5%;padding:8px;border-width:7px;border-radius:22px}.fossil-pieces{height:53px;padding-top:5px;gap:14px}.fossil-piece{height:46px;width:63px}.fossil-piece svg{height:36px}.fossil-slot{width:52px;height:48px}.fossil-slot svg{height:34px;width:40px}.activity-card:not(.dig-card){left:auto;right:6%;transform:none;top:10%;bottom:8%;width:38%}.stage-glee{width:48px;left:5px}.welcome{top:5%;left:4%}.welcome h1{font-size:31px}.welcome p{display:none}.brand{font-size:22px}.path-marker{min-height:44px;padding:6px 12px;font-size:12px}.path-marker svg{width:18px;height:18px}.orbit-controls button{height:48px}.dialog-controls{min-height:54px;padding:5px 12px}.toast{bottom:10px;padding:10px 24px;font-size:19px}}
@media(max-width:370px){#route-title{font-size:20px}.topbar{padding-left:8px;padding-right:8px}#play-dock{padding-left:10px;padding-right:10px}.primary,.secondary,.leaf-choice{font-size:14px}.fossil-pieces{gap:10px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}.toast{display:none}}

/* Bring the island’s existing sandy foreground under the child-triggered stamp. */
.trail-ground{display:none;position:absolute;bottom:0;left:0;right:0;height:52%;z-index:-2;background:url('assets/island.webp') 50% 100%/auto 300% no-repeat;mask-image:linear-gradient(transparent,#000 16%);-webkit-mask-image:linear-gradient(transparent,#000 16%)}
@media(orientation:portrait){#app[data-screen=tracks] .trail-ground{display:block}#app[data-screen=tracks] .activity-card{top:75%;bottom:3%;padding:8px}#app[data-screen=tracks] .activity-card p{font-size:13px;margin-bottom:3px}#app[data-screen=tracks] .match-area{min-height:60px}}
#app[data-screen=home]{--dock:82px}#app[data-screen=home] #actions{display:none}
@media(max-height:520px) and (orientation:landscape){#repeat-voice{min-height:44px;height:44px}#guide{min-height:44px}#app[data-screen=home]{--dock:62px}}

/* Captions are fully visible. The dock grows with the lesson instead of scrolling it. */
#app{grid-template-rows:calc(var(--header) + env(safe-area-inset-top)) minmax(0,1fr) auto}
#play-dock{min-height:calc(var(--dock) + env(safe-area-inset-bottom));height:auto}
#guide,#actions{flex:none}#guide{padding-inline:42px}
#caption{max-height:none;overflow:visible}
#celebrate{display:contents}.saved-spark{display:inline-block;flex:none;color:#b47b17;font-size:23px;line-height:1}
.book-grid{margin-top:12px}.book-page h3{margin:0 0 10px}.book-page .secondary{width:100%;margin-top:10px}
.book-page details{font-size:13px;margin-top:6px}.book-page summary{min-height:44px;display:flex;align-items:center;color:#638270;cursor:pointer}
@media(max-width:600px){.book-page.latest img{max-height:165px;object-fit:contain}.book-page.latest{padding:12px}.book-page.latest h3{font-size:22px}#dialog-content{padding-inline:18px}.book-page details p{margin-bottom:0}}
@media(max-height:620px) and (orientation:portrait){.speech{font-size:13px;line-height:1.3}#guide{padding-inline:36px}.stage-glee{width:45px}.fossil-pieces{height:59px;padding-top:7px}.fossil-piece{height:48px}.dig-card{padding:8px;border-width:8px;top:36%;bottom:3%}}

.book-page.latest{grid-column:1/-1}
@media(max-height:520px) and (orientation:landscape){.book-page.latest{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:16px;align-items:start}.book-page.latest img{grid-column:1;grid-row:1/4;max-height:180px;object-fit:contain}.book-page.latest h3,.book-page.latest .secondary,.book-page.latest details{grid-column:2}.book-page.latest .secondary{margin-top:0}.book-page.latest h3{margin-bottom:6px}}
/* One deliberate ground action, then the fresh marks the child observed. */
.observed-track-stage{position:absolute;inset:0;pointer-events:none}
.ground-step{position:absolute;transform:translate(-50%,-50%);width:92px;height:84px;min-width:88px;min-height:80px;border:3px solid #fff6ce;border-radius:50%;background:#eaf0cee8;color:#226b58;box-shadow:0 0 0 7px #f5efb433,0 5px 0 #7f9164;pointer-events:auto;padding:15px;z-index:3}
.ground-step svg{width:100%;height:100%;transform:rotate(var(--foot-angle,0rad));fill:currentColor;stroke:none}
.ground-step:disabled{pointer-events:none}#observed-prints{position:absolute;top:78%;right:max(12px,calc((100% - 390px)/2));width:min(calc(100% - 88px),360px);height:64px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;align-items:center;padding:4px 3px;background:#ecd5a779;border-radius:18px;box-shadow:inset 0 1px 8px #65462a25}#observed-prints[hidden]{display:none}.print-view-key{position:absolute;left:2px;top:-25px;color:#fff9d7;filter:drop-shadow(0 1px 2px #43351d)}.print-view-key svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.5}
.observed-print{position:relative;width:100%;height:56px;min-width:48px;min-height:48px;border:0;border-radius:10px;background:transparent;pointer-events:auto;z-index:2;padding:7px 2px;color:#573a24;box-shadow:none}.observed-print svg{width:100%;height:34px;max-width:72px;fill:currentColor;stroke:#f9e9b8;stroke-width:3;filter:drop-shadow(0 2px 1px #60432666)}.observed-print svg{overflow:visible}.observed-print svg path{vector-effect:non-scaling-stroke}.observed-print.noticed{color:#103f38;background:#fff4cfb8;box-shadow:inset 0 0 0 2px #174e42}.observed-print.noticed svg{stroke:#fff9df;stroke-width:3.5;filter:drop-shadow(0 2px 1px #103f38)}.trail-progress{display:flex;align-items:center;justify-content:center;gap:15px;width:100%;min-height:56px}.trail-progress span{display:grid;place-items:center;width:39px;height:39px;border-radius:50%;color:#a8b9a0;background:#e8edda}.trail-progress svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2}.trail-progress .observed{color:#276c5b;background:#dae8bf}
#app[data-screen=tracks] .stage-glee{pointer-events:none}
@media(max-height:620px) and (orientation:portrait){.ground-step{width:88px;height:80px;padding:14px}#observed-prints{height:56px}.observed-print{height:48px}.trail-progress{min-height:48px}}
/* This child-facing pass uses a 48px floor, including quiet navigation tools. */
button{min-width:48px;min-height:48px}#repeat-voice,.quiet-tools button,dialog .close,.topbar .round,.book-button{min-width:48px;min-height:48px;width:48px;height:48px}
@media(max-height:620px) and (orientation:portrait){#guide{padding-inline:48px}}
/* Retained artwork is framed as a sunlit clearing, with quiet depth at its edges. */
.landscape{filter:saturate(1.035) contrast(1.025)}
.shade{background:radial-gradient(ellipse at 12% 7%,#fff2c536,transparent 47%),linear-gradient(120deg,transparent 42%,#173d3215 100%),linear-gradient(0deg,#23422716,transparent 28%)}
@media(orientation:portrait){
 #app[data-screen=fossils] .landscape{background:#ad945d}
 #app[data-screen=fossils] .landscape:before{content:'';position:absolute;inset:0 0 auto;height:43%;background:url('assets/island.webp') 50% 100%/cover no-repeat}
 #app[data-screen=fossils] .landscape:after{content:'';position:absolute;inset:29% 0 auto;height:16%;background:linear-gradient(transparent,#ad945d 91%)}
}
@media(orientation:landscape){#observed-prints{top:auto;bottom:3%;right:max(16px,calc((100% - 390px)/2))}}

/* Explicit, compact sound state; no automatic playback. */
#sound{display:flex;flex-direction:column;justify-content:center;gap:2px;padding:3px;width:48px}#sound .sound-label{font-size:10px;line-height:1.1;white-space:nowrap;font-weight:700}
[data-screen="welcome"] #actions{flex-wrap:wrap}[data-screen="welcome"] #actions>button{flex:1 1 130px;font-size:15px}
/* Local presentation pass: existing scene and gameplay coordinates stay intact. */
:root{--header:64px;--dock:128px}
body{background:#274f41}
#app{height:100vh;height:100dvh;min-height:0;grid-template-rows:minmax(calc(var(--header) + env(safe-area-inset-top)),max-content) minmax(0,1fr) auto;background:url('assets/island.webp') center/cover no-repeat}
#app::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,#123c4266,transparent 24%,transparent 75%,#153c3266)}
#app .shade{background:none}
#app:not([data-screen=fossils]) .landscape{background:none;filter:none}
@media(orientation:landscape){#app[data-screen=fossils] .landscape{background:none;filter:none}}
#app[data-screen=welcome] .landscape::after{background:none}
#app[data-screen=welcome]::before{background:linear-gradient(180deg,#123c4270,transparent 70%,#153c3266)}
.topbar{background:transparent;padding:calc(6px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left))}
#route-title{font-size:23px;color:#fff9e7;text-shadow:0 2px 5px #123d35}
#route-title small{color:#fff9e7;text-shadow:0 1px 4px #123d35}
.topbar .round,.book-button{background:#fff8e6ed;box-shadow:0 2px 8px #173b3c33}
#play-dock{background:transparent;padding:6px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));gap:8px;min-height:0}
#guide{min-height:48px;padding-inline:52px}
.speech{background:#fff8e6f5;border-radius:20px;padding:2px 6px 2px 10px;box-shadow:0 2px 8px #173b3c26}
.quiet-tools{top:6px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right))}
.quiet-tools button{background:#fff8e6ed;color:var(--ink);box-shadow:0 2px 8px #173b3c26}
.quiet-tools .about{opacity:1}
#app[data-screen=home]{--dock:70px}
.welcome{top:3%}
.stage-glee{bottom:4px}
@media(max-width:370px){#route-title{font-size:20px}}

/* A short landscape viewport gets a side dock rather than a squeezed scene. */
@media(orientation:landscape) and (max-height:540px){
 #app{grid-template-columns:minmax(0,1fr) clamp(210px,30vw,280px);grid-template-rows:calc(60px + env(safe-area-inset-top)) minmax(0,1fr)}
 .topbar{grid-column:1/-1;grid-row:1;padding-top:calc(6px + env(safe-area-inset-top));padding-bottom:6px}
 #play-stage{grid-column:1;grid-row:2;margin-left:env(safe-area-inset-left);margin-bottom:env(safe-area-inset-bottom)}
 #play-dock{grid-column:2;grid-row:2;padding:4px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) 8px;overflow-y:auto;overscroll-behavior:contain;justify-content:center}
 #guide{padding:0;min-height:48px}
 .speech{font-size:13px;width:100%;padding-left:8px}
 #actions{flex-direction:column;gap:8px;min-height:0}
 #actions>button{flex:auto;min-height:48px;width:100%;max-width:none}
 [data-screen=welcome] #actions>button{flex:auto;font-size:14px}
 .quiet-tools{position:static;justify-content:center;gap:12px;flex:none;width:100%;order:3}
 .quiet-tools button{flex:none}
 #app[data-screen=home] #play-dock{justify-content:flex-end}
 .welcome{left:5%;top:2%}
 .welcome h1{font-size:clamp(24px,4vw,34px)}
 .brand{font-size:20px}
 .orbit-controls{gap:12px;flex-wrap:wrap}
 .path-marker{font-size:12px;padding:6px 8px;min-width:76px;min-height:48px}
}

/* Conserve space when Safari's bars leave a particularly short viewport. */
@media(orientation:landscape) and (max-height:350px){
 #play-dock{justify-content:flex-start;gap:5px}
 .speech{font-size:12px}
 #actions{gap:5px}
 .primary,.secondary,.leaf-choice,.capture{padding:6px 10px;font-size:14px}
 .welcome h1{font-size:25px}
}
