/* ============================================================
   responsive.css — breakpoints for phones, tablets, desktops
   Canvas pixel sizing itself is recalculated in JS (game.js
   resize()); this file only handles DOM/UI layout.
   ============================================================ */

/* ---------- Small / mobile screens: show touch controls ---------- */
@media (max-width: 860px) {
  .mobile-controls { display: flex; }
  .desktop-power { display: none; }

  .hud { padding-top: calc(8px + var(--safe-top)); gap: 6px; }
  .hud-value { font-size: 15px; }
  .hud-value--sm { font-size: 11px; }
  .hud-label { font-size: 9px; }
  .btn-icon { width: 40px; height: 40px; min-height: 40px; font-size: 14px; }

  .panel--center { padding: 30px 24px; border-radius: 20px; }
  .title--hero { font-size: 38px; }
  .title { font-size: 24px; }
}

/* ---------- Very small phones (e.g. 320–375px wide) ---------- */
@media (max-width: 400px) {
  .title--hero { font-size: 32px; }
  .subtitle { font-size: 13px; margin-bottom: 20px; }
  .btn { padding: 13px 18px; font-size: 13px; }
  .mc-btn { min-width: 44px; min-height: 44px; font-size: 16px; }
  .mc-shoot { min-width: 70px; font-size: 12px; }
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
  .result-value { font-size: 16px; }
  .stars { font-size: 26px; letter-spacing: 5px; }
}

/* ---------- Short viewports: landscape phones, small laptops ---------- */
@media (max-height: 520px) {
  .screen { padding-top: calc(10px + var(--safe-top)); padding-bottom: calc(10px + var(--safe-bottom)); }
  .panel--center { padding: 20px 26px; }
  .title--hero { font-size: 30px; }
  .title { font-size: 20px; margin-bottom: 6px; }
  .subtitle { margin-bottom: 14px; }
  .btn-stack { gap: 8px; }
  .btn { padding: 10px 18px; min-height: 40px; }
  .hud { padding-top: calc(6px + var(--safe-top)); padding-bottom: 6px; }
  .mobile-controls { padding-top: 6px; padding-bottom: calc(6px + var(--safe-bottom)); }
  .mc-btn, .mc-shoot { min-height: 40px; }
}

/* ---------- Tablet portrait / small laptop ---------- */
@media (min-width: 601px) and (max-width: 1024px) {
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ---------- Wide monitors: keep content comfortably bounded ---------- */
@media (min-width: 1400px) {
  .panel--center { max-width: 480px; }
  .level-grid, .scroll-area, .subheader, .how-to-play-back { max-width: 860px; }
}

/* ---------- Landscape phones: prefer a tighter HUD, controls stay reachable ---------- */
@media (orientation: landscape) and (max-width: 900px) and (pointer: coarse) {
  .hud { gap: 8px; }
  .hud-block--objective { display: none; } /* reclaim horizontal space in short landscape */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
