/* ==========================================================================
   Mobile secondary nav — sticky under header (not bottom docks).
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --page-dock-h: 0px;
  }

  /* Match sections — subtle sticky strip under top nav */
  body.match-page .mp-subnav {
    position: sticky;
    top: calc(var(--pb-h, 3px) + var(--nav-h, 52px));
    z-index: 85;
    margin: 0 calc(-1 * var(--mp-pad, 16px)) 12px;
    padding: 8px var(--mp-pad, 16px);
    background: rgba(10, 22, 40, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  body.match-page .mp-subnav-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0;
  }

  body.match-page .mp-subnav-inner::-webkit-scrollbar {
    display: none;
  }

  body.match-page .mp-subnav-link {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
  }

  body.match-page .mp-subnav-link.is-active {
    color: #fff;
    background: rgba(0, 194, 203, 0.14);
    border-color: rgba(0, 194, 203, 0.35);
  }

  body.match-page .mp-subnav-text--full {
    display: inline;
  }

  body.match-page .mp-subnav-text--short {
    display: none;
  }

  body.match-page #overview,
  body.match-page #penalties,
  body.match-page #timeline,
  body.match-page #lineups,
  body.match-page #stats,
  body.match-page #momentum,
  body.match-page #insights,
  body.match-page #before-match,
  body.match-page #match-ai-root,
  body.match-page #discussion {
    scroll-margin-top: calc(var(--pb-h, 3px) + var(--nav-h) + 56px);
    scroll-margin-bottom: calc(var(--bottom-nav-total, calc(var(--bottom-nav-h) + max(34px, env(safe-area-inset-bottom, 0px)))) + 20px);
  }

  /* FanPicks / leaderboards — horizontal scroll under hero */
  body.fanpicks-page .fp-tabs,
  body.leaderboards-page .fp-tabs {
    position: sticky;
    top: var(--nav-h, 52px);
    z-index: 40;
    margin: 0 0 14px;
    padding: 8px 0;
    background: rgba(10, 22, 40, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.fanpicks-page .fp-tabs::-webkit-scrollbar,
  body.leaderboards-page .fp-tabs::-webkit-scrollbar {
    display: none;
  }

  body.fanpicks-page .fp-tab-text--full,
  body.leaderboards-page .fp-tab-text--full {
    display: inline;
  }

  body.fanpicks-page .fp-tab-text--short,
  body.leaderboards-page .fp-tab-text--short {
    display: none;
  }

  /* Profile / player tabs */
  body.profile-page .up-tabs,
  body.player-page .pl-tabs {
    position: sticky;
    top: var(--nav-h, 52px);
    z-index: 40;
    margin: 0 0 14px;
    padding: 8px 0;
    background: rgba(10, 22, 40, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.match-page #discussion .disc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  body.match-page #discussion .disc-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  body.match-page #discussion .disc-tab {
    width: 100%;
    text-align: center;
    padding: 8px 6px;
    font-size: 10px;
  }
}
