/* Mobile safety layer. Loaded after all theme styles so it can correct legacy rules without changing desktop. */
@media (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: clip; }
  *, *::before, *::after { min-width: 0; }
  img, video, iframe, svg, canvas { max-width: 100%; }

  .shell { width: min(calc(100% - 32px), 1180px) !important; max-width: 100% !important; }
  .hero { overflow: clip !important; }
  .hero-grid { display: block !important; width: 100% !important; max-width: 100% !important; }
  .hero-copy,
  .hero-copy > *,
  .featured-card { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
  .featured-card { margin-top: 38px; transform: none !important; }

  .hero h1,
  .page-hero h1,
  .section h2,
  .section h3 { max-width: 100% !important; overflow-wrap: break-word; word-break: normal; }

  .hero-actions { width: 100%; max-width: 100%; flex-wrap: wrap; }
  .hero-actions .btn { max-width: 100%; white-space: normal; text-align: center; }

  .mini-socials,
  .social-row { max-width: 100% !important; flex-wrap: wrap !important; }
  .social-pill { max-width: 100%; }

  .card-grid,
  .post-grid,
  .streamer-grid,
  .home-news-grid,
  .home-topic-grid,
  .streamer-picks-list,
  .two-col,
  .suggest-grid,
  .comitement-feature,
  .discord-collab-card { min-width: 0 !important; max-width: 100% !important; }

  .btn,
  input,
  textarea,
  select,
  pre,
  table { max-width: 100%; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 28px) !important; }
  .header-inner { gap: 12px !important; }
  .brand { max-width: calc(100% - 56px) !important; }
  .brand-copy { min-width: 0; }
  .brand strong { font-size: 16px; overflow-wrap: anywhere; }

  .hero { padding: 52px 0 58px !important; }
  .hero .eyebrow { font-size: 11px !important; letter-spacing: .14em !important; line-height: 1.5; }
  .hero h1,
  .page-hero h1 {
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(2.05rem, 10vw, 2.75rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.035em !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: none !important;
    text-wrap: balance;
  }
  .hero-copy > p,
  .page-hero p { font-size: 16px !important; max-width: 100% !important; overflow-wrap: break-word; }

  .hero-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .hero-actions .btn { width: 100% !important; min-height: 48px; padding-inline: 14px !important; }

  /* Pills are a grid on phones: nothing can hang off the right edge. */
  .hero .mini-socials {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    width: 100% !important;
  }
  .hero .mini-socials .social-pill {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 8px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .streamer-grid,
  .post-grid,
  .home-news-grid,
  .home-topic-grid,
  .two-col,
  .suggest-grid,
  .comitement-feature { grid-template-columns: minmax(0, 1fr) !important; }

  /* Streamer recommendations intentionally stay two-up on phones. */
  .streamer-picks-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 32px 18px !important;
    justify-content: stretch !important;
    width: 100% !important;
  }
  .streamer-pick { width: 100% !important; max-width: 100% !important; min-width: 0 !important; text-align: center; }
  .streamer-pick-avatar { max-width: min(100%, 150px) !important; margin-inline: auto !important; }
  .streamer-pick-name,
  .streamer-pick-link,
  .streamer-pick-live { max-width: 100% !important; overflow-wrap: anywhere; }

  .news-item { grid-template-columns: minmax(78px, 105px) minmax(0, 1fr) !important; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 22px) !important; }
  .hero h1,
  .page-hero h1 { font-size: clamp(1.9rem, 9.8vw, 2.35rem) !important; }
  .hero .mini-socials { grid-template-columns: minmax(0, 1fr) !important; }
  .streamer-picks-list { gap: 26px 12px !important; }
}

/* deploy-marker: mobile-layout-2.4.3 */
