/* ── Mobile layer ──────────────────────────────────────────────────────────
   Loaded by every page AFTER its desktop styles (styles.css + inline blocks).
   Only @media rules live here, so desktop rendering is byte-identical.
   House breakpoints: 1000px (tablet squeeze), 760px (phone), 560px (narrow
   phone). New pages should lean on these instead of inventing their own. */

/* ── Tablet: depth chart drops to two columns ── */
@media (max-width: 1000px) {
    .depth-chart-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Phone ── */
@media (max-width: 760px) {
    html { -webkit-text-size-adjust: 100%; }

    /* iOS auto-zooms any focused control under 16px — keep controls at 16px,
       and give buttons/selects a real touch target. Checkboxes keep their
       size (a 40px checkbox is worse than a small one inside a big label). */
    button, select, textarea,
    input[type="text"], input[type="password"], input[type="number"],
    input[type="email"], input[type="submit"], input[type="button"] {
        font-size: 16px;
        min-height: 40px;
    }

    /* Wide data tables (rosters, contracts, markets — 13-15 columns) scroll
       INSIDE themselves instead of stretching the page sideways. Opt out of
       the containment with class="mobile-keep" on layout-ish tables. */
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.mobile-keep { display: table; overflow-x: visible; }

    /* The copy-pasted desktop page cap (body { max-width: 1520px }) already
       shrinks; just trim the gutters so content gets the width. */
    body { padding-left: 10px; padding-right: 10px; }

    /* Sortable table headers + toolbar buttons sit under the 44px guideline
       house-wide — pad the most common offenders up to tappable. */
    th[data-sort], .player-list-table thead th { padding: 12px 10px; }

    /* Modals sized for desktop (margin: 15% auto; width: 80%) become
       near-full-screen sheets. */
    .modal-content { width: 94% !important; margin: 8% auto !important; }

    /* Trade builder: the two side-by-side 45% checkbox panels stack. */
    .trade-cols { flex-direction: column !important; gap: 12px; }
    .trade-cols > div, .trade-cols .offer-side { width: auto !important; }
}

/* ── Narrow phone: cards go single-file and stop forcing one-line rows ── */
@media (max-width: 560px) {
    .depth-chart-grid { grid-template-columns: 1fr; }
    .ninja-card > span, .ninja-assignment { white-space: normal; }
    .ninja-name { min-width: 0; }
}
