html.mobile-game {
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html.mobile-game body {
  overscroll-behavior: none;
}

.mobile-game .game-wrap,
.mobile-game .stage-wrap,
.mobile-game canvas,
.mobile-game .mobile-controls,
.mobile-game .touch-controls,
.mobile-game .game-wrap button,
.mobile-game .stage-wrap button,
.mobile-game .mobile-controls button,
.mobile-game .touch-controls button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-game .game-wrap,
.mobile-game .stage-wrap,
.mobile-game canvas,
.mobile-game .mobile-controls,
.mobile-game .touch-controls,
.mobile-game .mobile-controls button,
.mobile-game .touch-controls button {
  touch-action: none;
}

.mobile-game canvas {
  -webkit-user-drag: none;
}

@media (pointer: coarse), (max-width: 760px) {
  body.game-running {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body.game-running > .shell,
  body.game-running > .game-shell {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body.game-running > .shell > header,
  body.game-running > .shell > footer,
  body.game-running > .game-shell > .topbar,
  body.game-running > .game-shell > .control-strip,
  body.game-running aside {
    display: none !important;
  }

  body.game-running main {
    display: block;
    width: 100vw;
    height: 100dvh;
  }

  body.game-running .game-wrap,
  body.game-running .stage-wrap {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  body.game-running .game-wrap canvas,
  body.game-running .stage-wrap canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  body.game-running .mobile-controls {
    display: grid !important;
    position: fixed;
    z-index: 20;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  body.game-running .mobile-controls button {
    pointer-events: auto;
    opacity: .92;
  }
}
