*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ===========================================
   デザイントークン（v3 BLUE LIGHT — 白基調×ロイヤルブルー）
   - 背景：オフ白＋淡グレー
   - メインアクセント：ロイヤルブルーのグラデーション
   - 赤は「勝敗・警告・メコドツ」など限定用途で残す
   =========================================== */
:root {
  /* ---- 面（Surfaces）---- 白3階調 */
  --bg-base:    #F4F7FA;   /* ベース: オフ白（空のような） */
  --bg-deep:    #EAEEF3;   /* 旧キー互換: 淡グレー */
  --bg-card:    #FFFFFF;   /* カード面: 純白 */
  --bg-raise:   #FFFFFF;   /* 持ち上げ面 */
  --bg-warm:    #EAEEF3;   /* 押下時 */
  --bg-surface: #FFFFFF;   /* 旧キー互換 */

  /* ---- 文字（Ink）---- 紺墨ベース */
  --ink-deep:   #0E1A2E;   /* 見出し: 紺墨 */
  --ink-body:   #2A3548;   /* 本文 */
  --ink-mute:   #8590A3;   /* 補助・キャプション */
  --ink-0:      #0E1A2E;   /* 旧キー互換 */
  --ink-1:      #0E1A2E;   /* 旧キー互換 */
  --ink-muted:  rgba(14,26,46,0.60);
  --ink-faint:  rgba(14,26,46,0.40);

  /* ---- 罫（Lines）---- 細罫 */
  --line-soft:  rgba(14,26,46,0.06);
  --line-hair:  rgba(14,26,46,0.12);
  --line-firm:  rgba(14,26,46,0.22);

  /* ---- メインアクセント（青）---- ロイヤルブルー */
  --accent:     #2B5FBC;
  --accent-2:   #3D7AE8;   /* グラデーションの明るい側 */
  --accent-dim: rgba(61,122,232,0.10);
  --accent-line:rgba(61,122,232,0.35);
  --accent-soft:#93B5F0;   /* バー・補助色 */
  --accent-grad:linear-gradient(135deg, #3D7AE8 0%, #2B5FBC 100%);

  /* ---- 警告・勝敗用（赤、限定使用）---- */
  --warn:       #E4002B;   /* 勝利バッジ・削除・警告 */
  --warn-dim:   rgba(228,0,43,0.08);
  --warn-line:  rgba(228,0,43,0.35);

  /* ---- 旧キーの互換エイリアス（他画面が参照し続けるため必須）---- */
  --latte:      #2B5FBC;
  --latte-dim:  rgba(61,122,232,0.10);
  --latte-line: rgba(61,122,232,0.35);
  --energy:     #2B5FBC;
  --mint:       #6B7A5A;
  --score-red:  #E4002B;   /* メコドツ赤丸（変更なし） */

  /* ---- タイポ ---- 新聞組版（極太Sans＋セリフ見出し＋モノ数字）*/
  --font-display: "Helvetica Neue", "Inter", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-body:    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, sans-serif;
  --font-mono:    "SF Mono", "JetBrains Mono", ui-monospace, "Menlo", "Consolas", monospace;
  --font-serif:   "Times New Roman", "Noto Serif JP", "Yu Mincho", serif;

  /* Radius（新聞風に鋭角寄り） */
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
}

html, body {
  width: 100%; min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg-base); color: var(--ink-body); font-size: 14px;
  touch-action: manipulation;
}

/* ページ遷移 */
.page { display: none; }
.page.active { display: block; }

/* ===========================================
   ホーム画面 — MUJI路線（生成り・墨・一本の赤）
   =========================================== */
.home-page.active {
  background: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 32px;
  position: relative;
}
/* 上部の静かな罫 */
.home-page.active::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--line-hair);
  opacity: 1;
}

.home-header {
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
  max-width: 420px;
  padding: 18px 0 20px;
  border-top: 3px double var(--line-firm);
  border-bottom: 3px double var(--line-firm);
  position: relative;
}
/* PRESS題号: 上部キッカー "◆ KENDO JOURNAL" */
.home-header::before {
  content: "◆ KENDO · JOURNAL";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-base);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 700;
}
.home-header h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  color: var(--ink-deep);
  letter-spacing: -0.02em;
  line-height: 1;
  padding-left: 0;
}
.home-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.home-header::after { content: none; }

.home-menu {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: menu;
}

.home-menu-btn {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--line-firm);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease;
  overflow: hidden;
  counter-increment: menu;
}
/* 左端の赤の縦バー（常時表示・新聞風） */
.home-menu-btn::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
  opacity: 1;
  transition: width 0.15s ease;
}
/* 先頭の項目だけ赤塗り（主要CTA） */
.home-menu-btn:first-child {
  background: var(--ink-deep);
  color: var(--bg-base);
}
.home-menu-btn:first-child .menu-label,
.home-menu-btn:first-child .menu-desc { color: var(--bg-base); }
.home-menu-btn:first-child .menu-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.home-menu-btn:active {
  transform: scale(0.98);
  background: var(--bg-warm);
}
.home-menu-btn:first-child:active { background: #1d1d1f; }
.home-menu-btn:active::before { width: 8px; }

.menu-icon {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  font-weight: 400;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--bg-base);
  border: 1.5px solid var(--line-firm);
  color: var(--ink-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.menu-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--ink-deep);
  letter-spacing: -0.01em;
}
.menu-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
}

.home-footer {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 2px;
}

/* ===== スコア入力画面 下端固定CTA（v2 ネイビートーン） ===== */
.score-bottom-cta {
  position: fixed;
  /* グローバルタブナビ(実測81px)の上に重ねる */
  bottom: 82px;
  left: 0; right: 0;
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(10,26,47,0.92);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -4px 14px rgba(0,0,0,0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.score-bottom-cta .cta-primary { flex: 1; }
.score-bottom-cta .cta-primary {
  height: 42px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(43,95,188,0.30);
}
.score-bottom-cta .cta-primary:active { opacity: 0.88; transform: scale(0.985); }
.score-bottom-cta .cta-secondary {
  height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.1s;
}
.score-bottom-cta .cta-secondary:active {
  background: rgba(255,255,255,0.14);
  transform: scale(0.96);
}
.score-bottom-cta .cta-secondary .cta-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  color: rgba(255,255,255,0.95);
}
.score-bottom-cta .cta-secondary .cta-label {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
}
/* スコア入力画面のとき本体下に余白を確保（CTAバー + タブ両方分） */
#page-score.active { padding-bottom: 140px; }
#page-score.score-readonly .score-bottom-cta { display: none; }

/* ===== 戻るボタン ===== */
.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  margin-right: 6px;
  flex-shrink: 0;
}
.back-btn:active { opacity: 0.6; }

/* ===== 結果参照ページ ===== */
.history-content {
  padding: 12px;
}
/* 年フィルタータブ（横スクロール） */
.history-year-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 2px 12px;
  margin: 0 -2px 8px;
}
.history-year-tabs::-webkit-scrollbar { display: none; }
.history-year-tab {
  flex: 0 0 auto;
  background: var(--bg-card);
  color: var(--ink-body);
  border: 1.5px solid var(--line-firm);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  min-height: 44px;
  text-transform: uppercase;
}
.history-year-tab:active { opacity: 0.7; }
.history-year-tab.active {
  background: var(--accent);
  color: #FBF8F2;
  border-color: var(--accent);
  font-weight: 600;
}
.history-card {
  background: var(--bg-raise);
  border: 1px solid var(--line-hair);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.history-card:active { background: var(--bg-warm); }
.history-card-info { flex: 1; min-width: 0; }
.history-card-tournament {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-card-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}
.history-card-del {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 12px;
  flex-shrink: 0;
}
.history-card-del:active { background: var(--accent); color: #fff; }

/* 大会詳細モーダル */
.tournament-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,38,34,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.tournament-detail-sheet {
  background: var(--bg-raise);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(43,38,34,0.18);
}
.tournament-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.tournament-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
}
.tournament-detail-close {
  background: none;
  border: 1.5px solid var(--line-firm);
  border-radius: var(--r-sm);
  font-size: 20px;
  color: var(--ink-deep);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tournament-detail-close:active { background: var(--bg-warm); }
/* ⋮ メニュー（モーダルヘッダー右上） */
.tournament-detail-menu {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.tournament-detail-menu:active { background: rgba(13,13,15,0.08); }
.tournament-detail-menu .td-menu-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-deep);
  display: block;
}
/* ヘッダーは popover の基準にする */
.tournament-detail-header { position: relative; }

/* メニュー本体（ポップオーバー） */
.td-menu-popover {
  position: absolute;
  top: calc(100% - 4px);
  right: 8px;
  min-width: 160px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  overflow: hidden;
  z-index: 100;
  animation: tdMenuIn 0.14s ease-out;
}
@keyframes tdMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.td-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: transparent;
  font-family: 'Noto Sans JP', var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #0d0d0f;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(13,13,15,0.06);
}
.td-menu-item:last-child { border-bottom: none; }
.td-menu-item:active { background: rgba(13,13,15,0.04); }
.td-menu-ic {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}
.td-menu-item:last-child .td-menu-ic { color: var(--ink-mute); }
.tournament-detail-share:active { opacity: 0.7; }
.tournament-detail-body {
  overflow-y: auto;
  flex: 1;
  padding: 12px 16px 24px;
}
.tournament-match-item {
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--line-hair);
  border-radius: 0;
  padding: 8px 12px;
  margin-bottom: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 44px;
}
.tournament-match-item:first-child {
  border-radius: 8px 8px 0 0;
}
.tournament-match-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}
.tournament-match-item:only-child {
  border-radius: 8px;
}
.tournament-match-item:active { background: var(--bg-warm); }
.tournament-match-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  min-width: 36px;
  flex-shrink: 0;
}
.tournament-match-teams {
  flex: 1;
  font-size: 13px;
  color: var(--ink-body);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tournament-match-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.tournament-match-arrow {
  color: var(--line-firm);
  margin-left: 2px;
  font-size: 14px;
  flex-shrink: 0;
}
.match-video-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  flex-shrink: 0;
  background: none;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.match-video-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  font-size: 16px;
  flex-shrink: 0;
  color: rgba(13,13,15,0.4);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.15s, background 0.15s;
}
.match-video-add-btn:active {
  background: rgba(13,13,15,0.06);
  color: var(--accent);
}
/* タップ領域を 44pt 以上に拡張（視覚サイズは保ちつつ親要素より優先） */
.match-video-add-btn::after {
  content: "";
  position: absolute;
  inset: -6px;
  /* 透明なタッチエリア */
}

/* ===== 動画URL入力モーダル（MUJIトーン） ===== */
.video-url-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,38,34,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.video-url-sheet {
  width: 100%;
  max-width: 360px;
  background: var(--bg-raise);
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 40px rgba(43,38,34,0.18);
  overflow: hidden;
  animation: videoUrlIn 0.18s ease-out;
}
@keyframes videoUrlIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.video-url-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.video-url-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-deep);
  letter-spacing: 2px;
}
.video-url-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-mute);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-url-close:active { color: var(--ink-deep); }
.video-url-body {
  padding: 16px;
}
.video-url-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.video-url-input {
  width: 100%;
  min-height: 44px;
  background: var(--bg-base);
  border: 1px solid var(--line-hair);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink-deep);
  outline: none;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
}
.video-url-input::placeholder { color: var(--ink-faint); }
.video-url-input:focus { border-color: var(--accent); }
.video-url-hint {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 8px;
  letter-spacing: 0.3px;
}
.video-url-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
}
.video-url-cancel,
.video-url-save {
  flex: 1;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
}
.video-url-cancel {
  background: var(--bg-raise);
  color: var(--ink-body);
  border: 1px solid var(--line-firm);
}
.video-url-cancel:active { background: var(--bg-warm); }
.video-url-save {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.video-url-save:active { opacity: 0.85; }

/* ===== 動画アクションシート（再生／挿入／削除）MUJIトーン ===== */
.video-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,38,34,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.video-action-sheet {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border-radius: var(--r-sm);
  border: 2px solid var(--ink-deep);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: videoUrlIn 0.18s ease-out;
}
.video-action-header {
  padding: 14px 20px;
  border-bottom: 2px solid var(--ink-deep);
  text-align: center;
}
.video-action-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-deep);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.video-action-body {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}
.video-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.12s ease;
}
.video-action-btn:last-child { border-bottom: none; }
.video-action-btn:active {
  background: var(--bg-warm);
}
.video-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  flex-shrink: 0;
  font-family: var(--font-body);
}
.video-action-label {
  flex: 1;
}
/* 個別カラー */
.video-action-play .video-action-icon { color: var(--accent); }
.video-action-play .video-action-label { color: var(--accent); }
.video-action-edit .video-action-icon { color: var(--ink-deep); }
.video-action-edit .video-action-label { color: var(--ink-deep); }
.video-action-delete .video-action-icon { color: var(--accent); opacity: 0.6; }
.video-action-delete .video-action-label { color: var(--accent); opacity: 0.6; }
.video-action-delete:active .video-action-icon,
.video-action-delete:active .video-action-label {
  opacity: 1;
}

.video-action-footer {
  padding: 8px 16px 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: center;
}
.video-action-close {
  background: var(--ink-deep);
  color: var(--bg-base);
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 14px 24px;
  min-height: 48px;
  cursor: pointer;
  display: block;
  width: 100%;
  border-radius: 0;
  border-top: 2px solid var(--ink-deep);
}
.video-action-close:active { background: #1d1d1f; }
.video-action-close:active { color: var(--ink-deep); }

/* 削除確認画面（シート内置換） */
.video-action-confirm {
  padding: 20px 20px 8px;
  text-align: center;
}
.video-action-confirm-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-body);
  line-height: 1.6;
  letter-spacing: 0.5px;
}
.video-action-confirm-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
}
.video-action-cancel,
.video-action-confirm-delete {
  flex: 1;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
}
.video-action-cancel {
  background: var(--bg-raise);
  color: var(--ink-body);
  border: 1px solid var(--line-firm);
}
.video-action-cancel:active { background: var(--bg-warm); }
.video-action-confirm-delete {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.video-action-confirm-delete:active { opacity: 0.85; }

/* 動画ありの試合用ボタン（実線枠を撤去、軽量アイコンに） */
.match-video-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  font-size: 18px;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s;
}
.match-video-action-btn:active {
  background: var(--accent-dim);
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-mute);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 16px; font-weight: 600; color: var(--ink-body); }
.empty-sub { font-size: 12px; color: var(--ink-mute); margin-top: 6px; }

/* ===== 予定ページ ===== */
.schedule-content {
  padding: 12px;
}

/* ===== ヘッダー ===== */
.app-header {
  background: var(--ink-deep); color: #fff; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 100; min-height: 48px;
}
.app-header h1 { font-size: 16px; font-weight: 800; letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.header-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.header-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  min-height: 36px; min-width: 44px; display: flex; align-items: center; justify-content: center; letter-spacing: 0.5px;
  transition: background 0.15s ease;
}
.header-btn:active { background: rgba(255,255,255,0.25); }

/* 試合形式選択バー */
.format-bar {
  background: var(--ink-body); padding: 6px 12px; display: flex; gap: 6px; align-items: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.format-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); padding: 7px 16px; border-radius: 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.format-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.format-btn:active { opacity: 0.8; }

/* スコアコンテナ */
.score-container { padding: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* メインテーブル */
.score-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-raise); border: 2.5px solid var(--ink-deep);
}
.score-table th, .score-table td {
  border: 1px solid var(--ink-deep); text-align: center; vertical-align: middle;
  padding: 0; position: relative;
}

/* テーブルヘッダー */
.score-table thead th {
  background: var(--ink-deep); color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 2px; letter-spacing: 2px;
}
.col-team { width: 78px; min-width: 78px; }
.col-pos { min-width: 90px; }
.col-total { width: 60px; min-width: 60px; }

/* チーム名セル */
.team-cell {
  background: var(--bg-card); padding: 2px; font-weight: 700;
  border-right: 2px solid var(--ink-deep);
  position: relative;
}
.team-cell .name-input-wrap {
  position: static;
  flex-direction: column;
  align-items: stretch;
}
/* B案: span表示（折り返し可能）＋ inputは非表示 */
.team-name-display {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-deep);
  padding: 2px 2px;
  word-break: break-all;
  line-height: 1.3;
  cursor: pointer;
  min-height: 1.3em;
}
.team-name-display.placeholder {
  color: var(--ink-mute);
  font-weight: 400;
  font-size: 11px;
}
.team-name-input {
  width: 100%; border: none; background: transparent; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink-deep); outline: none; padding: 2px 0;
}
.team-name-hidden {
  display: none !important;
}
.team-name-input::placeholder { color: var(--ink-mute); font-weight: 400; font-size: 11px; }

/* 選手名セル */
.player-cell { padding: 4px 3px; background: var(--bg-card); position: relative; }
.player-cell.fusen-player { background: var(--bg-warm); }
.player-name-input {
  width: calc(100% - 32px); border: none; border-bottom: 1px dashed var(--line-firm); background: transparent;
  text-align: center; font-size: 14px; color: var(--ink-deep); outline: none; padding: 4px 1px;
  display: inline-block;
}
.player-name-input::placeholder { color: var(--line-firm); font-size: 10px; }
.player-name-input.fusen { text-decoration: line-through; color: var(--accent); opacity: 0.5; }
.fusen-x-mark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 900; color: var(--accent); pointer-events: none; opacity: 0.7;
}
.fusen-toggle {
  position: absolute; right: 2px; bottom: 1px;
  width: 14px; height: 14px; border: 1px solid var(--line-firm); border-radius: 3px;
  background: var(--bg-raise); font-size: 8px; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  z-index: 2;
}
.fusen-toggle:active { background: var(--accent-dim); }

/* スコアエリア */
.score-area {
  padding: 4px 3px; position: relative; min-height: 50px;
}
.score-cells {
  display: flex; justify-content: center; align-items: center; gap: 8px;
}

/* 個別スコアセル */
.sc {
  width: 42px; height: 42px; border: 1.5px solid var(--line-firm); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #dc2626; cursor: pointer;
  background: var(--bg-raise); user-select: none; position: relative;
}
.sc:active { background: var(--accent-dim); }
/* 1本目（先取り）：赤丸枠＋赤字（背景は透明）*/
.sc.ippon {
  border: 2.5px solid #dc2626;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  background: transparent;
  color: #dc2626;
}
/* 2本目以降：赤字のみ、赤枠は付けない（剣道記録の慣習）*/
.sc.ippon-plain {
  border-color: var(--line-firm);
  color: #dc2626;
}

/* 反則エリア（スコアセル横：左に△表示、右に反ボタン） */
.hansoku-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2px; min-height: 16px; padding: 0 2px;
}
.hansoku-marks {
  display: flex; gap: 1px; align-items: center;
}
.hansoku-mark {
  font-size: 13px; font-weight: 900; color: var(--accent); line-height: 1;
}
.hansoku-btn {
  font-size: 10px; font-weight: 700; color: var(--ink-mute); background: var(--bg-warm);
  border: 1px solid var(--line-hair); border-radius: 3px; padding: 2px 6px;
  cursor: pointer; line-height: 14px; margin-left: auto;
}
.hansoku-btn:active { background: var(--line-hair); }
.hansoku-btn.has-hansoku { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-line); }

/* 中央区切り行（引分・延長・一本勝を表示） */
.mid-sep td {
  border-top: 2.5px solid var(--ink-deep); border-bottom: 2.5px solid var(--ink-deep);
  background: var(--bg-warm); padding: 0; height: auto;
}
.mid-sep .mid-team-cell { background: var(--bg-warm); }
.mid-sep .mid-total-cell { background: var(--bg-warm); }

/* 中央ステータス表示 */
.mid-content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px 1px; min-height: 24px; position: relative;
}
.mid-status {
  font-size: 11px; font-weight: 900; color: var(--ink-body); line-height: 1.2;
}
.mid-status.hikiwake-mark {
  font-size: 28px; color: var(--ink-muted);
}
.mid-status.encho-mark {
  font-size: 10px; color: #3A5A78; font-weight: 700;
}
.mid-status.ipponwin-mark {
  font-size: 9px; color: var(--mint); font-weight: 700;
}

/* 中央のアクションボタン */
.mid-actions {
  display: flex; gap: 2px; justify-content: center; flex-wrap: wrap;
}
.mid-act-btn {
  background: var(--bg-warm); border: 1px solid var(--line-firm); border-radius: 3px;
  font-size: 9px; color: var(--ink-body); padding: 2px 5px; cursor: pointer; line-height: 12px;
  white-space: nowrap;
}
.mid-act-btn:active { background: var(--line-hair); }
.mid-act-btn.active { background: var(--ink-body); color: #fff; border-color: var(--ink-body); }
.mid-act-btn:disabled,
.mid-act-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* 引き分け時：オーバーレイなし（スコア・選手名はそのまま表示） */
.hikiwake-overlay { display: none; }

/* 代表戦列 */
.col-daihyo { width: 90px; min-width: 90px; }
.daihyo-label {
  font-size: 14px; font-weight: 900; color: var(--accent); letter-spacing: 2px;
}
.daihyo-mid-btn {
  font-size: 9px !important; padding: 3px 6px !important; font-weight: 700 !important;
  color: var(--accent) !important; border-color: var(--accent) !important; background: var(--bg-raise) !important;
}
.daihyo-mid-btn:active { background: var(--accent) !important; color: #fff !important; }
.daihyo-mid-btn.active { background: var(--accent) !important; color: #fff !important; }

/* 本数/勝数セル - 縦書き風 */
.total-cell {
  background: var(--bg-card); padding: 6px 2px;
  vertical-align: middle;
  border-left: 2px solid var(--ink-deep);
}
.total-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
.total-inner .t-hon { font-size: 26px; font-weight: 900; color: var(--ink-deep); line-height: 1.1; }
.total-inner .t-sep { font-size: 16px; font-weight: 700; color: var(--ink-deep); line-height: 1; }
.total-inner .t-win { font-size: 26px; font-weight: 900; color: var(--ink-deep); line-height: 1.1; }
.total-inner .t-label { font-size: 7px; color: var(--ink-mute); letter-spacing: 0.5px; margin-top: 2px; }

/* 勝敗サマリーバー（page-scoreでは右側の「本数/勝数」列で代替・非表示） */
#page-score .result-bar { display: none !important; }
.result-bar {
  background: var(--bg-raise); border: 2.5px solid var(--ink-deep); border-top: none;
  display: flex; align-items: center; justify-content: center; padding: 10px 16px; gap: 20px;
}
.r-team { text-align: center; min-width: 80px; }
.r-label { font-size: 12px; color: var(--ink-body); }
.r-num { font-size: 28px; font-weight: 900; color: var(--ink-deep); }
.r-num.won { color: var(--accent); }
.r-vs { font-size: 22px; font-weight: 900; color: var(--ink-mute); }
.r-mid { text-align: center; }
.r-mid-label { font-size: 10px; color: var(--ink-mute); }

/* ポップアップ共通 */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1000; align-items: center; justify-content: center;
}
.overlay.show { display: flex; }
.popup {
  background: var(--bg-card); border-radius: var(--r-sm); padding: 20px;
  min-width: 280px; max-width: 360px;
  border: 2px solid var(--ink-deep);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25); max-height: 90vh; overflow-y: auto;
}
.popup-title {
  text-align: center; font-family: var(--font-display);
  font-size: 13px; font-weight: 900; color: var(--ink-deep);
  letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--ink-deep);
}

/* 技選択グリッド */
.waza-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.waza-btn {
  border: 2.5px solid var(--accent); background: var(--bg-raise); color: var(--accent);
  padding: 18px 0; border-radius: 8px; font-size: 22px; font-weight: 900; cursor: pointer;
  min-height: 56px; letter-spacing: 2px; transition: all 0.1s ease;
}
.waza-btn:active { background: var(--accent); color: #fff; transform: scale(0.96); }
.waza-btn.neutral { border-color: var(--line-firm); color: var(--ink-mute); font-size: 14px; font-weight: 700; }
.waza-btn.neutral:active { background: var(--ink-mute); color: #fff; transform: scale(0.96); }

/* 有効打突チェック */


/* 保存名入力 */
.save-input {
  width: 100%; border: 2px solid var(--line-hair); border-radius: 8px; padding: 10px;
  font-size: 14px; outline: none; margin-bottom: 12px;
}
.save-input:focus { border-color: var(--ink-deep); }

/* 確認ダイアログ */
.confirm-box { text-align: center; }
.confirm-box p {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700; line-height: 1.6;
  color: var(--ink-deep);
  margin-bottom: 18px;
  white-space: pre-line;
}
.confirm-btns { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; }
.confirm-btns button {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1.5px solid var(--line-firm);
  background: var(--bg-card);
  color: var(--ink-deep);
}
.confirm-btns button:active { background: var(--bg-warm); }
.confirm-btns .yes {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.confirm-btns .yes:active { opacity: 0.85; background: var(--accent); }

.close-btn {
  margin-top: 12px; width: 100%; padding: 10px; border: 2px solid var(--line-firm);
  border-radius: 8px; background: var(--bg-raise); color: var(--ink-body); font-size: 13px; font-weight: 700; cursor: pointer;
}
.close-btn:active { background: var(--bg-warm); }

/* トースト */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-deep);
  color: var(--bg-base);
  padding: 12px 24px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  border: 1.5px solid var(--ink-deep);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.toast.show { opacity: 1; }

/* テーブル幅 */
.score-table.wide { min-width: 900px; }
.score-table.narrow { min-width: 300px; }
/* 個人戦：自動幅。1試合のときは団体1人分くらいの幅に収まる */
.score-table.kojin { min-width: auto; width: auto; }
.score-table.kojin .col-pos { min-width: 140px; }
.score-table.kojin.wide { min-width: 900px; } /* 5試合以上で横スクロール */

/* 横向きヒント */
.landscape-hint {
  display: none; background: var(--ink-deep); color: #fff; text-align: center;
  padding: 6px; font-size: 11px; font-weight: 600;
}

/* モバイル縦向き: 横向き推奨表示 + テーブル拡大 */
@media (max-width: 600px) and (orientation: portrait) {
  .landscape-hint { display: block; }
  .score-table { min-width: 700px; }
  .sc { width: 48px; height: 48px; font-size: 20px; }
  .sc.ippon { width: 48px; height: 48px; }
  .col-pos { min-width: 100px; }
  .col-team { width: 68px; min-width: 68px; }
  .player-name-input { font-size: 13px; padding: 5px 1px; }
  .team-name-input { font-size: 12px; }
  .team-name-display { font-size: 12px; }
  .score-table thead th { font-size: 14px; padding: 10px 2px; }
  .total-inner .t-hon, .total-inner .t-win { font-size: 30px; }
  .hansoku-btn { font-size: 11px; padding: 2px 7px; }
  .hansoku-mark { font-size: 15px; }
  .mid-act-btn { font-size: 11px; padding: 4px 8px; }
  .waza-btn { padding: 18px 0; font-size: 24px; }
  .popup { min-width: 300px; }
}

/* モバイル横向き: フィットさせる */
@media (max-width: 900px) and (orientation: landscape) {
  .score-container { padding: 2px; }
  .app-header { padding: 4px 12px; }
  .app-header h1 { font-size: 13px; }
  .format-bar { padding: 3px 12px; }
  .sc { width: 42px; height: 42px; font-size: 19px; }
  .sc.ippon { width: 42px; height: 42px; }
  .score-table thead th { font-size: 13px; padding: 6px 2px; }
  .player-name-input { font-size: 12px; }
  .result-bar { padding: 6px 12px; }
}

/* ===== 試合設定画面 ===== */
.setup-content {
  padding: 20px 16px;
  max-width: 500px;
  margin: 0 auto;
}
.setup-section {
  margin-bottom: 20px;
}
.setup-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-body);
  margin-bottom: 6px;
}
.setup-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--line-hair);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg-raise);
  color: var(--ink-deep);
  outline: none;
}
.setup-input:focus {
  border-color: var(--ink-deep);
}
.setup-input::placeholder {
  color: var(--ink-mute);
}
.setup-type-btns, .setup-format-btns {
  display: flex;
  gap: 10px;
}
.setup-type-btn, .setup-format-btn {
  flex: 1;
  min-height: 48px;
  padding: 12px 10px;
  border: 1.5px solid var(--line-firm);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
  cursor: pointer;
  text-align: center;
}
.setup-type-btn.active, .setup-format-btn.active {
  border-color: var(--ink-deep);
  color: var(--bg-base);
  background: var(--ink-deep);
}
.setup-type-btn:active, .setup-format-btn:active {
  opacity: 0.7;
}
.setup-start-btn {
  width: 100%;
  min-height: 56px;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.15em;
  cursor: pointer;
  margin-top: 30px;
}
.setup-start-btn:active {
  opacity: 0.85;
}

/* 大会情報バー */
.match-info-bar {
  background: var(--bg-warm);
  padding: 6px 10px 6px 12px;
  font-size: 12px;
  color: var(--ink-body);
  border-bottom: 1px solid var(--line-hair);
  display: none;
}
.match-info-bar.visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.match-info-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.match-info-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ＋試合追加ボタン */
.add-match-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.add-match-btn {
  background: var(--ink-deep);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.add-match-btn-new {
  background: var(--ink-body);
}
.add-match-btn:active { opacity: 0.75; }

/* 大会内の過去試合カード一覧 */
.tournament-cards {
  padding: 8px 10px 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tournament-card {
  background: var(--bg-raise);
  border: 1px solid var(--line-hair);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.tc-num {
  font-size: 11px;
  color: #fff;
  background: var(--ink-body);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.tc-teams {
  flex: 1;
  color: var(--ink-body);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-score {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.tc-arrow {
  font-size: 18px;
  color: var(--ink-mute);
  flex-shrink: 0;
  margin-left: 2px;
}
.tournament-card:active { background: var(--bg-warm); }

/* 過去試合ブロック（入力テーブルと同じデザインで読み取り専用表示） */
.past-match-block {
  margin: 8px 10px;
  border: 2px solid var(--line-hair);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raise);
}
.past-match-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.past-match-header:active {
  background: var(--bg-warm);
}
.past-match-teams {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.past-match-score {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.past-match-arrow {
  font-size: 18px;
  color: var(--ink-mute);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.past-match-arrow.open {
  transform: rotate(90deg);
}
.past-match-body {
  border-top: 1px solid var(--line-hair);
}
.past-match-actions {
  display: flex;
  justify-content: center;
  padding: 10px 12px 14px;
}
.past-match-edit-btn {
  padding: 8px 28px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-deep);
  background: var(--bg-warm);
  border: 1.5px solid var(--line-firm);
  border-radius: 8px;
  cursor: pointer;
}
.past-match-edit-btn:active {
  background: var(--line-hair);
}
.past-match-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.past-match-table-wrap .score-table {
  margin: 0;
}
.past-match-table-wrap .result-bar {
  border: none;
  border-top: 2px solid var(--ink-deep);
}
/* 読み取り専用：操作ボタン非表示 */
.past-match-table .mid-actions,
.past-match-table .fusen-toggle,
.past-match-table .hansoku-btn,
.past-match-table .name-pick-btn {
  display: none !important;
}
.past-match-table .sc {
  cursor: default;
  pointer-events: none;
}
.past-match-table .team-name-display {
  cursor: default;
  pointer-events: none;
}
/* 読み取り専用の名前表示 */
.readonly-name {
  text-align: center;
  font-size: 14px;
  color: var(--ink-deep);
  padding: 4px 2px;
}
.readonly-name.fusen {
  text-decoration: line-through;
  color: var(--accent);
  opacity: 0.5;
}

/* 試合詳細モーダル */
.match-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,38,34,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.match-detail-sheet {
  background: var(--bg-raise);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(43,38,34,0.18);
}
.match-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.match-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
}
.match-detail-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.match-detail-edit {
  background: var(--ink-deep);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 8px;
}
.match-detail-edit:active { opacity: 0.75; }
.match-detail-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.match-detail-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 24px;
}

/* 合計バー */
.detail-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink-deep);
  color: #fff;
  padding: 14px 20px;
  margin-bottom: 6px;
}
.detail-total-team { font-size: 16px; font-weight: 700; flex: 1; }
.detail-total-team:last-child { text-align: right; }
.detail-total-score { font-size: 36px; font-weight: 900; color: var(--accent); letter-spacing: 0; flex-shrink: 0; display: flex; align-items: center; }

/* ポジション行 */
.detail-pos-row {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}
.detail-pos-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
/* 3カラムレイアウト: 名前A(固定) | 技エリア(可変) | 名前B(固定) */
.detail-pos-body {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  align-items: center;
  min-height: 44px;
  gap: 4px;
}
/* 名前セル: 名前と△を横並び */
.detail-name-cell-a {
  display: flex;
  align-items: center;
  gap: 3px;
}
.detail-name-cell-b {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
/* 名前は両端に固定 */
.detail-name-a {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-name-b {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-name-a.detail-win { color: var(--accent); }
.detail-name-b.detail-win { color: var(--accent); }
/* 反則△マーク */
.detail-han {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* 中央エリア: 両側の技を左右に配置 */
.detail-waza-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
/* A側の技：左寄せ */
.detail-waza-side-a {
  display: flex;
  justify-content: flex-start;
  flex: 1;
}
/* B側の技：右寄せ */
.detail-waza-side-b {
  display: flex;
  justify-content: flex-end;
  flex: 1;
}
/* 引き分けで技なし：× を中央に */
.detail-draw-mark-center {
  font-size: 22px;
  color: var(--ink-mute);
  font-weight: 700;
  text-align: center;
  width: 100%;
}
/* 旧クラスは非表示 */
.detail-draw-overlay { display: none; }

.detail-waza-box {
  background: var(--bg-warm);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.detail-waza-box .ippon { color: #dc2626; }
/* 先取り一本：○で囲む */
.detail-waza-box .ippon-circle {
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border: 2px solid #dc2626;
  border-radius: 50%;
  line-height: 1;
}
/* 現在の試合ラベル */
.current-match-label {
  padding: 6px 12px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
}

@media print {
  .app-header, .format-bar, .app-footer, .fusen-toggle, .mid-actions, .hansoku-btn, .landscape-hint, .match-info-bar { display: none !important; }
  .score-container { padding: 0; overflow: visible; }
  .score-table { min-width: unset !important; }
  .result-bar { min-width: unset; }
  body { background: var(--bg-raise); }
}

/* ======================================================
   デザイン改善 v3.0 — 和の品格あるカラースキーム統一
   ====================================================== */

/* --- カスタムプロパティ（配色統一: MUJI路線に再マッピング済み） --- */
:root {
  --kendo-navy: #2B2622;           /* 墨 */
  --kendo-navy-light: #4A423B;     /* 本文 */
  --kendo-red: #8E2A2A;            /* エンジ */
  --kendo-red-light: #8E2A2A;      /* エンジ（派生色なし） */
  --kendo-gold: #6B7A5A;           /* 若竹（アクセント補助） */
  --kendo-gold-light: #8A8178;     /* 補助文字 */
  --kendo-cream: #EDE6D7;          /* グレージュ */
  --kendo-cream-dark: #EDE6D7;     /* グレージュ同値 */
  --kendo-text: #2B2622;           /* 墨 */
  --kendo-text-sub: #4A423B;       /* 本文 */
  --kendo-border: rgba(43,38,34,0.14);
  --kendo-white: #FFFFFF;
  --kendo-shadow: 0 2px 12px rgba(43, 38, 34, 0.06);
  --kendo-shadow-lg: 0 8px 32px rgba(43, 38, 34, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* --- 全体のタイポグラフィ改善 --- */
html, body {
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 1. ホーム画面の改善 ===== */
/* ※ スタバ×ナイキラン新デザインへ移行（ファイル冒頭の :root と ホーム画面セクションを参照） */
/* 旧v3.0のホーム用スタイル（色付きSVGアイコン等）は削除済み */

/* ===== 2. 試合設定画面の改善 ===== */
.setup-content {
  padding: 28px 20px;
}
.setup-section {
  margin-bottom: 24px;
}
.setup-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--kendo-text-sub);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.setup-input {
  padding: 14px 16px;
  border: 1.5px solid var(--kendo-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--kendo-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.setup-input:focus {
  border-color: var(--kendo-navy);
  box-shadow: 0 0 0 3px rgba(43, 38, 34, 0.08);
}
input[type="date"].setup-input {
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.setup-type-btn, .setup-format-btn {
  padding: 14px 12px;
  border: 1.5px solid var(--line-firm);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
  background: var(--bg-card);
  transition: all 0.15s ease;
}
.setup-type-btn.active, .setup-format-btn.active {
  border-color: var(--ink-deep);
  color: var(--bg-base);
  background: var(--ink-deep);
  box-shadow: none;
}
.setup-start-btn {
  padding: 18px;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.15em;
  margin-top: 36px;
  box-shadow: none;
  transition: opacity 0.1s ease;
}
.setup-start-btn:active {
  opacity: 0.85;
}

/* ===== 3. スコア入力画面ヘッダーの改善 ===== */
.app-header {
  background: var(--kendo-navy);
  padding: 12px 16px;
  min-height: 48px;
}
.app-header h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
}
.header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: background 0.15s ease;
  min-height: 36px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-btn:active {
  background: rgba(255, 255, 255, 0.25);
}
.header-buttons {
  gap: 8px;
}

/* 戻るボタン改善 */
.back-btn {
  font-size: 22px;
  padding: 6px 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 4px;
  transition: background 0.15s ease;
}
.back-btn:active {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

/* 試合形式バー */
.format-bar {
  background: var(--kendo-navy-light);
  padding: 8px 16px;
  gap: 8px;
}
.format-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}
.format-btn.active {
  background: var(--kendo-red);
  border-color: var(--kendo-red);
  box-shadow: 0 2px 8px rgba(142, 42, 42, 0.22);
}

/* ===== 4. 技選択モーダルの改善 ===== */
.overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.popup {
  background: var(--kendo-white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  min-width: 300px;
  max-width: 360px;
  box-shadow: var(--kendo-shadow-lg);
}
.popup-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--kendo-text-sub);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: 1px;
}

.waza-grid {
  gap: 10px;
}
.waza-btn {
  border: 2.5px solid var(--kendo-red);
  border-radius: var(--radius-sm);
  padding: 18px 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--kendo-red);
  min-height: 56px;
  transition: all 0.1s ease;
  letter-spacing: 2px;
}
.waza-btn:active {
  background: var(--kendo-red);
  color: var(--kendo-white);
  transform: scale(0.96);
}
.waza-btn.neutral {
  border-color: var(--line-firm);
  color: var(--ink-mute);
  font-size: 14px;
  font-weight: 700;
}
.waza-btn.neutral:active {
  background: var(--ink-mute);
  color: var(--kendo-white);
  transform: scale(0.96);
}

/* 保存ダイアログ改善 */
.save-input {
  border: 1.5px solid var(--kendo-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.save-input:focus {
  border-color: var(--kendo-navy);
  box-shadow: 0 0 0 3px rgba(43, 38, 34, 0.08);
}
.confirm-btns button {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
  min-width: 44px;
  transition: transform 0.1s ease;
}
.confirm-btns button:active {
  transform: scale(0.97);
}
.confirm-btns .yes {
  background: var(--kendo-red);
  border-color: var(--kendo-red);
  box-shadow: 0 2px 8px rgba(142, 42, 42, 0.18);
}

/* ===== 5. 結果参照画面の改善 ===== */
.history-content {
  padding: 16px;
}
.history-card {
  border: 1px solid var(--kendo-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--kendo-shadow);
  transition: transform 0.1s ease;
}
.history-card:active {
  background: var(--kendo-cream);
  transform: scale(0.99);
}
.history-card-tournament {
  font-size: 16px;
  font-weight: 800;
  color: var(--kendo-navy);
}
.history-card-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
  gap: 14px;
}
.history-card-del {
  border: 1.5px solid var(--kendo-red);
  color: var(--kendo-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-card-del:active {
  background: var(--kendo-red);
  color: var(--kendo-white);
}

/* 空状態の絵文字も非表示にしてCSSアイコンに */
.empty-icon {
  font-size: 0;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--kendo-cream-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.empty-icon::after {
  content: '';
  width: 28px;
  height: 28px;
  background: var(--kendo-text-sub);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") center/contain no-repeat;
}
.empty-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--kendo-text-sub);
}
.empty-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 8px;
}

/* ===== 6. 大会詳細モーダルの改善 ===== */
.tournament-detail-sheet,
.match-detail-sheet {
  border-radius: 16px;
}
.tournament-detail-header,
.match-detail-header {
  padding: 18px 20px 14px;
}
.tournament-detail-title,
.match-detail-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--kendo-navy);
}
.tournament-match-item {
  padding: 10px 16px;
  transition: transform 0.1s ease;
}
.tournament-match-item:active {
  transform: scale(0.99);
}

/* ===== 7. スコアテーブルの微調整 ===== */
.score-table thead th {
  background: var(--kendo-navy);
  font-size: 14px;
  padding: 10px 4px;
  letter-spacing: 3px;
}
.team-cell {
  background: var(--bg-card);
}
.score-area {
  min-height: 54px;
  padding: 6px 4px;
}
.sc {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line-firm);
  border-radius: 6px;
  font-size: 19px;
  font-weight: 900;
  color: var(--accent);
  transition: background 0.1s ease;
}
/* 1本目（先取り）：赤丸枠＋赤字（背景は透明）*/
.sc.ippon {
  border: 2.5px solid #dc2626;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: transparent;
  color: #dc2626;
}

/* 勝敗サマリーバー */
.result-bar {
  border: 2.5px solid var(--kendo-text);
  border-top: none;
  padding: 12px 20px;
  gap: 24px;
}
.r-num {
  font-size: 30px;
  font-weight: 900;
}
.r-num.won {
  color: var(--kendo-red);
}

/* ===== 8. 横向きヒント改善 ===== */
.landscape-hint {
  background: var(--kendo-gold);
  color: var(--kendo-navy);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  letter-spacing: 0.5px;
}

/* ===== 9. トースト改善 ===== */
.toast {
  background: var(--kendo-navy);
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--kendo-shadow-lg);
}

/* ===== 10. モバイルレスポンシブ補正 ===== */
@media (max-width: 600px) and (orientation: portrait) {
  .sc { width: 36px; height: 36px; font-size: 18px; }
  .sc.ippon { width: 36px; height: 36px; }
  .waza-btn { padding: 20px 0; font-size: 26px; min-height: 64px; }
  .popup { min-width: 310px; max-width: 92vw; }
  .setup-content { padding: 24px 20px; }
  .app-header { padding: 12px 16px; min-height: 52px; }
  .app-header h1 { font-size: 16px; }
  .header-btn { padding: 8px 14px; font-size: 13px; }
  .home-header h1 { font-size: 30px; }
}

/* ===== 11. 閉じるボタン改善 ===== */
.close-btn {
  margin-top: 14px;
  padding: 12px;
  border: 1.5px solid var(--kendo-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  min-height: 48px;
  transition: background 0.15s ease;
}
.close-btn:active {
  background: var(--bg-warm);
}

/* ===== 12. 大会情報バー改善 ===== */
.match-info-bar {
  background: var(--kendo-cream);
  padding: 8px 14px 8px 16px;
  font-size: 13px;
  color: var(--kendo-text-sub);
  border-bottom: 1px solid var(--kendo-border);
}

/* 大会カード改善 */
.tournament-card {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--kendo-shadow);
}
.tc-num {
  background: var(--kendo-navy);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}
.tc-score {
  color: var(--kendo-red);
  font-weight: 900;
}

/* ===== 13. 詳細ビュー合計バー ===== */
.detail-total {
  background: var(--kendo-navy);
  padding: 16px 22px;
}
.detail-total-team {
  font-size: 17px;
  font-weight: 800;
}
.detail-total-score {
  color: var(--kendo-red-light);
  font-size: 38px;
}

/* 詳細ポジション行 */
.detail-pos-row {
  padding: 16px 18px;
}
.detail-pos-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--kendo-gold);
  letter-spacing: 2px;
}
.detail-name-a, .detail-name-b {
  font-size: 16px;
  font-weight: 800;
}
.detail-waza-box {
  background: var(--kendo-cream);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 18px;
  font-weight: 800;
}

/* ===== safe area対応 ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .home-page.active {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  .popup {
    margin-bottom: env(safe-area-inset-bottom);
  }
}

/* ===== メンバー登録画面 ===== */
.member-content {
  padding: 20px;
}
.member-section {
  margin-bottom: 28px;
}
.member-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line-soft);
}
.member-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.member-input {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--line-hair);
  border-radius: 8px;
  font-size: 16px;
  background: var(--bg-raise);
  outline: none;
}
.member-input:focus {
  border-color: var(--ink-deep);
}
.member-add-btn {
  padding: 12px 20px;
  background: var(--ink-deep);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.member-add-btn:active {
  opacity: 0.7;
}
.member-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--line-soft);
}
.member-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-body);
}
.member-item-del {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-empty {
  color: var(--ink-mute);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* ===== 動画ガイドページ ===== */
.video-guide-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  height: calc(100vh - 60px);
}
.guide-intro {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-body);
}
.guide-intro p { margin: 4px 0; }
.guide-section {
  background: var(--bg-raise);
  border: 1.5px solid var(--line-hair);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.guide-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-deep);
  margin: 0 0 6px;
}
.guide-recommend {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.guide-step-num {
  width: 24px;
  height: 24px;
  background: var(--ink-deep);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.guide-step-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-body);
}
.guide-step-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.guide-note {
  background: var(--bg-warm);
  border: 1.5px solid var(--line-hair);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-body);
}
.guide-note p { margin: 3px 0; }

/* ===== 名前選択プルダウン ===== */
.name-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}
.name-input-wrap .team-name-input,
.name-input-wrap .player-name-input {
  flex: 1;
  min-width: 0;
  width: calc(100% - 20px) !important;
  display: block;
}
.name-input-wrap .team-name-display {
  flex: 1;
  min-width: 0;
  width: calc(100% - 20px);
}
/* チーム名セルのプルダウン：右下に配置 */
.team-cell .name-pick-btn {
  right: 2px;
  top: auto;
  bottom: 2px;
  transform: none;
}
/* 選手名セルのプルダウン：右上に配置 */
.name-pick-btn {
  position: absolute;
  right: 2px;
  top: 1px;
  transform: none;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid var(--line-firm);
  border-radius: 3px;
  background: var(--bg-warm);
  color: var(--ink-body);
  font-size: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
  touch-action: manipulation;
}
.name-pick-btn:active {
  background: var(--line-firm);
  border-color: var(--ink-mute);
}
.name-picker-popup {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.name-picker-list {
  flex: 1;
  overflow-y: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}
.name-picker-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line-hair);
  border-radius: 8px;
  background: var(--bg-raise);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-body);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.name-picker-item:active {
  background: var(--bg-warm);
  border-color: var(--accent);
  color: var(--accent);
}

/* =================================================================
   グローバル v3 BLUE LIGHT トーン — 全ページ共通
   白基調 × ロイヤルブルー・アクセント
   ================================================================= */
body {
  background: var(--bg-base);
}
.page {
  background: var(--bg-base);
  color: var(--ink-body);
  font-family: 'Noto Sans JP', var(--font-display);
  min-height: 100vh;
  padding-bottom: 80px;
}
.page.active { display: block; }

/* ヘッダー（全ページ共通）— 白＋紺墨 */
.app-header {
  background: #fff;
  color: var(--ink-deep);
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 12px;
  min-height: 0;
  box-shadow: 0 1px 0 rgba(14,26,46,0.04);
}
.app-header h1 {
  color: var(--ink-deep);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
}
.app-header .back-btn {
  color: var(--ink-deep);
  font-size: 19px;
}
.app-header .header-btn {
  background: var(--bg-deep);
  border: 1px solid var(--line-hair);
  color: var(--ink-deep);
}

/* setup画面 */
.setup-content { color: var(--ink-body); }
.setup-section { padding: 6px 0; }
.setup-label {
  color: var(--ink-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.setup-input {
  background: #fff;
  border: 1.5px solid var(--line-hair);
  color: var(--ink-deep);
  border-radius: 10px;
}
.setup-input::placeholder { color: var(--ink-mute); }
.setup-input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: #fff;
}
.setup-type-btn, .setup-format-btn {
  background: #fff;
  color: var(--ink-body);
  border: 1.5px solid var(--line-hair);
}
.setup-type-btn.active, .setup-format-btn.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(43,95,188,0.25);
}
.setup-start-btn {
  background: var(--accent-grad);
  border: none;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(43,95,188,0.30);
  color: #fff;
}

/* 結果参照ページ */
.history-content { color: var(--ink-body); }
.history-year-tab {
  background: #fff;
  color: var(--ink-body);
  border: 1.5px solid var(--line-hair);
}
.history-year-tab.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}
.history-card {
  background: #fff;
  color: var(--ink-deep);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(14,26,46,0.06);
}
.history-card-tournament { color: var(--ink-deep); }
.history-card-sub { color: var(--ink-mute); }
.history-card-del {
  border: 1.5px solid var(--warn);
  color: var(--warn);
  border-radius: 10px;
}
.empty-state { color: var(--ink-mute); }
.empty-state .empty-text { color: var(--ink-deep); }
.empty-state .empty-sub { color: var(--ink-mute); }

/* メンバー登録ページ */
.member-section h2,
.member-section .section-title {
  color: var(--ink-deep);
}
.member-input,
.member-section input[type="text"] {
  background: #fff;
  border: 1.5px solid var(--line-hair);
  color: var(--ink-deep);
  border-radius: 10px;
}
.member-input::placeholder,
.member-section input[type="text"]::placeholder { color: var(--ink-mute); }
.member-add-btn,
.member-section button {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
}
.member-list-empty {
  color: var(--ink-mute);
  text-align: center;
  padding: 12px;
  font-size: 13px;
}
.member-item {
  background: #fff;
  color: var(--ink-deep);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(14,26,46,0.04);
}

/* 選手名リストは1行に2人ずつ並べる（苗字だけが多いので省スペース化） */
#playerList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#playerList .member-empty {
  grid-column: 1 / -1;
}
#playerList .member-item {
  padding: 10px 12px;
}
#playerList .member-item-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* スコア入力画面はテーブル表示があるので、ヘッダ周辺だけ統一。テーブル本体はそのまま白背景で残す */
#page-score .match-info-bar {
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* 試合タイマー */
.match-timer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: 12px;
}
.mt-display {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mt-display.running {
  color: #7BA8F0;
  text-shadow: 0 0 12px rgba(123,168,240,0.6);
}
.mt-actions {
  display: flex;
  gap: 8px;
}
.mt-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.mt-btn:active { transform: scale(0.94); }
.mt-btn.mt-toggle {
  background: var(--accent-grad);
  border-color: transparent;
  font-size: 18px;
}
.mt-btn.mt-toggle.is-running {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.35);
}
.mt-btn.mt-reset { color: rgba(255,255,255,0.7); font-size: 18px; }
.mt-btn:disabled,
.mt-btn[disabled] { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
#page-score .match-info-item { color: #fff; }
#page-score .add-match-btn {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
}
#page-score .add-match-btn-new {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}
#page-score .landscape-hint {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#page-score .score-bottom-cta {
  background: rgba(0,0,0,0.55);
  border-top: 1px solid rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
#page-score .score-bottom-cta .cta-secondary {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
}
#page-score .score-bottom-cta .cta-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 25px rgba(43,95,188,0.30);
}

/* 動画ガイド・予定・個人成績・その他（プレースホルダ）— 白基調統一 */
#page-video-guide,
#page-schedule,
#page-stats,
#page-other {
  color: var(--ink-deep);
  background: var(--bg-base);
  min-height: 100vh;
}
#page-video-guide h2,
#page-video-guide h3,
#page-schedule h2,
#page-schedule h3,
#page-stats h2,
#page-stats h3,
#page-other h2,
#page-other h3 { color: var(--ink-deep); }

/* その他ページ：白カード基調 */
.other-content { padding: 16px 14px 100px; }
.other-list { display: flex; flex-direction: column; gap: 8px; }
.other-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--ink-deep);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(14,26,46,0.04);
  transition: background 0.15s, transform 0.1s;
}
.other-item:active {
  transform: scale(0.99);
  background: var(--bg-warm, #f0f5fb);
}
.other-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43,95,188,0.10);
  border-radius: 50%;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--accent, #2b5fbc);
}
.other-icon svg { width: 20px; height: 20px; }
.other-text { flex: 1; min-width: 0; }
.other-title { font-size: 15px; font-weight: 700; color: var(--ink-deep); }
.other-sub {
  font-size: 12px;
  color: var(--ink-mute, #8898a8);
  margin-top: 3px;
}
.other-arrow { color: var(--ink-mute, #8898a8); font-size: 18px; }
.other-section-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--ink-mute, #8898a8);
  padding: 18px 6px 6px;
}

/* =================================================================
   ホーム画面 v2 (HV2) — ネイビーグラデ × 赤CTA × 白カード
   ================================================================= */
.home-v2 {
  background: var(--bg-base);
  color: var(--ink-deep);
  min-height: 100vh;
  font-family: 'Noto Sans JP', var(--font-display);
  padding: 56px 0 100px 0;
  overflow-x: hidden;
  position: relative;
}
.home-v2.active { display: block; }

/* ヒーロー画像（防具+タイトル+キャッチを画像内に内蔵） */
.hv2-hero-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 785;
  background-image: url('images/hero-men.jpg');
  background-position: 30% center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* 右上：その他メニュー（ヒーロー画像の上の白い余白に配置）*/
.hv2-hero-more {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: 0 2px 6px rgba(14,26,46,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-deep);
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s, transform 0.1s;
}
.hv2-hero-more:active { transform: scale(0.92); background: var(--bg-deep); }
.hv2-hero-more svg { width: 20px; height: 20px; }

/* ホーム：最近の試合セクション（個人成績と同じデザイン） */
.hv2-recent {
  margin: 18px 20px 0;
  padding: 0;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: 0 4px 16px rgba(14,26,46,0.06);
  overflow: hidden;
}
.hv2-recent:empty { display: none; }
.hv2-recent-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.hv2-recent-head:active { background: rgba(14,26,46,0.04); }
.hv2-recent-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hv2-recent-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.hv2-recent-title-icon svg { width: 22px; height: 22px; stroke: currentColor; }
.hv2-recent-detail {
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.hv2-recent-list {
  display: flex;
  flex-direction: column;
  padding: 0 8px 14px;
}
.hv2-recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line-soft, #e8edf4);
  padding: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.hv2-recent-item:active { background: var(--bg-warm, #f0f5fb); }
.hv2-recent-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex-shrink: 0;
}
.hv2-recent-date {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
  white-space: nowrap;
}
.hv2-recent-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.hv2-recent-sum {
  font-size: 11px;
  color: var(--ink-body, #5b6877);
  white-space: nowrap;
  flex-shrink: 0;
}
.hv2-recent-sum-num {
  font-weight: 700;
  color: var(--accent, #2b5fbc);
  font-size: 14px;
  margin-right: 1px;
}

/* ホーム右上：タイマーアイコン（⋯の左隣） */
.hv2-hero-timer {
  position: absolute;
  top: 12px;
  right: 64px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: 0 2px 6px rgba(14,26,46,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-deep);
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s, transform 0.1s;
}
.hv2-hero-timer:active { transform: scale(0.92); background: var(--bg-deep); }
.hv2-hero-timer svg { width: 20px; height: 20px; }

/* フローティングタイマー（ドラッグ可能・コンパクト） */
.timer-float {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  right: 12px;
  z-index: 200;
  background: #fff;
  border-radius: 18px;
  padding: 14px 14px 12px;
  width: 190px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.20);
  border: 1px solid var(--line-soft, #e3eaf2);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.timer-float.is-dragging { cursor: grabbing; }
.timer-float[hidden] { display: none; }
.timer-float button { cursor: pointer; }
.timer-float-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink-mute, #a0aab8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-float-close:active { background: var(--bg-warm, #f0f5fb); }
.timer-float-close svg { width: 12px; height: 12px; }
.timer-float-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute, #a0aab8);
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.timer-float .mt-display {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  text-align: center;
  letter-spacing: 0.04em;
  margin: 2px 0 10px;
  font-variant-numeric: tabular-nums;
}
.timer-float .mt-display.running { color: var(--ink-deep, #1a2740); }
.timer-float-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* フローティング内のアクションボタン上書き（縮小） */
.timer-float .timer-reset-btn,
.timer-float .timer-toggle-btn {
  width: 38px;
  height: 38px;
}
.timer-float .timer-reset-btn svg { width: 14px; height: 14px; }
.timer-float .timer-toggle-btn { font-size: 14px; }
.timer-sheet {
  background: #fff;
  border-radius: 20px;
  padding: 22px 20px 20px;
  width: calc(100% - 64px);
  max-width: 280px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.20);
}
.timer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink-mute, #a0aab8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-close:active { background: var(--bg-warm, #f0f5fb); }
.timer-close svg { width: 14px; height: 14px; }
.timer-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute, #a0aab8);
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.timer-sheet .mt-display {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 48px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  text-align: center;
  letter-spacing: 0.04em;
  margin: 2px 0 16px;
  font-variant-numeric: tabular-nums;
}
/* 計測中も色は変えない（黒のまま） */
.timer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.timer-action-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.timer-action-btn:active { transform: scale(0.94); }
.timer-reset-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-warm, #f0f5fb);
  color: var(--ink-body, #5b6877);
}
.timer-reset-btn svg { width: 18px; height: 18px; }
.timer-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent, #2b5fbc);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(43,95,188,0.30);
}
.timer-toggle-btn.is-running {
  background: var(--accent, #2b5fbc);
}
.hv2-hero-image::after {
  /* 下端に紺グラデを重ねて画面と滑らかに接続 */
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(10,26,47,0) 0%, var(--bg-base) 100%);
  pointer-events: none;
}
.hv2-bell {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.hv2-bell-icon {
  font-size: 18px;
  filter: brightness(2);
}
.hv2-bell-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3D7AE8;
  border: 2px solid var(--bg-base);
}

/* ヒーロー直下のキャッチコピー */
.hv2-hero-tagline {
  padding: 12px 20px 4px;
}
.hv2-hero-tagline h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0;
}

/* メインCTA：結果登録 */
.hv2-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 20px 12px;
  padding: 18px 20px;
  border: none;
  border-radius: 18px;
  background: var(--accent-grad);
  box-shadow: 0 10px 25px rgba(43,95,188,0.30);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: calc(100% - 40px);
}
.hv2-cta:active { transform: scale(0.985); box-shadow: 0 6px 16px rgba(43,95,188,0.35); }
.hv2-cta-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hv2-cta-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.hv2-cta-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}
.hv2-cta-sub {
  font-size: 12px;
  margin-top: 2px;
  color: rgba(255,255,255,0.85);
}
.hv2-cta-arrow {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  color: #3D7AE8;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 白カード（4枚） */
.hv2-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 20px 4px;
}
.hv2-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f7f8fa;
  border: none;
  border-radius: 16px;
  color: #111;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.hv2-card:active { background: #ebedf2; }
.hv2-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hv2-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}
.hv2-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}
.hv2-card-sub {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}
.hv2-card-arrow {
  color: #3D7AE8;
  font-size: 22px;
  font-weight: 400;
}


/* 統計 */
.hv2-stats {
  display: flex;
  margin: 12px 20px 0;
  border-radius: 16px;
  background: #0c223d;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.hv2-stat {
  flex: 1;
  text-align: center;
  padding: 14px 4px;
  position: relative;
}
.hv2-stat + .hv2-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 1px;
  background: rgba(255,255,255,0.08);
}
.hv2-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1;
}
.hv2-stat-num small {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  margin-left: 2px;
}
.hv2-stat-label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

/* 個人成績ハイライト（ホームのメインコンテンツ） */
.hv2-mystats {
  margin: 18px 20px 0;
  padding: 0;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: 0 4px 16px rgba(14,26,46,0.06);
  overflow: hidden;
}
.hv2-mystats:empty { display: none; }
/* ヘッダー（クリックで展開）= ボタン全幅 */
.mystats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.mystats-head:active { background: rgba(14,26,46,0.04); }
.mystats-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mystats-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.mystats-title-icon svg { width: 22px; height: 22px; stroke: currentColor; }
.mystats-detail {
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mystats-arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--accent);
}

/* 個人成績の詳細部分（初期=展開、トグルで折り畳み可能） */
.mystats-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
  padding: 0 20px;
}
.hv2-mystats.expanded .mystats-body {
  max-height: 800px;
  opacity: 1;
  padding: 4px 20px 18px;
}
.mystats-head {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.hv2-mystats.expanded .mystats-head {
  border-bottom-color: var(--line-soft);
}

/* 詳細フッター：個人成績ページへの導線 */
.mystats-more {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.mystats-more-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-deep);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.05em;
}
.mystats-more-btn:active { background: var(--accent-dim); }
.mystats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}
.mystats-num {
  font-family: 'Helvetica Neue', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink-deep);
  line-height: 1;
  letter-spacing: -0.02em;
}
.mystats-num small {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-left: 2px;
}
.mystats-num-label {
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 5px;
  letter-spacing: 0.1em;
}
.mystats-num-cell.highlight .mystats-num {
  color: var(--accent);
}

/* 個人成績サマリー：1行表示（N試合 N勝N敗N分｜勝率） */
.mystats-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.mystats-line-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}
.mystats-line-total {
  font-family: 'Helvetica Neue', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-deep);
  letter-spacing: -0.01em;
}
.mystats-line-total small {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  margin-left: 1px;
}
.mystats-line-wl {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  white-space: nowrap;
}
.mystats-line-rate-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.mystats-line-rate-label {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.mystats-line-rate {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
  flex-shrink: 0;
}
.mystats-line-rate-num {
  font-family: 'Helvetica Neue', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-deep);
  letter-spacing: -0.02em;
}
.mystats-line-rate-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
}

.mystats-waza-section { padding-top: 14px; }
.mystats-waza-label {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.mystats-waza-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mw-item {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  align-items: center;
  gap: 10px;
}
.mw-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-deep);
}
.mw-bar {
  height: 8px;
  background: rgba(14,26,46,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.mw-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-soft));
  border-radius: 4px;
  transition: width 0.3s ease;
}
.mw-num {
  font-family: 'SF Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-body);
  text-align: right;
}

.mystats-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--ink-mute);
  font-size: 13px;
}
.mystats-empty::before {
  content: "🎯";
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* ===========================
   デモ表示（初回起動時）
   =========================== */

/* デモのお知らせ文 — 最近の試合 */
.hv2-demo-note {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-mute, #8898a8);
  background: rgba(43, 95, 188, 0.04);
  border: 1px dashed rgba(136, 152, 168, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 10px;
  letter-spacing: 0.02em;
}

/* デモのお知らせ文 — 個人成績 */
.mystats-demo-note {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-mute, #8898a8);
  background: rgba(43, 95, 188, 0.04);
  border: 1px dashed rgba(136, 152, 168, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 12px 10px;
  letter-spacing: 0.02em;
}

/* デモのカード本体は薄字＋無効化 */
.hv2-recent-list.is-demo .hv2-recent-item.is-demo {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}
.hv2-recent-list.is-demo .hv2-recent-item.is-demo:active {
  background: inherit;
}

/* デモ用：見出しは押せないようにブロック化（ヘッダーの形は維持） */
.hv2-recent-head--demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 4px 8px;
  color: var(--ink-deep, #1a2740);
  font-weight: 700;
}
.hv2-recent-head--demo .hv2-recent-detail {
  opacity: 0.4;
}

/* 個人成績全体をデモ調に */
.hv2-mystats.is-demo .mystats-body {
  opacity: 0.6;
}
.hv2-mystats.is-demo .mystats-more-btn {
  pointer-events: auto;
  opacity: 1;
}

.hv2-bottom-spacer { height: 24px; }

/* 下部タブナビ */
.hv2-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  background: #fff;
  padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 50;
  border-top: 1px solid #e5e7eb;
}
.hv2-nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 11px;
  color: #777;
  cursor: pointer;
  min-height: 48px;
}
.hv2-nav-btn.active { color: var(--accent); }
.hv2-nav-icon {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hv2-nav-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
}
.hv2-nav-btn { color: #9CA5B5; }       /* 非アクティブ: ニュートラルグレーブルー */
.hv2-nav-btn.active { color: var(--accent); }
.hv2-nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* 中央FAB（結果登録 = 記録する）*/
.hv2-nav-btn.fab {
  position: relative;
  color: var(--ink-deep);
  font-weight: 700;
}
.hv2-nav-btn.fab .hv2-nav-fab-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -28px;
  margin-bottom: 4px;
  box-shadow: 0 8px 20px rgba(43,95,188,0.35), 0 0 0 4px #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hv2-nav-btn.fab .hv2-nav-fab-icon svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
}
.hv2-nav-btn.fab:active .hv2-nav-fab-icon {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(43,95,188,0.40), 0 0 0 4px #fff;
}
.hv2-nav-btn.fab.active .hv2-nav-fab-icon {
  box-shadow: 0 8px 24px rgba(43,95,188,0.50), 0 0 0 4px #fff;
}
.hv2-nav-btn.fab .hv2-nav-label {
  color: var(--ink-body);
  font-weight: 600;
}
.hv2-nav-btn.fab.active .hv2-nav-label { color: var(--accent); }

/* ========================================
   試合設定ページ：カードグループ化レイアウト
   ======================================== */
#page-setup .setup-content {
  padding: 16px 14px 120px;
  background: var(--bg-base, #f5f8fc);
  min-height: 100vh;
  box-sizing: border-box;
}
.setup-group {
  margin-bottom: 18px;
}
.setup-group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-body, #5b6877);
  margin: 0 6px 8px;
  letter-spacing: 0.06em;
}
.setup-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(14,26,46,0.04);
}
.setup-row {
  display: flex;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
  gap: 14px;
}
.setup-row:last-child { border-bottom: none; }
.setup-row-label {
  flex-shrink: 0;
  width: 64px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-body, #5b6877);
}
.setup-row-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink-deep, #1a2740);
  font-size: 15px;
  font-family: inherit;
  text-align: right;
  padding: 0;
  outline: none;
  box-shadow: none;
}
.setup-row-input::placeholder {
  color: var(--ink-mute, #a0aab8);
  font-size: 14px;
}
.setup-row-input[type="date"] {
  text-align: right;
  font-family: inherit;
}
.setup-row-input:focus {
  background: transparent;
  box-shadow: none;
}

/* 区分／試合種別／人数ボタン群（カード内配置） */
.setup-card .setup-category-btns,
.setup-card .setup-type-btns,
.setup-card .setup-format-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.setup-card .setup-category-btn,
.setup-card .setup-type-btn,
.setup-card .setup-format-btn {
  flex: 1;
  min-width: 60px;
  padding: 11px 10px;
  font-size: 14px;
}

/* 「保存して開始」ボタン（カードリスト下に配置） */
#page-setup .setup-start-btn {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  background: var(--accent-grad, linear-gradient(135deg, #2b5fbc, #3d7ae8));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(43,95,188,0.30);
}
#page-setup .setup-start-btn:active {
  transform: scale(0.985);
  box-shadow: 0 4px 12px rgba(43,95,188,0.30);
}

/* ========================================
   試合設定：区分（大会／練習試合）ボタン
   ======================================== */
.setup-category-btns {
  display: flex;
  gap: 10px;
}
.setup-category-btn {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--line-soft, #d8e0ec);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-body, #5b6877);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.setup-category-btn:active { transform: scale(0.98); }
.setup-category-btn.active {
  background: var(--accent, #2b5fbc);
  color: #fff;
  border-color: var(--accent, #2b5fbc);
  box-shadow: 0 4px 12px rgba(43,95,188,0.25);
}

/* ========================================
   結果参照ページ（v33: アコーディオン式）
   ======================================== */
#page-history .history-content {
  padding: 12px 16px 100px;
  background: var(--bg-base, #f5f8fc);
  min-height: 100vh;
}

/* 上部フィルタバー（区分タブ + 年プルダウン）— flex-wrap で狭い時は2行に */
.history-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 16px;
  flex-wrap: wrap;
  row-gap: 8px;
}
.history-filter-bar .history-cat-tabs { min-width: 0; }
.history-filter-bar .history-year-picker { flex-shrink: 0; }

/* 個人成績ページ：年と月を右側でグループ化 */
.pstats-yearmonth-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.history-cat-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.history-cat-tabs::-webkit-scrollbar { display: none; }
.history-cat-tab {
  padding: 6px 12px;
  border: 1px solid var(--line-soft, #e3eaf2);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-body, #5b6877);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.history-cat-tab:active { transform: scale(0.96); }
.history-cat-tab.active {
  background: var(--accent, #2b5fbc);
  color: #fff;
  border-color: var(--accent, #2b5fbc);
  box-shadow: 0 4px 12px rgba(43,95,188,0.25);
}
/* カスタム年ピッカー */
.history-year-picker {
  position: relative;
  flex-shrink: 0;
}
.history-year-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft, #e3eaf2);
  background: #fff;
  color: var(--ink-deep, #1a2740);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.history-year-btn svg {
  width: 12px;
  height: 12px;
  color: var(--accent, #2b5fbc);
}
.history-year-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(14,26,46,0.15);
  border: 1px solid var(--line-soft, #e3eaf2);
  min-width: 90px;
  z-index: 50;
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.history-year-menu[hidden] { display: none; }
.history-year-opt {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--ink-deep, #1a2740);
  cursor: pointer;
  white-space: nowrap;
}
.history-year-opt:hover { background: var(--bg-warm, #f0f5fb); }
.history-year-opt.active {
  background: var(--accent, #2b5fbc);
  color: #fff;
}

/* アコーディオンカード */
.hh-card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(14,26,46,0.04);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.hh-card.open {
  box-shadow: 0 3px 12px rgba(14,26,46,0.07);
}

.hh-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 42px 14px 16px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  position: relative;
}
.hh-card-header:active { background: var(--bg-warm, #f0f5fb); }

/* 開閉トグル（カード下端中央） */
.hh-card-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0 10px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line-soft, #e8edf4);
  color: var(--accent, #2b5fbc);
  cursor: pointer;
  font-family: inherit;
}
.hh-card-toggle:active { background: var(--bg-warm, #f0f5fb); }
.hh-card-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #2b5fbc);
  transition: transform 0.25s ease;
}
.hh-card-toggle-icon svg { width: 18px; height: 18px; }
.hh-card.open .hh-card-toggle-icon { transform: rotate(180deg); }
.hh-card.open .hh-card-toggle { border-top: none; }

/* 左：アイコン */
.hh-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hh-card-icon.hh-cat-official {
  background: var(--accent, #2b5fbc);
  color: #fff;
}
.hh-card-icon.hh-cat-practice {
  background: var(--accent, #2b5fbc);
  color: #fff;
}
.hh-card-icon svg {
  width: 22px;
  height: 22px;
}

/* 中央：メタ + 大会名 */
.hh-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}
.hh-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-mute, #8898a8);
  line-height: 1.2;
}
.hh-meta-date,
.hh-meta-location {
  white-space: nowrap;
}
/* 「N試合」を少し離して右寄せ気味に */
.hh-meta-count {
  margin-left: 6px;
  padding-left: 6px;
  white-space: nowrap;
}
.hh-cat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.hh-cat-badge.hh-cat-official {
  background: rgba(43,95,188,0.12);
  color: var(--accent, #2b5fbc);
}
.hh-cat-badge.hh-cat-practice {
  background: rgba(91,127,168,0.14);
  color: #5b7fa8;
}
.hh-card-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}

/* メタ行内の「N試合」 */
.hh-meta-count {
  margin-left: 5px;
  padding-left: 5px;
  font-size: 12px;
  color: var(--ink-body, #5b6877);
  white-space: nowrap;
}
.hh-meta-count-num {
  font-weight: 700;
  color: var(--accent, #2b5fbc);
  font-size: 13px;
  margin-right: 1px;
}

/* 右：サマリー + シェブロン */
.hh-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hh-card-summary {
  font-size: 13px;
  color: var(--ink-body, #5b6877);
  white-space: nowrap;
}
.hh-summary-count,
.hh-summary-w,
.hh-summary-l,
.hh-summary-d {
  font-weight: 700;
  color: var(--accent, #2b5fbc);
  font-size: 15px;
  margin-right: 1px;
}
.hh-summary-unit {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
  margin-right: 4px;
}
.hh-card-chevron {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #2b5fbc);
  transition: transform 0.25s ease;
}
.hh-card-chevron svg {
  width: 18px;
  height: 18px;
}
.hh-card.open .hh-card-chevron {
  transform: rotate(180deg);
}

/* ⋯メニュー（右側・縦中央） */
.hh-card-menu {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-mute, #8898a8);
  cursor: pointer;
}
.hh-card-menu svg { width: 18px; height: 18px; }
.hh-card-menu:hover {
  background: var(--bg-warm, #f0f5fb);
  color: var(--ink-deep, #1a2740);
}
.hh-card-menu svg {
  width: 18px;
  height: 18px;
}

/* メニューポップオーバー */
.hh-card-menu-popover {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(14,26,46,0.18);
  padding: 6px;
  min-width: 160px;
  z-index: 100;
  border: 1px solid var(--line-soft, #e3eaf2);
}
.hh-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-deep, #1a2740);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.hh-menu-item:hover { background: var(--bg-warm, #f0f5fb); }
.hh-menu-item.hh-menu-danger { color: #c62828; }
.hh-menu-ic { font-size: 14px; width: 18px; text-align: center; }

/* 試合行（展開時） */
.hh-match-list {
  padding: 2px 10px 8px;
  background: var(--bg-soft, #f7faff);
  border-top: 1px solid var(--line-soft, #e3eaf2);
}
.hh-match-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(14,26,46,0.04);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

/* 動画ボタン（試合行右端・ピル型・控えめ） */
.hh-match-video {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 9px;
  min-width: 78px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--bg-warm, #f0f5fb);
  border: 1px dashed var(--line-soft, #cdd5e0);
  color: var(--ink-mute, #a0aab8);
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.1s, background 0.15s;
}
.hh-match-video:active { transform: scale(0.96); }
.hh-match-video svg { width: 9px; height: 9px; }
.hh-match-video-plus {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.hh-match-video.has-video {
  background: var(--accent, #2b5fbc);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(43,95,188,0.20);
}
.hh-match-row:last-child { border-bottom: none; }
.hh-match-row:active { background: rgba(43,95,188,0.06); }
.hh-match-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #2b5fbc);
  background: rgba(43,95,188,0.10);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.hh-match-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-deep, #1a2740);
  letter-spacing: 0.04em;
  text-align: center;
}
.hh-match-score-a,
.hh-match-score-b {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  color: var(--accent, #2b5fbc);
}
.hh-match-score-sep {
  margin: 0 6px;
  color: var(--ink-mute, #8898a8);
  font-weight: 600;
}

/* ========================================
   iOS Safari 自動ズーム防止
   - input の font-size が 16px 未満だと iOS は自動ズームする
   - 文字入力 input/textarea/select を 16px 以上に強制
   - viewport の user-scalable=yes はそのままなので、2本指ピンチズームは可能
   ======================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
input:not([type]),
textarea,
select {
  font-size: 16px !important;
}

/* ========================================
   個人成績ページ（page-stats）
   ======================================== */
#page-stats .stats-content {
  padding: 16px 14px 120px;
  background: var(--bg-base, #f5f8fc);
  min-height: 100vh;
  box-sizing: border-box;
}

/* サマリー */
.pstats-summary {
  display: flex;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 16px 8px;
  box-shadow: 0 1px 3px rgba(14,26,46,0.04);
}
.pstats-summary-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  border-top: 1px solid var(--line-soft, #e8edf4);
  border-radius: 0 0 14px 14px;
  padding: 10px 8px 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(14,26,46,0.04);
  font-size: 12px;
}
.pstats-sub-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.pstats-sub-label {
  color: var(--ink-mute, #8898a8);
  font-size: 11px;
}
.pstats-sub-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-deep, #1a2740);
  letter-spacing: -0.01em;
}
.pstats-sub-unit {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
}
.pstats-sub-sep {
  color: var(--ink-mute, #8898a8);
  font-size: 13px;
}
.pstats-sum-cell {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--line-soft, #e8edf4);
}
.pstats-sum-cell:last-child { border-right: none; }
.pstats-sum-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink-deep, #1a2740);
  letter-spacing: -0.01em;
}
.pstats-sum-num small {
  font-size: 13px;
  font-weight: 700;
  margin-left: 1px;
}
.pstats-sum-cell.highlight .pstats-sum-num { color: var(--ink-deep, #1a2740); }
.pstats-sum-label {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.pstats-w { color: var(--ink-deep, #1a2740); }
.pstats-l { color: #8898a8; }
.pstats-d { color: #8898a8; }

/* 空状態 */
.pstats-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-mute, #8898a8);
  background: #fff;
  border-radius: 14px;
  margin-bottom: 16px;
}
.pstats-empty-icon { font-size: 36px; margin-bottom: 8px; }
.pstats-empty p { margin: 4px 0; font-size: 13px; }

/* リスト */
.pstats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.pstats-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(14,26,46,0.04);
  position: relative;
  overflow: hidden;
}
.pstats-card-head {
  display: grid;
  grid-template-columns: 60px 1fr auto 28px;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 14px 16px;
  width: 100%;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.pstats-card-head:active { background: var(--bg-warm, #f0f5fb); }

/* 開閉トグルバー（カード下端中央） */
.pstats-card-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0 10px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line-soft, #e8edf4);
  color: var(--accent, #2b5fbc);
  cursor: pointer;
  font-family: inherit;
}
.pstats-card-toggle:active { background: var(--bg-warm, #f0f5fb); }
.pstats-card-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #2b5fbc);
  transition: transform 0.25s ease;
}
.pstats-card-chevron svg { width: 18px; height: 18px; }
.pstats-card.open .pstats-card-chevron { transform: rotate(180deg); }
/* 試合行リストとトグルバーが重なるとborder-topが二重になるので片方解除 */
.pstats-card.open .pstats-card-toggle { border-top: none; }
.pstats-card-date {
  text-align: center;
  flex-shrink: 0;
}
.pstats-card-year {
  font-size: 10px;
  color: var(--ink-mute, #8898a8);
  letter-spacing: 0.04em;
}
.pstats-card-md {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-deep, #1a2740);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.pstats-card-wd {
  font-size: 10px;
  color: var(--ink-mute, #8898a8);
}
.pstats-card-info {
  min-width: 0;
}
.pstats-card-tournament {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pstats-card-location {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
  margin-top: 1px;
}
.pstats-card-summary {
  text-align: right;
}
.pstats-card-count {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent, #2b5fbc);
}
.pstats-card-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute, #8898a8);
  margin-left: 1px;
}
.pstats-card-wl {
  font-size: 11px;
  color: var(--ink-body, #5b6877);
  margin-top: 1px;
}
.pstats-card-wlsep {
  margin-right: 2px;
  margin-left: 1px;
}
.pstats-card-menu {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink-mute, #8898a8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.pstats-card-menu:active { background: var(--bg-warm, #f0f5fb); }
.pstats-card-menu svg { width: 16px; height: 16px; }

/* 試合行 */
.pstats-card-matches {
  display: flex;
  flex-direction: column;
  padding: 4px 14px 12px;
  border-top: 1px solid var(--line-soft, #e8edf4);
}
.pstats-card-memo {
  margin: 0 14px 12px;
  padding: 10px 14px;
  background: var(--bg-warm, #f7f9fc);
  border-radius: 10px;
  border: 1px solid var(--line-soft, #e8edf4);
}
.pstats-card-memo-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute, #8898a8);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.pstats-card-memo-val {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-deep, #1a2740);
  white-space: pre-wrap;
  word-break: break-word;
}
.pstats-match-block { border-bottom: 1px solid rgba(14,26,46,0.04); }
.pstats-match-block:last-child { border-bottom: none; }
.pstats-match-row {
  display: grid;
  grid-template-columns: 56px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--ink-deep, #1a2740);
}
/* 中央集約：スコア + 名前(所属) を1まとめで中央寄せ */
.pstats-match-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.pstats-match-detail-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bg-warm, #f0f5fb);
  color: var(--ink-mute, #8898a8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.pstats-match-detail-btn:active { transform: scale(0.92); }
.pstats-match-detail-btn svg { width: 12px; height: 12px; }
.pstats-match-detail-btn.open { background: var(--accent, #2b5fbc); color: #fff; }
.pstats-match-detail-btn.open svg { transform: rotate(180deg); }

/* 詳細展開エリア */
.pstats-match-detail {
  background: var(--bg-warm, #f0f5fb);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 8px;
}
.pstats-match-detail-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  padding: 4px 0;
}
.pstats-match-detail-label {
  color: var(--ink-mute, #8898a8);
  font-weight: 600;
  flex-shrink: 0;
  width: 60px;
}
.pstats-match-detail-val {
  color: var(--ink-deep, #1a2740);
  font-weight: 600;
  flex: 1;
  word-break: break-word;
}
.pstats-match-detail-self { color: var(--accent, #2b5fbc); }
.pstats-match-detail-vs { color: var(--ink-mute, #8898a8); font-weight: 500; font-size: 11px; }
.pstats-match-detail-opp { color: var(--ink-deep, #1a2740); }
.pstats-match-detail-empty { color: var(--ink-mute, #a0aab8); font-style: italic; }

/* メモのtextarea */
.pstats-row-memo { align-items: flex-start !important; }
.pstats-row-memo .setup-row-label { padding-top: 6px; }
.pstats-match-memo-input {
  resize: vertical !important;
  text-align: left !important;
  min-height: 50px;
  font-family: inherit !important;
  padding: 4px 0 !important;
}
.pstats-match-row:last-child { border-bottom: none; }
.pstats-match-num {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
}
.pstats-match-score {
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.pstats-match-vs {
  color: var(--ink-deep, #1a2740);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 新規追加ボタン（旧）— 念のため残す */
.pstats-add-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent-grad, linear-gradient(135deg, #2b5fbc, #3d7ae8));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(43,95,188,0.30);
  transition: transform 0.1s;
}
.pstats-add-btn:active { transform: scale(0.985); }

/* FABボタン（右下に固定） */
.pstats-fab {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad, linear-gradient(135deg, #2b5fbc, #3d7ae8));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(43,95,188,0.40);
  z-index: 80;
  transition: transform 0.1s;
}
.pstats-fab:active { transform: scale(0.94); }
.pstats-fab svg { width: 26px; height: 26px; }

/* 編集モーダル */
.pstats-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(14,26,46,0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.pstats-edit-sheet {
  background: var(--bg-base, #f5f8fc);
  width: 100%;
  max-width: 480px;
  height: 92vh;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pstats-edit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
}
.pstats-edit-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-warm, #f0f5fb);
  border: none;
  color: var(--ink-deep, #1a2740);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pstats-edit-close svg { width: 16px; height: 16px; }
.pstats-edit-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  margin: 0;
}
/* タブ */
.pstats-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
}
.pstats-tab {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute, #8898a8);
  cursor: pointer;
  transition: all 0.15s;
}
.pstats-tab.active {
  color: var(--accent, #2b5fbc);
  border-bottom-color: var(--accent, #2b5fbc);
  font-weight: 700;
}
.pstats-tab:active { background: var(--bg-warm, #f0f5fb); }

.pstats-edit-body {
  padding: 16px 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.pstats-edit-footer {
  display: flex;
  gap: 8px;
  padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: #fff;
  border-top: 1px solid var(--line-soft, #e8edf4);
  align-items: center;
}
.pstats-edit-footer .pstats-save-btn {
  margin-top: 0;
  flex: 1;
  padding: 12px;
  font-size: 15px;
}
.pstats-edit-footer .pstats-delete-btn {
  margin-top: 0;
  width: auto;
  padding: 12px 16px;
  flex-shrink: 0;
}
.pstats-footer-spacer { flex-shrink: 0; }
.pstats-back-btn {
  padding: 12px 16px;
  background: transparent;
  border: 1.5px solid var(--line-soft, #e3eaf2);
  border-radius: 12px;
  color: var(--ink-body, #5b6877);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.pstats-back-btn:active { background: var(--bg-warm, #f0f5fb); }
.pstats-next-btn {
  flex: 1;
  padding: 14px;
  background: var(--accent-grad, linear-gradient(135deg, #2b5fbc, #3d7ae8));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(43,95,188,0.30);
}
.pstats-next-btn:active { transform: scale(0.985); }

/* 登録タブ：確認画面 */
.pstats-register-intro {
  text-align: center;
  padding: 12px 0 18px;
}
.pstats-register-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--accent, #2b5fbc);
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: 0 6px 16px rgba(43,95,188,0.30);
}
.pstats-register-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  margin: 0 0 4px;
}
.pstats-register-sub {
  font-size: 12px;
  color: var(--ink-mute, #8898a8);
  margin: 0;
}
.pstats-summary-row {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
  gap: 12px;
  font-size: 14px;
}
.pstats-summary-row:last-child { border-bottom: none; }
.pstats-summary-row-memo { align-items: flex-start; }
.pstats-summary-key {
  flex-shrink: 0;
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute, #8898a8);
}
.pstats-summary-val {
  flex: 1;
  font-weight: 600;
  color: var(--ink-deep, #1a2740);
  word-break: break-word;
  text-align: right;
}
.pstats-summary-row-memo .pstats-summary-val { text-align: left; line-height: 1.5; }

/* 登録タブの試合行サマリー */
.pstats-summary-match {
  display: grid;
  grid-template-columns: 56px 32px auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
  font-size: 13px;
}
.pstats-summary-match:last-child { border-bottom: none; }
.pstats-summary-match-waza {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding: 0 4px 10px 4px;
  margin-top: -4px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-soft, #e8edf4);
}
.pstats-summary-match-waza:last-child { border-bottom: none; }
.pstats-summary-match-waza-label {
  grid-column: 1;
  color: var(--ink-mute, #8898a8);
  font-size: 11px;
}
.pstats-summary-match-waza-val {
  grid-column: 2;
  color: var(--ink-deep, #1a2740);
  font-weight: 500;
}
.pstats-summary-match-num {
  font-size: 11px;
  color: var(--ink-mute, #8898a8);
}
.pstats-summary-match-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.pstats-summary-match-win { background: var(--accent, #2b5fbc); color: #fff; }
.pstats-summary-match-lose { background: var(--bg-warm, #f0f5fb); color: var(--ink-body, #5b6877); border: 1.5px solid var(--line-soft, #e3eaf2); }
.pstats-summary-match-draw { background: var(--bg-warm, #f0f5fb); color: var(--ink-deep, #1a2740); }
.pstats-summary-match-score {
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
  font-size: 14px;
}
.pstats-summary-match-opp {
  color: var(--ink-deep, #1a2740);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

/* 個人成績モーダル内：入力欄を中央寄せに */
.pstats-edit-sheet .setup-row-input {
  text-align: center !important;
}
.pstats-edit-sheet .setup-row-input::placeholder {
  text-align: center;
}

/* スコア入力（左右分割：自分 − 相手） */
.pstats-row-score { align-items: center; }
.pstats-score-split {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}
.pstats-score-input {
  width: 90px;
  text-align: center !important;
  border: 1.5px solid var(--line-soft, #e3eaf2) !important;
  border-radius: 10px;
  padding: 8px 6px !important;
  font-weight: 700 !important;
  background: #fff;
  color: var(--ink-deep, #1a2740);
  font-family: inherit !important;
  outline: none;
}
.pstats-score-input:focus {
  border-color: var(--accent, #2b5fbc) !important;
}
.pstats-score-input::placeholder {
  color: var(--ink-mute, #a0aab8);
  font-weight: 500;
}
.pstats-score-sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-deep, #1a2740);
}

/* 区分（大会/練習試合）ボタン */
.pstats-row-cat { align-items: center; }
.pstats-cat-btns {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}
.pstats-cat-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line-soft, #e3eaf2);
  background: #fff;
  color: var(--ink-body, #5b6877);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.pstats-cat-btn:active { transform: scale(0.96); }
.pstats-cat-btn.active {
  background: var(--accent, #2b5fbc);
  color: #fff;
  border-color: var(--accent, #2b5fbc);
  box-shadow: 0 4px 12px rgba(43,95,188,0.25);
}

/* 試合数カウンター */
.pstats-count-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pstats-count-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--line-soft, #e3eaf2);
  background: #fff;
  color: var(--ink-deep, #1a2740);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pstats-count-btn:active { background: var(--bg-warm, #f0f5fb); transform: scale(0.94); }
.pstats-count-input {
  width: 56px;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  border: 1.5px solid var(--line-soft, #e3eaf2) !important;
  border-radius: 8px;
  padding: 6px 0;
  background: #fff;
}

/* 詳細メモ */
.pstats-memo-card {
  padding: 0 !important;
}
.pstats-memo {
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-deep, #1a2740);
  outline: none;
  min-height: 120px;
  box-sizing: border-box;
}
.pstats-memo::placeholder { color: var(--ink-mute, #a0aab8); }

/* 結果ボタン群 */
.pstats-row-result { align-items: center; }
.pstats-result-btns {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}
.pstats-result-btn {
  width: 50px;
  padding: 8px 0;
  border-radius: 10px;
  border: 1.5px solid var(--line-soft, #e3eaf2);
  background: #fff;
  color: var(--ink-body, #5b6877);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.pstats-result-btn:active { transform: scale(0.96); }
.pstats-result-btn-win.active {
  background: var(--accent, #2b5fbc);
  color: #fff;
  border-color: var(--accent, #2b5fbc);
  box-shadow: 0 3px 8px rgba(43,95,188,0.25);
}
.pstats-result-btn-lose.active {
  background: #5b6877;
  color: #fff;
  border-color: #5b6877;
}
.pstats-result-btn-draw.active {
  background: #1a2740;
  color: #fff;
  border-color: #1a2740;
}

/* 保存・削除ボタン */
.pstats-save-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-grad, linear-gradient(135deg, #2b5fbc, #3d7ae8));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  box-shadow: 0 8px 20px rgba(43,95,188,0.30);
}
.pstats-save-btn:active { transform: scale(0.985); }
.pstats-delete-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #c62828;
  border: 1px solid rgba(198,40,40,0.30);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
}
.pstats-delete-btn:active { background: rgba(198,40,40,0.06); }
