/* All mobile DS proportions live here. The lower screen never depends on dialogue height. */
:root{--ds-gap:8px;--ds-icon:24px;--ds-hit:44px;--ds-tool-gap:0px;--ds-lower-ratio:1.3333333333;--ds-top-min:120px;--ds-paper:#e9d7a7;--ds-ink:#3c2b1d}
.mobile-ds-top,#mobile-notebook,#mobile-ds-notebook{display:none}
@media(max-width:900px) and (orientation:portrait), (max-width:1100px) and (max-height:600px) and (orientation:landscape){
 body.mobile-ds{height:var(--ds-viewport,100dvh);min-height:0;overflow:hidden;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);box-sizing:border-box;background:#281e17}
 .mobile-ds .game-window{display:flex;flex-direction:column;gap:var(--ds-gap);height:100%;min-height:0;width:100%;margin:0;padding:0!important;border:0;border-radius:0;box-shadow:none;background:#281e17;overflow:visible}
 .mobile-ds .game-window>header{display:none}
 .mobile-ds .game-window>.scene{flex:none;width:min(100%,calc((var(--ds-viewport,100dvh) - var(--ds-top-min) - var(--ds-gap) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))*var(--ds-lower-ratio)));align-self:center;aspect-ratio:var(--ds-lower-ratio);height:auto;overflow:hidden;border:0;border-radius:0;container-type:inline-size}
 .mobile-ds-top{display:flex;flex:1;min-height:0;flex-direction:column;position:relative;overflow:auto;padding:22px 24px;color:var(--ds-ink);background:repeating-linear-gradient(0deg,transparent 0 27px,#7f62380b 28px),linear-gradient(120deg,#f5e8c5,#d7bf88);font:24px/1.15 'Nintendo DS',monospace;border-bottom:3px solid #8b6b42}
 .mobile-ds-heading{display:flex;justify-content:space-between;gap:12px;font:10px 'Trebuchet MS',sans-serif;letter-spacing:.1em;color:#775b38}
 .mobile-ds-top h2{font:32px/1.05 'Nintendo DS',monospace;margin:auto 0 12px}
 .mobile-ds-rule{height:3px;flex:none;background:#89673d;margin-bottom:20px;width:44px}
 .mobile-ds-top small,#mobile-ds-notebook small{font:10px 'Trebuchet MS',sans-serif;letter-spacing:.14em;color:#795e3e}
 .mobile-ds-objective{margin:10px 0;font-size:25px;max-width:32ch}
 .mobile-ds-selection{font-size:21px;margin:0;color:#73512e}
 .mobile-ds-footer{margin-top:auto;padding-top:18px;font:9px 'Trebuchet MS',sans-serif;letter-spacing:.15em;color:#836a46}
 .mobile-ds .room-tag,.mobile-ds .game-tools .tool-status,.mobile-ds #show-points,.mobile-ds #help,.mobile-ds #tbt-investigation .case-notebook{display:none!important}
 .mobile-ds .scene .game-tools{inset:4px 4px auto auto!important;width:var(--ds-hit);display:flex;flex-direction:column;gap:var(--ds-tool-gap);opacity:1;padding:0;background:none;z-index:18}
 .mobile-ds .scene .game-tools .tool{width:var(--ds-hit);min-width:var(--ds-hit);height:var(--ds-hit);min-height:var(--ds-hit);padding:0;display:flex;align-items:center;justify-content:center;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 1px 1px #fff8d4);transform:none}
 .mobile-ds .scene .game-tools .tool svg{width:var(--ds-icon);height:var(--ds-icon)}
 .mobile-ds .scene .game-tools .tool>span{display:none!important}
 .mobile-ds #inventory-toggle{order:1}.mobile-ds #mobile-notebook{order:2}.mobile-ds #phone{order:3}
 .mobile-ds .scene>#main-menu-toggle{position:absolute;left:4px;top:4px;width:var(--ds-hit);height:var(--ds-hit);min-height:0;padding:0;border:0;background:none;box-shadow:none;font-size:0;z-index:18;color:#fff0cb;text-shadow:0 1px 2px #21180f}
 .mobile-ds #main-menu-toggle::after{content:'☰';font:24px Georgia}
 .mobile-ds #ds-dialogue{inset:auto 5px 5px;min-height:0;max-height:65%;padding:18px 10px 5px;border-radius:7px;overflow:visible;z-index:25}
 .mobile-ds .ds-message{gap:2px;min-height:0}.mobile-ds .ds-message>p:not(.sr-only){font-size:23px;line-height:1.06;min-height:2.15em;max-height:34cqw;overflow:auto}
 .mobile-ds #ds-dialogue .ds-advance{font-size:20px;min-height:40px;padding:3px 8px;background:none;border:0;box-shadow:none}
 .mobile-ds .ds-speaker{font-size:21px}.mobile-ds .ds-speaker span{padding:4px 12px}
 .mobile-ds #speech-bubble{left:5px!important;right:5px!important;bottom:5px!important;top:auto!important;transform:none!important;max-width:none!important;width:auto!important}
 .mobile-ds .scene .inventory,#mobile-ds-notebook{position:absolute;inset:48px 5px 5px;width:auto;max-height:none;overflow:auto;padding:12px;background:#f0dfb5;border:2px solid #765334;border-radius:5px;z-index:24;color:#38291b;font:22px/1.1 'Nintendo DS',monospace;box-sizing:border-box}
 #mobile-ds-notebook:not([hidden]){display:block}#mobile-ds-notebook[hidden]{display:none}
 #mobile-ds-notebook header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #b79a65;margin-bottom:14px}#mobile-ds-notebook h2{margin:0;font:30px 'Nintendo DS'}
 #mobile-ds-notebook button{min-height:44px;font:22px 'Nintendo DS';background:none;border:0;border-bottom:1px solid #b79a65;color:#51371f;text-align:left;display:block;width:100%;padding:8px 2px}#mobile-ds-notebook header button{width:44px;text-align:center;font-size:30px}
 .mobile-ds .scene #items button{font:21px 'Nintendo DS';padding:6px;min-height:44px}.mobile-ds .inventory-heading h2{font:28px 'Nintendo DS'}
 .mobile-ds dialog#panel,.mobile-ds dialog#panel.phone-panel{position:fixed;inset:0;transform:none;margin:0;width:100vw;max-width:100vw;height:var(--ds-viewport,100dvh);max-height:var(--ds-viewport,100dvh);border-radius:0;box-sizing:border-box;padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));z-index:60}
 .mobile-ds #tbt-case-panel:not([hidden]){position:fixed!important;inset:0!important;width:100vw;height:var(--ds-viewport,100dvh);min-height:0!important;max-height:none!important;box-sizing:border-box;border-radius:0;z-index:55}
 .mobile-ds-special .game-tools,.mobile-ds-special .scene>#main-menu-toggle{visibility:hidden}
 .mobile-ds.game-menu-visible .game-window{display:none}
 .mobile-ds #main-menu{height:var(--ds-viewport,100dvh)}
}
@media(max-width:900px) and (orientation:portrait), (max-width:1100px) and (max-height:600px) and (orientation:landscape){.mobile-ds #mobile-notebook{display:flex}.mobile-ds .scene>#main-menu-toggle{font-size:0}.mobile-ds .scene #speech-bubble::after{display:none}}
@media(max-width:900px) and (orientation:portrait), (max-width:1100px) and (max-height:600px) and (orientation:landscape){#mobile-ds-notebook [hidden]{display:none!important}#mobile-ds-notebook button{box-shadow:none;border-radius:0}.mobile-ds .scene:has(#mobile-ds-notebook:not([hidden])) .game-tools{visibility:hidden}}
.mobile-ds-inspection-canvas{position:absolute;inset:0}
@media(max-width:900px) and (orientation:portrait), (max-width:1100px) and (max-height:600px) and (orientation:landscape){
 .mobile-ds #tbt-case-panel[data-view=guitar]{background:#241b14!important}
 .mobile-ds-inspection-canvas{inset:auto 0;top:50%;height:auto;aspect-ratio:4/3;transform:translateY(-50%)}
 .mobile-ds-inspection-canvas .case-guitar-art{object-fit:fill}
}
