/* Lockon — simplified MOBILE homepage (2026-10-10). Loaded by index.html only.
   Desktop (>1100px) is untouched: every rule below is inside a max-width query, except the
   two mobile-only affordances (.hero-learn, .m-see-all) which are hidden by default.
   Order on stacked layouts: hero -> Live Activity -> Top Riders -> Top Hosts (bottom tab bar from ux-fixes.css).
   $LOCK market + holder rewards stay hidden until LOCK_MINT is configured (html.lock-launched, set in index.html). */

.hero-learn, .m-see-all { display: none; }

@media (max-width: 1100px) {
  body[data-page="home"] .content { display: flex; flex-direction: column; }
  body[data-page="home"] .content > .hero { order: 0; }
  body[data-page="home"] .content > .market-live-row { order: 1; }
  body[data-page="home"] .content > .holder-rewards { order: 2; }
  body[data-page="home"] .content > #top-riders { order: 3; }
  body[data-page="home"] .content > #explore { order: 4; }

  /* Live Activity first inside the market row (when $LOCK is live it follows below). */
  body[data-page="home"] .market-live-row .live-activity { order: -1; }

  /* Pre-$LOCK: hide $LOCK market + holder rewards (nothing to show yet). */
  html:not(.lock-launched) body[data-page="home"] #lock-market,
  html:not(.lock-launched) body[data-page="home"] #holder-rewards { display: none; }

  /* Entry tiles (Explore / Launch / Airdrop) duplicate the tab bar; Airdrop lives in More. */
  body[data-page="home"] .dest-grid { display: none; }

  /* Rank lists -> horizontal swipe cards */
  body[data-page="home"] .rank-section { margin-top: 8px; margin-bottom: 18px; }
  body[data-page="home"] .rank-section .section-h { align-items: center; flex-wrap: nowrap; gap: 12px; margin-bottom: 10px; }
  body[data-page="home"] .rank-section .pager,
  body[data-page="home"] .rank-section .tabs,
  body[data-page="home"] .rank-section .section-sub { display: none; }
  body[data-page="home"] .m-see-all {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; flex: none;
    border: 1px solid hsl(var(--border)); border-radius: 999px;
    font: 600 13px/1 var(--font-body); color: hsl(var(--foreground)); text-decoration: none;
  }
  body[data-page="home"] .m-see-all:focus-visible { outline: 2px solid hsl(var(--foreground)); outline-offset: 2px; }
  body[data-page="home"] .rank-section .rank-list {
    display: flex; grid-template-columns: none; gap: 10px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    margin: 0 -16px; padding: 2px 16px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  body[data-page="home"] .rank-section .rank-list::-webkit-scrollbar { display: none; }
  body[data-page="home"] .rank-section .mkt-card {
    flex: 0 0 min(62vw, 240px); scroll-snap-align: start;
    min-height: 176px; padding: 14px; gap: 6px; /* fixed floor: "—" placeholders and loaded values share one height */
  }
  /* Card = logo · ticker · market cap · 24h change. Details live on the token page (SOL buy). */
  body[data-page="home"] .rank-section .mkt-card .mkt-top-right,
  body[data-page="home"] .rank-section .mkt-card .mkt-pair,
  body[data-page="home"] .rank-section .mkt-card .mkt-community,
  body[data-page="home"] .rank-section .mkt-card .mkt-trade-on,
  body[data-page="home"] .rank-section .mkt-card .mkt-watermark,
  body[data-page="home"] .rank-section .mkt-card .mkt-vol { display: none; }
  body[data-page="home"] .rank-section .mkt-card .mkt-body { max-width: none; }
  body[data-page="home"] .rank-section .mkt-card .mkt-mc { font-size: 22px; margin-top: 4px; }
  body[data-page="home"] .rank-section .mkt-card .mkt-mc-label { display: none; }
  body[data-page="home"] .rank-section .mkt-card .mkt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-page="home"] .rank-section .mkt-card .mkt-foot { margin-top: 4px; }
  body[data-page="home"] .rank-section .mkt-card .mkt-foot .mkt-chg { font-weight: 700; }
}

@media (max-width: 768px) {
  /* Hero: headline + Launch CTA in the first screen; lead collapses to 2 lines + docs link. */
  body[data-page="home"] .hero { margin-bottom: 18px; }
  body[data-page="home"] .hero-copy > p[data-i18n-html="home.hero.lead"] {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    overflow: hidden; margin-bottom: 4px;
  }
  body[data-page="home"] .hero-learn {
    display: inline-block; margin: 0 0 14px; padding: 6px 2px;
    font: 600 14px/1.2 var(--font-body); color: hsl(var(--foreground));
    text-decoration: underline; text-underline-offset: 3px; text-decoration-color: hsl(var(--border));
  }
  body[data-page="home"] .hero-learn:focus-visible { outline: 2px solid hsl(var(--foreground)); outline-offset: 2px; border-radius: 4px; }
  body[data-page="home"] .hero-cta .btn { min-height: 44px; }
  /* FIRE demo a bit smaller (% based scene scales with the stage width). */
  body[data-page="home"] .hero-demo { width: min(80vw, 340px); }
  body[data-page="home"] .hero-host { margin-top: 4px; }
  body[data-page="home"] .live-activity { max-height: 300px; }
}

/* ---------- $LOCK panel on mobile (only when LOCK_MINT is set; otherwise hidden above) ---------- */
.lock-m-row { display: none; }
@media (max-width: 768px) {
  html.lock-launched body[data-page="home"] .lock-m-row {
    display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 8px;
  }
  .lock-m-brand { display: inline-flex; align-items: center; gap: 8px; color: hsl(var(--foreground)); text-decoration: none; font: 700 15px/1 var(--font-display, var(--font-body)); }
  .lock-m-brand img { width: 28px; height: 28px; border-radius: 50%; }
  .lock-m-price { font: 700 16px/1 var(--font-body); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lock-m-chg { font: 600 13px/1 var(--font-body); font-variant-numeric: tabular-nums; color: hsl(var(--secondary)); }
  .lock-m-chg[data-dir="up"] { color: hsl(142 70% 45%); }
  .lock-m-chg[data-dir="down"] { color: hsl(0 72% 58%); }
  .lock-m-trade { min-height: 36px; padding: 0 10px; gap: 6px; font-size: 13px; }
  .lock-m-toggle {
    display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 8px;
    border: 1px solid hsl(var(--border)); border-radius: 999px; background: none; cursor: pointer;
    color: hsl(var(--foreground)); font: 600 12px/1 var(--font-body);
  }
  .lock-m-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
  .lock-m-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .lock-m-toggle:focus-visible, .lock-m-trade:focus-visible, .lock-m-brand:focus-visible { outline: 2px solid hsl(var(--foreground)); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .lock-m-toggle svg { transition: none; } }

  /* Collapsed: only the compact row. Expanded: full panel below the row. */
  html.lock-launched body[data-page="home"] #lock-market { padding: 10px 12px; }
  html.lock-launched body[data-page="home"] #lock-market:not(.is-m-open) > :not(.lock-m-row) { display: none; }
  html.lock-launched body[data-page="home"] #lock-market.is-m-open > .lock-m-row { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid hsl(var(--border)); }

  /* Stats grid: label directly above its value in each cell (3 columns). The header row and value row
     become grid items of one grid (display: contents) and each pair is placed into the same cell. */
  body[data-page="home"] #lock-market .lock-ticker {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; row-gap: 2px; overflow: visible;
  }
  body[data-page="home"] #lock-market .lock-ticker-row { display: contents; }
  body[data-page="home"] #lock-market .lock-ticker-row > * {
    min-width: 0; padding: 0; text-align: left; justify-self: stretch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body[data-page="home"] #lock-market .lock-ticker-head > * { font-size: 11px; color: hsl(var(--secondary)); padding-top: 8px; }
  body[data-page="home"] #lock-market .lock-ticker-body > * { font-size: 15px; font-weight: 700; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(1), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(1) { grid-column: 1; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(2), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(2) { grid-column: 2; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(3), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(3) { grid-column: 3; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(4), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(4) { grid-column: 1; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(5), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(5) { grid-column: 2; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(6), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(6) { grid-column: 3; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(7), body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(7) { grid-column: 1; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(-n+3) { grid-row: 1; }
  body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(-n+3) { grid-row: 2; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(n+4):nth-child(-n+6) { grid-row: 3; }
  body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(n+4):nth-child(-n+6) { grid-row: 4; }
  body[data-page="home"] #lock-market .lock-ticker-head > :nth-child(7) { grid-row: 5; }
  body[data-page="home"] #lock-market .lock-ticker-body > :nth-child(7) { grid-row: 6; }
}
@media (max-width: 768px) {
  /* Compact row fits 360px: logo-only brand + chevron-only toggle (text kept for screen readers). */
  .lock-m-brand strong, .lock-m-toggle span {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .lock-m-toggle { width: 36px; justify-content: center; padding: 0; }
  .lock-m-price { text-align: left; }
}
