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

:root {
  --bg-0: #0a0904;
  --bg-1: #12100a;
  --bg-2: #1a1710;
  --bg-3: #211d13;
  --line: #3a3221;
  --line-strong: #55462a;
  --text: #e8dfc7;
  --text-dim: #a89778;
  --muted: #756751;
  --gold: #d4a54a;
  --gold-bright: #f5c96b;
  --red: #c04a2d;
  --red-bright: #e05a3a;
  --green: #7fa859;
  --blue: #5a8ca8;
  --rarity-1: #b8b8b8;
  --rarity-2: #a8c4a0;
  --rarity-3: #8ab0d4;
  --rarity-4: #b48ad4;
  --rarity-5: #d48a8a;
  --rarity-6: #d4a54a;
  --rarity-7: #e05a3a;
  --rarity-8: #f5c96b;
}

html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(212, 165, 74, 0.06), transparent 60%),
    radial-gradient(900px 600px at 80% 100%, rgba(192, 74, 45, 0.05), transparent 60%),
    var(--bg-0);
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== Topbar ============== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  border-radius: 8px;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(192, 74, 45, 0.4);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; color: var(--gold-bright); }
.brand-sub  { font-size: 11px; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.5px; }

.stats { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.stats b { color: var(--gold-bright); font-weight: 700; }

/* ============== App layout ============== */
.app {
  display: flex;
  min-height: calc(100vh - 72px);
}

.sidebar {
  width: 220px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 4px 0 16px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}
.nav-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.nav-section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 12px;
}
.side-title {
  padding: 0 20px 10px;
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
}
.side-title.expandable {
  cursor: pointer;
  padding: 8px 16px 8px 16px;
  margin: 0 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
  user-select: none;
}
.side-title.expandable:hover { background: rgba(212, 165, 74, 0.08); }
.chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--gold-bright);
  font-size: 10px;
  width: 12px;
  text-align: center;
}
.nav-section.collapsed .chevron { transform: rotate(-90deg); }

.nav-collapsible {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.25s ease-out, opacity 0.2s;
  opacity: 1;
}
.nav-section.collapsed .nav-collapsible {
  max-height: 0;
  opacity: 0;
}
.kind-list { display: flex; flex-direction: column; }
.kind-item {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
}
.kind-item:hover {
  background: rgba(212, 165, 74, 0.05);
  color: var(--text);
}
.kind-item.active {
  background: rgba(212, 165, 74, 0.1);
  border-left-color: var(--gold-bright);
  color: var(--gold-bright);
  font-weight: 600;
}
.kind-icon { font-size: 20px; width: 24px; text-align: center; }
.kind-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
}

.main {
  flex: 1;
  padding: 22px 28px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 72px);
}
.main-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.section-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.current-kind {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.3px;
}
.search-wrap { margin-left: auto; }
.search-input {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  width: 260px;
  outline: none;
}
.search-input:focus { border-color: var(--gold); }

.loading, .empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}

/* ============== Tree grid ============== */
.tree-wrap { padding: 20px 0; position: relative; }

/* ============== Element filter bar (header) ============== */
.element-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(212,165,74,0.05), transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.el-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.15s;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.55;
  user-select: none;
  text-transform: capitalize;
}
.el-filter .el-svg { width: 16px; height: 16px; flex-shrink: 0; }
.el-filter:hover { opacity: 1; transform: translateY(-1px); }
.el-filter.active {
  opacity: 1;
  background: currentColor;
  color: #1a1710 !important;
  box-shadow: 0 0 0 2px rgba(255, 215, 100, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.el-filter.active .el-svg { color: #1a1710; }
.el-filter.el-all { color: var(--gold-bright); }

/* Global grid — semua tree per kind di 1 canvas, col align tier */
.global-outer {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
}
.global-labels {
  flex-shrink: 0;
  width: 152px;
  z-index: 3;
  padding-right: 4px;
  border-right: 2px solid var(--gold);
  background: linear-gradient(90deg, var(--bg-1), rgba(212,165,74,0.06));
}
.col-ruler-spacer {
  height: 28px;
  border-bottom: 1px solid var(--line);
}
.global-scroll {
  flex: 1;
  min-width: 0;
  overflow: hidden;   /* no horizontal scroll — auto-fit width */
  padding-bottom: 12px;
}

.global-canvas { position: relative; }

.col-ruler {
  position: relative;
}
.col-tier {
  position: absolute;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  text-align: center;
}

/* Row labels: kolom fixed left, di luar scroll horizontal */
.row-labels-col {
  width: 100%;
}
.row-label {
  position: absolute;
  display: flex;
  align-items: center;
  padding-right: 10px;
  width: 100%;
}
.rl-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  text-align: right;
  width: 100%;
  line-height: 1.25;
  letter-spacing: 0.3px;
}

/* Tier ruler (scrolls horizontally with canvas) */
.col-ruler {
  position: relative;
  height: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  padding-top: 4px;
}

/* Base weapon highlight */
.tree-node.tn-base {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212,165,74,0.15), var(--bg-2));
  box-shadow: 0 4px 12px rgba(212, 165, 74, 0.2), inset 0 0 0 1px rgba(212, 165, 74, 0.3);
}
.tn-base-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--gold);
  color: #1a1100;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

/* Cross-tree connection lines (dashed, terang biar keliatan) */
.tree-line-cross {
  stroke: var(--gold-bright);
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgba(245, 201, 107, 0.5));
}

.tree-grid {
  position: relative;
  z-index: 2;
  min-width: max-content;
}

.tree-node {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: absolute;
  overflow: hidden;
}
.tree-node.tn-compact {
  padding: 5px 7px;
}
.tree-node.tn-compact .tn-name {
  font-size: 11px;
  line-height: 1.15;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tree-node.tn-compact .tn-meta {
  font-size: 10px;
  gap: 5px;
}
.tree-node.tn-compact .tn-atk { font-size: 11px; }
.tree-node.tn-compact .tn-rarity {
  font-size: 9px;
  padding: 0 4px;
}
.tree-node.tn-compact .el-badge {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 0 3px;
  font-size: 8px;
  background: rgba(0,0,0,0.6);
}
.tree-node.tn-compact .el-badge .el-svg { width: 10px; height: 10px; }
.tree-node:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(212, 165, 74, 0.15);
}
.tree-node .tn-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}
.tree-node .tn-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  align-items: center;
}
.tree-node .tn-rarity {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1a1710;
}
.tree-node .tn-atk {
  font-weight: 700;
  color: var(--red-bright);
}
.tree-node .tn-atk::before { content: '⚔ '; opacity: 0.6; }

/* Rarity colors */
.rarity-1 { background: var(--rarity-1); }
.rarity-2 { background: var(--rarity-2); }
.rarity-3 { background: var(--rarity-3); }
.rarity-4 { background: var(--rarity-4); }
.rarity-5 { background: var(--rarity-5); }
.rarity-6 { background: var(--rarity-6); }
.rarity-7 { background: var(--rarity-7); }
.rarity-8 { background: var(--rarity-8); }

/* Connection lines drawn via SVG overlay */
.tree-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.tree-line {
  stroke: var(--line-strong);
  stroke-width: 2;
  fill: none;
}

/* ============== Modal ============== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal-nested { z-index: 200; }
.modal-nested .modal-card { max-width: 640px; }

/* Clickable material item */
.mat-item.mat-clickable { cursor: pointer; }
.mat-item.mat-clickable:hover { transform: translateX(2px); }
.mat-item.mat-clickable::after {
  content: '›';
  margin-left: 6px;
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  opacity: 0.6;
  transition: transform 0.15s;
}
.mat-item.mat-clickable:hover::after { transform: translateX(3px); opacity: 1; }

/* Item source modal content */
.src-header {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.src-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #1a1710;
  flex-shrink: 0;
}
.src-title { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.src-desc  { font-size: 12px; color: var(--text-dim); font-style: italic; margin-top: 4px; }

.src-group {
  margin-bottom: 16px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red-bright);
  border-radius: 6px;
  padding: 12px 14px;
}
.src-monster {
  font-size: 15px;
  font-weight: 800;
  color: var(--red-bright);
  margin-bottom: 4px;
}
.src-location {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.src-location::before { content: '📍 '; opacity: 0.7; }
.src-drop-list { display: flex; flex-direction: column; gap: 4px; }
.src-drop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.src-kind {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.src-rank-low  { color: var(--rarity-4); border-color: var(--rarity-4); }
.src-rank-high { color: var(--red-bright); border-color: var(--red-bright); }
.src-chance {
  margin-left: auto;
  font-weight: 800;
  color: var(--gold-bright);
  font-size: 13px;
}
.src-part { font-size: 10px; color: var(--muted); font-style: italic; }
.src-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}

/* ============== Armor grid ============== */
.armor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.armor-set {
  background: linear-gradient(180deg, rgba(212,165,74,0.03), transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px 14px;
}
.armor-set-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.armor-set-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold-bright);
}
.armor-set-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.armor-set-rank {
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.armor-pieces {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.armor-piece {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.armor-piece:hover { border-color: var(--gold); transform: translateY(-2px); }
.ap-slot {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ap-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
.ap-stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.ap-def {
  color: var(--gold-bright);
  font-weight: 700;
}

/* Resistances mini */
.res-list { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid currentColor;
  background: rgba(0,0,0,0.35);
}
.res-pill.res-pos { opacity: 1; }
.res-pill.res-neg { opacity: 0.85; }
.res-pill .el-svg { width: 10px; height: 10px; }

/* ============== Charms ============== */
/* Charm list — grid multi-column, banyak muat ke samping */
.charm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.charm-card {
  background: linear-gradient(180deg, rgba(160, 102, 184, 0.06), transparent);
  border: 1px solid var(--line);
  border-left: 3px solid #a066b8;
  border-radius: 6px;
  padding: 12px 14px;
}
.charm-name {
  font-size: 15px;
  font-weight: 800;
  color: #d09be0;
  margin-bottom: 8px;
}
.charm-ranks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.charm-rank {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.charm-rank:hover { border-color: var(--gold); }
.cr-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.cr-name { font-size: 13px; font-weight: 700; color: var(--text); }
.cr-rarity {
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px 28px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
}
.modal-x:hover { background: var(--bg-3); color: var(--text); }

/* Modal content */
.md-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.md-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.2;
  margin-bottom: 6px;
}
.md-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.md-rarity {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1a1710;
  letter-spacing: 0.5px;
}
.md-kind {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-3);
  border: 1px solid var(--line);
  text-transform: capitalize;
}
.md-desc {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  border-left: 2px solid var(--gold);
  padding-left: 12px;
}

.md-section {
  margin-bottom: 22px;
}
.md-section-title {
  font-size: 11px;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat-cell {
  background: var(--bg-3);
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}
.stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.stat-val.atk { color: var(--red-bright); }
.stat-val.aff-pos { color: var(--green); }
.stat-val.aff-neg { color: var(--red); }
.stat-val.small { font-size: 14px; }

/* Sharpness bar */
.sharpness-wrap {
  display: flex;
  height: 12px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
}
.sh-red    { background: #c73030; }
.sh-orange { background: #e69945; }
.sh-yellow { background: #d4c145; }
.sh-green  { background: #7fa859; }
.sh-blue   { background: #4a8ac0; }
.sh-white  { background: #e8e0d0; }
.sh-purple { background: #a066b8; }

/* Element pill (large, for modal) */
.elem-list { display: flex; gap: 8px; flex-wrap: wrap; }
.elem-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.elem-pill .el-svg { width: 20px; height: 20px; flex-shrink: 0; }

.elem-fire      { color: #e06232; border-color: #a04525; }
.elem-water     { color: #4a9ac8; border-color: #3a7095; }
.elem-thunder   { color: #d4c145; border-color: #a08a25; }
.elem-ice       { color: #7ac0e0; border-color: #4a90b0; }
.elem-dragon    { color: #b8688b; border-color: #8b4560; }
.elem-poison    { color: #a066b8; border-color: #7a4890; }
.elem-paralysis { color: #d48b45; border-color: #a06525; }
.elem-sleep     { color: #7a95c8; border-color: #4a6595; }
.elem-blast     { color: #b47a45; border-color: #855520; }

/* Element badge (mini, for tree-node card) */
.el-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 5px 1px 3px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid currentColor;
  background: rgba(0,0,0,0.35);
}
.el-badge .el-svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Material list */
.mat-list { display: flex; flex-direction: column; gap: 6px; }
.mat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  transition: border-color .15s;
}
.mat-item:hover { border-color: var(--gold); }
.mat-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a1710;
  flex-shrink: 0;
  text-transform: uppercase;
}
.mat-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.mat-name .mat-desc {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
  margin-top: 2px;
  line-height: 1.3;
}
.mat-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-bright);
  min-width: 40px;
  text-align: right;
}

/* Zenny cost */
.zenny {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright);
  padding: 8px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.zenny::before { content: 'z'; font-size: 11px; opacity: 0.6; letter-spacing: 1px; }

/* Skills list */
.skill-list { display: flex; flex-direction: column; gap: 8px; }
.skill-item {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 10px 14px;
}
.skill-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.skill-lvl {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}
.skill-desc {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

/* Slots */
.slot-list { display: flex; gap: 4px; }
.slot-pill {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  background: var(--bg-2);
  border: 2px solid var(--gold);
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  color: var(--gold-bright);
}
.slot-pill.s-4 { border-color: var(--red-bright); color: var(--red-bright); }

/* Kind-specific pills (coatings, phials, shells) */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  text-transform: capitalize;
}

/* Bow coatings — colored pills with dot */
.coating-list { display: flex; flex-wrap: wrap; gap: 8px; }
.coating-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: rgba(0,0,0,0.35);
  font-weight: 700;
  font-size: 12px;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}
.coating-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

/* Bowgun ammo table */
.ammo-legend {
  display: grid;
  grid-template-columns: 1fr 60px 60px 90px;
  gap: 8px;
  padding: 6px 12px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.ammo-list { display: grid; gap: 4px; }
.ammo-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 90px;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 13px;
}
.ammo-name { font-weight: 700; text-transform: capitalize; letter-spacing: 0.3px; }
.ammo-lvl {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-2);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  font-weight: 700;
}
.ammo-cap {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-bright);
  text-align: center;
}
.ammo-rapid {
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.5px;
}

/* Armor set bonuses */
.set-bonus-list { display: flex; flex-direction: column; gap: 8px; }
.set-bonus {
  background: linear-gradient(90deg, rgba(212,165,74,0.15), rgba(212,165,74,0.05));
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 10px 14px;
  position: relative;
}
.sb-badge {
  position: absolute;
  top: -8px; left: 12px;
  padding: 2px 10px;
  background: var(--gold);
  color: #1a1100;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.sb-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-top: 4px;
}
.sb-effect {
  font-size: 12px;
  color: var(--text);
  margin-top: 2px;
}
.sb-effect b { color: var(--gold-bright); }
.sb-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
  line-height: 1.4;
}

/* Full set summary in armor list */
.set-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(212, 165, 74, 0.05);
  border: 1px solid rgba(212, 165, 74, 0.2);
  border-radius: 6px;
}
.ss-title {
  font-size: 10px;
  color: var(--gold-bright);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.ss-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.ss-skill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.ss-skill:hover {
  border-color: var(--blue);
  background: rgba(90, 140, 168, 0.15);
  color: var(--gold-bright);
}
.ss-lvl {
  padding: 1px 6px;
  background: var(--blue);
  color: #fff;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
}
.ss-bonuses { display: flex; flex-direction: column; gap: 4px; }
.ss-bonus {
  font-size: 12px;
  color: var(--gold-bright);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.15s;
}
.ss-bonus:hover { background: rgba(212, 165, 74, 0.1); }
.sbm-req {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--gold);
  color: #1a1100;
  border-radius: 3px;
  margin-right: 6px;
  font-weight: 800;
}

/* Clickable skill items */
.skill-clickable { cursor: pointer; transition: all 0.15s; }
.skill-clickable:hover {
  border-color: var(--blue) !important;
  transform: translateX(2px);
}
.skill-clickable::after {
  content: 'ℹ';
  position: absolute;
  right: 10px;
  top: 10px;
  color: var(--blue);
  opacity: 0.5;
  font-size: 14px;
  font-weight: 700;
}
.set-bonus.skill-clickable { position: relative; }

/* Skill modal — effect per level */
.skill-level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-lvl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.skill-lvl-badge {
  padding: 3px 10px;
  background: var(--blue);
  color: #fff;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.skill-lvl-desc {
  color: var(--text-dim);
  flex: 1;
  min-width: 200px;
  font-size: 12px;
  line-height: 1.4;
}

/* ============== Build Maker ============== */
.build-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .build-wrap { grid-template-columns: 1fr; }
}

.build-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.build-slot {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.build-slot:hover {
  border-style: solid;
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 165, 74, 0.15);
}
.build-slot.filled { border-style: solid; border-color: var(--line-strong); }
.build-slot.filled:hover { border-color: var(--gold); }

.bs-slot-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}
.bs-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.25;
}
.bs-placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
  padding: 12px 0;
  text-align: center;
}
.bs-mini {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.bs-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.build-slot.filled .bs-remove { display: flex; }
.bs-remove:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Summary panel */
.build-summary {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 16px 18px;
  position: sticky;
  top: 20px;
}
.bsum-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.bsum-name-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 14px;
}
.bsum-name-input:focus { border-color: var(--gold); }

.bsum-section {
  border-top: 1px dashed var(--line);
  padding: 10px 0;
}
.bsum-section:first-of-type { border-top: none; }
.bsum-section-title {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 8px;
}
.bsum-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bsum-stat {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 10px;
}
.bsum-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.bsum-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}
.bsum-stat-val.pos { color: var(--green); }
.bsum-stat-val.neg { color: var(--red); }
.bsum-stat-val.atk { color: var(--red-bright); }
.bsum-stat-val.def { color: var(--gold-bright); }

.bsum-skill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  cursor: pointer;
}
.bsum-skill:hover { color: var(--gold-bright); }
.bsum-skill-name { flex: 1; }
.bsum-skill-lvl {
  padding: 1px 8px;
  background: var(--blue);
  color: #fff;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
}
.bsum-skill-lvl.maxed { background: var(--gold); color: #1a1100; }
.bsum-skill-lvl.overcap { background: var(--red); color: #fff; }

.bsum-set-bonus {
  padding: 6px 8px;
  background: rgba(212, 165, 74, 0.05);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  margin-bottom: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.bsum-set-bonus.active {
  border-left-color: var(--gold);
  background: rgba(212, 165, 74, 0.15);
  color: var(--gold-bright);
}
.bsum-set-bonus:hover { transform: translateX(2px); }
.bsum-set-bonus b { color: var(--gold-bright); }

.bsum-res-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.bsum-res {
  text-align: center;
  padding: 4px 2px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0,0,0,0.35);
}
.bsum-res .el-svg { width: 12px; height: 12px; display: block; margin: 0 auto 2px; }

.build-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.build-actions .btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--gold);
  color: #1a1100;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.build-actions .btn.secondary {
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.build-actions .btn.danger { background: var(--red); color: #fff; }
.build-actions .btn:hover { filter: brightness(1.15); }

/* Saved builds list in sidebar */
.saved-build-item {
  padding: 8px 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  border-left: 3px solid transparent;
}
.saved-build-item:hover {
  background: rgba(212, 165, 74, 0.05);
  color: var(--text);
}
.saved-build-item.active {
  background: rgba(212, 165, 74, 0.1);
  border-left-color: var(--gold-bright);
  color: var(--gold-bright);
}
.saved-build-item.new-build {
  color: var(--gold-bright);
  font-weight: 700;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}
.saved-build-item .sb-del {
  margin-left: auto;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 6px;
}
.saved-build-item:hover .sb-del { opacity: 1; }
.saved-build-item .sb-del:hover { color: var(--red); }

/* Picker modal */
.picker-search {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 12px;
}
.picker-search:focus { border-color: var(--gold); }
.picker-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.picker-item {
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  transition: all 0.15s;
}
.picker-item:hover {
  border-color: var(--gold);
  background: rgba(212, 165, 74, 0.08);
}
.picker-item .pi-name { font-size: 13px; font-weight: 700; color: var(--text); }
.picker-item .pi-meta { font-size: 11px; color: var(--text-dim); }
.picker-item .pi-stats { display: flex; gap: 8px; font-size: 11px; color: var(--text-dim); }
.picker-item .pi-stats b { color: var(--gold-bright); }
.picker-group-title {
  font-size: 10px;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 10px 0 4px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 4px;
}
.picker-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
}

/* ============== Community Builds ============== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.cm-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.cm-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(212, 165, 74, 0.15);
}
.cm-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 4px;
  line-height: 1.25;
}
.cm-author {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.cm-author::before { content: '👤 '; opacity: 0.6; }
.cm-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.cm-stat {
  font-size: 11px;
  color: var(--text-dim);
  padding: 1px 6px;
  background: var(--bg-3);
  border-radius: 3px;
}
.cm-time {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* No-data */
.no-data { color: var(--muted); font-size: 12px; font-style: italic; }

/* ============== Responsive ============== */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
  }
  .kind-list { flex-direction: row; overflow-x: auto; padding: 0 12px; }
  .kind-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 14px;
  }
  .kind-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--gold-bright);
  }
  .side-title { display: none; }
  .kind-count { display: none; }
  .main-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-input { width: 100%; min-width: 0; }
  .search-wrap { margin-left: 0; }
}
