/* SMALL PHONES (26 Nov 2026, owner: "why do things scale off screen" at 320). One sheet, loaded on every page by the
   header (fragments/nav), so it reads after each page's own styles. Found by tools/small-phone-audit.js at 320, 360,
   375, 390 and 430px: text clipped inside its box, boxes past the right edge, text under 12px, tap targets under
   40px. The house look stays; only widths, gaps, wrapping and the type floor move, and only on a phone.

   The rules, once: lines wrap rather than clip; a flex child that holds text may shrink (min-width:0); long club
   names break across lines; padding and gaps shrink before text does; nothing a punter reads is under 12px; every
   button, chip and link in a bar of links is at least 40px tall. */

@media (max-width: 480px) {

    /* ---- wrapping, not clipping ---- */
    /* /previews big-game card: "Last 5: won 1, drew 1, lost 3" ran past the card's edge on one line */
    .fb-tm .fw { white-space: normal !important; flex-wrap: nowrap; align-items: flex-start; min-width: 0; }
    .fb-tm .fw > * { flex: none; }
    .fb-tm .fw > span:last-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
    .fb-tm .fw .dots { margin-top: .3em; }
    /* the card's inner gutter shrinks before its words do */
    .fbig .fb-top { padding: 14px 12px 10px; }
    .fbig .fr-ours { padding-left: 12px; padding-right: 12px; }
    .fb-tm .nm { overflow-wrap: anywhere; }
    /* the homepage's game rows: the fixture breaks onto a second line instead of "Dinamo Zagreb v Bayer Le..." */
    .hfx { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
    .hgl1, .hgl1 > *, .cfx { min-width: 0; }
    /* the homepage's two counts: "987 of 1,334" fits its half at 320 */
    .hrec-b { font-size: clamp(1rem, 5.4vw, 1.9rem) !important; white-space: nowrap !important; }
    /* the tips pages' record pill and the h2h banner's link wrap inside the screen */
    .me-record { white-space: normal !important; max-width: 100%; border-radius: 14px !important; }
    .upcoming-banner, .upcoming-banner p, .upcoming-banner a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal !important; }
    .upcoming-banner { flex-wrap: wrap; }
    .upcoming-banner a { display: inline-block; margin-top: 8px; }
    /* club names in lists and tables break rather than run off ("Borussia Mönchengladbach", "Brighton & Hove Albion") */
    .team-card-name, .team-card-name > span, .league-form-team, .league-form-team > span { min-width: 0; overflow-wrap: anywhere; white-space: normal !important; text-overflow: clip !important; overflow: visible !important; }

    /* ---- tap targets: 40px or more ---- */
    .site-header .site-logo { min-height: 44px; display: inline-flex; align-items: center; }
    .dchips button, .pvchips button, nav.arch a.chip, nav.pi-days a, nav.chip-rail a.cov-chip, nav.breadcrumbs a,
    .refresh-btn, .pvb-cta, a.build-door, .mprose > button, button.ib {
        min-height: 40px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    }
    button.ib { min-width: 40px; }

    .tr-why-toggle { min-height: 40px; display: inline-flex; align-items: center; }
    .teams-league-chip, .tool-cta-btn { min-height: 40px; display: inline-flex; align-items: center; box-sizing: border-box; }

    /* ---- the type floor: nothing a punter reads under 12px ---- */
    .pro-mark, .ptag, .nbtag, .potd, .footer-col-title, #fbb-fa-k-footer, #fbb-fa-k-home, .kr-eyebrow, .outcome-badge,
    .h2h-result-pill, .hrec-k, .hkick, .hmarks span, .meta em.out, .fxcall .lbl, .mid .lbl, .mfx-tm .ha, .mchance-k,
    span.p > small, span.p > em, .mcall .k, .mlikely .k, .pk .k, .fb-meta .lg, .l-line .mk, .k > span, .jsofar-k,
    li.dh > span, .pr-story-k, .pr-news-k, th, button.ib, body footer .footer-col-title, body .rr-fx .outcome-badge, body .outcome-badge, .fbb-lbar-k {
        font-size: 12px !important;
    }

    /* the landing bar's email form fits the screen: the field shrinks before the button leaves it */
    .fbb-lbar-in { flex-wrap: wrap; row-gap: 8px; }
    .fbb-lbar-f { flex: 1 1 100% !important; min-width: 0; max-width: 100%; }
    .fbb-lbar-f input { min-width: 0; flex: 1 1 auto; }
    .fbb-lbar-btn { flex: none; }
}
