/* V43: immersive desktop browser layout. Mobile and Pi 3 builds remain unchanged. */
@media (min-width: 721px) and (pointer: fine) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: #050409;
  }

  .game-shell {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
  }

  .game-header,
  footer {
    display: none !important;
  }

  .game-frame {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #050409;
    box-shadow: none;
  }

  .screen-wrap,
  .screen-wrap.choosing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(100vw, 177.777778vh);
    height: min(100vh, 56.25vw);
    min-height: 0 !important;
    overflow: hidden;
    transform: translate(-50%, -50%);
    border: 0;
    background: #050409;
    box-shadow: none;
  }

  .screen-wrap::after {
    box-shadow: none;
  }

  canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    background: #050409;
  }

  .game-frame .hud {
    position: absolute;
    z-index: 18;
    top: max(8px, calc((100vh - 56.25vw) / 2 + 8px));
    left: 50%;
    width: min(940px, calc(100vw - 24px), calc(177.777778vh - 24px));
    min-height: 0;
    padding: 0;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .game-frame .hud > div {
    height: 44px;
    padding: 4px 8px;
    opacity: .94;
  }

  .mobile-controls {
    display: none !important;
  }
}

@media (min-width: 721px) and (pointer: fine) and (min-height: 100px) {
  @supports (height: 100dvh) {
    .game-shell {
      height: 100dvh;
    }

    .screen-wrap,
    .screen-wrap.choosing {
      width: min(100vw, 177.777778dvh);
      height: min(100dvh, 56.25vw);
    }

    .game-frame .hud {
      top: max(8px, calc((100dvh - 56.25vw) / 2 + 8px));
      width: min(940px, calc(100vw - 24px), calc(177.777778dvh - 24px));
    }
  }
}
