/* Phone layout: canvas first, existing controls and reference text in accessible drawers. */
.mobile-nav,.mobile-drawer{display:none}
.immersive-hint[hidden],.combat-fullscreen-option[hidden]{display:none!important}
.immersive-hint{position:absolute;z-index:18;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:12px;display:grid;grid-template-columns:1fr 44px;gap:8px;padding:12px;border:1px solid #899372;border-radius:4px;background:#252e21f5;color:#eee9d7;box-shadow:0 8px 30px #0004}
.immersive-hint>div{grid-column:1;grid-row:1}.immersive-hint strong,.immersive-hint span{display:block;font-size:14px;line-height:1.4}.immersive-hint span{font-size:12px;margin-top:4px;color:#d3d6c8}
.immersive-primary,.immersive-dismiss,.install-help{min-height:44px;border:1px solid #8d9875;border-radius:3px;padding:8px 14px;font:inherit;font-size:14px;cursor:pointer;touch-action:manipulation}
.immersive-primary{background:#d3bc7b;color:#202c1c;font-weight:700}.immersive-hint>.immersive-primary{grid-column:1;grid-row:2}.immersive-dismiss{grid-column:2;grid-row:1;width:44px;padding:0;font-size:24px;background:transparent;color:#eee9d7}
.install-help{margin:12px;background:#35422d;color:#eee9d7}.install-guide .mobile-drawer-body{padding:16px;font-size:15px;line-height:1.55}.install-guide h3{font-size:17px;margin:16px 0 0}.install-guide p{margin:8px 0}.install-guide .install-note{color:#c3cbb5;font-size:13px}.install-guide .immersive-primary{margin:8px 0}.install-guide button[hidden],.install-help[hidden]{display:none}
.immersive-hint button:focus-visible,.install-guide button:focus-visible,.install-help:focus-visible{outline:2px solid #f0d59a;outline-offset:2px}
.combat-fullscreen-option{display:flex;align-items:center;gap:10px;min-height:48px;margin:12px 0;font-size:14px;cursor:pointer;color:#eee9d7}.combat-fullscreen-option input{width:22px;height:22px;accent-color:#d3bc7b;flex-shrink:0}
body[data-mobile-drawer="on"] .immersive-hint{display:none}
@media(orientation:landscape){.immersive-hint{grid-template-columns:minmax(0,1fr) auto 44px;align-items:center;max-width:720px;margin-inline:auto}.immersive-hint>.immersive-primary{grid-column:2;grid-row:1}.immersive-dismiss{grid-column:3}.immersive-hint span{display:none}}
.mobile-drawer[open]{display:flex;flex-direction:column}
body[data-mobile="on"]{overflow:hidden}
body[data-mobile="on"] .museum-shell{display:grid;height:100dvh;min-height:0!important;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
body[data-mobile="on"] .museum-header{padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));min-height:0;gap:8px}
body[data-mobile="on"] .header-exhibit>span,body[data-mobile="on"] .museum-header #open-stories,body[data-mobile="on"] .museum-footer{display:none}
body[data-mobile="on"] .brand-category{font-size:9px;margin-bottom:4px}
body[data-mobile="on"] .brand-name{font-size:13px}
body[data-mobile="on"] .header-exhibit h1{font-size:32px}
body[data-mobile="on"] .exhibit-layout{display:block;min-height:0;overflow:hidden}
body[data-mobile="on"] .gallery-column{height:100%;min-height:0}
body[data-mobile="on"] .stage,body[data-mobile="on"][data-presentation="intro"] #stage{height:100%!important;min-height:0!important;max-height:none;border:0}
body[data-mobile="on"] .mobile-nav{display:flex;gap:8px;padding:8px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#252e21;border-top:1px solid #566147}
.mobile-nav button,.mobile-drawer-heading button{min-height:44px;padding:8px 12px;border:1px solid #85916b;background:#303d28;color:#eee9d7;font:inherit;font-size:13px;border-radius:3px;touch-action:manipulation;cursor:pointer}
.mobile-nav button{flex:1}
.mobile-nav button[hidden]{display:none}
.mobile-nav button:focus-visible,.mobile-drawer button:focus-visible{outline:2px solid #f0d59a;outline-offset:2px}
.mobile-drawer{padding:0;width:min(720px,calc(100% - 16px));height:auto;max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:1px solid #85916b;background:#252e21;color:#eee9d7;border-radius:6px;overflow:hidden}
.mobile-drawer::backdrop{background:#121c14b8}
.mobile-drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid #58634b;flex-shrink:0}
.mobile-drawer-heading h2{font:normal 21px Georgia,serif;margin:0}
.mobile-drawer-body{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.mobile-drawer #info-panel{display:block!important;height:auto;max-height:none;overflow:visible;padding:22px;position:static;width:100%}
.mobile-drawer #modebar{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:8px}
.mobile-drawer #modebar button{min-height:48px;font-size:14px}
.mobile-drawer .gallery-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:8px}
.mobile-drawer .heroes-bar,.mobile-drawer .environment-bar{padding:12px;flex-wrap:wrap}
.mobile-drawer .studio-option{padding:8px 12px}
.mobile-drawer .toolbar-button,.mobile-drawer select,.mobile-drawer .studio-option button{min-height:44px}
body[data-mobile="on"] .interior-marker,body[data-mobile="on"] .hotspot{min-width:44px;min-height:44px}
body[data-mobile="on"] .stage-label{left:12px;top:12px;font-size:11px}
body[data-mobile="on"] .stage-instruction{font-size:11px;bottom:14px}
body[data-mobile="on"] .intro-caption{left:18px;bottom:45px}
body[data-mobile="on"] #intro-title{font-size:clamp(30px,7vw,46px)}
body[data-mobile="on"] #intro-subtitle{font-size:14px}
body[data-mobile="on"] #intro-kicker{font-size:11px;margin-bottom:8px}
/* Battle keeps all HUD and touch controls inside the safe viewport. */
body[data-mobile="on"][data-combat="on"] .museum-header,body[data-mobile="on"][data-combat="on"] .mobile-nav{display:none}
body[data-mobile="on"][data-combat="on"] .museum-shell{grid-template-rows:minmax(0,1fr)}
body[data-mobile="on"] .combat-top{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));gap:8px;flex-wrap:wrap}
body[data-mobile="on"] .combat-top nav{display:flex;gap:8px;margin-left:auto}
body[data-mobile="on"] .combat-top nav button{min-width:44px;min-height:44px;padding:7px 10px;font-size:11px}
body[data-mobile="on"] .combat-mission{padding:8px 10px}
body[data-mobile="on"] .combat-mission>span{font-size:9px;letter-spacing:.02em}
body[data-mobile="on"] .combat-mission strong{font-size:11px;margin:4px 0 0;gap:12px}
body[data-mobile="on"] .combat-mission b{font-size:16px}
body[data-mobile="on"] .combat-radar{display:none}
body[data-mobile="on"] .combat-touch{position:absolute;inset:0 max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:block;pointer-events:none;z-index:4}
body[data-mobile="on"] .combat-drive-pad{position:absolute;left:0;bottom:126px;display:grid;grid-template-columns:repeat(3,48px);gap:8px}
body[data-mobile="on"] .combat-drive-pad button:first-child{grid-column:2;grid-row:1}
body[data-mobile="on"] .combat-drive-pad button:not(:first-child){grid-row:2}
body[data-mobile="on"] .combat-aim-pad{position:absolute;right:0;bottom:126px;display:grid;grid-template-columns:repeat(2,48px);gap:8px}
body[data-mobile="on"] .combat-aim-pad span{grid-column:1/3;text-align:center;color:#fff0c9;font-size:11px;text-shadow:0 1px 3px #000}
body[data-mobile="on"] .combat-touch button{width:48px;height:48px;min-height:48px;padding:4px;font-size:22px;background:#293b22e8}
body[data-mobile="on"] .combat-touch button.is-held{background:#b8a76f;color:#1e291d;border-color:#f4dc9f}
body[data-mobile="on"] .combat-bottom{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));gap:8px}
body[data-mobile="on"] .combat-status{width:136px;padding:10px}
body[data-mobile="on"] .combat-status strong{font-size:24px;margin:3px 0 8px}
body[data-mobile="on"] .combat-status p{font-size:11px;margin:7px 0 0}
body[data-mobile="on"] .combat-weapon{width:154px;padding:8px}
body[data-mobile="on"] #combat-fire{font-size:16px;min-height:54px}
body[data-mobile="on"] #combat-fire kbd{display:none}
body[data-mobile="on"] .combat-menu{padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));backdrop-filter:none}
body[data-mobile="on"] .combat-menu-card{padding:20px;width:min(600px,100%)}
body[data-mobile="on"] .combat-controls-guide{display:none}
body[data-mobile="on"] .combat-guide-note{font-size:12px}
body[data-mobile="on"] .combat-graphics select{min-height:44px;font-size:14px}
body[data-mobile="on"] .combat-menu-actions button{min-height:48px;font-size:13px}
@media(orientation:portrait){
 body[data-mobile="on"] .combat-mission{width:100%;display:flex;justify-content:space-between;align-items:center}
 body[data-mobile="on"] .combat-mission strong{margin:0}
 body[data-mobile="on"] .combat-target-console{top:110px;left:12px;right:12px;bottom:auto;transform:none;width:auto;padding:7px}
 body[data-mobile="on"] #combat-roster{gap:8px}
 body[data-mobile="on"] #combat-roster button{min-height:48px;padding:5px 7px}
 body[data-mobile="on"] #combat-feedback{top:212px}
 body[data-mobile="on"] #combat-kill-banner{top:244px}
}
@media(orientation:landscape) and (max-height:700px){
 body[data-mobile="on"] .museum-header{padding-top:max(5px,env(safe-area-inset-top));padding-bottom:5px}
 body[data-mobile="on"] .brand-category{display:none}
 body[data-mobile="on"] .header-exhibit h1{font-size:27px}
 body[data-mobile="on"] .mobile-nav{padding-top:5px;padding-bottom:max(5px,env(safe-area-inset-bottom))}
 body[data-mobile="on"] .combat-top{flex-wrap:nowrap;align-items:start}
 body[data-mobile="on"] .combat-mission{width:auto;display:block;max-width:240px}
 body[data-mobile="on"] .combat-top nav{width:auto}
 body[data-mobile="on"] .combat-target-console{top:62px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:310px;padding:4px 6px}
 body[data-mobile="on"] #combat-roster{gap:8px}
 body[data-mobile="on"] #combat-roster button{min-height:44px;padding:3px 7px}
 body[data-mobile="on"] #combat-roster span{font-size:10px;white-space:nowrap}
 body[data-mobile="on"] #combat-roster small{font-size:9px;margin:0 0 2px}
 body[data-mobile="on"] .combat-target-status{min-height:32px}
 body[data-mobile="on"] .combat-target-status p{font-size:10px}
 body[data-mobile="on"] #combat-unlock{min-height:44px}
 body[data-mobile="on"] .combat-drive-pad{bottom:0}
 body[data-mobile="on"] .combat-aim-pad{bottom:98px}
 body[data-mobile="on"] .combat-status{position:absolute;left:0;bottom:112px;width:152px;padding:6px 8px}
 body[data-mobile="on"] .combat-status>span{font-size:10px}
 body[data-mobile="on"] .combat-status strong{font-size:18px;margin:0 0 3px}
 body[data-mobile="on"] .combat-status p{font-size:10px;margin:4px 0 0}
 body[data-mobile="on"] .combat-status #combat-health-warning{display:none}
 body[data-mobile="on"] .combat-weapon{width:152px;padding:6px}
 body[data-mobile="on"] #combat-fire{min-height:48px}
 body[data-mobile="on"] .combat-weapon .combat-meter{margin:5px 0}
 body[data-mobile="on"] #combat-feedback{top:auto;bottom:112px;font-size:11px}
 body[data-mobile="on"] #combat-kill-banner{top:auto;bottom:15px;padding:6px 12px;max-width:300px}
 body[data-mobile="on"] #combat-kill-banner strong{font-size:20px}
 body[data-mobile="on"] #combat-optics>span{display:none}
 body[data-mobile="on"] #combat-optics i{top:calc(50% + 32px)}
 body[data-mobile="on"] .interior-top{top:10px;left:14px;right:14px}
 body[data-mobile="on"] .interior-hint{display:none}
 body[data-mobile="on"] .intro-caption{bottom:30px;right:80px}
 body[data-mobile="on"] #intro-title{font-size:30px;margin-bottom:8px}
 body[data-mobile="on"] #intro-subtitle{font-size:12px;max-width:45ch}
 body[data-mobile="on"] .stories-dialog{height:calc(100dvh - 12px);max-height:calc(100dvh - 12px)}
 body[data-mobile="on"] .stories-heading{padding:8px 14px}
 body[data-mobile="on"] .stories-heading h2{font-size:23px}
}
@media(orientation:landscape) and (max-height:360px){
 body[data-mobile="on"] .combat-target-console{position:static;transform:none;background:transparent;border:0;padding:0;width:auto}
 body[data-mobile="on"] #combat-roster{position:absolute;top:58px;left:50%;transform:translateX(-50%);width:290px;background:#202a1eee;padding:4px}
 body[data-mobile="on"] .combat-target-status{position:absolute;top:auto;bottom:8px;left:178px;right:178px;background:#202a1eee;padding:0 8px}
 body[data-mobile="on"] .combat-status{bottom:112px}
 body[data-mobile="on"] .combat-status>span,body[data-mobile="on"] .combat-status p{display:none}
 body[data-mobile="on"] #combat-feedback{top:108px}
}

.combat-mobile-guide{display:none}
body[data-mobile="on"] .combat-desktop-guide{display:none}
body[data-mobile="on"] .combat-mobile-guide{display:inline}

.mobile-drawer #open-stories{display:block;margin:0 12px 12px;width:calc(100% - 24px);min-height:44px;text-align:left}

.mobile-drawer-body{display:flex;flex-direction:column}
.mobile-drawer-body>*{flex-shrink:0}
.mobile-drawer #interior-bar,.mobile-drawer #explode-bar,.mobile-drawer #motion-bar,.mobile-drawer #tour-bar,.mobile-drawer #presence-bar{order:-1}
