/* ===== RESET & VARIABLES ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* BG — 段階のはっきりしたニュートラル寄りダーク */
  --bg-body: #0a0c12;
  --bg-surface: #11141c;
  --bg-card: #171b25;
  --bg-card-hover: #1e2330;
  --bg-elevated: #232936;
  --bg-input: #0d1017;

  /* Borders */
  --border: #232936;
  --border-light: #333b4c;
  --border-active: #4b7fc4;

  /* Text */
  --text-primary: #eef1f7;
  --text-secondary: #97a1b5;
  --text-muted: #626c81;
  --text-accent: #6fb0f5;

  /* Accents */
  --gold: #d0a447;
  --gold-light: #f2cd72;
  --blue: #4f8fdb;
  --blue-light: #6fb0f5;
  --green: #2fbf71;
  --green-dark: #26a35f;
  --red: #e5533d;
  --orange: #eda033;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
  --shadow-glow-gold: 0 0 0 1px rgba(208,164,71,0.35), 0 6px 20px rgba(208,164,71,0.12);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.14s var(--ease);
  --t-base: 0.22s var(--ease);

  /* Stat Colors */
  --stat-hp: #e74c3c;
  --stat-mana: #3498db;
  --stat-ad: #ff6b35;
  --stat-ap: #9b59f0;
  --stat-armor: #5dade2;
  --stat-mr: #a569f0;
  --stat-as: #f1c40f;
  --stat-crit: #e67e22;
  --stat-ms: #1abc9c;
  --stat-cdr: #95a5a6;
  --stat-pen: #e84393;
  --stat-ls: #fd79a8;
  --stat-ov: #fdcb6e;

  /* Category Colors */
  --cat-ad: #ff6b35;
  --cat-ap: #9b59f0;
  --cat-as: #f1c40f;
  --cat-defense: #3498db;
  --cat-boots: #1abc9c;
  --cat-support: #e91e63;
  --cat-enchant: #d4a017;

  /* Sizing */
  --header-h: 56px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

html {
  overflow-x: hidden;
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 上部にごくわずかな環境光。単調な黒一色を避ける */
  background-image:
    radial-gradient(1200px 480px at 50% -160px, rgba(79,143,219,0.07), transparent 70%),
    radial-gradient(900px 400px at 88% -80px, rgba(208,164,71,0.05), transparent 70%);
  background-attachment: fixed;
}

/* 見出しは詰めぎみ・太めでツール然とさせる */
h1, h2, h3, h4 {
  letter-spacing: -0.015em;
  line-height: 1.35;
}

/* 数値は等幅で桁を揃える（勝率・ステータス・ゴールドなど） */
.stat-value, .win-rate, .total-cost, .cr-num, .comp-stat-value,
.champ-winrate, .cs-val, .sum-value, .dmg-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  max-width: 100vw;
}

.header-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.logo-icon {
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, rgba(208,164,71,0.22), rgba(208,164,71,0.05));
  border: 1px solid rgba(208,164,71,0.32);
  flex-shrink: 0;
}

.logo-icon svg { width: 17px; height: 17px; }

.logo-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #f6dc9a, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-nav {
  display: flex;
  gap: 2px;
}

.nav-link {
  position: relative;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.045); }
.nav-link.active { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* アクティブタブは下線で示す（塗りつぶしより落ち着いて見える） */
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: -13px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.patch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(47,191,113,0.10);
  border: 1px solid rgba(47,191,113,0.28);
  color: #6ddc9d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* 「今のパッチのデータです」という生きてる感じを出す小さなドット */
.patch-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 6px #3ddc84;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover { border-color: var(--border-light); color: var(--text-primary); }

.mobile-menu-btn { display: none; }
.mobile-nav { display: none; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.hidden { display: none; }

.search-modal {
  width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.search-modal input {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: background 0.1s;
}

.search-result-item:hover { background: var(--bg-elevated); }
.search-result-item .sr-type { font-size: 11px; color: var(--text-muted); }

/* ===== MAIN LAYOUT ===== */
.main-content {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 28px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  gap: 28px;
  align-items: start;
}

/* 左カラムも幅を持たせつつ、追従させて空白を減らす */
.panel-left { min-width: 0; }

/* 右カラムは入れ子スクロールをやめ、ページ全体のスクロールに委ねる。
   代わりにチャンピオンカードだけを追従させて、常に「誰のビルドか」が見える状態にする。 */
.panel-right {
  position: static;
  max-height: none;
  overflow: visible;
  min-width: 0;
}

.panel-right > .stats-sticky > .champion-card {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 20;
}

/* ===== SECTION BASE ===== */
.section {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0) 120px),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

/* 区切り線は「見出しを持つ本物のヘッダー」だけに引く。
   フィルタ行など section-header を流用しているだけの要素には引かない。 */
.section-header:has(h2) {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}

.section-header h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 15px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(208,164,71,0.4);
}

/* ===== PAGE TITLE (下層ページ共通) =====
   各ページの<style>で個別定義していたものをここに集約 */
.page-title {
  position: relative;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: 26px;
  padding-bottom: 16px;
  line-height: 1.2;
}

.page-title span {
  background: linear-gradient(180deg, #f6dc9a, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* サブタイトルが続く場合はタイトル側の余白を詰める */
.page-title:has(+ .page-sub) { margin-bottom: 14px; }

/* 見出し下にごく短いアクセント線を入れて、ページの起点をはっきりさせる */
.page-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), rgba(208,164,71,0));
}

/* ===== CHAMPION SELECT ===== */
.role-filter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.role-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.role-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.role-btn.active {
  background: rgba(74, 144, 217, 0.15);
  border-color: var(--blue);
  color: var(--blue-light);
}

.lane-filter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.lane-filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.lane-filter-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.lane-filter-btn.active {
  background: rgba(200,155,60,0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

.champion-search-wrap {
  margin-bottom: 12px;
}

.champion-search-wrap input {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.champion-search-wrap input:focus { border-color: var(--blue); }

.champion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  /* 320pxだと窮屈で「窓から覗く」感じになるため、画面に合わせて広く取る */
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.champ-cell {
  padding: 12px 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  justify-content: flex-start;
}

/* レーティングバーと勝率を持つカード（ビルドシミュレーター側）だけ高さを揃える。
   カウンター検索ページのように名前だけのカードは、余白が空かないよう自然な高さのまま。 */
.champ-cell:has(.champ-ratings) { min-height: 158px; }

.champ-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--t-fast);
}

.champ-cell img {
  border-radius: 10px;
  transition: transform var(--t-base);
}

.champ-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.champ-cell:hover img { transform: scale(1.06); }

.champ-cell.active {
  border-color: rgba(208,164,71,0.85);
  background: linear-gradient(160deg, rgba(208,164,71,0.13), rgba(208,164,71,0.03));
  box-shadow: var(--shadow-glow-gold);
}

.champ-cell.active::before {
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.champ-cell .champ-name {
  font-size: 12px;
  font-weight: 700;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.champ-cell .champ-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* 勝率はカード下端に固定して、縦位置を揃える */
.champ-cell .champ-wr {
  margin-top: auto;
  padding-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* 難易度バッジ（カード右上） */
.champ-diff {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  z-index: 2;
  line-height: 1;
}
.champ-diff.diff-easy   { color: #37c871; background: rgba(55,200,113,0.15); border: 1px solid rgba(55,200,113,0.5); }
.champ-diff.diff-normal { color: #4a97e0; background: rgba(74,151,224,0.15); border: 1px solid rgba(74,151,224,0.5); }
.champ-diff.diff-hard   { color: #e0653f; background: rgba(224,101,63,0.15); border: 1px solid rgba(224,101,63,0.5); }

/* 物理/魔法レーティング（ミニバー） */
.champ-ratings {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}
.cr-row { display: flex; align-items: center; gap: 4px; }
.cr-icon { font-size: 10px; width: 12px; text-align: center; flex-shrink: 0; }
.cr-icon.ad { color: #e0653f; }
.cr-icon.ap { color: #9d7cff; }
.cr-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.cr-fill { display: block; height: 100%; border-radius: 999px; }
.cr-fill.ad { background: linear-gradient(90deg, #e0653f, #f0885f); }
.cr-fill.ap { background: linear-gradient(90deg, #7d5cff, #b79cff); }
.cr-num { font-size: 10px; font-weight: 700; width: 12px; text-align: right; flex-shrink: 0; color: var(--text-secondary); }

.selected-champion-banner {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(200,155,60,0.12), rgba(200,155,60,0.04));
  border: 1px solid rgba(200,155,60,0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-champion-banner.hidden { display: none; }

.selected-champion-banner .banner-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
}

.selected-champion-banner .banner-info {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== POPULAR BUILD ===== */
.popular-build-section {
  border-color: rgba(200, 155, 60, 0.3);
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.04), var(--bg-surface));
}

.popular-build-section.hidden { display: none; }

.popular-build-section .section-header h2::before {
  background: var(--gold);
}

/* 主要アクション（人気ビルドを適用など）はゴールドの実ボタンにして一目で分かるように */
.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(208,164,71,0.55);
  background: linear-gradient(180deg, rgba(208,164,71,0.26), rgba(208,164,71,0.12));
  color: var(--gold-light);
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast);
}

.btn-apply:hover {
  background: linear-gradient(180deg, rgba(208,164,71,0.40), rgba(208,164,71,0.20));
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(208,164,71,0.20);
  transform: translateY(-1px);
}

.btn-apply:active { transform: translateY(0); }

/* Lane Selector */
.lane-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lane-selector.hidden { display: none; }

.lane-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lane-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.lane-btn.active {
  background: linear-gradient(135deg, rgba(200,155,60,0.15), rgba(200,155,60,0.05));
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

.lane-btn .lane-icon {
  font-size: 14px;
}

.popular-build-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-playstyle {
  padding: 10px 14px;
  background: rgba(100, 181, 246, 0.08);
  border: 1px solid rgba(100, 181, 246, 0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.popular-playstyle .ps-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.popular-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popular-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.popular-items-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.popular-item-chip {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.popular-item-chip .pip-order {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-body);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-runes-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.popular-rune-chip {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
}

.popular-rune-chip.keystone {
  border-color: rgba(200, 155, 60, 0.4);
  background: rgba(200, 155, 60, 0.08);
  color: var(--gold-light);
  font-weight: 600;
}

/* ===== TIER LIST ===== */
.tier-lane-tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.tier-lane-tab {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.tier-lane-tab:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.tier-lane-tab.active {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px var(--border-light), 0 2px 8px rgba(0,0,0,0.35);
}

/* ティアごとに1本の帯にして、ランク差が縦に読めるようにする */
.tier-group {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tier-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  position: relative;
}

/* 帯の左端をティア色で塗り、一覧性を上げる */
.tier-label::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--tier-color, var(--border-light));
}

.tier-badge {
  width: 46px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.tier-badge.s-plus { background: linear-gradient(140deg, #ff7a6b, #e14a35); box-shadow: 0 4px 14px rgba(225,74,53,0.30); }
.tier-badge.s      { background: linear-gradient(140deg, #ffb44d, #ef8033); box-shadow: 0 4px 14px rgba(239,128,51,0.28); }
.tier-badge.a      { background: linear-gradient(140deg, #6fe39b, #2bbd6b); box-shadow: 0 4px 14px rgba(43,189,107,0.26); }
.tier-badge.b      { background: linear-gradient(140deg, #7ab5ff, #3d84e6); box-shadow: 0 4px 14px rgba(61,132,230,0.26); }
.tier-badge.c      { background: linear-gradient(140deg, #a7b1c2, #6c7688); box-shadow: 0 4px 14px rgba(108,118,136,0.22); }

.tier-group:has(.tier-badge.s-plus) { --tier-color: #e14a35; }
.tier-group:has(.tier-badge.s)      { --tier-color: #ef8033; }
.tier-group:has(.tier-badge.a)      { --tier-color: #2bbd6b; }
.tier-group:has(.tier-badge.b)      { --tier-color: #3d84e6; }
.tier-group:has(.tier-badge.c)      { --tier-color: #6c7688; }

.tier-label-text {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tier-champs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 16px;
  align-content: center;
}

.tier-champ {
  padding: 5px 12px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), box-shadow var(--t-fast);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* champImg() がインラインで border-radius を付けているため上書きする */
.tier-champ img {
  border-radius: 50% !important;
  border: 1px solid var(--border-light);
}

.tier-champ:hover {
  border-color: rgba(208,164,71,0.7);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tier-champ .tc-reason {
  display: none;
  font-size: 10px;
  color: var(--text-muted);
  max-width: 200px;
}

.tier-champ:hover .tc-reason {
  display: inline;
}

/* ===== TEAM COMP BUILDER ===== */
.team-comp-section {
  border-color: rgba(100, 181, 246, 0.2);
}

.counter-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.team-builder {
  margin-bottom: 16px;
}

.team-label {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

/* 敵/味方は絵文字ではなく色つきバーで区別する */
.team-label::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.enemy-label { color: #ff8570; }
.ally-label { color: var(--blue-light); }

.lane-slots {
  display: flex;
  gap: 8px;
}

.lane-slot {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 0;
}

.lane-slot:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.lane-slot.filled {
  border-color: var(--gold);
  background: rgba(200,155,60,0.06);
}

.lane-slot.filled:hover {
  border-color: var(--red);
}

.lane-slot-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.lane-slot-champ {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-slot:not(.filled) .lane-slot-champ {
  color: var(--text-muted);
  font-weight: 400;
}

/* Lane Picker */
.lane-picker {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 12px;
}

.lane-picker.hidden { display: none; }

.lane-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lane-picker-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-accent);
}

.lane-picker-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lane-picker-close:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.lane-picker input {
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}

.lane-picker input:focus { border-color: var(--blue); }

.lane-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.lp-champ {
  padding: 6px 4px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.1s;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-champ:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}

.lp-champ.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.lp-champ.lp-offmeta {
  opacity: 0.6;
}

.lp-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-search-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.lp-show-all-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.lp-show-all-toggle input {
  accent-color: var(--gold);
  cursor: pointer;
  margin: 0;
}

.lp-offmeta-divider {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-weight: 600;
}

/* Comp Analysis */
.comp-analysis {
  margin-top: 16px;
}

.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.analysis-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Star Rating */
.star-rating-section {
  background: linear-gradient(135deg, rgba(200,155,60,0.08), var(--bg-card));
  border: 1px solid rgba(200,155,60,0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}

.star-rating-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.star-rating-champ {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.stars {
  font-size: 28px;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.star-filled { color: var(--gold); }
.star-empty { color: var(--border); }

.star-verdict {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.verdict-great { color: var(--green); }
.verdict-good { color: var(--blue-light); }
.verdict-ok { color: var(--orange); }
.verdict-bad { color: var(--red); }

/* Comp Breakdown */
.comp-breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.comp-stat-box {
  flex: 1;
  min-width: 100px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.comp-stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.comp-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Recommended Picks */
.rec-lane-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rec-lane-tab {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.rec-lane-tab:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.rec-lane-tab.active {
  background: rgba(200,155,60,0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

.rec-champs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rec-champ-card {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid rgba(46,204,113,0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.rec-champ-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.rec-champ-card.avoid {
  border-color: rgba(231,76,60,0.2);
}

.rec-champ-card.avoid:hover {
  border-color: var(--red);
}

.rec-champ-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rec-champ-info {
  flex: 1;
  min-width: 0;
}

.rec-champ-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-champ-stars {
  font-size: 12px;
  font-weight: 600;
}

.rec-champ-reason {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Matchup Build */
.matchup-build {
  margin-top: 12px;
}

.matchup-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.matchup-tip {
  padding: 10px 14px;
  background: var(--bg-card);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.matchup-tip.critical {
  border-left-color: var(--red);
  background: rgba(231,76,60,0.05);
}

.matchup-tip.important {
  border-left-color: var(--orange);
  background: rgba(243,156,18,0.05);
}

.matchup-tip strong {
  color: var(--text-primary);
}

.matchup-swap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.comp-tag {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-tag:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.comp-tag.enemy.active {
  border-color: var(--red);
  background: rgba(231, 76, 60, 0.12);
  color: #ff7675;
  font-weight: 600;
}

.comp-tag.ally.active {
  border-color: var(--blue-light);
  background: rgba(100, 181, 246, 0.12);
  color: var(--blue-light);
  font-weight: 600;
}

.comp-icon {
  font-size: 14px;
}

.swap-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.swap-card .swap-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.swap-card .swap-header .swap-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.swap-badge.remove {
  background: rgba(231, 76, 60, 0.15);
  color: var(--red);
}

.swap-badge.add {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
}

.swap-arrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.swap-item {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.swap-item.from {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: var(--red);
  text-decoration: line-through;
  text-decoration-color: rgba(231, 76, 60, 0.5);
}

.swap-item.to {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.25);
  color: var(--green);
}

.swap-arrow {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

.swap-reason {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 4px;
}

.swap-apply-btn {
  margin-top: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.08);
  color: var(--green);
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}

.swap-apply-btn:hover {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--green);
}

.no-swap-message {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== BUILD COMPARE ===== */
.compare-panel { margin-top: 12px; }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.compare-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.compare-diff-col {
  min-width: 180px;
}

.compare-col-header {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.build-a-header { background: rgba(74,144,217,0.15); color: var(--blue-light); }
.build-b-header { background: rgba(243,156,18,0.15); color: var(--orange); }
.diff-header { background: rgba(155,89,240,0.15); color: #bb8fce; }

.compare-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.compare-slot {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  text-align: center;
  line-height: 1.1;
  padding: 2px;
}

.compare-slot:hover { border-color: var(--border-light); }
.compare-slot.filled { border-color: var(--gold); }
.compare-slot.filled img { border-radius: 4px; }
.compare-slot.editing { border-color: var(--orange); box-shadow: 0 0 8px rgba(243,156,18,0.3); }

.compare-cost {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
}

.compare-b-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.compare-diff-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compare-diff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.compare-diff-row .cdr-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.compare-diff-row .cdr-value {
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.cdr-positive { color: var(--green); background: rgba(46,204,113,0.06); }
.cdr-negative { color: var(--red); background: rgba(231,76,60,0.06); }
.cdr-neutral { color: var(--text-muted); }

.compare-shop-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}

.compare-shop {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.compare-shop input {
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}

.compare-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.compare-shop-item {
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
}

.compare-shop-item:hover { border-color: var(--gold); }
.compare-shop-item .csi-cost { color: var(--gold); font-weight: 600; margin-left: auto; }

/* Gold Efficiency */
.compare-gold-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.gold-eff-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gold-light);
}

.gold-eff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gold-eff-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.gold-eff-box.a { background: rgba(74,144,217,0.08); border: 1px solid rgba(74,144,217,0.2); }
.gold-eff-box.b { background: rgba(243,156,18,0.08); border: 1px solid rgba(243,156,18,0.2); }

.geff-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.geff-value { font-size: 22px; font-weight: 800; }
.geff-sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.geff-winner { border-color: var(--green) !important; }
.geff-winner .geff-value { color: var(--green); }

@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* ===== ITEM SLOTS ===== */
.item-slots-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.item-slots-row .item-slot { width: auto; }

.item-slot {
  width: 80px;
  height: 92px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  gap: 4px;
}

.item-slot.empty {
  color: var(--text-muted);
  cursor: pointer;
  background: rgba(255,255,255,0.012);
}

.item-slot.empty:hover {
  border-color: var(--blue-light);
  background: rgba(79,143,219,0.07);
  transform: translateY(-2px);
}

.item-slot.empty .slot-plus {
  font-size: 22px;
  line-height: 1;
  opacity: 0.35;
  transition: opacity var(--t-fast);
}

.item-slot.empty:hover .slot-plus { opacity: 0.8; }

.item-slot.empty .slot-label {
  font-size: 9px;
  opacity: 0.4;
  letter-spacing: 0.04em;
}

.item-slot.filled {
  border-style: solid;
  border-color: rgba(208,164,71,0.55);
  background: linear-gradient(165deg, rgba(208,164,71,0.13), var(--bg-card) 70%);
  padding: 6px 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.item-slot.filled:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.item-slot.filled img {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.item-slot.filled .slot-item-name {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  color: var(--text-primary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-slot.filled .slot-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}

.item-slot.filled:hover .slot-remove { display: flex; }
.item-slot.filled:hover { border-color: var(--red); }

.total-cost-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cost-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.cost-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.build-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-quick-apply {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid rgba(208,164,71,0.55);
  background: linear-gradient(180deg, rgba(208,164,71,0.26), rgba(208,164,71,0.12));
  color: var(--gold-light);
  font-size: 13px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast);
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-quick-apply:hover {
  background: linear-gradient(180deg, rgba(208,164,71,0.40), rgba(208,164,71,0.20));
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(208,164,71,0.20);
  transform: translateY(-1px);
}

.btn-quick-apply:active { transform: translateY(0); }

/* SVGに置き換えた稲妻アイコン */
.qa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qa-icon svg { width: 13px; height: 13px; }
.btn-quick-apply-sm .qa-icon svg { width: 11px; height: 11px; }

.btn-quick-apply:hover {
  background: linear-gradient(135deg, rgba(200,155,60,0.35), rgba(200,155,60,0.15));
  box-shadow: 0 0 12px rgba(200,155,60,0.2);
}

.btn-quick-apply .qa-icon {
  font-size: 15px;
}

.btn-quick-apply-sm {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(200,155,60,0.4);
  background: rgba(200,155,60,0.08);
  color: var(--gold-light);
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-quick-apply-sm:hover {
  background: rgba(200,155,60,0.2);
  border-color: var(--gold);
}

.btn-quick-apply-sm .qa-icon {
  font-size: 12px;
}

/* ===== Workbench Tabs (build / analyze / compare) ===== */
.wb-tabs {
  display: flex;
  gap: 3px;
  margin: 0 0 18px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.wb-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}

.wb-tab svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }

.wb-tab:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.wb-tab.active {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-light), 0 2px 8px rgba(0,0,0,0.35);
}

.wb-tab.active svg { opacity: 1; color: var(--gold-light); }

.wb-panel.hidden {
  display: none;
}

/* ===== App view switch: champion-select screen vs build/stats screen ===== */
/* Top "change champion" bar — only on the build screen, spans full width, sits first */
/* 幅いっぱいの帯だと「空の枠」に見えるので、必要な幅だけの戻るボタンにする */
.back-to-select {
  grid-column: 1 / -1;
  justify-self: start;
  display: none;
  width: auto;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
}
.back-to-select:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
  transform: translateX(-2px);
}

/* SELECT view: show only the champion picker grid */
body.view-select .wb-tabs,
body.view-select .wb-panel,
body.view-select .panel-right { display: none; }
body.view-select .main-content { grid-template-columns: 1fr; }

/* BUILD view: hide the picker section entirely, show the top change-champion bar */
body.view-build .champion-section { display: none; }
body.view-build .back-to-select { display: block; }

/* ===== Item picker modal: tap-to-expand description + equip button ===== */
.modal-shop-item { cursor: pointer; }
.modal-shop-item .shop-item-row { align-items: center; }
.modal-item-chevron {
  margin-left: auto;
  padding-left: 8px;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.modal-shop-item.expanded .modal-item-chevron { transform: rotate(180deg); }

.modal-item-detail { display: none; padding: 10px 4px 4px; }
.modal-shop-item.expanded .modal-item-detail { display: block; }

.mid-effect {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.mid-effect-label {
  display: inline-block;
  font-weight: 700;
  color: var(--gold-light);
  margin-right: 6px;
}
.mid-effect-none { color: var(--text-muted); font-style: italic; }

.mid-add-btn {
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-active);
  background: rgba(74,144,217,0.12);
  color: var(--blue-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.mid-add-btn:hover { background: rgba(74,144,217,0.22); }

/* ===== Popular build picker (lane tabs: usage / win) ===== */
.bp-patch {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-light);
  margin-left: 8px;
}
.bp-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
}
.bp-tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.bp-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.bp-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-active);
  box-shadow: inset 0 -2px 0 var(--blue-light);
}
/* レーン別タブ（アイコン＋ラベル＋使用率を縦積み） */
.bp-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
}
.bp-tab .lane-ico, .bp-tab img { width: 20px; height: 20px; }
.bp-tab-label { font-size: 12px; font-weight: 700; }
.bp-tab-pick { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.bp-tab.active .bp-tab-pick { color: var(--blue-light); }
.bp-hint { margin: 8px 16px 0; font-size: 11px; color: var(--text-muted); }
/* 構成タイプタブ（第2階層） */
.bp-vtabs { display: flex; gap: 6px; margin: 0 0 12px; }
.bp-vtab {
  flex: 1;
  padding: 7px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.bp-vtab:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.bp-vtab.active {
  background: var(--gold-dim, rgba(200,155,60,0.16));
  color: var(--gold-light);
  border-color: var(--gold-light);
}
.bp-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; margin: 6px 0 4px; }
.bp-subrunes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bp-subrune { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-secondary); }
.bp-subrune img { border-radius: 50%; }
.bp-empty { padding: 24px; text-align: center; color: var(--text-muted); }
/* 次の一手レコメンド */
.next-item-rec:empty { display: none; }
.next-item-rec {
  margin-top: 14px;
  padding: 12px;
  background: rgba(100,181,246,0.07);
  border: 1px solid rgba(100,181,246,0.3);
  border-radius: var(--radius-md);
}
.nir-title {
  font-size: 12px; font-weight: 800; color: var(--blue-light);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.02em;
}
/* 絵文字の代わりに他の見出しと同じカラーバーで揃える */
.nir-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 999px;
  background: currentColor; flex-shrink: 0;
}
.nir-sub { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.nir-list { display: flex; flex-direction: column; gap: 8px; }
.nir-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.nir-item:hover { background: var(--bg-card-hover); border-color: var(--blue-light); }
.nir-item img { border-radius: 6px; flex-shrink: 0; }
.nir-txt { display: flex; flex-direction: column; flex: 1; line-height: 1.45; min-width: 0; }
.nir-txt b { font-size: 13px; font-weight: 700; }
.nir-txt span { font-size: 11.5px; color: var(--text-secondary); }
.nir-add {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(100,181,246,0.18); color: var(--blue-light); font-weight: 800; font-size: 16px;
}
/* プロ目線の解説ボックス */
.bp-guide {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: rgba(200,155,60,0.10);
  border: 1px solid rgba(200,155,60,0.35);
  border-radius: var(--radius-sm);
}
.bp-guide-icon { font-size: 15px; line-height: 1.4; flex-shrink: 0; }
.bp-guide-title { font-size: 11px; font-weight: 800; color: var(--gold-light); margin-bottom: 2px; }
.bp-guide-body p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-primary); }
/* アイテム解説リスト */
.bp-reasons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bp-reason { display: flex; align-items: flex-start; gap: 8px; }
.bp-reason img { border-radius: 4px; flex-shrink: 0; margin-top: 1px; }
.bp-reason-txt { display: flex; flex-direction: column; line-height: 1.45; }
.bp-reason-txt b { font-size: 12px; color: var(--text-primary); font-weight: 700; }
.bp-reason-txt span { font-size: 11.5px; color: var(--text-secondary); }

.bp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.bp-card:hover { border-color: var(--border-active); }
.bp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.bp-lane { display: flex; align-items: center; gap: 6px; }
.bp-lane-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.bp-base-tag {
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.bp-metrics { display: flex; gap: 10px; }
.bp-metric { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.bp-metric-label { font-size: 10px; font-weight: 500; color: var(--text-muted); }
.bp-metric.primary { color: var(--gold-light); }
.bp-metric.stat-high { color: var(--green); }
.bp-metric.stat-mid { color: var(--text-secondary); }
.bp-metric.stat-low { color: var(--red); }
.bp-items { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.bp-item img { border-radius: 4px; display: block; }
.bp-rune {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.bp-rune img { border-radius: 50%; }
.bp-apply {
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-active);
  background: rgba(74,144,217,0.12);
  color: var(--blue-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.bp-card:hover .bp-apply { background: rgba(74,144,217,0.22); }

/* 破壊的操作なので、主要アクションより一段控えめなゴーストボタンにする */
.btn-reset {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.btn-reset:hover {
  background: rgba(229,83,61,0.10);
  border-color: rgba(229,83,61,0.5);
  color: #ff8570;
}

/* ===== RUNE BUILD ROW ===== */
.rune-build-row {
  display: flex;
  gap: 16px;
}

.rune-group-box {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.rune-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.rune-slot-display {
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.rune-slot-display.active {
  color: var(--gold-light);
  background: rgba(200,155,60,0.1);
  border: 1px solid rgba(200,155,60,0.3);
}

.rune-slots-display {
  display: flex;
  gap: 6px;
}

.rune-slot-mini {
  flex: 1;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rune-slot-mini.active {
  color: var(--blue-light);
  background: rgba(74,144,217,0.1);
  border: 1px solid rgba(74,144,217,0.3);
}

/* ===== ITEM SHOP ===== */
.shop-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chip:hover { border-color: var(--border-light); color: var(--text-primary); }
.filter-chip.active {
  background: rgba(74,144,217,0.12);
  border-color: var(--blue);
  color: var(--blue-light);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chip-dot.ad { background: var(--cat-ad); }
.chip-dot.ap { background: var(--cat-ap); }
.chip-dot.as { background: var(--cat-as); }
.chip-dot.defense { background: var(--cat-defense); }
.chip-dot.boots { background: var(--cat-boots); }
.chip-dot.support { background: var(--cat-support); }
.chip-dot.enchant { background: var(--cat-enchant); }

.item-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-item {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.shop-item:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.shop-item .item-cat-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.shop-item[data-category="ad"] .item-cat-indicator { background: var(--cat-ad); }
.shop-item[data-category="ap"] .item-cat-indicator { background: var(--cat-ap); }
.shop-item[data-category="as"] .item-cat-indicator { background: var(--cat-as); }
.shop-item[data-category="defense"] .item-cat-indicator { background: var(--cat-defense); }
.shop-item[data-category="boots"] .item-cat-indicator { background: var(--cat-boots); }
.shop-item[data-category="support"] .item-cat-indicator { background: var(--cat-support); }
.shop-item[data-category="enchant"] .item-cat-indicator { background: var(--cat-enchant); }

.shop-item .shop-item-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-left: 8px;
}

.shop-item .shop-item-icon {
  flex: 0 0 auto;
}

.shop-item .shop-item-icon img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.shop-item .shop-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-item .item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

/* アイテム名が2〜3行に折り返して読みにくかったため、
   モーダル内は列を広く取り、価格は縮まないようにする */
#modal-item-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.shop-item .item-cost {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.shop-item .shop-item-body .item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding-left: 0;
}

.shop-item .shop-item-body .item-stats-tags {
  padding-left: 0;
}

.shop-item .item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding-left: 8px;
}

.shop-item .item-cost {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

.shop-item .item-stats-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 8px;
}

.stat-tag {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(46,204,113,0.1);
  color: var(--green);
}

.shop-item .item-desc-preview {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== RUNE SELECTION ===== */
.rune-category-block {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rune-category-header {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.rune-category-header.domination { background: linear-gradient(135deg, rgba(231,76,60,0.15), rgba(231,76,60,0.05)); color: #ff6b6b; border-bottom: 2px solid rgba(231,76,60,0.3); }
.rune-category-header.precision { background: linear-gradient(135deg, rgba(241,196,15,0.15), rgba(241,196,15,0.05)); color: #f1c40f; border-bottom: 2px solid rgba(241,196,15,0.3); }
.rune-category-header.sorcery { background: linear-gradient(135deg, rgba(100,181,246,0.15), rgba(100,181,246,0.05)); color: #64b5f6; border-bottom: 2px solid rgba(100,181,246,0.3); }
.rune-category-header.resolve { background: linear-gradient(135deg, rgba(46,204,113,0.15), rgba(46,204,113,0.05)); color: #2ecc71; border-bottom: 2px solid rgba(46,204,113,0.3); }
.rune-category-header.inspiration { background: linear-gradient(135deg, rgba(155,89,240,0.15), rgba(155,89,240,0.05)); color: #b39ddb; border-bottom: 2px solid rgba(155,89,240,0.3); }

.rune-category-body {
  padding: 12px 16px;
  background: var(--bg-card);
}

.rune-tier-group {
  margin-bottom: 12px;
}

.rune-tier-group:last-child { margin-bottom: 0; }

.rune-tier-label {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  margin-bottom: 8px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Tier labels colored by category */
.rune-tier-label.rtl-domination {
  background: rgba(231,76,60,0.12);
  color: #ff6b6b;
  border-left: 3px solid #e74c3c;
}

.rune-tier-label.rtl-precision {
  background: rgba(241,196,15,0.12);
  color: #f1c40f;
  border-left: 3px solid #f1c40f;
}

.rune-tier-label.rtl-sorcery {
  background: rgba(100,181,246,0.12);
  color: #64b5f6;
  border-left: 3px solid #2e86c1;
}

.rune-tier-label.rtl-resolve {
  background: rgba(46,204,113,0.12);
  color: #2ecc71;
  border-left: 3px solid #27ae60;
}

.rune-tier-label.rtl-inspiration {
  background: rgba(155,89,240,0.12);
  color: #bb8fce;
  border-left: 3px solid #8e44ad;
}

.rune-select-group {
  margin-bottom: 16px;
}

.rune-select-group:last-child { margin-bottom: 0; }

.rune-select-group h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.rune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.rune-cell {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.rune-cell:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.rune-cell.active {
  border-color: var(--gold);
  background: rgba(200,155,60,0.08);
}

.rune-cell .rune-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.rune-cell .rune-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.rune-cell .rune-stats-tag {
  margin-top: 5px;
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
}

/* ===== RIGHT PANEL: CHAMPION CARD ===== */
.champion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.champ-card-placeholder {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.champ-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.champ-card-content .cc-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-light);
}

.champ-card-content .cc-title {
  font-size: 13px;
  color: var(--text-secondary);
}

.champ-card-content .cc-tags {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.cc-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(74,144,217,0.12);
  color: var(--blue-light);
  border: 1px solid rgba(74,144,217,0.25);
}

/* ===== CHAMPION CARD LANES ===== */
.cc-lanes {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-lanes-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.cc-lanes-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Official Wild Rift position icons (image) */
.lane-ico {
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}

.lane-ico-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--gold-light);
}

/* ===== CHAMPION STATS (WIN/PICK/BAN) ===== */
.cc-stats-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cc-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.cc-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-high { color: #4ecb71; }
.stat-mid { color: var(--text-primary); }
.stat-low { color: #e74c4c; }

.champ-wr {
  font-size: 10px;
  font-weight: 700;
  margin-top: 1px;
}

/* ===== COUNTER & SYNERGY ===== */
.counter-synergy-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.cs-group {
  margin-bottom: 14px;
}

.cs-group:last-child { margin-bottom: 0; }

.cs-title {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

/* 絵文字アイコンをやめ、色つきの縦バーで「苦手/得意」を示す */
.cs-counter-title { color: #ff8570; }
.cs-synergy-title { color: #57d693; }
.cs-title::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.cs-champ-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  /* 下端をフェードさせ「まだ続きがある」ことを示す */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent 100%);
}
/* 理由付きマッチアップ項目 */
.cs-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cs-item:hover { background: var(--bg-card-hover); border-color: var(--border-active); }
.cs-item-head { display: flex; align-items: center; gap: 8px; }
.cs-item .cs-champ-img { width: 34px; height: 34px; border-width: 2px; flex-shrink: 0; }
.cs-item-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.cs-noimg { width: 100%; height: 100%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cs-samelane {
  font-size: 9px; font-weight: 700; color: var(--blue-light);
  border: 1px solid var(--blue-light); border-radius: 999px; padding: 1px 6px; margin-left: auto;
}
.cs-lane-tag {
  font-size: 9px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; margin-left: auto;
}
.cs-item-reason {
  font-size: 11px; line-height: 1.5; color: var(--text-secondary);
  margin: 6px 0 0; padding-left: 42px;
}
.cs-empty { font-size: 12px; color: var(--text-muted); }

.cs-champ {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s;
}

.cs-champ:hover { transform: scale(1.05); }

.cs-champ-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
}

.cs-champ-img.counter { border-color: var(--red); }
.cs-champ-img.synergy { border-color: var(--green); }

.cs-champ-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-champ-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== PASSIVE PANELS ===== */
.passive-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.passive-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.passive-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
}

.champ-passive-box {
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cp-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.cp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.item-passive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-card {
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ip-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.ip-passive-text {
  font-size: 11px;
  color: var(--text-accent);
  margin-bottom: 4px;
  font-weight: 500;
}

.ip-calc {
  font-size: 11px;
  color: var(--green);
  line-height: 1.5;
  padding: 6px 8px;
  background: rgba(46,204,113,0.06);
  border-radius: 4px;
  border-left: 2px solid var(--green);
}

.ip-stackable {
  border-left-color: var(--orange);
  background: rgba(243,156,18,0.06);
  color: var(--orange);
}

/* ===== RIGHT PANEL: STATS ===== */
.stats-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0) 120px),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.stats-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.stats-panel-header h2 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}

.stats-panel-header h2::before {
  content: '';
  width: 3px;
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 8px rgba(208,164,71,0.4);
}

.stats-legend {
  display: flex;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.base { background: var(--blue); }
.legend-dot.bonus { background: var(--green); }

/* 左カラムは幅が広いので、幅いっぱいに1本ずつ並べず2列に分ける。
   バーが間延びせず、一画面に収まる項目数も増える。 */
.stats-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 6px 28px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}

.stat-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.stat-icon-box svg { width: 14px; height: 14px; }

/* アイコンはバーと同じ色にして、行ごとの対応が一目で分かるようにする */
.stat-icon-box.icon-hp          { color: var(--stat-hp); }
.stat-icon-box.icon-mana        { color: var(--stat-mana); }
.stat-icon-box.icon-ad          { color: var(--stat-ad); }
.stat-icon-box.icon-ap          { color: var(--stat-ap); }
.stat-icon-box.icon-armor       { color: var(--stat-armor); }
.stat-icon-box.icon-mr          { color: var(--stat-mr); }
.stat-icon-box.icon-as          { color: var(--stat-as); }
.stat-icon-box.icon-critRate    { color: var(--stat-crit); }
.stat-icon-box.icon-critDmg     { color: var(--stat-crit); }
.stat-icon-box.icon-moveSpeed   { color: var(--stat-ms); }
.stat-icon-box.icon-cdReduction { color: var(--stat-cdr); }
.stat-icon-box.icon-armorPen    { color: var(--stat-pen); }
.stat-icon-box.icon-magicPen    { color: var(--stat-pen); }
.stat-icon-box.icon-lifeSteal   { color: var(--stat-ls); }
.stat-icon-box.icon-omnivamp    { color: var(--stat-ov); }

.stat-label {
  width: 60px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stat-bar-wrap {
  flex: 1;
  min-width: 0;
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.stat-bar-base {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s var(--ease);
  opacity: 0.85;
}

.stat-bar-bonus {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s var(--ease), left 0.45s var(--ease);
  background: linear-gradient(90deg, #34d07f, #57e39b);
  box-shadow: 0 0 8px rgba(52,208,127,0.45);
}

/* Stat bar colors */
.stat-bar-base.hp { background: var(--stat-hp); }
.stat-bar-base.mana { background: var(--stat-mana); }
.stat-bar-base.ad { background: var(--stat-ad); }
.stat-bar-base.ap { background: var(--stat-ap); }
.stat-bar-base.armor { background: var(--stat-armor); }
.stat-bar-base.mr { background: var(--stat-mr); }
.stat-bar-base.as { background: var(--stat-as); }
.stat-bar-base.critRate { background: var(--stat-crit); }
.stat-bar-base.critDmg { background: var(--stat-crit); }
.stat-bar-base.moveSpeed { background: var(--stat-ms); }
.stat-bar-base.cdReduction { background: var(--stat-cdr); }
.stat-bar-base.armorPen { background: var(--stat-pen); }
.stat-bar-base.magicPen { background: var(--stat-pen); }
.stat-bar-base.lifeSteal { background: var(--stat-ls); }
.stat-bar-base.omnivamp { background: var(--stat-ov); }

.stat-values {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  min-width: 96px;
  flex-shrink: 0;
}

.stat-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-bonus {
  font-size: 10px;
  font-weight: 800;
  color: #57e39b;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(52,208,127,0.12);
  white-space: nowrap;
}

.stat-no-change {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

/* ===== DAMAGE CALCULATOR ===== */
.dmg-calc-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.dmg-target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dmg-select {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.dmg-select:focus { border-color: var(--blue); }

.dmg-target-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.dmg-input-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dmg-input-row label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.dmg-input-row input {
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  text-align: center;
}

.dmg-input-row input:focus { border-color: var(--blue); }

.dmg-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dmg-result-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.dmg-group-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dmg-group-title.physical { color: var(--stat-ad); }
.dmg-group-title.magic { color: var(--stat-ap); }
.dmg-group-title.ehp { color: var(--stat-armor); }

.dmg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
}

.dmg-row .dmg-label { color: var(--text-secondary); }
.dmg-row .dmg-value { font-weight: 700; color: var(--text-primary); }

.dmg-bar-wrap {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.dmg-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.dmg-bar.physical { background: linear-gradient(90deg, var(--stat-ad), #ff8a5c); }
.dmg-bar.magic { background: linear-gradient(90deg, var(--stat-ap), #c39bff); }
.dmg-bar.ehp-phys { background: linear-gradient(90deg, var(--stat-armor), #7ec8e3); }
.dmg-bar.ehp-mag { background: linear-gradient(90deg, var(--stat-mr), #c39bff); }

.dmg-big-num {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  margin: 4px 0;
}

.dmg-vs-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== BUILD SUMMARY ===== */
.summary-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.summary-panel h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.build-summary-content .placeholder-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.summary-item:last-child { border-bottom: none; }

.summary-stat-name {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-change {
  font-weight: 700;
}

.summary-change.up { color: var(--green); }
.summary-change.neutral { color: var(--text-muted); }

.summary-message-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(46,204,113,0.08);
  border: 1px solid rgba(46,204,113,0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--green);
  line-height: 1.7;
}

/* ===== RUNE PICKER MODAL ===== */
.rune-modal-overlay {
  position: fixed;
  inset: 0;
  /* 背面をしっかり落として、モーダルに視線が集まるようにする */
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rune-modal {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 160px),
    var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.5);
  overflow: hidden;
}

.rune-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}

.rune-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.rune-modal-close {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.rune-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.rune-modal-body {
  overflow-y: auto;
  padding: 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.rune-modal-body .rune-cell {
  cursor: pointer;
}

.rune-slot-display, .rune-slot-mini {
  cursor: pointer;
}

.rune-slot-display:hover, .rune-slot-mini:hover {
  border-color: var(--blue-light) !important;
}

/* ===== TOOLTIP ===== */
.tooltip {
  display: none;
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px;
  max-width: 300px;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}

.tooltip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.tooltip-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.tooltip-stats {
  font-size: 12px;
  color: var(--green);
  line-height: 1.6;
}

.tooltip-passive {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-accent);
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
/* Mobile details toggle button - hidden on desktop */
.mobile-details-btn {
  display: none;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-active);
  background: rgba(74,144,217,0.08);
  color: var(--blue-light);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-bottom: 10px;
}

.mobile-details-btn:hover {
  background: rgba(74,144,217,0.15);
}

@media (max-width: 1024px) {
  .mobile-details-btn { display: block; }
  .main-content {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Right panel appears FIRST on mobile (champion info at top) */
  .main-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .panel-right {
    order: -1;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .panel-left {
    order: 1;
  }

  /* Make right panel collapsible sections on mobile */
  .stats-sticky {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Champion card: compact horizontal on mobile */
  .champion-card { padding: 14px; }

  /* Hide less critical right panel sections by default on mobile (ダメージ計算/サマリーはトグル) */
  .summary-panel,
  .dmg-calc-panel {
    display: none;
  }

  /* Show them with a toggle */
  .panel-right.show-details .summary-panel,
  .panel-right.show-details .dmg-calc-panel {
    display: block;
  }

  /* ステータス詳細: 右パネル内(元位置)では非表示、ビルド欄に移動したものは常時表示 */
  .panel-right .stats-panel { display: none; }
  .stats-panel.stats-in-build { display: block; margin-top: 12px; }

  /* Touch devices have no hover: keep the item remove (×) always visible */
  .item-slot.filled .slot-remove {
    display: flex;
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  /* Change-champion bar pinned above the champion card on mobile */
  .back-to-select { order: -2; }

  .header-nav { display: none; }

  /* ハンバーガーは廃止。ナビは常時タブバーとして表示 */
  .mobile-menu-btn { display: none !important; }

  .mobile-nav {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar { display: none; }

  .mobile-nav.hidden { display: flex; } /* hidden指定でも常時表示 */

  .mobile-nav-link {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: all 0.15s;
  }

  .mobile-nav-link.active {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 2px 8px rgba(74,144,217,0.4);
  }

  .mobile-nav-link:hover { background: var(--bg-card-hover); }
  .mobile-nav-link.active:hover { background: var(--blue); }

  /* Lane slots: smaller on tablet */
  .lane-slots { gap: 4px; }
  .lane-slot { padding: 6px 2px; }

  /* Compare grid: stack vertically */
  .compare-grid { grid-template-columns: 1fr; }
  .compare-diff-col { min-width: auto; }

  /* Rune categories */
  .rune-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 640px) {
  .main-content {
    padding: 6px;
    gap: 10px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .panel-left, .panel-right {
    max-width: 100%;
    overflow-x: hidden;
  }

  .section {
    padding: 10px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Header */
  .header-inner { padding: 0 12px; gap: 8px; }
  .logo-text { font-size: 15px; }
  .patch-badge { font-size: 9px; padding: 2px 6px; }

  /* Champion card: more compact */
  .champion-card { padding: 10px; margin-bottom: 10px; }
  .cc-name { font-size: 18px !important; }
  .cc-tag { font-size: 10px; padding: 2px 8px; }

  /* Counter/Synergy: smaller icons */
  .cs-champ-img { width: 44px; height: 44px; }
  .cs-champ-name { font-size: 9px; max-width: 50px; }
  .cs-champ-list { gap: 8px; }

  /* Passive panel */
  .passive-panel { padding: 10px 12px; margin-bottom: 10px; }

  /* Champion grid: 3 wider columns, taller area (extends downward) on mobile */
  .champion-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 64vh;
    gap: 8px;
  }

  .champ-cell { padding: 10px 6px; }
  .champ-cell img { width: 46px !important; height: 46px !important; }
  .champ-name { font-size: 11px; }
  .champ-meta { font-size: 9px; }

  /* Role & Lane filters: scrollable */
  .role-filter, .lane-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .role-filter::-webkit-scrollbar, .lane-filter::-webkit-scrollbar { display: none; }
  .role-btn, .lane-filter-btn { white-space: nowrap; flex-shrink: 0; font-size: 11px; padding: 4px 10px; }

  /* Section headers */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-header h2 { font-size: 14px; }

  /* Item slots: 3x2 grid */
  .item-slots-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .item-slot { width: auto; height: 70px; }

  /* Item shop: single column */
  .item-shop-grid { grid-template-columns: 1fr; max-height: 300px; }
  .shop-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shop-filters::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; }

  /* Rune build row */
  .rune-build-row { flex-direction: column; gap: 8px; }

  /* Rune grid: 2 columns */
  .rune-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .rune-cell { padding: 8px 10px; }
  .rune-cell .rune-name { font-size: 12px; }
  .rune-cell .rune-desc { font-size: 10px; }

  /* Team comp: lanes smaller */
  .lane-slots { gap: 3px; }
  .lane-slot { padding: 4px 2px; }
  .lane-slot-label { font-size: 9px; }
  .lane-slot-champ { font-size: 10px; }
  .lane-slot-champ img { width: 20px !important; height: 20px !important; }

  /* Lane picker grid */
  .lane-picker-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }

  /* Popular build items */
  .popular-items-row { flex-wrap: wrap; }
  .popular-item-chip { font-size: 11px; padding: 4px 8px; }

  /* Build actions */
  .btn-quick-apply { font-size: 11px; padding: 6px 12px; }
  .btn-reset { font-size: 11px; }

  /* Compare */
  .compare-slots { gap: 4px; }
  .compare-slot { width: 48px; height: 48px; }

  /* Rec champs */
  .rec-champs-grid { grid-template-columns: 1fr; }
  .rec-lane-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rec-lane-tabs::-webkit-scrollbar { display: none; }
  .rec-lane-tab { flex-shrink: 0; }

  /* Stats panel (when visible) */
  .stat-row { gap: 4px; }
  .stat-label { width: 40px; font-size: 10px; }
  .stat-values { min-width: 55px; }
  .stat-total { font-size: 11px; }
  .stat-bar-wrap { min-width: 0; }

  /* Prevent overflow on all elements */
  .selected-champion-banner { flex-wrap: wrap; }
  .section-header h2 { font-size: 13px; word-break: break-all; }
  .build-actions { flex-wrap: wrap; gap: 6px; }
  .btn-quick-apply { font-size: 10px; padding: 5px 10px; }

  /* Item slots overflow fix */
  .total-cost-row { flex-wrap: wrap; }

  /* Popular build overflow */
  .popular-items-row { gap: 4px; }
  .popular-item-chip { font-size: 10px; padding: 3px 6px; }
  .popular-item-chip .pip-order { width: 16px; height: 16px; font-size: 9px; }
  .popular-runes-row { flex-wrap: wrap; gap: 4px; }
  .popular-rune-chip { font-size: 10px; padding: 4px 8px; }

  /* Compare: prevent overflow */
  .compare-grid { gap: 8px; }
  .compare-col { padding: 8px; }
  .compare-slot { width: 44px; height: 44px; }

  /* Gold efficiency */
  .gold-eff-grid { grid-template-columns: 1fr; gap: 8px; }
  .geff-value { font-size: 18px; }

  /* Rec picks */
  .rec-champ-card { padding: 8px; }
  .rec-champ-name { font-size: 12px; }

  /* Swap cards */
  .swap-arrow-row { flex-wrap: wrap; gap: 6px; }
  .swap-item { font-size: 11px; }

  /* Damage calc */
  .dmg-target-stats { flex-wrap: wrap; }
  .dmg-input-row { min-width: 60px; }

  /* Tooltip: full width on mobile */
  .tooltip { max-width: calc(100vw - 24px); font-size: 12px; }

  /* Footer */
  .site-footer { padding: 16px; font-size: 10px; }
}
