/**
 * Live Stats — スマホ完成版（≤960px）
 * 3秒理解 · 横スクロール禁止 · カード最小
 */

@media (max-width: 960px) {
  html,
  body,
  #liver-shell,
  .main.liver-main {
    overflow-x: hidden;
    max-width: 100vw;
  }

  #liver-shell.mobile-tab-mode .main.liver-main {
    padding: 2.5rem 0.55rem calc(6.5rem + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }

  #liver-shell.mobile-tab-mode .home-dashboard {
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
  }

  /* ── ホーム: 4指標を大きく ── */
  .home-dashboard {
    gap: 0.45rem;
    padding-bottom: 0.15rem;
  }

  .home-block {
    padding: 0.5rem 0.55rem;
  }

  .home-block__title {
    font-size: 0.76rem;
  }

  .home-pk-summary-grid {
    gap: 0.3rem;
  }

  .home-pk-summary__value {
    font-size: 0.72rem;
  }

  .home-gifter-row__diamonds {
    font-size: 0.65rem;
  }

  .home-profile-strip {
    padding: 0.25rem 0 0.35rem;
  }

  .home-profile-strip__avatar {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.05rem;
  }

  .home-profile-strip__name {
    font-size: 1rem;
  }

  .home-profile-strip__handle {
    font-size: 0.68rem;
  }

  .home-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .home-stat-card--diamond {
    border-color: rgba(59, 130, 246, 0.32);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.18), rgba(18, 22, 34, 0.95));
  }

  .home-stat-card--pk {
    border-color: rgba(168, 85, 247, 0.32);
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.18), rgba(18, 22, 34, 0.95));
  }

  .home-stat-card--streak {
    border-color: rgba(251, 146, 60, 0.32);
    background: linear-gradient(145deg, rgba(251, 146, 60, 0.16), rgba(18, 22, 34, 0.95));
  }

  .home-stat-card--gifter {
    border-color: rgba(34, 197, 94, 0.28);
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.14), rgba(18, 22, 34, 0.95));
  }

  .home-stat-card__label {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
  }

  .home-stat-card__value {
    margin-top: 0.28rem;
    font-size: clamp(1.15rem, 5.5vw, 1.45rem);
  }

  .home-stat-card__value--name {
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .home-stat-card__sub {
    font-size: 0.58rem;
    margin-top: 0.2rem;
  }

  /* ── PK戦績 ── */
  #liver-shell.mobile-tab-mode #battle-pk-section .pk-legacy,
  #liver-shell.mobile-tab-mode #battle-pk-section .chart-grid,
  #liver-shell.mobile-tab-mode #battle-pk-section .liver-dual-grid,
  #liver-shell.mobile-tab-mode #battle-pk-section .career-strip {
    display: none !important;
  }

  .pk-page {
    gap: 0.65rem;
  }

  .pk-career,
  .pk-recent,
  .pk-opponents {
    padding: 0.55rem 0.6rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .pk-page__title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
  }

  .pk-career__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .pk-opponents {
    border-color: rgba(124, 58, 237, 0.2);
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.08), rgba(255, 255, 255, 0.02));
  }

  .pk-opponents .pk-page__title {
    color: #e9d5ff;
  }

  .pk-career__cell {
    padding: 0.55rem 0.35rem;
  }

  .pk-career__label {
    font-size: 0.58rem;
  }

  .pk-career__value {
    font-size: 0.95rem;
    margin-top: 0.2rem;
  }

  .pk-recent-row,
  .pk-opponent-row {
    padding: 0.55rem 0.6rem;
  }

  .pk-recent-row__vs {
    font-size: 0.8rem;
  }

  .pk-opponent-row__name {
    font-size: 0.8rem;
  }

  /* ── ギフト分析 ── */
  .gift-page {
    gap: 0.55rem;
  }

  .gift-page__head {
    margin-bottom: 0.15rem;
  }

  .gift-page__title {
    font-size: 0.88rem;
  }

  .gift-total-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(236, 72, 153, 0.3);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.16), rgba(124, 58, 237, 0.1));
  }

  .gift-total-banner__label {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
  }

  .gift-total-banner__value {
    margin: 0.15rem 0 0;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: #f9a8d4;
  }

  .gift-total-banner__month {
    margin: 0;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: right;
  }

  .gift-hero-row {
    gap: 0.45rem;
  }

  .gift-hero-card {
    padding: 0.65rem 0.7rem;
    min-height: 4.5rem;
  }

  .gift-hero-card__label {
    font-size: 0.62rem;
  }

  .gift-hero-card__name {
    font-size: 0.92rem;
    margin-top: 0.2rem;
  }

  .gift-hero-card__meta {
    font-size: 0.68rem;
  }

  .gift-panel {
    padding: 0.55rem 0.6rem;
  }

  .gift-panel__title {
    font-size: 0.8rem;
  }

  .gift-rank-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
  }

  .gift-rank-row__rank {
    font-size: 0.72rem;
    font-weight: 700;
    color: #c4b5fd;
    min-width: 2rem;
  }

  .gift-rank-row__name,
  .gift-history-row__gifter {
    font-size: 0.8rem;
  }

  .gift-rank-row__diamonds,
  .gift-history-row__diamonds {
    font-size: 0.78rem;
  }

  /* ── リーグ: ホーム段階ラダー（home-mock.css でスタイル） ── */

  /* ── ギフト: 推移は STEP1 対象外 ── */
  .gift-panel--trend {
    display: none !important;
  }

  /* ── PK/VS: セクションヘッダー非表示 ── */
  #liver-shell.mobile-tab-mode #battle-section.mobile-view--pk .liver-section__head,
  #liver-shell.mobile-tab-mode #battle-section.mobile-view--vs .liver-section__head {
    display: none !important;
  }

  #liver-shell.mobile-tab-mode .gift-page__head {
    display: none;
  }

  /* ── ホーム以外の成長残骸 ── */
  #liver-shell.mobile-tab-mode #growth-level-section,
  #liver-shell.mobile-tab-mode #daily-missions-section,
  #liver-shell.mobile-tab-mode #ai-coach-teaser,
  #liver-shell.mobile-tab-mode #league-section:not(.is-active) {
    display: none !important;
  }

  /* ── デスクトップ残骸を隠す ── */
  #liver-shell.mobile-tab-mode #accuracy-section,
  #liver-shell.mobile-tab-mode .accuracy-section__link,
  #liver-shell.mobile-tab-mode .dash-header__welcome,
  #liver-shell.mobile-tab-mode .dash-date,
  #liver-shell.mobile-tab-mode .dash-sync,
  #liver-shell.mobile-tab-mode .growth-header__eyebrow,
  #liver-shell.mobile-tab-mode #dash-page-title,
  #liver-shell.mobile-tab-mode .liver-section__desc,
  #liver-shell.mobile-tab-mode .liver-section__badge,
  #liver-shell.mobile-tab-mode #stream-history-section,
  #liver-shell.mobile-tab-mode #badge-collection-section,
  #liver-shell.mobile-tab-mode #ai-coach-section,
  #liver-shell.mobile-tab-mode #my-dashboard-section {
    display: none !important;
  }

  #liver-shell.mobile-tab-mode .growth-hero,
  #liver-shell.mobile-tab-mode #growth-level-section,
  #liver-shell.mobile-tab-mode #daily-missions-section,
  #liver-shell.mobile-tab-mode #ai-coach-teaser {
    display: none !important;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #liver-shell.mobile-tab-mode .mobile-tab-panel.is-active .table-wrap {
    display: none;
  }
}

@media (max-width: 380px) {
  .pk-career__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stat-card__value {
    font-size: 1.1rem;
  }
}
