/* Mobile browsers lose usable height when their toolbars expand. Keep the
   complete garage in one scrollable main region, above the fixed dock. */
@media (max-width: 600px) {
  .game-shell.screen-garage > .management-main {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .game-shell.screen-garage .screen-content,
  .game-shell.screen-garage .garage-studio {
    height: auto;
    min-height: 100%;
  }

  .game-shell.screen-garage .garage-studio,
  .game-shell.screen-garage .garage-studio .gs-layout,
  .game-shell.screen-garage .garage-studio .gs-focus,
  .game-shell.screen-garage .garage-studio .gs-workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 0;
  }

  .game-shell.screen-garage .garage-studio .gs-focus > .gs-car-heading {
    flex-wrap: wrap;
  }

  .game-shell.screen-garage .garage-studio .gs-car-heading > div:first-child {
    flex: 1 0 100%;
    min-width: 0;
  }

  .game-shell.screen-garage .garage-studio .gs-car-heading .gs-change-car {
    margin-left: auto;
  }

  .game-shell.screen-garage .garage-studio .gs-workspace .gs-showroom {
    height: 220px;
    min-height: 220px;
    flex: none;
  }

  .game-shell.screen-garage .garage-studio .gs-unified-panel {
    min-width: 0;
    flex: none;
    overflow: visible;
    padding: 16px 12px;
  }

  .game-shell.screen-garage .garage-studio .gs-resource-summary > div {
    min-width: 0;
  }

  .game-shell.screen-garage .garage-studio .gs-resource-summary > div > span {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
  }

  .game-shell.screen-garage .garage-studio .gs-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-shell.screen-garage .garage-studio .gs-unified-actions {
    flex-wrap: wrap;
  }

  .game-shell.screen-garage .garage-studio .gs-unified-actions .gs-prepare {
    flex-basis: 100%;
  }
}

/* The narrow account row must fit its links, balance and account control. */
@media (max-width: 360px) {
  .game-shell.screen-garage:not(.screen-race) > .game-hud {
    grid-template-columns: 0 minmax(0, 1fr);
    column-gap: 0;
  }

  .game-shell.screen-garage:not(.screen-race) > .game-hud > .hud-account {
    width: 100%;
    gap: 3px;
  }

  .game-shell.screen-garage:not(.screen-race) > .game-hud .hud-balance {
    flex: 1;
    min-width: 0;
    gap: 2px;
  }

  .game-shell.screen-garage:not(.screen-race) > .game-hud .hud-balance strong {
    font-size: clamp(12px, 4.4vw, 16px);
  }
}
