/* ── Layout ── */
.runes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 0 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 90px);
}
@media(max-width:900px){
  .runes-layout { grid-template-columns:1fr; padding: 0 10px 40px; }
}

/* ── Header nav ── */
.site-nav { display:flex; gap:6px; }
.nav-link {
  padding: 7px 18px;
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-link:hover { color:#fff; background: rgba(255,255,255,0.08); }
.nav-link.active {
  color: #c8a23c;
  border-color: rgba(200,162,60,0.4);
  background: rgba(200,162,60,0.12);
}
.nav-back {
  color: rgba(255,255,255,0.55);
  text-decoration:none;
  font-size:0.8rem;
  font-weight:500;
  transition: color 0.2s;
}
.nav-back:hover { color:#fff; }
.header-center { flex:1; display:flex; justify-content:center; }

/* ── Champion Search ── */
.champ-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: rgba(10,12,24,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.champ-search:focus { border-color: rgba(200,162,60,0.6); }
.champ-search::placeholder { color: rgba(255,255,255,0.3); }

/* ── Champion Grid ── */
.runes-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}
.champ-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
  padding: 4px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,162,60,0.3) transparent;
}
.champ-grid::-webkit-scrollbar { width:4px; }
.champ-grid::-webkit-scrollbar-thumb { background:rgba(200,162,60,0.3); border-radius:4px; }
.cg-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border-radius: 8px;
  padding: 5px 3px;
  transition: all 0.15s;
  border: 1px solid transparent;
  background: rgba(10,12,24,0.4);
}
.cg-item:hover {
  background: rgba(200,162,60,0.12);
  border-color: rgba(200,162,60,0.3);
  transform: translateY(-1px);
}
.cg-item.cg-active {
  background: rgba(200,162,60,0.2);
  border-color: rgba(200,162,60,0.7);
  box-shadow: 0 0 10px rgba(200,162,60,0.25);
}
.cg-item img {
  width: 46px; height: 46px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
}
.cg-active img { border-color: rgba(200,162,60,0.6); }
.cg-name {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  line-height: 1.2;
  max-width: 58px;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cg-active .cg-name { color: #c8a23c; }
.cg-no-build { opacity: 0.5; }
.loading { grid-column:1/-1; text-align:center; color:rgba(255,255,255,0.4); padding:30px 0; font-size:0.85rem; }
.loading-err { grid-column:1/-1; text-align:center; color:#e05555; padding:20px 0; font-size:0.85rem; }

/* ── Rune Panel ── */
.runes-panel {
  background: rgba(8,10,22,0.82);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
  min-height: 400px;
}

/* Placeholder */
.rp-placeholder {
  display: flex; flex-direction:column; align-items:center; justify-content:center;
  height: 100%; min-height: 360px; gap: 12px;
}
.rp-placeholder-icon { font-size: 3rem; }
.rp-placeholder-text { font-size:1.1rem; font-weight:600; color:rgba(255,255,255,0.5); }
.rp-placeholder-sub  { font-size:0.82rem; color:rgba(255,255,255,0.3); }

/* Champion header */
.rp-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}
.rp-champ-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(200,162,60,0.6);
  object-fit: cover;
  box-shadow: 0 0 16px rgba(200,162,60,0.3);
}
.rp-champ-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: #fff;
}
.rp-champ-meta { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.rp-role {
  padding: 3px 10px;
  background: rgba(200,162,60,0.2);
  border: 1px solid rgba(200,162,60,0.4);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #c8a23c;
  letter-spacing: 0.08em;
}
.rp-tag {
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
}
.rp-patch {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
}

/* Body: two trees side by side */
.rp-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media(max-width:700px){ .rp-body{ grid-template-columns:1fr; } }

/* Rune tree block */
.rune-tree-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.rune-tree-block::before {
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(135deg, var(--tree-bg,#444) 0%, transparent 60%);
  opacity: 0.18;
  pointer-events:none;
}
.rune-tree-secondary { grid-column: unset; }

.rtb-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rtb-tree-icon {
  width: 26px; height: 26px;
  filter: drop-shadow(0 0 6px var(--tree-glow,rgba(0,0,0,0.4)));
}
.rtb-tree-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tree-badge, #ccc);
}
.rtb-tree-en {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  margin-left: 2px;
}

/* Rune rows */
.rune-row {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.rune-row-keystones { margin-bottom: 12px; }

.rune-opt {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}
.rune-opt img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.rune-opt-lg { width: 56px; height: 56px; flex-direction:column; gap:4px; }
.rune-opt-lg img { width: 50px; height: 50px; }
.rune-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--tree-badge, #ccc);
  text-align: center;
  max-width: 60px;
  line-height: 1.2;
  display: none;
}

.rune-active img {
  border: 2px solid var(--tree-badge, #c8a23c);
  box-shadow: 0 0 12px var(--tree-glow, rgba(200,162,60,0.4));
  filter: brightness(1.1);
}
.rune-active { background: rgba(255,255,255,0.05); border-radius:50%; }

.rune-dim img {
  opacity: 0.28;
  filter: grayscale(0.7) brightness(0.7);
}
.rune-dim:hover img { opacity: 0.55; filter: none; }

/* Shards */
.shards-block {
  grid-column: 1 / -1;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 12px 16px;
}
.shards-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.shards-row { display:flex; gap:12px; flex-wrap:wrap; }
.shard-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
}
.shard-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* Counters */
.counters-block {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
}
.counters-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.counters-title strong { color: rgba(255,255,255,0.85); }
.counters-list { display:flex; gap:12px; flex-wrap:wrap; }
.counter-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 16px;
  flex: 1; min-width: 150px;
  transition: all 0.2s;
}
.counter-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.counter-rank { font-size: 1.1rem; flex-shrink:0; }
.counter-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  object-fit: cover;
}
.counter-info { display:flex; flex-direction:column; gap:3px; }
.counter-name { font-size: 0.9rem; font-weight: 700; color: #fff; }
.counter-wr   { font-size: 0.8rem; font-weight: 700; }

/* ── Role Tabs ─────────────────────────────────────────── */
.role-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.role-tab {
  padding: 4px 12px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.role-tab:hover { background: rgba(255,255,255,0.1); color:#fff; }
.role-tab.active {
  background: rgba(200,162,60,0.22);
  border-color: rgba(200,162,60,0.6);
  color: #c8a23c;
}
.role-single { display:flex; align-items:center; }
.role-badge {
  padding: 4px 12px;
  border-radius: 5px;
  background: rgba(200,162,60,0.18);
  border: 1px solid rgba(200,162,60,0.4);
  color: #c8a23c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

/* ── Matchup Bar ────────────────────────────────────────── */
.matchup-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  margin-bottom: 10px;
}
.matchup-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  margin-right: 2px;
}
.matchup-pill {
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.matchup-pill:hover { background: rgba(255,255,255,0.1); color:#fff; border-color:rgba(255,255,255,0.2); }
.mpill-active {
  background: rgba(91,132,224,0.25);
  border-color: rgba(91,132,224,0.6);
  color: #8aabee;
}

/* ── Matchup Note ───────────────────────────────────────── */
.matchup-note {
  padding: 8px 14px;
  background: rgba(91,132,224,0.1);
  border: 1px solid rgba(91,132,224,0.25);
  border-radius: 7px;
  font-size: 0.8rem;
  color: rgba(200,220,255,0.8);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Rune keystone label fix ────────────────────────────── */
.rune-ks-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--tree-badge, #c8a23c);
  text-align: center;
  max-width: 62px;
  line-height: 1.2;
  margin-top: 2px;
}
