/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  --bg:           #0f0f1a;
  --surface:      #1a1a2e;
  --surface2:     #252540;
  --surface3:     #2e2e52;
  --border:       #2a2a4a;
  --border2:      rgba(42,42,74,0.5);
  --accent:       #c0392b;
  --accent-h:     #e74c3c;
  --gold:         #f0a500;
  --text:         #e8e8f0;
  --text-muted:   #8888aa;
  --text-dim:     #55557a;
  --success:      #27ae60;
  --fire:         #e74c3c;
  --water:        #3498db;
  --thunder:      #f39c12;
  --ice:          #00bcd4;
  --dragon:       #9b59b6;
  --poison:       #8e44ad;
  --nav-h:        60px;
  --sidebar-w:    220px;
  --header-h:     54px;
  --radius:       8px;
  --radius-lg:    12px;
  --safe-b:       env(safe-area-inset-bottom, 0px);
  --safe-t:       env(safe-area-inset-top, 0px);
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3 { line-height: 1.3; }

/* ─── Loading Screen ────────────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-text { color: var(--text-muted); font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── App Shell Layout ──────────────────────────────────────── */
#app-shell { display: flex; min-height: 100dvh; }

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: none;
}
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-width: 0;
}
#page-header {
  position: sticky;
  top: 0;
  height: calc(var(--header-h) + var(--safe-t));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  padding-top: var(--safe-t);
  z-index: 50;
}
#content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--safe-b) + 16px);
  overflow-y: auto;
}
#bottom-nav { display: none; }

/* ─── Desktop Layout ────────────────────────────────────────── */
@media (min-width: 768px) {
  #sidebar { display: flex; flex-direction: column; }
  #main-content { margin-left: var(--sidebar-w); }
  #content { padding-bottom: 16px; }
  #back-btn { display: none !important; }
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo { width: 28px; height: 28px; object-fit: contain; }
.sidebar-title { font-size: 16px; font-weight: 700; color: var(--gold); letter-spacing: 0.02em; }
.sidebar-nav { padding: 8px 0; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 0.1s, color 0.1s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(192,57,43,0.08); }
.sidebar-item .nav-icon { font-size: 18px; width: 24px; text-align: center; }

/* ─── Bottom Nav ─────────────────────────────────────────────── */
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  min-width: 0;
}
.nav-item:hover, .nav-item.active { color: var(--accent); }
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item .nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* ─── Page Header ────────────────────────────────────────────── */
.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: var(--radius);
  transition: background 0.1s;
  line-height: 1;
  display: flex;
  align-items: center;
}
.back-btn svg { width: 22px; height: 22px; }
.back-btn:hover { background: var(--surface2); }
.page-title { font-size: 17px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: background 0.1s, color 0.1s;
  line-height: 1;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

/* ─── Install Banner ─────────────────────────────────────────── */
.install-banner {
  background: linear-gradient(135deg, #1a2a1a, #1e2e1a);
  border: 1px solid #3a5a2a;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.install-banner-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.install-banner-icon { font-size: 20px; flex-shrink: 0; }
.install-banner-text { flex: 1; min-width: 0; }
.install-banner-text strong { font-size: 14px; color: #7ecf5a; display: block; }
.install-banner-text span { font-size: 12px; color: var(--text-muted); }
.install-banner-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  flex-shrink: 0;
  line-height: 1;
}
.install-banner-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.install-steps {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 4px;
  line-height: 1.7;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
}
.install-steps b { color: var(--text); }

/* ─── Cards & Lists ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border2);
  cursor: pointer;
  transition: background 0.1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover, .list-item:active { background: var(--surface2); }
.list-item .icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.list-item .icon-lg { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.list-item-info { flex: 1; min-width: 0; }
.list-item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.list-arrow { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

/* ─── Search ──────────────────────────────────────────────────── */
.search-wrap { position: relative; margin-bottom: 16px; }
.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 40px 10px 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
  pointer-events: none;
}
.search-group { margin-bottom: 16px; }
.search-group-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 0 4px 6px;
}
.see-all-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.see-all-btn:hover { background: var(--surface2); }

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-fire    { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.badge-water   { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-thunder { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-ice     { background: rgba(0,188,212,0.15);  color: #00bcd4; }
.badge-dragon  { background: rgba(155,89,182,0.15); color: #9b59b6; }
.badge-poison  { background: rgba(142,68,173,0.15); color: #8e44ad; }
.badge-default { background: var(--surface2); color: var(--text-muted); }
.badge-gold    { background: rgba(240,165,0,0.15);  color: var(--gold); }
.badge-green   { background: rgba(39,174,96,0.15);  color: #27ae60; }
.badge-red     { background: rgba(192,57,43,0.15);  color: var(--accent); }
.badge-boss    { background: rgba(192,57,43,0.15);  color: var(--accent); }
.badge-minion  { background: var(--surface2); color: var(--text-muted); }
.badge-blue    { background: rgba(52,152,219,0.15);  color: #3498db; }
.badge-orange  { background: rgba(230,126,34,0.15);  color: #e67e22; }

/* ─── Chips / Filters ────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  padding: 5px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  color: var(--text-muted);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Tabs ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[style*="display: none"] { display: none !important; }

/* ─── Section Headers ────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 0 6px;
}
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ─── Item Stat Strip (horizontal iOS-style) ─────────────────── */
.item-stat-strip {
  display: flex;
  padding: 0;
}
.item-stat-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border);
}
.item-stat-cell:last-child { border-right: none; }
.item-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.item-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ─── Stat Rows ───────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border2);
  font-size: 14px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.elem-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
thead .elem-icon { width: 14px; height: 14px; }
.elem-icon-wrap { display: inline-flex; align-items: center; gap: 3px; }

/* ─── Weakness panel ─────────────────────────────────────────── */
.weak-row {
  display: flex;
  justify-content: space-around;
  padding: 12px 8px;
}
.weak-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.weak-icon { width: 28px; height: 28px; object-fit: contain; }
.weak-icon-placeholder { width: 28px; height: 28px; }
.weak-cell-label { font-size: 10px; color: var(--text-muted); text-align: center; }
.weak-cell-stars { font-size: 13px; font-weight: 700; letter-spacing: -1px; line-height: 1; min-height: 14px; }
.weak-divider { height: 1px; background: var(--border2); margin: 0 12px; }
.trap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  padding: 10px 12px;
}
.trap-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 33.33%;
  font-size: 12px;
}
.trap-check { font-size: 13px; font-weight: 700; width: 16px; text-align: center; }
.trap-active .trap-check { color: #4caf50; }
.trap-inactive .trap-check { color: var(--text-dim); }
.trap-active .trap-label { color: var(--text); }
.trap-inactive .trap-label { color: var(--text-dim); }
.status-header { display: flex; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--border2); }
.status-header > span:first-child { flex: 1; }
.status-cols { display: flex; gap: 0; }
.status-cols span { width: 44px; text-align: center; font-size: 11px; color: var(--text-dim); }
.status-header .status-cols span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }

.ailment-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; }
.ailment-tag { font-size: 12px; font-weight: 600; padding: 4px 12px; background: var(--surface2); border-radius: 999px; color: var(--text-muted); border: 1px solid var(--border); }
.stat-value { font-weight: 600; }

/* ─── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }
tr.hitzone-state-header td { background: var(--surface2); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 10px; border-bottom: 1px solid var(--border); }
tr.hitzone-state-header:hover td { background: var(--surface2); }

/* ─── Detail Header ──────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.detail-header img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.detail-header-info { flex: 1; min-width: 0; }
.detail-header-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.detail-header-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ─── Bow Charges & Coatings ─────────────────────────────────── */
.stat-row-block { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; }
.stat-row-block .stat-label { margin-bottom: 0; }

.bow-charges { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.bow-charge-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border-radius: 6px;
  padding: 6px 10px;
}
.bow-charge-num {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  background: var(--surface3); border-radius: 4px;
  padding: 1px 5px; min-width: 28px; text-align: center;
}
.bow-charge-name { font-size: 13px; color: var(--text); flex: 1; }
.bow-charge-arc {
  font-size: 10px; font-weight: 700; color: var(--gold);
  background: rgba(240,165,0,0.15); border-radius: 4px;
  padding: 1px 5px; letter-spacing: 0.05em;
}

.bow-coatings {
  display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
}
.bow-coating {
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--surface2); color: var(--text-dim);
  border: 1.5px solid transparent;
}
.bow-coating-active {
  background: color-mix(in srgb, var(--coat-color) 15%, transparent);
  color: var(--coat-color);
  border-color: color-mix(in srgb, var(--coat-color) 35%, transparent);
}
.bow-coating-name { display: block; }

/* ─── Sharpness Bar ──────────────────────────────────────────── */
.note-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: #fff;
  margin-right: 3px;
}
.sharpness-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.sharpness-row  { display: flex; align-items: center; gap: 8px; }
.sharpness-label { font-size: 11px; color: var(--text-muted); width: 28px; text-align: right; flex-shrink: 0; }
.sharpness-bar {
  display: flex;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  background: var(--surface2);
}
.sharpness-bar div { height: 100%; }

/* ─── Percentage / Drop Bars ─────────────────────────────────── */
.pct-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.pct-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ─── Resistance Values ─────────────────────────────────────── */
.res-pos { color: #27ae60; font-weight: 600; }
.res-neg { color: #e74c3c; font-weight: 600; }
.res-zero { color: var(--text-muted); }
.resist-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}
.resist-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.resist-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.resist-cell span {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ─── Weapon Tree ────────────────────────────────────────────── */
.weapon-tree { }
.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border2);
  cursor: pointer;
  transition: background 0.1s;
}
.tree-node:hover { background: var(--surface2); }
.tree-node img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.tree-node .elem-icon { width: 16px; height: 16px; }
.tree-node-info { flex: 1; min-width: 0; }
.tree-node-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node-stats { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.tree-node-stats .elem { font-weight: 600; }

/* ─── Home Grid ───────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .home-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .home-grid { grid-template-columns: repeat(4, 1fr); } }
.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, transform 0.15s, background 0.15s;
}
.home-card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface2); }
.home-card:active { transform: translateY(0); }
.home-card .hc-icon { font-size: 32px; margin-bottom: 8px; line-height: 1; height: 40px; display: flex; align-items: center; justify-content: center; }
.home-card .hc-icon .hc-img { width: 40px; height: 40px; object-fit: contain; }
.home-card .hc-label { font-size: 13px; font-weight: 600; }
.home-card .hc-count { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Home Search ────────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 24px 0 20px;
  margin-bottom: 8px;
}
.home-hero h1 { font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: 0.02em; }
.home-hero p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── More Drawer ────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 300; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.drawer-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(16px + var(--safe-b));
  max-height: 80dvh;
  overflow-y: auto;
}
.drawer-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.drawer-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.drawer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drawer-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drawer-item:hover { border-color: var(--accent); background: var(--surface3); }
.drawer-item .icon { font-size: 26px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; height: 32px; }
.drawer-item .label { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* Nav image icons */
.nav-img { object-fit: contain; display: block; }
.sidebar-item .nav-icon .nav-img { width: 22px; height: 22px; }
.nav-item .nav-icon .nav-img { width: 26px; height: 26px; }
.drawer-item .icon .nav-img { width: 32px; height: 32px; }

/* Nav SVG icons */
.nav-svg { display: block; }
.sidebar-item .nav-icon .nav-svg { width: 22px; height: 22px; }
.nav-item .nav-icon .nav-svg { width: 26px; height: 26px; }
.drawer-item .icon .nav-svg { width: 32px; height: 32px; }

/* ─── Weapon Type Grid ───────────────────────────────────────── */
.wtype-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
@media (min-width: 480px) { .wtype-grid { grid-template-columns: repeat(3, 1fr); } }
.wtype-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.wtype-card:hover { border-color: var(--accent); background: var(--surface2); }
.wtype-card img { width: 36px; height: 36px; object-fit: contain; }
.wtype-card-name { font-size: 13px; font-weight: 500; }

/* ─── Location Map ───────────────────────────────────────────── */
.location-map {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0 auto 20px;
  display: block;
}

/* ─── Skill Points ───────────────────────────────────────────── */
.pts-pos { color: #27ae60; font-weight: 600; }
.pts-neg { color: #e74c3c; font-weight: 600; }

/* ─── Rarity Stars ───────────────────────────────────────────── */
.rarity { color: var(--gold); font-size: 12px; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h2 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ─── Inline Loading ─────────────────────────────────────────── */
.loading-inline { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }

/* ─── Talisman Form ──────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select { cursor: pointer; appearance: auto; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: rgba(192,57,43,0.15); color: var(--accent); border: 1px solid rgba(192,57,43,0.3); }
.btn-danger:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ─── Talisman Cards ─────────────────────────────────────────── */
.talisman-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.talisman-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.talisman-slots { font-size: 14px; }
.talisman-actions { display: flex; gap: 6px; }
.talisman-skills { font-size: 13px; color: var(--text-muted); }
.talisman-skill { display: flex; justify-content: space-between; }

/* ─── Combining Table ────────────────────────────────────────── */
.combine-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; }
.combine-row:last-child { border-bottom: none; }
.combine-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.combine-item img { width: 28px; height: 28px; object-fit: contain; }
.combine-plus, .combine-arrow { color: var(--text-dim); font-size: 16px; }
.combine-pct { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ─── Section divider ────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface3); }

/* ─── Canteen ────────────────────────────────────────────────── */
.combo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.combo-ingredients { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.combo-skills { font-size: 12px; color: var(--text-muted); }

/* ─── Wyporium / Veggie Elder ───────────────────────────────── */
.trade-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border2); cursor: pointer; flex-wrap: wrap; }
.trade-row:last-child { border-bottom: none; }
.trade-row:hover { background: var(--surface2); }
.trade-row img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.trade-info { flex: 1; min-width: 0; }
.trade-name { font-size: 14px; font-weight: 500; }
.trade-sub { font-size: 12px; color: var(--text-muted); }
.trade-arrow-big { font-size: 20px; color: var(--gold); flex-shrink: 0; }
.trade-unlock-quest { width: 100%; display: flex; align-items: center; gap: 6px; padding-top: 6px; cursor: pointer; font-size: 12px; }
.trade-unlock-label { color: var(--text-muted); font-size: 11px; }
.trade-unlock-name { color: var(--text); }
.trade-unlock-quest:hover .trade-unlock-name { color: var(--gold); }
.quest-hub { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.03em; }
.quest-hub--caravan { background: #5a3a00; color: #f0a500; }
.quest-hub--guild   { background: #0d2e4e; color: #4fa8d5; }
.quest-hub--event   { background: #3a0d3a; color: #c97de8; }
.quest-stars { color: var(--gold); font-size: 10px; }

/* ─── Monster weakness stars ─────────────────────────────────── */
.eff-3  { color: var(--fire); font-weight: 700; }
.eff-2  { color: var(--thunder); }
.eff-1  { color: var(--text-muted); font-size: 12px; }
.eff-0  { color: var(--text-dim); }
.eff-x  { color: var(--success); }

/* ─── Misc ───────────────────────────────────────────────────── */
.star-gold { color: var(--gold); }
.mono { font-family: ui-monospace, monospace; font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
