/**
 * style.css  ─  全ページ共通スタイル（ゲームテーマ・ゴールドアクセント）
 *
 * 読み込み順:
 *   <link rel="stylesheet" href="/assets/css/common.css" />   ← レアリティ・ステータスバッジ
 *   <link rel="stylesheet" href="/style.css" />               ← 本ファイル（トークン・base・UI）
 *   <style> … </style>                                        ← ページ固有スタイル
 *
 * ─────────────────────────────────────────────────────
 * CSS 変数（旧名 → 新名 対応表）
 *
 *   旧: --bg / --surface / --surface2 / --surface3
 *   新: --bg / --surface / --surface-2 / --surface-3   ← ハイフン区切りに統一
 *
 *   旧: --line / --border (ファイルによってどちらかが存在)
 *   新: --border / --border-2                          ← --line 廃止
 *
 *   旧: --r / --r2 / --r3 / --radius / --radius-sm /
 *       --radius-md / --radius-lg / --r-md / --r-lg /
 *       --radius-xl / --radius-sm(8px)
 *   新: --radius-xl(18px) / --radius-lg(14px) /
 *       --radius-md(10px) / --radius-sm(8px)           ← 4段階に統一
 *
 *   旧: --accent（ページによってゴールドまたはブルー）
 *   新: --gold（ゴールドアクセント） / --blue（ブルー、補助色）
 *
 * ─────────────────────────────────────────────────────
 * 移行チェックリスト（各 HTML の <style> から削除してよいもの）
 *
 *   □ :root { --bg … } ブロック全体
 *   □ *, *::before, *::after { box-sizing … } リセット
 *   □ body { background / color / font-family / min-height }
 *   □ a { color: inherit; text-decoration: none; }
 *   □ nav { … } / nav a { … } / nav a.active { … }
 *   □ .site-header { … } / .back-link { … }
 *   □ .container { … }  ← max-width のみ各ページで上書き
 *   □ .btn-primary / .btn-secondary / .btn-ghost / .btn-danger
 *   □ .state-box / .empty-box / .loading-box / .loading-text
 *   □ #toast / #toast.show  ← AppUI が自動生成するため不要
 *   □ レアリティバッジ色  → common.css に統合済み
 *   □ ステータスバッジ色  → common.css に統合済み
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&display=swap');


/* ═══════════════════════════════════════════════════════
   1. CSS 変数
   ═══════════════════════════════════════════════════════ */

:root {
  /* ── 背景・サーフェス ── */
  --bg:        #0d1117;
  --surface:   #111620;
  --surface-2: #181e2c;
  --surface-3: #1e2538;

  /* ── テキスト ──
     可読性・アクセシビリティ調整により、当初値（--text:#e8eaf0 / --muted:#8b93a8 /
     --muted-2:#5c6478）から本文が読みやすいコントラストへ引き上げ済み。 */
  --text:   #f2f4f8;
  --muted:  #b8c0d2;
  --muted-2: #9ea8bd;

  /* ── ボーダー ── */
  --border:   #2a3045;
  --border-2: #1e2538;
  --line:     var(--border);   /* レガシー互換（battle.js 等） */

  /* ── アクセントカラー ── */
  --gold:        #d4a843;          /* プライマリアクセント（ゲーム感） */
  --gold-dim:    rgba(212,168,67,.15);
  --gold-bright: #f0c060;          /* ホバー・強調用 */
  --blue:        #2563eb;          /* セカンダリアクセント */
  --blue-dim:    rgba(37,99,235,.15);

  /* ── セマンティックカラー ── */
  --green:    #22c55e;
  --green-dim: rgba(34,197,94,.15);
  --red:      #ef4444;
  --red-dim:  rgba(239,68,68,.15);
  --orange:   #f97316;
  --purple:   #7c3aed;
  /* --yellow は廃止。var(--gold) を使用すること */

  /* ── レアリティカラー（common.css の .badge-* / .rarity-badge-* と
       gacha_result.html の .rarity-* が共通で参照する） ── */
  --rarity-n-bg:      rgba(107,114,128,0.2);
  --rarity-n-fg:      #9ca3af;
  --rarity-r-bg:      rgba(37,99,235,0.2);
  --rarity-r-fg:      #93c5fd;
  --rarity-sr-bg:     rgba(124,58,237,0.2);
  --rarity-sr-fg:     #c4b5fd;
  --rarity-ssr-bg:    rgba(234,179,8,0.2);
  --rarity-ssr-fg:    #fde047;
  --rarity-legend-bg: rgba(239,68,68,0.2);
  --rarity-legend-fg: #fca5a5;

  /* ── 角丸 ── */
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm:  8px;

  /* ── シャドウ ── */
  --shadow:    0 8px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.25);
  --shadow-gold: 0 0 20px rgba(212,168,67,.12);

  /* ── レイアウト ── */
  --nav-height: 49px;   /* sticky nav の高さ。.tab-row の top オフセットに使用 */
  --content-max-width: 720px;
}


/* ═══════════════════════════════════════════════════════
   2. リセット & ベース
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  min-height: 100vh;
  /* 背景にごく淡いグリッドテクスチャ（ゲーム感） */
  background-image:
    linear-gradient(rgba(212,168,67,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,168,67,.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: inherit;
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════
   3. グローバルナビゲーション（トップ）
      nav.js が付与する .site-top-nav のみ対象。
      ボトムナビ（.site-bottom-nav）はセクション 20 を参照。
   ═══════════════════════════════════════════════════════ */

nav.site-top-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 20;
}

nav.site-top-nav::-webkit-scrollbar { display: none; }

nav.site-top-nav > a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 14px 12px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

nav.site-top-nav > a:hover {
  color: var(--text);
}

nav.site-top-nav > a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ログアウトボタン(nav.jsが生成する<button>)をナビリンクと同じ見た目に揃える(20260723) */
nav.site-top-nav > button.site-nav-logout {
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 14px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
nav.site-top-nav > button.site-nav-logout:hover {
  color: var(--text);
}
nav.site-top-nav > button.site-nav-logout:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* 管理画面リンク(管理者のみ表示)。スマホでも隠さない(20260723) */
nav.site-top-nav > a.site-nav-admin {
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 14px 12px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
nav.site-top-nav > a.site-nav-admin:hover {
  color: var(--gold-bright, var(--gold));
}


/* ═══════════════════════════════════════════════════════
   4. サイトヘッダー（戻るボタン付き単ページ用）
      .site-header / .back-link / .header-title
   ═══════════════════════════════════════════════════════ */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header h1,
.header-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.back-link {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: color .2s;
  flex-shrink: 0;
}

.back-link:hover { color: var(--gold); }

/* グロナビありページ用：container 内の戻る＋タイトル（site-header 代替） */
.page-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 4px;
}

.page-top-bar h1,
.page-top-bar .header-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}


/* ═══════════════════════════════════════════════════════
   5. コンテナ
      max-width は各ページの <style> で上書きする
   ═══════════════════════════════════════════════════════ */

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 20px 16px;
}

#gachaActions,
.gacha-section {
  scroll-margin-top: calc(var(--nav-height, 49px) + 12px);
}

/* ═══════════════════════════════════════════════════════
   6. ボタン
   ═══════════════════════════════════════════════════════ */

/* ── 共通ベース ── */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: opacity .15s, background .15s, box-shadow .15s;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Gold プライマリ ── */
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8892e 100%);
  color: #0a0c10;
  box-shadow: 0 2px 8px rgba(212,168,67,.25);
}

.btn-primary:hover:not(:disabled) {
  opacity: .9;
  box-shadow: 0 4px 16px rgba(212,168,67,.35);
}

/* ── セカンダリ ── */
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--gold);
}

/* ── ゴースト ── */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
}

/* ── デンジャー ── */
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,.25);
}

/* ── フルワイド修飾子 ── */
.btn-block {
  display: flex;
  width: 100%;
}

/* ── サイズ修飾子 ── */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 20px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

/* ── .button（レガシー共通ボタン） ──
   mypage.js / menu.html / bundle_*.html 等で使用。
   itemshop.html の .button-primary / .button-muted もここで定義。 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 42px;
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, background .15s, transform .08s ease;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.button.success {
  background: var(--green);
  color: #0a0c10;
  border-color: transparent;
}

.button.danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,.3);
}

.button.primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8892e 100%);
  color: #0a0c10;
  border-color: transparent;
}

.button-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb, #3b82f6);
  color: #fff;
  border-color: transparent;
}

.button-muted {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border);
}

/* ── ローディングスピナー ── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════
   7. パネル・カード
   ═══════════════════════════════════════════════════════ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}

/* ゴールドボーダーのハイライトパネル */
.panel-gold {
  background: var(--surface);
  border: 1px solid rgba(212,168,67,.35);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-gold);
}


/* ═══════════════════════════════════════════════════════
   8. ステート表示（ローディング / 空 / エラー）
      .state-box / .empty-box / .loading-box / .loading-text / .error-box
   ═══════════════════════════════════════════════════════ */

.state-box,
.empty-box,
.loading-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.empty-box {
  border-style: dashed;
}

.loading-box,
.loading-text {
  animation: pulse 1.6s ease-in-out infinite;
}

.loading-text {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

.error-box {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.error-box a { color: var(--gold); }

/* ─── メッセージボックス（.msg-box） ─────────────────────────────────────────
   各ページの <style> に個別定義していたものを統一。
   HTML 側の .msg-box 定義は削除してよい。
   ファイル固有のスタイルがある場合のみ HTML 側に追記すること。
──────────────────────────────────────────────────────────────────────────── */
.msg-box {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 12px;
}
.msg-box.show    { display: block; }
.msg-box.error   { color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.msg-box.success { color: #86efac; border-color: rgba(34,197,94,0.35); }
.msg-box.info    { color: #93c5fd; border-color: rgba(59,130,246,0.4); }



/* ═══════════════════════════════════════════════════════
   9. フォーム要素
   ═══════════════════════════════════════════════════════ */

.form-input,
.toolbar-search,
.toolbar-select,
.price-input,
.bid-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .2s;
}

.form-input:focus,
.toolbar-search:focus,
.toolbar-select:focus,
.price-input:focus,
.bid-input:focus {
  outline: none;
  border-color: var(--gold);
}

.form-input::placeholder,
.toolbar-search::placeholder {
  color: var(--muted-2);
}

/* select のデフォルト矢印を維持しつつ色を合わせる */
.toolbar-select,
select.form-input {
  cursor: pointer;
  appearance: auto;
  color-scheme: dark;
}


/* ═══════════════════════════════════════════════════════
   10. ページネーション
    .pagination / .pager 共通
   ═══════════════════════════════════════════════════════ */

.pagination,
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button,
.pager button,
.btn-page {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.pagination button:hover:not(:disabled),
.pager button:hover:not(:disabled),
.btn-page:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--gold);
}

.pagination button:disabled,
.pager button:disabled,
.btn-page:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.pager-info {
  font-size: 12px;
  color: var(--muted);
}


/* ═══════════════════════════════════════════════════════
   11. バッジ（共通シェル）
       色は common.css の .badge-N など
   ═══════════════════════════════════════════════════════ */

.badge,
.rarity-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════
   12. サマリーカード（統計表示）
   ═══════════════════════════════════════════════════════ */

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--gold);
}

.summary-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

@media (max-width: 860px) {
  .summary-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .summary-row { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════
   13. メディア（画像・動画サムネイル）
   ═══════════════════════════════════════════════════════ */

.media {
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* audio media_type: サムネイル領域にプレーヤーを表示 */
.media audio {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
}

/* audio 用フォールバック背景（波形プレースホルダー） */
.media-audio-bg {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  color: var(--muted);
  font-size: 28px;
  letter-spacing: 2px;
}

.media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  letter-spacing: .05em;
}

.media-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════
   14. ヒーローセクション
   ═══════════════════════════════════════════════════════ */

.hero {
  background: linear-gradient(135deg, var(--gold-dim), var(--blue-dim));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-gold);
}

.hero h2 {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
  color: var(--gold-bright);
}

.hero p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}


/* ═══════════════════════════════════════════════════════
   15. 価格表示
   ═══════════════════════════════════════════════════════ */

.price-value,
.price-main {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: -0.5px;
}

.price-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}


/* ═══════════════════════════════════════════════════════
   16. タブ
   ═══════════════════════════════════════════════════════ */

.tab-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: var(--nav-height, 49px);   /* nav の高さ分オフセット */
  z-index: 9;
}

.tab-btn {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ═══════════════════════════════════════════════════════
   17. モーダル / オーバーレイ
   ═══════════════════════════════════════════════════════ */

.modal-overlay,
.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open,
.result-overlay.open {
  display: flex;
}

.modal-box,
.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow), var(--shadow-gold);
}

/* ── オンボーディング ── */
.onboarding-box { max-width: 480px; }
.onboarding-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(212,168,67,.35);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}
.onboarding-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.3;
}
.onboarding-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.onboarding-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.onboarding-step-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.onboarding-step-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}
.onboarding-step-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-guide-link {
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.onboarding-skip {
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
}


/* ═══════════════════════════════════════════════════════
   18. ユーティリティ
   ═══════════════════════════════════════════════════════ */

/* テキスト */
.text-muted   { color: var(--muted); }
.text-gold    { color: var(--gold); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.font-bold    { font-weight: 700; }
.font-black   { font-weight: 900; }

/* スペーシング */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* フレックス */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* 区切り線 */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* 表示切り替え（AppUI / battle.js / market_mode_switch.html 等で使用） */
.is-hidden { display: none !important; }
.is-flex   { display: flex !important; }
.is-block  { display: block !important; }


/* ═══════════════════════════════════════════════════════
   19. レスポンシブ
   ═══════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .container {
    padding: 16px 12px;
  }

  nav.site-top-nav > a { padding: 12px 10px; font-size: 12px; }

  .modal-box,
  .result-box { padding: 18px; }
}

/* ─── ステータスドット・アイコン ──────────────────────────────────────────────
   絵文字の代替として使用するCSSシンボル。
──────────────────────────────────────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.5); }
.dot-blue   { background: var(--blue);  box-shadow: 0 0 6px rgba(37,99,235,.4); }
.dot-gold   { background: var(--gold);  box-shadow: 0 0 6px rgba(212,168,67,.4); }
.dot-red    { background: var(--red);   box-shadow: 0 0 6px rgba(239,68,68,.4); }
.dot-muted  { background: var(--muted); }

/* ロックアイコン（鍵マーク絵文字の代替） */
.icon-lock {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: var(--muted);
  border-radius: 3px;
  position: relative;
  margin: 0 auto;
}
.icon-lock::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 8px;
  border: 2px solid var(--muted);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
}

/* サイトシンボル（⚔ の代替。ゲームタイトルロゴ用） */
.site-symbol {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   20. スマホボトムナビ
   ═══════════════════════════════════════════════════════ */

/* デフォルトは非表示。720px以下でトップナビリンクを隠し、ボトムナビを表示 */
.site-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  height: calc(56px + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(10, 11, 15, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
}

.site-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 2px;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.site-bottom-nav a .site-bottom-icon {
  font-size: 20px;
  line-height: 1;
}

/* 共通アイコン（menu / index / card_growth 等） */
.app-icon,
.menu-icon,
.header-action-btn .btn-icon {
  font-size: 26px;
  line-height: 1;
  display: inline-block;
}

.menu-card.wide .menu-icon {
  font-size: 26px;
}

.btn-nav .app-icon {
  font-size: 16px;
  margin-right: 4px;
  vertical-align: middle;
}

.site-bottom-nav a.active {
  color: var(--gold);
}

.site-bottom-nav a:hover {
  color: var(--text);
}

/* ボトムナビ分のpadding（コンテンツが隠れないよう）*/
body.has-bottom-nav {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
}

@media (max-width: 720px) {
  /* トップナビのリンク群を隠し、残高チップのみ表示 */
  nav.site-top-nav {
    justify-content: flex-end;
    padding: 8px 12px;
    min-height: auto;
  }

  nav.site-top-nav > a:not(.site-nav-wallet):not(.site-nav-ticket):not(.site-nav-admin):not(.site-nav-menu) {
    display: none;
  }

  .site-bottom-nav {
    display: flex;
  }

  body.has-bottom-nav {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
  }
}

/* ── トップナビ残高チップ（nav.js injectWalletBadge が生成） ── */
.site-nav-wallet {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold, #d4a843);
  background: var(--gold-dim, rgba(212, 168, 67, 0.15));
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  margin-left: 8px;
  border-bottom: none !important;
}
.site-nav-wallet:hover {
  background: var(--gold-bright, #f0c060);
  color: #1a1a2e;
}
.site-nav-ticket {
  color: var(--blue, #5b9bd5);
  background: rgba(91, 155, 213, 0.15);
}
.site-nav-ticket:hover {
  background: var(--blue, #5b9bd5);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   21. 可読性・アクセシビリティ調整
   ChatGPTチャット相当の本文サイズを基準に、補足文も小さくなりすぎないよう統一。
   カラー変数（--text / --muted / --muted-2）はセクション1の :root に統合済み。
   ═══════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: 16px;
  line-height: 1.7;
}

/* 本文・説明・入力項目は16pxを標準にする */
p,
li,
dt,
dd,
label,
input,
select,
textarea,
button,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.msg-box,
.state-box,
.empty-box,
.loading-box,
.loading-text {
  font-size: 16px;
}

/* 小文字指定でも可読性を落とさない */
small,
.text-sm,
.text-xs,
.hint,
.note,
.help,
.caption,
.meta,
.sub,
.subtext,
.description,
.muted,
[class*="hint"],
[class*="caption"],
[class*="meta"] {
  font-size: 14px;
  line-height: 1.65;
}

nav.site-top-nav > a,
.site-nav-wallet {
  font-size: 14px;
}

.site-header h1,
.header-title,
.page-top-bar h1,
.page-top-bar .header-title {
  font-size: 18px;
}

/* ページ固有CSSで薄く指定された補助文字も共通トークンへ寄せる */
.muted,
.text-muted,
.sub,
.subtext,
.description,
.hint,
.note,
.help,
.caption,
.meta,
small {
  color: var(--muted);
}

::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: .72;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  nav.site-top-nav > a,
  .site-nav-wallet {
    font-size: 14px;
  }
}

/* ═══════════════════════════════════════════════════════
   22. カード本文の可読性
   説明本文まで muted 系クラスで薄くならないよう、カード内では本文色へ戻す。
   日時・件数などのメタ情報（.meta / .caption / small）は従来どおり補助色を維持する。
   ═══════════════════════════════════════════════════════ */
:where(.card, .panel, .panel-gold, .summary-card, .onboarding-step)
:where(p, li, dd, .description, .sub, .subtext, .hint, .note, .help, .muted, .text-muted) {
  color: var(--text);
}

/* カード内でも補助情報として薄くしてよい要素 */
:where(.card, .panel, .panel-gold, .summary-card, .onboarding-step)
:where(.meta, .caption, small) {
  color: var(--muted);
}

