/* Mobile layer — loaded last, presentation only.
   Fixes found by auditing every main route at 360–390px wide:
   the sticky header covered ~40% of a phone screen, several controls were
   below comfortable touch size, some labels rendered at 8–9px, and iOS
   zoomed the page whenever a small form field was focused. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Header: on phones the brand/arena block scrolls away and only the section
   navigation stays pinned. mobile-shell.js measures the height to hide. */
@media (max-width: 820px) {
  .topbar { top: calc(-1 * var(--mta-topbar-collapse, 0px)); }
  .site-links { scroll-padding-inline: 16px; overscroll-behavior-x: contain; }
}

@media (max-width: 760px) {
  /* Account buttons: readable and at least 38px tall. */
  .nav-utility .account-menu button,
  .nav-utility .account-menu #openAccountProfile { min-height: 38px; font-size: .7rem; }

  .hub-promo-label { font-size: .66rem; }
  .hub-promo-copy { font-size: .72rem; }

  /* Segmented period filters on Official Clan Wars. */
  .cw-period-tabs button { min-height: 38px; padding-inline: 12px; font-size: .74rem; }

  /* Player names in tournament rosters are buttons. */
  .roster-player-link { min-height: 32px; }

  /* Status pills and small labels were 8–9.6px. */
  .home-entry-type, .home-entry-status, .player-activity-status, .card-arena-label,
  .event-status, .community-status, .world-podium-emblem, .ccw-human-reviewed-badge,
  #ratingBoardLabel { font-size: .64rem; }
}

/* iOS Safari zooms into any focused field under 16px; keep the page still. */
@media (max-width: 760px) and (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="email"], input[type="password"],
  input[type="number"], input[type="url"], input:not([type]), select, textarea { font-size: 16px; }
}

/* Very narrow phones: one filter per row so select labels are not cut off. */
@media (max-width: 420px) {
  .toolbar { grid-template-columns: minmax(0, 1fr); }
  .toolbar > * { grid-column: 1 / -1; }
}
