/* Secondary tools scroll in one menu; the landscape stays visible at rest. */
body.simple-taiwan-interface #taiwan-game-menu{position:fixed;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));z-index:1160;background:#071923f2;border:1px solid #80c7d670;border-radius:12px;color:#effaff;max-width:calc(100vw - 20px);pointer-events:auto;font:600 14px system-ui}
#taiwan-game-menu>summary{min-height:44px;min-width:90px;box-sizing:border-box;padding:12px;cursor:pointer;list-style:none}
#taiwan-game-menu>summary::after{content:'＋';float:right;margin-left:12px}#taiwan-game-menu[open]>summary::after{content:'−'}
#taiwan-game-menu[open]{width:min(340px,calc(100vw - 20px));max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);overflow:auto;overscroll-behavior:contain}
#taiwan-game-menu:not([open])>:not(summary){display:none!important}
body.simple-taiwan-interface #taiwan-game-menu :is(#mode-links,#hint,#hsr-info,#maglev-panel,.climate-panel,#mission,#wallet,#corridor-meta,#fps,canvas){position:static!important;inset:auto!important;transform:none!important;width:auto!important;max-width:100%!important;max-height:none!important;margin:8px!important;box-sizing:border-box;visibility:visible!important}
body.simple-taiwan-interface #taiwan-game-menu #mode-links{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:0!important}
#taiwan-game-menu :is(button,a,summary,select){min-height:44px;min-width:44px;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
body.simple-taiwan-interface #taiwan-game-menu #mode-links>*{padding:10px!important;display:flex;align-items:center;justify-content:center;font-size:13px}
body.simple-taiwan-interface #taiwan-game-menu #hsr-info{display:block!important;font:13px/1.5 system-ui!important}
body.simple-taiwan-interface #taiwan-game-menu #hsr-info .legacy-rail-body{max-height:none!important;overflow:visible!important}
body.simple-taiwan-interface #taiwan-game-menu .climate-fields{position:static!important;width:auto!important;max-width:100%!important;display:grid;grid-template-columns:1fr;gap:6px}
body.simple-taiwan-interface #taiwan-game-menu .climate-panel{display:block!important}
body.simple-taiwan-interface #taiwan-game-menu canvas{display:block!important;width:260px!important;height:260px!important;max-width:calc(100% - 16px)!important}
#taiwan-primary-actions{position:fixed;right:max(10px,env(safe-area-inset-right));top:calc(max(10px,env(safe-area-inset-top)) + 54px);z-index:81;display:flex;flex-direction:column;gap:6px;pointer-events:auto}
#taiwan-primary-actions button{min-height:44px;max-width:120px;padding:10px 12px;background:#123c48ed;color:#edffff;border:1px solid #72ddc9;border-radius:10px;font:700 14px system-ui}
body.simple-taiwan-interface #maglev-readout{left:max(10px,env(safe-area-inset-left));top:max(10px,env(safe-area-inset-top));max-width:calc(100vw - 150px);padding:8px;box-sizing:border-box;font:600 12px/1.45 system-ui;visibility:visible!important}
body.simple-taiwan-interface #alien-invasion-panel{left:max(10px,env(safe-area-inset-left));bottom:170px;max-width:min(420px,calc(100vw - 150px));z-index:82}
body.simple-taiwan-interface #maglev-walk-controls{left:max(10px,env(safe-area-inset-left));right:auto;width:156px;bottom:max(10px,env(safe-area-inset-bottom));padding:6px;box-sizing:border-box}
body.simple-taiwan-interface #maglev-walk-controls .maglev-driver-actions{display:grid!important;grid-template-columns:repeat(2,minmax(44px,1fr));gap:6px}
body.simple-taiwan-interface #maglev-walk-controls button{min-height:44px;padding:6px;font-size:12px;grid-column:auto!important}
body.simple-taiwan-interface :is(#maglev-driver-controls,#maglev-walk-controls)>p{margin:0 0 4px;font:11px/1.35 system-ui}
body.simple-taiwan-interface #maglev-walk-controls #maglev-walk-seat{grid-column:1/-1!important}
body.simple-taiwan-interface #maglev-driver-controls{left:max(10px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));width:min(280px,calc(100vw - 20px));box-sizing:border-box;padding:6px}
body.simple-taiwan-interface:has(#taiwan-game-menu[open]) :is(#maglev-driver-controls,#maglev-walk-controls){visibility:hidden}
#taiwan-game-menu :is(button,a,summary,select):focus-visible,#taiwan-primary-actions button:focus-visible{outline:3px solid white;outline-offset:2px}
@media(max-height:450px){body.simple-taiwan-interface #maglev-walk-controls{width:156px}body.simple-taiwan-interface #maglev-readout{max-width:min(260px,calc(100vw - 150px))}body.simple-taiwan-interface #alien-invasion-panel{bottom:160px;font-size:12px}}
body.simple-taiwan-interface #taiwan-game-menu :is(#scene-travel-toggle,#release-notice-toggle){position:static!important;display:block!important;visibility:visible!important;margin:8px;max-width:calc(100% - 16px)}
body.simple-taiwan-interface #taiwan-game-menu #maglev-info{display:block!important}
body.simple-taiwan-interface #taiwan-game-menu #maglev-panel label{position:static!important;width:auto!important;height:auto!important;clip:auto!important;overflow:visible!important;padding:0}
body.simple-taiwan-interface #taiwan-game-menu #maglev-panel[open]{z-index:auto!important}
body.simple-taiwan-interface #taiwan-game-menu :is(#legacy-rail-options,#hsr-info){--rail-top:0px!important;--rail-height:none!important}
body.simple-taiwan-interface:has(#taiwan-game-menu[open]) #touch-drive-controls{visibility:hidden}

body.simple-taiwan-interface #maglev-readout .train-readout-field{display:inline-block;white-space:nowrap;overflow-wrap:normal}
