/* Space 2047 HD Edition v6.5.1 — mobile HUD layout repair. */
@media (max-width:760px){
  html,body{overflow-x:hidden!important}
  .s2047-reference-hud .s2047-reference-topbar{
    display:grid!important;
    grid-template-columns:82px minmax(0,1fr)!important;
    grid-template-rows:42px 58px!important;
    gap:3px 7px!important;
    width:100%!important;
    height:106px!important;
    min-height:106px!important;
    padding:4px 7px 5px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  .s2047-reference-hud .s2047-reference-logo{display:none!important}
  .s2047-reference-hud .s2047-reference-options{
    grid-column:1!important;grid-row:1!important;
    width:78px!important;min-width:78px!important;max-width:78px!important;
    height:38px!important;min-height:38px!important;
    margin:0!important;padding:0 7px!important;
    font-size:13px!important;line-height:1!important;
    align-self:center!important;justify-self:start!important;
  }
  .s2047-reference-hud .s2047-reference-location{
    grid-column:2!important;grid-row:1!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    align-items:center!important;text-align:center!important;
    justify-self:stretch!important;align-self:center!important;
    white-space:normal!important;overflow:hidden!important;
  }
  .s2047-reference-hud .s2047-reference-location strong{
    width:100%!important;font-size:13px!important;line-height:1.05!important;
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  .s2047-reference-hud .s2047-reference-location span{
    width:100%!important;font-size:10px!important;line-height:1.1!important;
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  .s2047-reference-hud .s2047-reference-player{
    grid-column:1 / -1!important;grid-row:2!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    height:56px!important;min-height:56px!important;
    margin:0!important;padding:4px 7px!important;
    grid-template-columns:38px 38px minmax(0,1fr) 38px!important;
    gap:6px!important;border-radius:14px!important;
    box-sizing:border-box!important;
  }
  .s2047-reference-hud .s2047-reference-switch{
    width:38px!important;min-width:38px!important;height:38px!important;
    display:grid!important;place-items:center!important;
    padding:0!important;font-size:25px!important;line-height:38px!important;
  }
  .s2047-reference-hud .s2047-reference-portrait{width:36px!important;height:36px!important;font-size:20px!important}
  .s2047-reference-hud .s2047-reference-player-info{min-width:0!important;overflow:hidden!important}
  .s2047-reference-hud .s2047-reference-player-info>strong{font-size:13px!important;line-height:1!important}
  .s2047-reference-hud .s2047-reference-energy-row{font-size:10px!important;gap:4px!important}
  .s2047-reference-hud .s2047-reference-lives{font-size:9px!important;margin-top:1px!important;overflow:hidden!important}
  .s2047-reference-hud .s2047-reference-lives b{max-width:150px!important;font-size:9px!important}

  .s2047-reference-dpad{
    position:fixed!important;left:8px!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    width:126px!important;height:126px!important;
    border-width:3px!important;z-index:2147481500!important;
  }
  .s2047-reference-dpad button{
    width:38px!important;height:38px!important;font-size:20px!important;
    display:grid!important;place-items:center!important;padding:0!important;line-height:1!important;
  }
  #s2047-minimap-wrap,.s2047-minimap-wrap{
    position:fixed!important;right:8px!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    width:124px!important;padding:5px!important;border-width:3px!important;border-radius:17px!important;
    z-index:2147481450!important;
  }
  #s2047-minimap-wrap canvas,.s2047-minimap-wrap canvas{width:108px!important;height:76px!important;border-radius:10px!important}
  #s2047-minimap-wrap span,.s2047-minimap-wrap span{font-size:11px!important;padding-top:4px!important}
  .s2047-reference-inventory{
    position:fixed!important;right:8px!important;
    bottom:max(118px,calc(env(safe-area-inset-bottom) + 118px))!important;
    min-width:124px!important;width:124px!important;height:35px!important;
    padding:5px 7px!important;font-size:11px!important;z-index:2147481460!important;
  }
  #s2047-nearby-object-actions,.s2047-nearby-object-actions{
    position:fixed!important;left:50%!important;right:auto!important;
    bottom:max(148px,calc(env(safe-area-inset-bottom) + 148px))!important;
    transform:translateX(-50%)!important;
    width:auto!important;max-width:calc(100vw - 20px)!important;
    padding:7px!important;border-radius:12px!important;z-index:2147481550!important;
  }
  #s2047-nearby-object-actions>div,.s2047-nearby-object-actions>div{
    display:flex!important;flex-wrap:nowrap!important;justify-content:center!important;
    gap:5px!important;overflow-x:auto!important;max-width:calc(100vw - 34px)!important;
  }
  #s2047-nearby-object-actions button,.s2047-nearby-object-actions button{
    flex:0 0 auto!important;min-height:32px!important;padding:5px 8px!important;font-size:11px!important;
  }
}
@media (max-width:390px){
  .s2047-reference-hud .s2047-reference-topbar{grid-template-columns:72px minmax(0,1fr)!important;padding-left:4px!important;padding-right:4px!important}
  .s2047-reference-hud .s2047-reference-options{width:68px!important;min-width:68px!important;max-width:68px!important;font-size:12px!important}
  .s2047-reference-hud .s2047-reference-player{grid-template-columns:34px 34px minmax(0,1fr) 34px!important;gap:4px!important;padding-left:5px!important;padding-right:5px!important}
  .s2047-reference-hud .s2047-reference-switch{width:34px!important;min-width:34px!important;height:34px!important;line-height:34px!important;font-size:23px!important}
  .s2047-reference-hud .s2047-reference-portrait{width:32px!important;height:32px!important}
  .s2047-reference-dpad{width:116px!important;height:116px!important}
  .s2047-reference-dpad button{width:35px!important;height:35px!important;font-size:18px!important}
  #s2047-minimap-wrap,.s2047-minimap-wrap{width:116px!important}
  #s2047-minimap-wrap canvas,.s2047-minimap-wrap canvas{width:100px!important;height:70px!important}
  .s2047-reference-inventory{width:116px!important;min-width:116px!important}
}
