html.mobile-game,
html.mobile-game body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.mobile-game body {
  position: fixed;
  inset: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

html.mobile-game .runner-shell,
html.mobile-game .jump-shell,
html.mobile-game .fall-shell,
html.mobile-game .walk-shell,
html.mobile-game .tux-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding:
    max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

html.mobile-game .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

html.mobile-game .brand-link {
  gap: 8px;
  font-size: 0.72rem;
}

html.mobile-game .brand-mark {
  width: 34px;
  flex-basis: 34px;
}

html.mobile-game .title-lockup,
html.mobile-game .eyebrow {
  display: none;
}

html.mobile-game .action-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, auto);
  gap: 6px;
  width: auto;
}

html.mobile-game .selector-link,
html.mobile-game .action-row button {
  min-height: 36px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 900;
}

html.mobile-game .scorebar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(74px, 1fr);
  grid-template-columns: none;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

html.mobile-game .scorebar::-webkit-scrollbar {
  display: none;
}

html.mobile-game .score-tile {
  min-width: 74px;
  padding: 7px 8px;
  border-radius: 7px;
}

html.mobile-game .score-label {
  font-size: 0.58rem;
}

html.mobile-game .score-tile strong {
  font-size: 1rem;
}

html.mobile-game .leaderboard-panel,
html.mobile-game .route-bar {
  display: none;
}

html.mobile-game .game-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
}

html.mobile-game .canvas-frame {
  min-height: 0;
  border-radius: 8px;
}

html.mobile-game canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  touch-action: none;
}

html.mobile-game .lower-bar {
  display: grid;
  gap: 7px;
  align-items: stretch;
}

html.mobile-game .run-status,
html.mobile-game .jump-status,
html.mobile-game .fall-status,
html.mobile-game .walk-status {
  min-height: 0;
  font-size: 0.7rem;
  text-align: center;
}

html.mobile-game .touch-controls {
  display: none;
}

html.mobile-game .touch-controls button {
  width: 100%;
  min-height: 58px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 1rem;
  font-weight: 950;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html.mobile-game #upButton {
  grid-column: 2;
}

html.mobile-game #leftButton {
  grid-column: 1;
}

html.mobile-game #downButton {
  grid-column: 2;
}

html.mobile-game #rightButton {
  grid-column: 3;
}

html.mobile-game #upButton,
html.mobile-game #leftButton,
html.mobile-game #downButton,
html.mobile-game #rightButton {
  min-width: 0;
}

html.mobile-game .walk-shell .touch-controls {
  display: none;
}

@media (orientation: landscape) {
  html.mobile-game .runner-shell,
  html.mobile-game .jump-shell,
  html.mobile-game .fall-shell,
  html.mobile-game .walk-shell,
  html.mobile-game .tux-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  html.mobile-game .topbar {
    display: none;
  }

  html.mobile-game .scorebar {
    position: absolute;
    z-index: 2;
    top: max(6px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    pointer-events: none;
  }

  html.mobile-game .score-tile {
    background: rgba(255, 255, 255, 0.86);
  }
}

@media (max-height: 560px) {
  html.mobile-game .touch-controls button {
    min-height: 48px;
  }

  html.mobile-game .score-tile {
    padding: 5px 7px;
  }
}
