/* Rotation and safe-area layout. Keep controls large enough for touch. */
html,body{width:100%;height:100%;height:100dvh;overscroll-behavior:none}
button[data-pad-focus="true"]{outline:3px solid #ffe584!important;outline-offset:2px;background-color:#49694b!important}
#bh159ArcadeHUD{white-space:pre-line;max-height:25vh;overflow:hidden}
#bh159ArcadeResult button{margin:8px;min-height:44px}
#start{overflow:auto;touch-action:pan-y}
@media(orientation:landscape) and (max-height:600px){
 #start{align-items:flex-start!important;padding:12px max(20px,env(safe-area-inset-left))!important}
 #start .start-card{padding:12px!important;max-width:660px!important;width:90%!important}
 #start .start-logo{font-size:34px!important}#start .start-sub{font-size:22px!important}
 #start .start-desc,#start .start-version{margin:5px!important}#start p{font-size:12px!important;margin:6px!important}
 #hud{top:calc(5px + env(safe-area-inset-top))!important;left:max(12px,env(safe-area-inset-left))!important;max-width:42vw!important}
 #objective{font-size:11px!important;padding:5px!important;margin:0!important;max-height:55px;overflow:hidden}
 #status,#wallet{font-size:10px!important;margin-top:2px!important}
 #hint{top:95px!important;left:max(12px,env(safe-area-inset-left))!important;max-width:30vw!important;font-size:10px!important}
 #joy{width:92px!important;height:92px!important;left:max(14px,env(safe-area-inset-left))!important;bottom:14px!important}
 #knob{left:26px!important;top:26px!important}
 #actions{right:max(12px,env(safe-area-inset-right))!important;bottom:12px!important;flex-direction:row!important}
 #actions button{min-height:44px!important;padding:8px!important}
 #bh148CombatUI{bottom:68px!important;right:max(12px,env(safe-area-inset-right))!important}
 #bh148CombatPad button{min-height:44px!important;padding:8px!important;min-width:62px!important}
 #bh147Actions{bottom:125px!important;right:max(12px,env(safe-area-inset-right))!important;max-height:23vh!important;max-width:190px!important}
 #bh151ViewTools{top:115px!important;left:max(12px,env(safe-area-inset-left))!important}
 #bh153PadBadge{top:155px!important;left:max(12px,env(safe-area-inset-left))!important}
 #bh153HP{top:85px!important}#bh153Dispatch{display:none!important}
 #bh151Companion{bottom:5px!important;max-width:50vw!important;overflow:auto}
 #chapterHud,#gpsGuide{top:65px!important;left:45%!important;max-width:26vw!important;font-size:10px!important;max-height:70px;overflow:auto}
 #dialogue{bottom:65px!important;max-height:70vh!important;overflow:auto!important;width:min(64vw,600px)!important;padding:10px!important}
 #line{font-size:13px!important}#next{min-height:44px!important;margin-top:5px!important}
 #fieldPanel,#chapterPanel,#arcadeBrief160,#bh154Sound,#bh154Music,#bh154Services{inset:3% max(12px,env(safe-area-inset-right)) 3% max(12px,env(safe-area-inset-left))!important;max-height:94dvh!important;touch-action:pan-y!important}
 #fieldMap{max-width:240px!important;float:left;margin:6px 15px 6px 0!important}#fieldList{max-height:58vh!important}
 #bh153RoomUI{top:6px!important;max-height:40vh!important;max-width:65vw!important;padding:7px!important}
 #bh153Door{bottom:115px!important;left:max(12px,env(safe-area-inset-left))!important;padding:8px!important;font-size:11px!important}
 #bh159ArcadeHUD{top:calc(4px + env(safe-area-inset-top))!important;left:max(12px,env(safe-area-inset-left))!important;font-size:11px!important;max-height:25vh!important}
 #bh159ArcadePad{bottom:calc(5px + env(safe-area-inset-bottom))!important;left:max(12px,env(safe-area-inset-left))!important;right:max(12px,env(safe-area-inset-right))!important;gap:4px!important;flex-wrap:nowrap!important}
 #bh159Arcade button{min-height:44px!important;min-width:44px!important;padding:8px 6px!important;font-size:11px!important}
 #bh159ArcadeResult{inset:8% 18%!important;padding:12px!important}
 #bh159ArcadeResult h2{margin:5px}#bh149DriveHelp{left:125px!important;bottom:12px!important}
}
@media(orientation:landscape) and (max-height:600px){#bh149Pedals{bottom:65px!important;right:max(12px,env(safe-area-inset-right))!important}#bh149Pedals button{height:48px!important;min-height:44px!important;width:58px!important}}
#bh159Arcade[data-mode="fight"] #bh159ArcadeHUD{display:none!important}

/* Safari long-press must not select game controls. Save-code editors remain editable. */
html,body,canvas,button,[role=button],#bh159Arcade,#bh153RoomUI,#bh168Venue{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
input,textarea,[contenteditable=true]{-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default!important}
button,canvas{touch-action:manipulation}
#bh159Arcade button,#bh159Arena,#bh153Room{touch-action:none}
