/* ============================================================
   gn-mobile.css — shared responsive overrides for 207gamenight
   Loaded LAST on every page so these rules win on equal specificity.
   Desktop layout is untouched; everything here is inside a media query.
   ============================================================ */


/* ─────────────────────────────────────────────
   TABLETS AND BELOW  (≤ 820px)
   ───────────────────────────────────────────── */
@media (max-width: 820px) {

  /* Nav becomes horizontally scrollable instead of overflowing.
     All links stay reachable — no hamburger, no JS. */
  nav {
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }

  .nav-brand {
    font-size: 13px;
    padding: 12px 12px 12px 0;
    margin-right: 4px;
  }
  .nav-primary { flex: 0 0 auto; }
  .nav-link { padding: 12px 10px; font-size: 12px; }
  .nav-link.secondary { font-size: 11px; }
  .nav-secondary { padding-left: 4px; margin-left: 4px; }
}


/* ─────────────────────────────────────────────
   PHONES  (≤ 620px)
   ───────────────────────────────────────────── */
@media (max-width: 620px) {

  body { font-size: 14px; }

  /* ── Hero ── */
  .hero, header {
    padding: 20px 16px 18px;
  }
  .hero::before, .hero::after,
  header::before, header::after { display: none; }
  .hero-eyebrow, .header-eyebrow { font-size: 10px; margin-bottom: 6px; }
  .hero-title, header h1 { font-size: 1.4rem; line-height: 1.25; }
  .hero-sub, .header-sub { font-size: 11px; line-height: 1.45; }

  /* ── Player switcher ── */
  .switcher-bar {
    padding: 8px 16px;
    gap: 8px;
  }
  .switcher-label { font-size: 9px; }
  .player-chip { font-size: 11px; padding: 4px 10px; }

  /* ── Metrics: 2 across, tighter ── */
  .metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    padding: 12px 16px;
  }
  .metric, .metric-card { padding: 12px 13px; }
  .metric-label { font-size: 9px; letter-spacing: .08em; }
  .metric-value { font-size: 19px; }
  .metric-sub, .metric-trend, .metric-name { font-size: 10px; }

  /* ── Page body ── */
  main, .main { padding: 0 12px 28px !important; }
  .main { grid-template-columns: 1fr !important; gap: 12px; }
  .two-col, .three-col { grid-template-columns: 1fr !important; gap: 12px; }
  .card, .chart-card { padding: 14px; border-radius: 10px; }
  .card-title { font-size: 9px; margin-bottom: 12px; }
  .section-header { padding-top: 14px; margin-bottom: 10px; }
  .section-title { font-size: 14px; }
  .section { margin-bottom: 16px; }

  /* ── Generic: let text cells shrink, trim fixed columns ──
     The desktop rows reserve ~280px of non-shrinking width,
     which leaves almost nothing for names on a phone. */
  .game-name, .rival-name, .opp-name, .list-name,
  .recent-game-name, .wr-bar-label, .gb-name,
  .tight-names, .partner-name, .player-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ── Streaks page ── */
  .result-dot { width: 26px; height: 26px; }
  .bar-label { width: 32px; font-size: 11px; }
  .bar-val { width: 32px; font-size: 10px; }
  .game-record { width: 48px; font-size: 9px; }
  .game-pct { width: 34px; font-size: 12px; }
  .mini-bar { width: 40px; }
  .chart-wrap { height: 190px; }

  /* ── Rivalries page ── */
  .rival-name { width: auto; flex: 0 1 76px; }
  .rival-meta { font-size: 9px; }
  .rival-pct { width: 32px; font-size: 12px; }
  .rival-total { display: none; }          /* game count also shown in meta line */
  .badge-pair { flex-direction: column; gap: 8px; }
  .badge-player-name { font-size: 16px; }
  .badge-pct { font-size: 22px; }
  .matchup-name { font-size: 16px; }
  .matchup-score { font-size: 11px; }
  .gb-bar-bg { width: 52px; }
  .gb-record { width: 46px; font-size: 9px; }
  .gb-pct { width: 32px; }
  .tight-rank { width: 16px; font-size: 10px; }
  .tight-bar-bg { width: 56px; }
  .tight-record { width: 54px; font-size: 9px; }
  .tight-games { display: none; }
  .tight-row, .rival-row { gap: 8px; }

  /* ── Co-op page ── */
  .wr-bar-bg { width: 64px; }
  .wr-record { width: 46px; font-size: 9px; }
  .wr-pct { width: 34px; font-size: 12px; }
  .size-label { width: 60px; font-size: 10px; }
  .partner-name { width: auto; flex: 0 1 68px; }
  .partner-plays { width: 44px; font-size: 9px; }
  .partner-pct { width: 32px; font-size: 12px; }
  .list-stat { font-size: 10px; }
  .list-badge { font-size: 8px; padding: 2px 6px; }

  /* ── BGA page ── */
  .tourney-banner { padding: 16px 16px; }
  .tourney-banner::before { font-size: 1.8rem; right: 10px; top: 8px; }
  .tourney-name { font-size: 1.1rem; }
  .tourney-sub { font-size: 11px; }
  .standings-table { font-size: 12px; }
  .standings-table th { font-size: 9px; padding: 6px 4px; }
  .standings-table td { padding: 7px 4px; }
  .standings-table td.num { font-size: 11px; }
  .pos-medal { width: 19px; height: 19px; line-height: 19px; font-size: 9px; margin-right: 3px; }
  .me-tag { font-size: 8px; padding: 1px 4px; margin-left: 3px; }
  .finisher { font-size: 10px; padding: 2px 7px; }
  .finish-chip { width: 38px; height: 26px; font-size: 10px; }
  .game-plays { width: 44px; font-size: 9px; }
  .opp-record { width: 58px; font-size: 10px; }
  .opp-badge { font-size: 8px; padding: 1px 5px; }
  .opp-games { font-size: 10px; }
  #opponentList { max-height: 260px; }

  /* ── Overview page ── */
  .recent-game { gap: 10px; padding: 12px 0; }
  .recent-date { width: 62px; font-size: 9px; }
  .recent-game-name { font-size: 14px; }
  .player-pill { font-size: 11px; padding: 2px 8px; }
  .h2h-label { width: 84px; font-size: 11px; }
  .h2h-count { width: 46px; font-size: 9px; }
  .bar-meta { width: 52px; font-size: 10px; }
  .records-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .record-card { padding: 11px 12px; }
  .record-value { font-size: 18px; }
  .record-label { font-size: 9px; }
  .coop-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .badges-grid { grid-template-columns: 1fr !important; }
  .legend { font-size: 11px; gap: 10px; }
  .tabs { gap: 4px; }
  .tab { font-size: 11px; padding: 4px 11px; }

  /* ── Admin & calendar ── */
  .evt-grid { grid-template-columns: 1fr !important; }
  .input-row { flex-direction: column; }
  .input-row .btn { width: 100%; justify-content: center; }
  .drop-zone { padding: 1.75rem 1rem; }
  .btn { padding: 10px 18px; }          /* comfortable tap target */
  .field input[type="text"],
  .field input[type="password"],
  input[type="date"],
  input[type="text"].bare { font-size: 16px; }  /* prevents iOS zoom-on-focus */

  footer { font-size: 10px; padding: 1.25rem 12px .75rem; }
}


/* ─────────────────────────────────────────────
   SMALL PHONES  (≤ 400px)
   ───────────────────────────────────────────── */
@media (max-width: 400px) {

  .hero-title, header h1 { font-size: 1.25rem; }
  .metric-value { font-size: 17px; }
  .metrics { padding: 10px 12px; gap: 6px; }
  .card, .chart-card { padding: 12px; }

  /* Drop the lowest-value columns so names stay legible */
  .game-record, .wr-record, .gb-record { display: none; }
  .rival-name { flex-basis: 64px; }
  .partner-name { flex-basis: 60px; }
  .standings-table th:nth-child(4),
  .standings-table td:nth-child(4) { display: none; }   /* Races column */
  .chart-wrap { height: 170px; }
  .result-dot { width: 24px; height: 24px; }
}


/* ─────────────────────────────────────────────
   TOUCH DEVICES
   ───────────────────────────────────────────── */
@media (hover: none) {
  /* Hover-only affordances don't work on touch, so make the
     equivalent info visible / tappable instead. */
  .rival-row:hover { background: transparent; margin: 0; padding: 10px 0; }
  .rival-row { -webkit-tap-highlight-color: rgba(24,95,165,.12); }
  .rival-row:active { background: #f0f5fa; }
  .result-dot { cursor: default; }
}
