/* Touch layout. Desktop, including narrow mouse windows, keeps the album sleeve. */
.mobile-settings:not([open]),.mobile-target,.touch-actions,.mobile-taxi-touch,.mobile-intro-help{display:none}
.is-mobile-player .mobile-intro-help{display:block;font:12px/1.5 var(--album-label);color:var(--panel-muted)}
body.mobile-playing{margin:0;padding:0;overflow:hidden;overscroll-behavior:none}
body main.album-shell.is-mobile-player,body.debug-open main.album-shell.is-mobile-player{width:100%;max-width:none;height:100dvh;min-height:0;margin:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column;overflow:hidden}
.is-mobile-player>.album-header,.is-mobile-player .scene-caption,.is-mobile-player .album-transport,.is-mobile-player .ride-views{display:none}
.album-shell.is-mobile-player .chapter-nav.chapter-nav-compact{display:grid;flex:0 0 48px;grid-template-columns:48px minmax(0,1fr) 48px;gap:0;margin:0;border-bottom:1px solid var(--rule)}
.is-mobile-player .chapter-direction .step-label,.is-mobile-player .track-duration,.is-mobile-player .track-complete{display:none}
.album-shell.is-mobile-player .chapter-direction{border:0;min-height:48px;padding:0}.is-mobile-player .step-arrow{font-size:22px}
.album-shell.is-mobile-player .chapter-nav .track{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;border:0;padding:0;pointer-events:none}
.is-mobile-player .track-number{font-size:12px}.is-mobile-player .track-title{font-size:13px}
.is-mobile-player .album-layout{display:flex;flex:1;min-height:0;margin:0;padding:0;align-items:stretch}
.album-shell.is-mobile-player .album-player{display:flex;flex:1;min-width:0;min-height:0;width:100%;max-width:none;padding:12px 8px 8px;border:0;flex-direction:column;align-items:center;justify-content:center;position:relative;gap:8px}
.album-shell.is-mobile-player .stage,.album-shell.is-mobile-player .stage:has(>#ending:not([hidden])){flex:none;width:var(--mobile-scene-width);height:auto;min-height:0;aspect-ratio:16/9;margin:0;border:1px solid var(--panel-rule);overflow:hidden}
.album-shell.is-mobile-player .stage>canvas{position:static;width:100%;height:100%;object-fit:contain}
.is-mobile-player .summer-tools,.is-mobile-player .dream-tools,.is-mobile-player .metro-tools,.is-mobile-player .home-tools,.is-mobile-player #details{display:none}
.is-mobile-player .mobile-target{display:block;order:1;min-height:36px;max-height:48px;width:100%;margin:0;padding:0 12px;text-align:center;overflow:auto;font:13px/1.4 var(--album-label);color:var(--panel-ink)}
.album-shell.is-mobile-player .touch{display:flex;order:2;width:100%;max-width:600px;justify-content:space-between;align-items:center;flex:none;margin:0;padding:12px 4px 0;gap:16px}
.is-mobile-player .dpad{display:grid;grid-template:repeat(2,48px)/repeat(3,48px);gap:4px;flex:none}
.is-mobile-player .dpad button{min-width:48px;min-height:48px;padding:0;font-size:20px;border-radius:5px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.is-mobile-player .dpad [data-key=ArrowUp],.is-mobile-player .dpad [data-view=front]{grid-area:1/2}
.is-mobile-player .dpad [data-key=ArrowLeft],.is-mobile-player .dpad [data-view=left]{grid-area:2/1}
.is-mobile-player .dpad [data-key=ArrowDown]{grid-area:2/2}
.is-mobile-player .dpad [data-key=ArrowRight],.is-mobile-player .dpad [data-view=right]{grid-area:2/3}
.is-mobile-player .dpad [data-view]{font-size:0}.is-mobile-player .dpad [data-view]::after{font-size:20px}.is-mobile-player [data-view=left]::after{content:'←'}.is-mobile-player [data-view=front]::after{content:'↑'}.is-mobile-player [data-view=right]::after{content:'→'}
.is-mobile-player .touch-actions{display:flex;flex-direction:column;align-items:stretch;width:128px;gap:8px;flex:none}
.album-shell.is-mobile-player #touch-e{order:0;width:100%;min-height:52px;height:52px;padding:6px;border-radius:6px;font:13px var(--album-label);letter-spacing:0;color:var(--panel-ink);background:var(--panel-action);border:1px solid var(--panel-accent);touch-action:manipulation}
.is-mobile-player .touch-utility{order:1;display:flex;gap:4px}.is-mobile-player .touch-utility button{width:50%;min-height:44px;padding:3px;font:10px/1.2 var(--album-label);letter-spacing:0}
.is-mobile-player .touch #time{order:2;display:block;width:100%;text-align:center;font:10px var(--album-label);white-space:nowrap}
.is-mobile-player #chapter-progress{width:100%;height:3px;margin:0;flex:none;order:5}
.is-mobile-player .veil{position:fixed;inset:56px 8px 178px;z-index:12;overflow:auto;padding:16px;background:var(--panel);background:color-mix(in srgb,var(--panel) 96%,transparent);border:1px solid var(--panel-rule);align-items:center}
.is-mobile-player .intro-card{width:100%;max-width:520px;padding:0;margin:auto;text-align:center}.is-mobile-player .intro-card h1,.is-mobile-player .intro-card h2{font-size:clamp(25px,6vw,40px);line-height:1.1;margin:12px 0}
.is-mobile-player .intro-card .eyebrow{font-size:11px;margin:6px 0}.is-mobile-player .intro-card .invitation{font-size:15px;line-height:1.4;margin:12px 0}.is-mobile-player .intro-card .instructions{display:none}
.is-mobile-player .intro-card button,.is-mobile-player .intro-card a{min-height:44px;font-size:12px;letter-spacing:.02em}
.is-mobile-player #dialogue{font-size:13px;line-height:1.5;top:8px;max-height:65%;overflow:auto;padding:9px 12px;pointer-events:auto}
.is-mobile-player #prompt{display:none}
.is-mobile-player #choices:not([hidden]){position:fixed;inset:56px 8px 178px;z-index:14;width:auto;max-width:none;max-height:none;transform:none;padding:12px;overflow:auto;background:var(--panel)}
.is-mobile-player #choices button{min-height:48px;font-size:13px;line-height:1.4}
.is-mobile-player .mobile-settings[open]{display:block;position:fixed;inset:0;max-width:600px;width:calc(100% - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;padding:16px;color:var(--panel-ink);background:var(--panel);border:1px solid var(--panel-rule);overflow:auto;overscroll-behavior:contain}
.mobile-settings::backdrop{background:#050b10d9}.mobile-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.mobile-settings-heading h2{font:22px/1.2 var(--album-title);margin:0}.mobile-settings-close{min-height:44px;font-size:12px}
.is-mobile-player .mobile-settings .album-settings{display:flex;margin:16px 0;justify-content:flex-start}.mobile-settings select{min-height:44px}.mobile-instructions{font:14px/1.5 var(--album-label);color:var(--panel-muted)}
.is-mobile-player .mobile-settings .album-sidebar{display:block;width:100%;padding:12px 0;border:0;background:none}.mobile-settings .chapter-meta{display:none}.mobile-settings .album-footer{display:block}.mobile-settings .volume-control{display:flex;min-height:52px;width:100%}.mobile-settings #album-volume{flex:1;width:auto}.mobile-settings #debug-panel{margin:16px 0}.mobile-settings #debug-toggle,.mobile-settings summary{min-height:44px}.mobile-settings .listening-note{margin:16px 0 0}
body.mobile-playing #handheld{padding:8px}body.mobile-playing .pocket-shell{box-sizing:border-box;min-width:0;width:min(94vw,calc((100dvh - 225px)*10/9));max-height:calc(100dvh - 16px);padding:8px;overflow:auto}body.mobile-playing .pocket-shell button{min-height:44px;min-width:44px}body.mobile-playing .pocket-controls p{display:none}
@media(orientation:landscape){
 .album-shell.is-mobile-player .album-player{display:grid;grid-template-columns:148px minmax(0,1fr) 88px;grid-template-rows:minmax(0,1fr) 28px 3px;gap:4px;padding:4px}
 .album-shell.is-mobile-player .stage{grid-area:1/2;justify-self:center;align-self:center}
 .album-shell.is-mobile-player .touch{display:contents}.is-mobile-player .dpad{grid-area:1/1;align-self:center;grid-template:repeat(2,46px)/repeat(3,46px);gap:3px}.is-mobile-player .dpad button{min-width:46px;min-height:46px}
 .is-mobile-player .touch-actions{grid-area:1/3;width:88px;align-self:center;gap:8px}.is-mobile-player .touch-utility{flex-direction:column;gap:4px}.is-mobile-player .touch-utility button{width:100%;min-height:44px;font-size:11px}
 .is-mobile-player .mobile-target{display:block;grid-area:2/2;min-height:0;max-height:28px;padding:0;font-size:12px}.is-mobile-player #chapter-progress{grid-area:3/1/4/4}
 .is-mobile-player .veil,.is-mobile-player #choices:not([hidden]){inset:52px 96px 8px 156px;padding:12px}
 .is-mobile-player .intro-card h1,.is-mobile-player .intro-card h2{font-size:26px}.is-mobile-player .intro-card .invitation{font-size:13px;margin:8px 0}
 .is-mobile-player #dialogue{max-height:80%;font-size:12px;top:4px;padding:8px}
 body.mobile-playing .pocket-shell{width:min(96vw,760px);display:grid;grid-template-columns:minmax(100px,1fr) minmax(0,calc((100dvh - 48px)*10/9)) minmax(100px,1fr);gap:8px;align-items:center}
 body.mobile-playing .pocket-display{grid-area:1/2/4/3}body.mobile-playing .pocket-header{display:contents}body.mobile-playing .pocket-header>div{grid-area:1/1}body.mobile-playing #pocket-close{grid-area:3/3}body.mobile-playing .pocket-footer{grid-area:2/3;flex-direction:column}body.mobile-playing .pocket-controls{display:contents}body.mobile-playing .pocket-controls>div{grid-area:3/1}body.mobile-playing .pocket-controls>button{grid-area:1/3}body.mobile-playing .pocket-header p{display:none}
}

html:has(body.mobile-playing){scrollbar-gutter:auto}
@media(orientation:portrait){.album-shell.is-mobile-player .stage{margin-block:auto}}
.mobile-settings .album-author{display:block;margin-top:16px;font:11px var(--album-label);color:var(--panel-muted)}
.is-mobile-player .mobile-settings .album-footer{color:var(--panel-ink)}
.is-mobile-player .mobile-settings .album-footer button,.is-mobile-player .mobile-settings .control-action,.is-mobile-player .mobile-settings summary{color:var(--panel-ink)}
.is-mobile-player #pause,.is-mobile-player #sound{color:var(--panel-ink)}
.is-mobile-player button,.is-mobile-player a{-webkit-tap-highlight-color:transparent}
.is-mobile-player .mobile-settings .language-control select,.is-mobile-player .mobile-settings .debug-place select{font-size:16px}
.is-mobile-player .mobile-settings .volume-value{background:none}
.is-mobile-player .veil,.is-mobile-player #choices:not([hidden]){top:calc(56px + env(safe-area-inset-top));bottom:calc(178px + env(safe-area-inset-bottom));left:calc(8px + env(safe-area-inset-left));right:calc(8px + env(safe-area-inset-right))}
@media(orientation:landscape){.is-mobile-player .veil,.is-mobile-player #choices:not([hidden]){top:calc(52px + env(safe-area-inset-top));bottom:calc(8px + env(safe-area-inset-bottom));left:calc(156px + env(safe-area-inset-left));right:calc(96px + env(safe-area-inset-right))}}
@media(orientation:landscape) and (max-height:500px){
 .is-mobile-player #ending:has(#chapter-countdown){left:calc(8px + env(safe-area-inset-left));right:calc(8px + env(safe-area-inset-right))}
 .is-mobile-player #ending:has(#chapter-countdown) .intro-card{display:grid;grid-template-columns:1fr 1fr;gap:4px;max-width:680px}
 .is-mobile-player #ending:has(#chapter-countdown) .intro-card>p,.is-mobile-player #ending:has(#chapter-countdown) .intro-card>h2{grid-column:1/-1;margin:4px 0}
 .is-mobile-player #ending:has(#chapter-countdown) h2{font-size:24px}
 .is-mobile-player #ending .next-chapter{grid-column:1;width:100%;margin:0;min-height:44px;font-size:11px;padding:8px}
 .is-mobile-player #ending .ending-countdown{grid-column:2;flex-wrap:wrap;gap:0 8px;align-content:center;margin:0;font-size:11px}
 .is-mobile-player #ending .ending-secondary,.is-mobile-player #ending .chapter-link{margin:0;min-height:44px;font-size:10px;padding:8px}
}
