/* DECKRISE mobile v2 — final cascade, shared by every game and account surface. */
@media (max-width: 720px) {
  :root { --mobile-gutter: 16px; }
  html { scroll-padding-top: 72px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

  /* Compact header + dependable six-destination bottom navigation. */
  .site-header {
    height: 62px;
    min-height: 62px;
    padding: 6px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    background: rgba(7, 7, 9, .96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  }
  .site-header > .brand { min-width: 0; }
  .site-header > .brand > img { display: block; width: 132px; height: 38px; object-fit: contain; object-position: left center; }
  .site-header .header-actions { gap: 4px; }
  .site-header .notification-button,
  .site-header .auth-button { width: 42px; height: 42px; min-height: 42px; flex: 0 0 42px; }
  .site-header nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 3px env(safe-area-inset-bottom);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, .45);
  }
  .site-header nav a {
    position: relative;
    min-height: 54px;
    padding: 4px 1px 0;
    font-size: clamp(7px, 2.2vw, 9px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.01em;
  }
  .site-header nav a.active { color: var(--rise, var(--acid)); background: linear-gradient(180deg, rgba(199,255,56,.08), transparent 72%); }
  .site-header nav .beta-tag {
    position: absolute !important;
    top: 8px;
    right: 2px;
    margin: 0 !important;
    padding: 2px 3px !important;
    font-size: 5px !important;
    letter-spacing: .02em !important;
  }

  /* Game picker reads as two clear, equal choices instead of a dense banner. */
  .public-game-portal { padding: 10px 10px 11px; gap: 7px; }
  .public-game-label { margin-bottom: 3px; }
  .public-game-link { min-height: 58px; padding: 9px 10px; border-radius: 10px; }
  .public-game-link > span strong { font-size: 9px; }
  .public-game-link > span small { display: none; }
  .public-game-link > b { font-size: 13px; }

  /* Homepage: quicker hierarchy, less dead space, cleaner podium. */
  .hero-copy { padding: 44px var(--mobile-gutter) 36px; }
  .hero h1, .meta-hero h1 { margin: 20px 0; font-size: clamp(40px, 12vw, 54px); line-height: .94; }
  .hero-description { font-size: 15px; line-height: 1.55; }
  .universal-search { margin-top: 22px; }
  .hero-actions { margin-top: 18px; }
  .hero-art { min-height: 340px; }
  .orbit-one { width: 410px; height: 410px; left: -6%; top: -3%; }
  .orbit-two { width: 270px; height: 270px; left: 17%; top: 10%; }
  .rank-card { width: 108px; height: 172px; padding: 11px; }
  .rank-1 { width: 136px; height: 207px; left: calc(50% - 68px); top: 18%; }
  .rank-2 { left: 2%; top: 31%; }
  .rank-3 { right: 2%; top: 34%; }
  .rank-card strong { font-size: 14px; }
  .rank-card small, .rank-card span, .podium-pilot-link { font-size: 7px !important; }
  .podium-art { inset: -10px -8px 52px !important; }
  .stat-ribbon { padding: 10px var(--mobile-gutter); }
  .stat-ribbon div { min-height: 72px; padding: 11px !important; }
  .stat-ribbon strong { font-size: 20px; }
  .stat-ribbon span { font-size: 8px; letter-spacing: .06em; }
  .home-summary, .home-journal { padding: 52px var(--mobile-gutter); }
  .home-summary h2, .section-heading h2 { font-size: clamp(38px, 12vw, 50px); }
  .finish-list div { min-height: 60px; padding: 14px 2px; }

  /* Tier rows prioritize archetype, share, and the primary action. */
  .meta-hero { padding: 45px var(--mobile-gutter) 30px; }
  .method-note, .tier-controls, .tier-list, .deck-toolbar, .deck-grid, .section-heading { margin-left: var(--mobile-gutter); margin-right: var(--mobile-gutter); }
  .tier-tabs { overflow-x: auto; display: flex; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .tier-tabs::-webkit-scrollbar { display: none; }
  .tier-tabs button { min-width: 44px; flex: 1 0 44px; }
  .tier-block { border: 1px solid var(--edge, #303038); border-radius: 13px; overflow: hidden; }
  .tier-label { border-radius: 0; }
  .tier-row { min-height: 108px; padding: 12px; }
  .archetype strong { font-size: 13px; white-space: normal; line-height: 1.15; }
  .archetype small { font-size: 8px; }
  .sig-art { width: 58px; height: 58px; border-radius: 8px; }
  .share-metric strong, .metric strong { font-size: 14px; }
  .view-decks { min-height: 42px; border-radius: 7px; }
  .deck-explorer { padding-top: 52px; }
  .deck-card { min-height: 190px; padding: 15px; border-radius: 10px; }

  /* Meta data stays legible without forcing horizontal page scroll. */
  .meta-overview-hero { padding: 48px var(--mobile-gutter) 34px; gap: 22px; }
  .meta-overview-hero h1 { font-size: clamp(42px, 13vw, 60px); }
  .meta-share-panel, .op-color-signal { grid-template-columns: 1fr; padding: 48px var(--mobile-gutter); gap: 24px; }
  .meta-donut { width: min(310px, 82vw); }
  .meta-legend article { min-height: 58px; padding: 0 13px; gap: 10px; }
  .meta-legend strong { font-size: 11px; }
  .meta-pulse-grid { grid-template-columns: 1fr; padding: 0 var(--mobile-gutter) 48px; }
  .meta-ranking { padding: 48px 0 64px; }
  .meta-ranking > div:last-child { margin: 0 var(--mobile-gutter); }
  .meta-ranking article { grid-template-columns: 28px minmax(0, 1fr) 54px; gap: 8px; padding: 0 11px; }
  .meta-ranking article > i, .meta-ranking article > a { display: none; }

  /* Detail pages: card art remains usable, lists stay dense and scannable. */
  .detail-hero { min-height: auto; }
  .detail-hero-art { min-height: 250px; position: relative; inset: auto; opacity: 1; order: 1; }
  .detail-hero-copy { order: 2; padding: 30px var(--mobile-gutter) 36px !important; }
  .detail-back { margin-bottom: 34px; }
  .detail-hero h1 { margin: 18px 0 28px; font-size: clamp(40px, 13vw, 58px); }
  .detail-stats { gap: 0; }
  .detail-stats div { padding: 12px 8px; }
  .pokemon-detail-art.pokemon-card-art { padding: 24px 5%; gap: 4px; }
  .pokemon-detail-art.pokemon-card-art :is(a,.pokemon-hero-card,.pokemon-profile-card) { width: min(31%, 145px); }
  .featured-list, .pilot-roster, .matchup-section, .pokemon-list-section, .pokemon-pilots-section { padding: 48px var(--mobile-gutter) !important; }
  .pokemon-deck-board { padding: 10px; }
  .pokemon-deck-board-head { gap: 16px; }
  .pokemon-deck-actions { width: 100%; gap: 8px; }
  .pokemon-deck-count { padding-right: 9px; }
  .pokemon-deck-count strong { font-size: 29px; }
  .pokemon-save-deck { min-height: 44px; }
  .pokemon-deck-shell { padding: 5px; }
  .pokemon-deck-shell .pokemon-60-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .pokemon-card-caption { padding: 4px 1px 1px; }
  .pokemon-card-caption strong { font-size: 6.5px; }
  .pokemon-card-caption small { display: none; }
  .pokemon-card-visual > b { min-width: 21px; height: 21px; top: 3px; left: 3px; font-size: 8px; }
  .pokemon-pilot-table { max-height: 560px; border-radius: 10px; }
  .pokemon-pilot-table article { grid-template-columns: 35px minmax(0,1fr) 58px 38px; gap: 8px; padding: 10px; }

  /* Player Lab: thumb-friendly tabs, forms and round rows. */
  .player-hq-hero { padding: 42px var(--mobile-gutter) 30px; }
  .player-hq-hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .player-hq-hero > button { width: 100%; justify-content: center; }
  .player-stat-ribbon { margin: 0 var(--mobile-gutter); transform: translateY(14px); }
  .player-stat-ribbon article { padding: 14px; }
  .player-tabs { position: sticky; top: 62px; z-index: 8; padding: 30px var(--mobile-gutter) 10px; background: rgba(10,10,13,.95); backdrop-filter: blur(14px); }
  .player-tabs button { min-height: 42px; padding: 10px 14px; }
  .player-tab-panel { padding: 24px var(--mobile-gutter) 64px; }
  .player-panel-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .player-panel-heading button { width: 100%; min-height: 44px; }
  .personal-deck-grid > article { padding: 15px; }
  .player-event-list article { gap: 10px; padding: 14px; }
  .match-history article { grid-template-columns: 32px minmax(0,1fr) 36px 24px; padding: 11px 9px; gap: 8px; }
  .round-composer > form { inset: 3vh 0 0; padding: 22px var(--mobile-gutter) calc(24px + env(safe-area-inset-bottom)); }
  .round-result-picker label { min-height: 76px; }

  /* Sheets and dialogs feel native instead of squeezed desktop boxes. */
  dialog { max-height: calc(100dvh - 8px); border-radius: 18px 18px 0 0; }
  .article-copy { padding-left: var(--mobile-gutter); padding-right: var(--mobile-gutter); }
  .auth-dialog { padding-left: 20px; padding-right: 20px; }
  .site-footer { padding: 36px var(--mobile-gutter); }
}

@media (max-width: 380px) {
  .site-header > .brand > img { width: 116px; }
  .site-header nav a { font-size: 7px; }
  .site-header nav .beta-tag { display: none !important; }
  .rank-card { width: 96px; }
  .rank-1 { width: 124px; left: calc(50% - 62px); }
  .pokemon-deck-shell .pokemon-60-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (hover: none) and (pointer: coarse) {
  .deck-card:hover, .blog-tile:hover, .pokemon-list-card:hover, .rank-card:hover { transform: none; }
  button, a, input, select { touch-action: manipulation; }
}
