/* Nerddi OS Run 52 · Landscape Guard + True Viewport Fix
   BotzWar's phone controller is landscape-only. Rotation never reloads or tears down transport. */

/* Use the visual viewport height supplied by Run 52 JS so Android browser chrome/nav bars
   cannot leave stale 100vh space around the controller. */
.controller-app[data-game-skin="botzwar"]:not(.controller-studio-mode){
  height:var(--nerddi-vvh,100dvh)!important;
  min-height:0!important;
  max-height:var(--nerddi-vvh,100dvh)!important;
}

/* Run 51 hid the layout banner but the base deck still pins itself to grid row 2.
   With a one-row stage that creates an implicit blank first row and pushes the gamepad down.
   Pin the actual gamepad to the only intended row. */
@media(orientation:landscape){
  .controller-app[data-game-skin="botzwar"]:not(.controller-studio-mode) .controller-stage[data-controldeck-chassis="gamepad"]{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    min-height:0!important;
    height:100%!important;
  }
  .controller-app[data-game-skin="botzwar"]:not(.controller-studio-mode) .controller-stage[data-controldeck-chassis="gamepad"]>.controldeck-gamepad{
    grid-column:1!important;
    grid-row:1!important;
    align-self:stretch!important;
    justify-self:stretch!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
  }
  .controller-app[data-game-skin="botzwar"]:not(.controller-studio-mode) .private-game-screen-home:empty{
    display:none!important;
  }
}

/* Portrait is a hard orientation gate for BotzWar. Keep the live DOM/session underneath,
   but make it completely non-interactive and invisible until the player rotates back. */
@media(orientation:portrait){
  .controller-app[data-game-skin="botzwar"]{visibility:hidden!important;pointer-events:none!important;user-select:none!important}
  #controldeck-rotate[data-run52-active="true"]{
    display:grid!important;
    visibility:visible!important;
    pointer-events:auto!important;
    z-index:2147483000!important;
  }
}

#controldeck-rotate[data-run52-active="true"]{
  background:
    radial-gradient(circle at 50% 38%,#123143 0,#06101a 38%,#010306 78%),
    #010306;
}
#controldeck-rotate[data-run52-active="true"] .controldeck-rotate-phone{
  width:66px;height:104px;border-radius:18px;
  box-shadow:0 0 0 1px #ffffff10 inset,0 0 45px #63f3ff2e;
}
#controldeck-rotate[data-run52-active="true"] b{font-size:clamp(18px,5vw,24px)}
#controldeck-rotate[data-run52-active="true"] span{max-width:330px;line-height:1.55}
