/* responsive.css — tablet first, then phones and big screens. */

/* Hide the left panels on narrow screens so the world stays visible. */
@media (max-width: 820px) {
  .side-panel { width: min(86vw, 18rem); }
  #panel-log { display: none; }
  .hud-planet { font-size: 0.95em; }
  .log-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 620px) {
  :root { --touch: 56px; }

  .hud-bar { flex-wrap: wrap; justify-content: center; row-gap: 0.3rem; }
  .hud-group.meters { order: 3; width: 100%; justify-content: center; }
  .o2-cell { width: 11px; }
  .hud-chip { display: none; }

  #action-bar { gap: 0.3rem; padding: 0.35rem; border-radius: var(--radius-md); }
  .action-btn { width: var(--touch); height: var(--touch); font-size: 0; gap: 0; }
  .action-btn .icon { width: 28px; height: 28px; }

  .side-panel { top: auto !important; bottom: calc(var(--touch) + 22px + env(safe-area-inset-bottom)); max-height: 32vh; }
  .profile-list { grid-template-columns: repeat(2, 1fr); }
  .bp-grid { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 0.8rem; }
  .game-title { font-size: 1.7em; }
}

/* Wide screens: give the panels more room and stop the HUD stretching. */
@media (min-width: 1280px) {
  .hud-bar { left: 50%; right: auto; transform: translateX(-50%); width: min(96vw, 1180px); }
  .side-panel { width: 22rem; }
  #panel-log { top: calc(92px + 34vh); }
}

/* Landscape phones: shrink the vertical stack. */
@media (max-height: 520px) {
  .side-panel { display: none; }
  #action-bar { bottom: 6px; }
  .action-btn { width: var(--touch); height: var(--touch); font-size: 0; }
}

/* Coarse pointers get bigger buttons; fine pointers can be smaller. */
@media (pointer: coarse) {
  .big-btn { min-height: 60px; }
}

/* Respect the operating system's motion preference on first run. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
