/* ── 戦績テーブル ── */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  margin-top: 8px;
}
.stats-table th {
  background: #0f3460;
  color: #7ec8e3;
  padding: 6px 8px;
  text-align: center;
  font-weight: bold;
}
.stats-table td {
  padding: 5px 8px;
  text-align: center;
  border-bottom: 1px solid #1a2a4a;
  color: #ddd;
}
.stats-table tr:hover td { background: #0f1e35; }
.stats-name { text-align: left !important; }
.stats-rank { color: #888; }
.stats-wins { color: #4fc3f7; font-weight: bold; }
.stats-losses { color: #ef9a9a; }
.rate-high { color: #81c784; font-weight: bold; }
.rate-low  { color: #e57373; }
.stats-empty { text-align: center; color: #888; padding: 20px 0; }
.stats-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.stats-mode-tab {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.78em;
  background: #0f1e35;
  color: #7ec8e3;
  border: 1px solid #1a3a5c;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.stats-mode-tab.active {
  background: #0f3460;
  color: #fff;
  border-color: #4fc3f7;
}
.stats-mode-tab:hover:not(.active) { background: #162840; }

/* ── 戦績ヘッダー（モードタブ + 表/グラフ切り替え） ── */
.stats-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.stats-header .stats-mode-tabs { flex: 1; margin-bottom: 0; }
.stats-view-toggle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.stats-view-btn {
  padding: 4px 10px;
  font-size: 0.78em;
  background: #0f1e35;
  color: #7ec8e3;
  border: 1px solid #1a3a5c;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.stats-view-btn.active {
  background: #0f3460;
  color: #fff;
  border-color: #4fc3f7;
}
.stats-view-btn:hover:not(.active) { background: #162840; }

/* ── 勝率バーグラフ ── */
.stats-chart { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.stats-chart-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78em;
}
.stats-chart-name {
  width: 90px;
  flex-shrink: 0;
  color: #ccc;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-chart-bar-wrap {
  flex: 1;
  position: relative;
}
.stats-chart-bar {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  background: #0a0f1a;
  border: 1px solid #1a2a4a;
}
.stats-chart-fill { height: 100%; transition: width 0.3s ease; }
.stats-chart-fill-loss { background: #3a1a1a; }
.stats-chart-50 {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: #334;
  pointer-events: none;
}
.stats-chart-label {
  width: 72px;
  flex-shrink: 0;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}
.stats-chart-sub { color: #666; font-size: 0.9em; }
