/* ==========================================================================
   MOBILE — loaded LAST, on purpose.

   These rules were first written into wire.css, where they lost every
   specificity contest to hub.css, rest.css, gear.css and watch.css, all of
   which load after it. A source disclosure stayed 32px tall no matter what
   wire.css said about it. Loading this sheet last is the fix, and it is also
   the honest description of what it is: the overrides for small screens.

   Everything here is inside a max-width query. The approved desktop design,
   its logo, its colours and its video are untouched above 900px.
   ========================================================================== */

/* ---------------------------- the menu button ---------------------------- */
.menubtn { display: none; }
.menu { display: none; }

@media (max-width: 900px) {
  .menubtn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-left: auto; padding: 0.6rem 0.85rem;
    min-height: 44px; min-width: 44px;
    background: transparent; color: var(--cream);
    border: 1px solid var(--line); border-radius: var(--radius);
    font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer;
  }
  .menubtn__bars { display: grid; gap: 3px; width: 17px; }
  .menubtn__bars span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out); }
  .menubtn[aria-expanded="true"] { border-color: var(--lime); color: var(--lime); }
  .menubtn[aria-expanded="true"] .menubtn__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .menubtn[aria-expanded="true"] .menubtn__bars span:nth-child(2) { opacity: 0; }
  .menubtn[aria-expanded="true"] .menubtn__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

  /* The header CTA duplicates what the panel already offers, and at 320px it
     wrapped onto two lines beside the logo. */
  .hdr__cta { display: none; }

  .menu {
    display: block; border-top: 1px solid var(--line);
    background: rgba(8, 10, 11, 0.98);
    max-height: min(70vh, 34rem); overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .menu[hidden] { display: none; }
  .menu__nav {
    display: grid; gap: 0.25rem;
    padding: 0.6rem var(--gutter) 1rem;
    max-width: var(--shell); margin-inline: auto;
  }
  .menu__a {
    display: flex; align-items: center; min-height: 48px;
    padding: 0.35rem 0.6rem; border-radius: var(--radius);
    color: var(--cream); text-decoration: none; font-weight: 700; font-size: 1.0625rem;
    border: 1px solid transparent;
  }
  .menu__a:hover, .menu__a:focus-visible { background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
  .menu__a[aria-current="page"] { color: var(--lime); border-color: rgba(214, 255, 63, 0.4); background: rgba(214, 255, 63, 0.08); }
  .menu__a--sub { font-size: 0.9375rem; font-weight: 600; color: var(--cream-dim); min-height: 44px; }
  .menu__cta { margin-top: 0.5rem; justify-content: center; min-height: 48px; }
  /* The page behind must not scroll under an open panel. */
  .ww-menu-open body { overflow: hidden; }
}

/* ------------------------------- the hero -------------------------------
   The cause of the overlap: .hero__ctl was position:absolute over the hero,
   and .hero__body reserved room for it with padding-bottom. On a phone the
   control row wrapped, grew taller than the reserved space, and landed on top
   of the Replay button — a measured 165x41px collision at every width tested.

   Below 900px it stops being absolute. The hero becomes a column that grows
   with its content, and every control gets its own row. */
@media (max-width: 900px) {
  .hero {
    min-height: 0;
    display: flex; flex-direction: column;
    padding-bottom: 0;
  }
  .hero__media { position: absolute; inset: 0; z-index: 0; }
  .hero__body {
    position: relative; z-index: 2;
    padding: clamp(1.4rem, 5vw, 2.2rem) var(--gutter) 1.1rem;
    display: grid; gap: 0.85rem; justify-items: start;
  }
  .hero__h { margin: 0; }
  .hero__lede { margin: 0; max-width: 34ch; }

  /* Explore is the primary action and gets the full width and its own row.
     Replay sits below it, clearly secondary, never beside it. */
  .hero__actions { display: grid; gap: 0.6rem; width: 100%; }
  .hero__actions .btn { width: 100%; justify-content: center; min-height: 50px; }
  .hero__actions .btn--ghost { min-height: 46px; }

  /* Out of absolute flow: its own band under the body, in normal order. */
  .hero__ctl {
    position: static; z-index: 2;
    display: grid; gap: 0.7rem; justify-items: stretch;
    padding: 0 var(--gutter) calc(1.1rem + env(safe-area-inset-bottom, 0px));
    width: 100%;
  }
  .hero__btns {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    order: 1;                       /* controls first */
  }
  .hero__btns .ctl { min-height: 44px; }
}

/* Short screens — an iPhone SE in landscape, or a tall browser toolbar. The
   hero must never demand more height than the content needs. */
@media (max-width: 900px) and (max-height: 620px) {
  .hero__body { padding-top: 1rem; gap: 0.65rem; }
  .hero__h { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .hero__lede { font-size: 0.9375rem; }
}

/* ------------------------- the very narrow case ------------------------- */
@media (max-width: 360px) {
  .hdr__in { gap: 0.5rem; padding-inline: 0.85rem; }
  .brand img { width: 148px; height: auto; }
  .menubtn { padding: 0.55rem 0.6rem; }
  .menubtn__t {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .hero__btns .ctl { flex: 1 1 auto; justify-content: center; }
}

/* ------------------------------ safe areas ------------------------------ */
@supports (padding: env(safe-area-inset-left)) {
  @media (max-width: 900px) {
    .hdr__in, .menu__nav, .hero__body, .hero__ctl, .ftr__in {
      padding-left: max(var(--gutter), env(safe-area-inset-left));
      padding-right: max(var(--gutter), env(safe-area-inset-right));
    }
  }
}

/* ------------------- the last 320px overflow, and the logo -------------------
   Two things pushed the document 15px wide at 320: the carousel's "Auto off"
   button sitting in a row that could not wrap, and a safehouse hotspot label
   which is invisible until hover but still occupies layout. */
@media (max-width: 900px) {
  /* The brand link was 36px tall. It is the first thing a thumb reaches for. */
  .brand { display: inline-flex; align-items: center; min-height: 44px; }

  .picks__foot { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .picks__auto { min-height: 44px; }

  /* A label that only appears on hover has no business reserving width on a
     touch screen, where there is no hover at all. */
  .spot__label { max-width: min(60vw, 14rem); white-space: normal; }
}
@media (max-width: 360px) {
  .picks__foot { justify-content: flex-start; }
  .picks__auto { flex: 1 1 auto; justify-content: center; }
}
@media (hover: none) {
  /* It can never be shown, so it must never take space. */
  .spot__label { display: none; }
}

/* ------------------------- touch targets, site-wide -------------------------
   Every control a thumb can reach gets 44px on a touch screen. These were
   measured at 320/375/390/430 in WebKit, not guessed: source disclosures at
   43x32, carousel CTAs at 98x34, community links at 286x39, filters at 97x36,
   and bare 17x17 checkboxes in the gear comparison and the setup form. */
@media (max-width: 900px) {
  .src summary,
  .kd__s,
  .picks__cta,
  .comm__go,
  .filter,
  .topic__reveal,
  .nextcard,
  .ckitem__go,
  .player__meta a,
  .qrow,
  .vcard__link,
  .hist__src,
  .ednote__srcs summary,
  .gp__more summary,
  .disc__d summary {
    min-height: 44px;
    display: inline-flex; align-items: center;
  }
  .nextcard, .qrow, .vcard__link { display: flex; }

  /* A 17px checkbox is not a target; the label around it is. */
  .opt { min-height: 48px; }
  .opt input[type="checkbox"], .opt input[type="radio"] { width: 22px; height: 22px; }
  .gp__cmp { min-height: 44px; }
  .gp__cmpbox { width: 20px; height: 20px; }

  /* Standalone switches that sit outside a label. */
  #hideSpoilers, #autoNext, .spoiler-toggle input, .wq__auto input {
    width: 24px; height: 24px;
  }
  .spoiler-toggle, .wq__auto, label:has(#hideSpoilers), label:has(#autoNext) {
    min-height: 44px; display: inline-flex; align-items: center; gap: 0.5rem;
  }

  /* Community "Open r/GTA6" wrapped to 39px because the name broke onto a
     second line inside a fixed-height pill. */
  .comm__go { padding-block: 0.6rem; }
}

/* --------------- the targets the first pass missed, by real name ---------------
   Measured in WebKit at 390px: .picks__go was 98x34, .fdet__s 132x32,
   .nowplay__ch 133x36, .ed__moreS 316x25. */
@media (max-width: 900px) {
  .picks__go,
  .deeplink,
  .fdet__s,
  .nowplay__ch,
  .nowplay__src,
  .ed__moreS,
  .filters .filter,
  .filters--watch .filter {
    min-height: 44px;
    display: inline-flex; align-items: center;
  }
  .ed__moreS { padding-block: 0.6rem; }
  .picks__go { padding-block: 0.55rem; }

  /* Community: the featured block's media column was 356px inside a 320px
     viewport because the two-column grid never collapsed at this width. */
  .feat { grid-template-columns: minmax(0, 1fr); }
  .feat__media { width: 100%; min-width: 0; }
  .feat__media img { width: 100%; }
  .topics, .topic { min-width: 0; max-width: 100%; }
  .topic { overflow-wrap: anywhere; }
}

/* --------------------------- the last few, measured --------------------------- */
@media (max-width: 900px) {
  /* The detail markers were 40x40; 44 is the floor. */
  .mark { width: 44px; height: 44px; }

  /* Community at 320: the featured grid and the topic grid both had a
     minimum track wider than the viewport. */
  .feat { grid-template-columns: minmax(0, 1fr) !important; }
  .topics { grid-template-columns: minmax(0, 1fr) !important; }
  .plcs { grid-template-columns: minmax(0, 1fr) !important; }
  .plcs > li:first-child { grid-column: auto !important; }
  .gps, .gcards, .pcards, .ncards, .deeps, .comms, .nextgrid, .guidegrid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .ncard--big, .gp, .gcard, .pcard { grid-column: auto !important; }
}

/* The newsletter consent label was 25px tall at 430px, where its text fits on
   one line. A consent control is exactly the one a person must be able to hit. */
@media (max-width: 900px) {
  .signup__opt, .alerts__opt, label:has(#signupOpt), label:has(#alertsOpt) {
    min-height: 44px; display: flex; align-items: center; gap: 0.6rem;
  }
  .signup__opt input, .alerts__opt input { width: 22px; height: 22px; flex: none; }
}

/* The policy links were 19px tall — body-copy sized links in a row a thumb has
   to hit. mobile.css loads last, so this is where the override belongs. */
@media (max-width: 900px) {
  .ftr__policy { gap: 0 1.1rem; }
  .ftr__policy a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* The address inside the page copy was 19px tall. On the Contact page it is the
   whole point of the page, so on a phone it has to be a target rather than a
   line of text a thumb has to find. Desktop keeps the tighter inline setting. */
@media (max-width: 900px) {
  .policy__mail {
    display: inline-block;
    padding: 0.8rem 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

/* The maker's page is kept as an alternative beneath the Amazon button. It is
   body-copy sized, which made it a 19px target on a phone — the same defect the
   footer policy row had. */
@media (max-width: 900px) {
  .pcard__alt a, .gp__alt a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
}

/* The source link under each "latest" item on the GTA VI hub measured 36px on
   a phone — a standalone link, not inline in a sentence, so the 44px floor
   applies to it. */
@media (max-width: 900px) {
  .latest__src { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---- the visual mobile menu ---------------------------------------------
   Eight destinations, each a tile + name + hook + arrow. The tiles are drawn,
   not photographed: the thumbnails on disk have no provenance record, and
   Rockstar's press images are barred from preorder.html while this menu appears
   on every page. An accent gradient and a stroke icon need no licence. */
.menu__nav { display: grid; gap: var(--s-2); }

.mcard {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 20px;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--tap);
  padding: var(--s-3);
  border: var(--edge);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgb(var(--a-rgb) / 0.10), rgba(0,0,0,0.25) 70%), var(--surface);
  text-decoration: none;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.mcard:hover, .mcard:focus-visible { border-color: rgb(var(--a-rgb) / 0.55); transform: translateY(-1px); }
.mcard.is-here { border-color: rgb(var(--a-rgb) / 0.7); }

.mcard__tile {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--a-rgb) / 0.35);
  background: linear-gradient(150deg, rgb(var(--a-rgb) / 0.22), rgba(0,0,0,0.35) 78%);
  color: var(--a);
}
.mcard__tile svg { width: 26px; height: 26px; }

.mcard__b { display: grid; gap: 2px; min-width: 0; }
.mcard__t { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; color: var(--cream); }
.mcard__h {
  /* Wraps rather than truncating. An ellipsis hides the end of the sentence and
     no scrollWidth check would ever report it — "Characters, theories and
     trailer breakdo…" was live until it was looked at. */
  font-size: var(--t-caption); line-height: 1.45; color: var(--cream-dim);
}
.mcard__go { justify-self: end; font-size: 1.1rem; color: var(--a); }

.menu__more {
  margin: var(--s-3) 0 0;
  font-size: var(--t-label); font-weight: 800; letter-spacing: var(--tr-label);
  text-transform: uppercase; color: var(--cream-dim);
}

@media (prefers-reduced-motion: reduce) {
  .mcard { transition: none; }
  .mcard:hover, .mcard:focus-visible { transform: none; }
}
