/* FPS JAPAN mobile readability + Front Page Tools refinement — v0.4.135-beta
 * Public/mobile-only layer. Desktop geometry and DB/data contracts remain unchanged.
 */
@media (max-width:680px) {
  body.fpsj-theme {
    --fpsj-mobile-micro-size:11px;
    --fpsj-mobile-meta-size:12px;
    --fpsj-mobile-card-title-size:14px;
  }

  /* Semantic microcopy should not collapse below a comfortable phone size. */
  body.fpsj-theme :where(.fpsj-front-v4,.fpsj-landing-page,.fpsj-site-footer) small,
  body.fpsj-theme :where(.fpsj-front-v4,.fpsj-landing-page,.fpsj-site-footer) time {
    font-size:var(--fpsj-mobile-meta-size)!important;
    line-height:1.45!important;
  }

  body.fpsj-theme :where(.fpsj-front-v4,.fpsj-landing-page) :where([class*="__eyebrow"],[class*="__kicker"]),
  body.fpsj-theme .fpsj-front-v4 .fpsj-v3-section-head > span,
  body.fpsj-theme .fpsj-landing-page [class*="__section-head"] > span,
  body.fpsj-theme .fpsj-settings-landing-hero__count span {
    font-size:var(--fpsj-mobile-micro-size)!important;
    line-height:1.35!important;
  }

  /* Front Page / FPS JAPAN Tools: three supporting actions become readable full-width rows. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-tool-subgrid {
    grid-template-columns:minmax(0,1fr)!important;
    gap:.55rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-tools .fpsj-front-card--tool-sub {
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:.8rem!important;
    min-height:58px!important;
    padding:.78rem .9rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-tools .fpsj-front-card--tool-sub > strong {
    min-width:0!important;
    font-size:16px!important;
    line-height:1.3!important;
    overflow-wrap:normal!important;
    word-break:keep-all!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-tools .fpsj-front-card--tool-sub > small {
    justify-self:end!important;
    font-size:12px!important;
    line-height:1.3!important;
    white-space:nowrap!important;
  }

  /* Front Page discovery/editorial copy: preserve density while making metadata readable. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access .fpsj-front-card__label {
    font-size:var(--fpsj-mobile-micro-size)!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-content-compact-post__copy > strong,
  body.fpsj-theme.fpsj-front-page .fpsj-front-content-explore-card__copy > strong {
    font-size:var(--fpsj-mobile-card-title-size)!important;
    line-height:1.45!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-content-editorial-lane__head h4 {
    font-size:15px!important;
  }

  /* Keep the approved five-up Game Hub shelf, but remove its sub-8px phone type. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-card__copy {
    min-height:38px!important;
    padding:.32rem .16rem .34rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-card__copy strong {
    display:-webkit-box!important;
    min-height:2.3em!important;
    overflow:hidden!important;
    font-size:10px!important;
    line-height:1.15!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
  }

  /* Landing cards / filters: micro labels and article metadata get the same phone floor. */
  body.fpsj-theme .fpsj-settings-hub__game-filter b,
  body.fpsj-theme .fpsj-settings-hub__topic-grid b,
  body.fpsj-theme .fpsj-game-hub__route-grid b,
  body.fpsj-theme .fpsj-game-hub__setting-grid b {
    font-size:10px!important;
  }

  body.fpsj-theme .fpsj-settings-hub__game-filter span {
    font-size:12px!important;
  }

  body.fpsj-theme .fpsj-settings-hub__topic-grid strong,
  body.fpsj-theme .fpsj-game-hub__setting-grid strong,
  body.fpsj-theme .fpsj-settings-card__body > strong,
  body.fpsj-theme .fpsj-device-article-card__body > strong,
  body.fpsj-theme .fpsj-game-article-card__body > strong {
    font-size:var(--fpsj-mobile-card-title-size)!important;
  }

  body.fpsj-theme .fpsj-game-hub__route-grid em,
  body.fpsj-theme .fpsj-settings-card__meta,
  body.fpsj-theme .fpsj-device-article-card__meta,
  body.fpsj-theme .fpsj-game-article-card__meta {
    font-size:var(--fpsj-mobile-meta-size)!important;
    line-height:1.4!important;
  }

  body.fpsj-theme .fpsj-game-landing-hero__lead {
    font-size:14px!important;
  }
}

/* =========================================================
   Front Page mobile density + discovery layout / v0.4.135-beta
   Public mobile-only geometry. Approved Header drawer/accordion is untouched.
   ========================================================= */
@media (max-width:680px) {
  /* Quick Access: keep all information, but remove the oversized vertical air. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access {
    min-height:72px!important;
    padding:.56rem .78rem .58rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access .fpsj-front-card__label {
    margin:0 0 .18rem!important;
    line-height:1.15!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access .fpsj-front-card__title-row {
    align-items:center!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access strong {
    font-size:16px!important;
    line-height:1.2!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access small {
    max-width:calc(100% - 1.2rem)!important;
    margin:.16rem 0 0!important;
    font-size:12px!important;
    line-height:1.22!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-card--access b {
    top:.56rem!important;
    right:.72rem!important;
  }

  /* Game Hub: larger package cards + native touch swipe. The next card peeks in by design. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-grid {
    display:flex!important;
    grid-template-columns:none!important;
    gap:.62rem!important;
    width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0 0 .48rem!important;
    scroll-snap-type:x mandatory!important;
    scroll-padding-inline:.08rem!important;
    overscroll-behavior-inline:contain!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-grid::-webkit-scrollbar {
    display:none;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-grid > * {
    flex:0 0 clamp(150px,42vw,176px)!important;
    width:clamp(150px,42vw,176px)!important;
    min-width:150px!important;
    scroll-snap-align:start!important;
    scroll-snap-stop:normal;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-card--game {
    min-height:0!important;
    height:auto!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-card__copy {
    min-height:50px!important;
    padding:.52rem .58rem .56rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-card__copy strong {
    display:block!important;
    min-height:0!important;
    overflow:visible!important;
    font-size:12px!important;
    line-height:1.2!important;
    white-space:normal!important;
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    -webkit-line-clamp:unset!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-games .fpsj-front-game-card__copy small {
    margin-top:.2rem!important;
    font-size:10px!important;
    line-height:1.2!important;
  }

  /* PRO USAGE RANKING: comparison-first 2 x 2 grid on phones. */
  body.fpsj-theme.fpsj-front-page .fpsj-front-device-ranking-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:.58rem!important;
  }

  body.fpsj-theme.fpsj-front-page a.fpsj-front-device-card,
  body.fpsj-theme.fpsj-front-page .fpsj-front-device-card {
    min-height:224px!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-device-card__media {
    height:118px!important;
    padding:.42rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-device-card__body {
    padding:.56rem .58rem .55rem!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-device-card__body > strong {
    min-height:2.5em!important;
    font-size:13px!important;
    line-height:1.3!important;
  }

  body.fpsj-theme.fpsj-front-page .fpsj-front-device-card--pending .fpsj-front-device-card__body > strong {
    font-size:11px!important;
    line-height:1.35!important;
  }

  /* Footer: brand remains full width; four discovery groups become 2 columns x 2 rows. */
  body.fpsj-theme .fpsj-footer .fpsj-footer__grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    column-gap:1rem!important;
    row-gap:1.7rem!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__brand {
    grid-column:1 / -1!important;
    grid-row:auto!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__site {
    grid-column:auto!important;
    min-width:0!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__nav,
  body.fpsj-theme .fpsj-footer .fpsj-footer__site .fpsj-footer__nav {
    padding-top:.88rem!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__nav h2 {
    margin-bottom:.82rem!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__nav li + li {
    margin-top:.64rem!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__search {
    max-width:none!important;
    margin-top:.9rem!important;
  }
}



/* =========================================================
   Mobile Footer search separation + Header-size parity / v0.4.136-beta
   Keep the four discovery groups 2 x 2, then promote search to a
   dedicated full-width row with the same phone geometry as Header search.
   ========================================================= */
@media (max-width:680px) {
  body.fpsj-theme .fpsj-footer .fpsj-footer__site {
    display:contents!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__site .fpsj-footer__nav {
    grid-column:auto!important;
    min-width:0!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__search {
    grid-column:1 / -1!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 42px!important;
    align-items:center!important;
    width:100%!important;
    max-width:none!important;
    height:44px!important;
    margin-top:.15rem!important;
    border-radius:10px!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__search input {
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    padding-inline:.8rem!important;
    font-size:16px!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__search button {
    width:40px!important;
    height:40px!important;
    margin:auto 2px auto 0!important;
    border-radius:8px!important;
  }

  body.fpsj-theme .fpsj-footer .fpsj-footer__search svg {
    width:18px!important;
    height:18px!important;
  }
}
