/* ==========================================================================
   responsive.css — tablet and phone layouts.
   Design goal: vertical flow, board always fits, no horizontal scrolling,
   comfortable touch targets (>= 44px) everywhere.
   ========================================================================== */

/* ---------- Small phones (<= 420px) ---------- */

@media (max-width: 420px) {
  .app-header { padding: 10px 12px; }

  .logo { width: 38px; height: 38px; }

  .brand-text h1 { font-size: 1.05rem; }

  .tagline { display: none; }

  .app-main { padding: 4px 10px 18px; }

  .panel { padding: 16px 14px 20px; }

  .menu-grid { grid-template-columns: 1fr; }

  .menu-btn { min-height: 72px; }

  .board { width: 100%; max-width: 92vw; }

  .board-frame { width: 100%; padding: 8px; }

  .players-bar { gap: 8px; }

  .player-chip { padding: 6px 12px 6px 8px; min-height: 44px; }

  .chip-name { max-width: 9ch; }

  .turn-indicator { font-size: 1.15rem; }

  .actions, .overlay-actions { gap: 8px; }

  .btn { min-height: 48px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .stat-box { padding: 10px 10px; }

  input[type="range"] { width: 120px; }

  .setting-row { flex-wrap: wrap; }
  .setting-row select { width: 100%; }
}

/* ---------- Very small screens (<= 340px) ---------- */

@media (max-width: 340px) {
  .chip-name { max-width: 7ch; }
  .vs { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Landscape phones: keep the board compact ---------- */

@media (max-height: 480px) and (orientation: landscape) {
  .board { width: min(52vh, 320px); }
  .app-main { padding-bottom: 10px; }
}

/* ---------- Larger tablets & desktops ---------- */

@media (min-width: 900px) {
  .app-header { padding: 20px 28px; }

  .logo { width: 52px; height: 52px; }

  .brand-text h1 { font-size: 1.45rem; }

  .app-main { max-width: 680px; padding: 16px 24px 40px; }

  .panel { padding: 28px 30px 32px; }

  .menu-grid { grid-template-columns: repeat(3, 1fr); }

  .menu-btn { min-height: 108px; }

  .board { width: 400px; }
}

/* ---------- Touch devices: bigger targets, no hover flicker ---------- */

@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 50px; }
  .menu-btn { min-height: 84px; }
  .back-link { min-height: 48px; }
  .setting-row { min-height: 52px; }
  .cell { min-width: 56px; min-height: 56px; }
}

/* ---------- Print (just in case someone prints the How-to-Play) ---------- */

@media print {
  .bg-ornaments, .app-header .icon-btn, .app-footer { display: none; }
  body { background: #fff; }
}
