:root {
  color-scheme: dark;
  --bg-deep: #070b14;
  --bg-surface: #0e1626;
  --bg-card: #121c30;
  --bg-card-hover: #182540;
  --bg-elevated: #1b2945;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-gold: rgba(200, 155, 60, 0.45);
  --border-cyan: rgba(56, 189, 248, 0.45);
  --text-main: #edf2f7;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --gold: #d9ae54;
  --gold-bright: #f5d487;
  --cyan: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --prismatic-1: #e879f9;
  --prismatic-2: #38bdf8;
  --prismatic-3: #fbbf24;
  --gold-rarity: #f59e0b;
  --silver-rarity: #cbd5e1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 18px 42px rgba(2, 6, 23, 0.55);
  accent-color: #d9ae54;
  scrollbar-color: #334155 #0b1120;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 0%, #101e38 0%, var(--bg-deep) 52%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

::selection {
  background: rgba(217, 174, 84, 0.35);
  color: #fff;
}

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

h1, h2, h3, h4 {
  margin: 0;
  text-wrap: balance;
  font-weight: 700;
}

p, li, .pretty-text {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.muted {
  color: var(--text-muted);
}

.spacer {
  flex: 1;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  border-radius: 8px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--gold-bright), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.global-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 460px;
}

.global-search {
  width: 100%;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(18, 28, 48, 0.9);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.global-search::placeholder {
  color: var(--text-dim);
}
.global-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 174, 84, 0.16);
  outline: none;
}

.search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #10192c;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 60;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.is-selected {
  background: rgba(56, 189, 248, 0.14);
}
.search-item img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.search-item-meta {
  flex: 1;
  min-width: 0;
}
.search-item-name {
  font-weight: 700;
  font-size: 14px;
}
.search-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.band-switch {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 2px;
}
.band-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.band-btn:hover {
  color: var(--text-main);
}
.band-btn.is-active {
  background: linear-gradient(135deg, rgba(217, 174, 84, 0.25), rgba(56, 189, 248, 0.22));
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(217, 174, 84, 0.4);
}

.icon-btn, .btn-ghost, .btn-primary, .btn-danger, .pill-btn {
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-btn, .btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
}
.icon-btn:hover, .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(148, 163, 184, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, #c89b3c, #e6be6a);
  border: 1px solid #f5d487;
  color: #0b1120;
  padding: 8px 16px;
  font-weight: 700;
}
.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  padding: 7px 12px;
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.24);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Main Shell */
.main-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 18px 48px;
}

.quick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(14, 22, 38, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.quick-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
}
.quick-chip:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}
.quick-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* Compare Dock */
.compare-dock {
  background: linear-gradient(135deg, rgba(217, 174, 84, 0.08), rgba(56, 189, 248, 0.08));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
}
.compare-card.is-best {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(217, 174, 84, 0.35);
}

/* Toolbar */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.role-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
}
.pill-btn:hover {
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.35);
}
.pill-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--cyan);
  color: #e0f2fe;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-label {
  font-size: 12px;
  color: var(--text-muted);
}
.select-input, .text-input, .textarea-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13px;
}
.textarea-input {
  width: 100%;
  resize: vertical;
  font-family: inherit;
}
.text-input {
  width: 100%;
}
.input-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* Hero Grid */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(242px, 1fr));
  gap: 12px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
}
/* 仅对首屏下方的卡片启用 content-visibility: auto，遵循现代性能优化规范 */
.hero-card:nth-child(n + 19) {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 116px;
}
.hero-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}
.hero-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(217, 174, 84, 0.35);
  flex-shrink: 0;
  background: #0b1220;
}
.hero-info {
  flex: 1;
  min-width: 0;
}
.hero-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-title {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-stats-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-top: 2px;
}
.wr-high { color: var(--green); font-weight: 700; }
.wr-mid { color: var(--text-main); font-weight: 600; }
.wr-low { color: var(--red); font-weight: 600; }

.card-actions-mini {
  display: flex;
  gap: 4px;
  flex-direction: column;
  align-items: flex-end;
}
.mini-toggle {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}
.mini-toggle:hover { color: var(--text-main); border-color: var(--cyan); }
.mini-toggle.is-on {
  background: rgba(217, 174, 84, 0.22);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.style-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.style-mini-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.style-mini-chip.is-diy {
  background: rgba(192, 132, 252, 0.16);
  border-color: rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
}

/* Tier & Badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.tier-Sp { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.tier-S  { background: rgba(245, 158, 11, 0.24); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.5); }
.tier-A  { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.45); }
.tier-B  { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.tier-C  { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-gold { background: rgba(217, 174, 84, 0.2); color: var(--gold-bright); border: 1px solid rgba(217, 174, 84, 0.45); }
.badge-cyan { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-green { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.4); }
.badge-purple { background: rgba(192, 132, 252, 0.18); color: #e9d5ff; border: 1px solid rgba(192, 132, 252, 0.45); }
.badge-warn { background: rgba(251, 191, 36, 0.18); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.45); }
.badge-red { background: rgba(248, 113, 113, 0.18); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.45); }

/* ================= Hero Detail View ================= */
.hero-header-card {
  background: linear-gradient(135deg, rgba(18, 28, 48, 0.96), rgba(14, 24, 44, 0.92));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 2px solid var(--gold);
  object-fit: cover;
}
.hero-h1 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-metrics-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 13px;
}
.spells-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.spell-combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}
.spell-combo-chip img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

/* Panels */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.panel-workbench {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(16, 30, 56, 0.92), rgba(14, 22, 38, 0.96));
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-title {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Workbench Grid */
.workbench-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.55fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
}

.wb-box {
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px;
}
.wb-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

/* Selected Augments Slots */
.selected-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.aug-slot {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(18, 28, 48, 0.5);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.aug-slot:hover {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
}
.aug-slot.is-filled {
  border-style: solid;
  border-color: var(--border-gold);
  background: rgba(217, 174, 84, 0.09);
  cursor: default;
}
.aug-slot-empty {
  color: var(--text-dim);
  font-size: 12px;
  width: 100%;
  text-align: center;
}
.slot-remove {
  margin-left: auto;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.slot-remove:hover {
  background: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

/* 3-pick comparator */
.trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .trio-grid {
    grid-template-columns: 1fr;
  }
}
.trio-card {
  border: 1px dashed rgba(148, 163, 184, 0.32);
  background: rgba(18, 28, 48, 0.55);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 128px;
  position: relative;
}
.trio-card.is-empty {
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
}
.trio-card.is-empty:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.trio-card.is-winner {
  border-style: solid;
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(217, 174, 84, 0.16), rgba(18, 28, 48, 0.85));
  box-shadow: 0 0 18px rgba(217, 174, 84, 0.16);
}
.trio-card.is-filled {
  border-style: solid;
  border-color: var(--border-subtle);
}

/* Dynamic Synergy Reaction Box */
.synergy-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(192, 132, 252, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.45);
}
.synergy-tips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}
.synergy-tip-line {
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(7, 11, 20, 0.52);
  border-left: 3px solid var(--gold);
}
.synergy-items-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 9px;
}
.syn-item-card {
  background: rgba(14, 22, 38, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.syn-item-card.is-core-hit {
  border-color: var(--gold);
}

/* Playstyle Tabs */
.style-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.style-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 13px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.style-tab:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}
.style-tab.is-active {
  background: linear-gradient(135deg, rgba(217, 174, 84, 0.22), rgba(56, 189, 248, 0.14));
  border-color: var(--gold-bright);
  color: #fff;
}
.style-tab.is-diy.is-active {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.25), rgba(56, 189, 248, 0.16));
  border-color: #d8b4fe;
}

/* Build Section */
.style-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(340px, 1.35fr);
  gap: 16px;
}
@media (max-width: 960px) {
  .style-layout {
    grid-template-columns: 1fr;
  }
}

.sub-card {
  background: rgba(7, 11, 20, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}
.sub-card h3 {
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.core-route-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}
.route-arrow {
  color: var(--gold);
  font-weight: 800;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}
.item-chip:hover {
  border-color: var(--gold);
}
.item-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b1220;
  flex-shrink: 0;
}
.item-icon-sm {
  width: 28px;
  height: 28px;
}

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

/* Augment Cards & Rarity Colors */
.aug-rarity-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 720px) {
  .aug-rarity-columns {
    grid-template-columns: 1fr;
  }
}
.rarity-col {
  background: rgba(14, 22, 38, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
}
.rarity-col-head {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rarity-prismatic { color: #f0abfc; }
.rarity-gold { color: #fbbf24; }
.rarity-silver { color: #cbd5e1; }

.aug-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #0a101f;
  flex-shrink: 0;
}
.aug-icon.r-prismatic { border: 2px solid #e879f9; box-shadow: 0 0 8px rgba(232, 121, 249, 0.35); }
.aug-icon.r-gold { border: 2px solid #f59e0b; }
.aug-icon.r-silver { border: 2px solid #94a3b8; }

.aug-mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 7px;
  transition: border-color 0.14s, background 0.14s;
}
.aug-mini-card:last-child { margin-bottom: 0; }
.aug-mini-card:hover {
  border-color: var(--cyan);
  background: var(--bg-card-hover);
}
.aug-mini-card.is-picked {
  border-color: var(--gold-bright);
  background: rgba(217, 174, 84, 0.14);
}
.aug-mini-body {
  flex: 1;
  min-width: 0;
}
.aug-mini-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aug-mini-stat {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.aug-mini-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.act-dot {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
}
.act-dot:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Full Augments Table */
.aug-table-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.aug-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 8px;
}
.aug-table-grid .aug-mini-card:nth-child(n + 25) {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 64px;
}

/* Tooltip */
.hover-tooltip {
  position: fixed;
  z-index: 90;
  max-width: 340px;
  background: rgba(9, 14, 26, 0.97);
  border: 1px solid var(--gold);
  border-radius: 11px;
  padding: 11px 13px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  font-size: 12.5px;
  line-height: 1.5;
}
.tt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tt-title {
  font-weight: 700;
  font-size: 14px;
}
.tt-desc {
  color: #cbd5e1;
  white-space: pre-line;
}
.tt-tip {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 12px;
}

/* Native Dialog */
.hex-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(86vh, 780px);
  background: #0d1526;
  color: var(--text-main);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hex-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(18, 28, 48, 0.9);
}
.dialog-head h2 {
  font-size: 16px;
}
.dialog-close {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}
.dialog-close:hover {
  border-color: var(--red);
  color: var(--red);
}
.dialog-body {
  padding: 16px 18px;
  overflow-y: auto;
  max-height: calc(min(86vh, 780px) - 62px);
}
.dialog-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.form-row {
  margin-bottom: 13px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}
.diy-selected-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  padding: 6px;
  border-radius: 9px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid var(--border-subtle);
  margin-bottom: 7px;
}
.diy-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 6px;
  max-height: 155px;
  overflow-y: auto;
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: rgba(7, 11, 20, 0.4);
}
.diy-pick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}
.diy-pick-btn:hover { border-color: var(--cyan); }
.diy-pick-btn.is-selected {
  border-color: var(--gold-bright);
  background: rgba(217, 174, 84, 0.2);
}
.diy-pick-btn img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
}
.diy-pick-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.rarity-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.aug-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
}

.info-card {
  background: rgba(7, 11, 20, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.info-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--gold-bright);
}
.pretty-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #cbd5e1;
}
.pretty-list li { margin-bottom: 5px; }
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.file-btn {
  position: relative;
}

.loading-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 18px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 11, 20, 0.72);
  padding: 16px 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  .topbar-inner { padding: 10px 12px; }
  .main-shell { padding: 12px 12px 36px; }
  .topbar-controls { width: 100%; justify-content: space-between; }
  .hero-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
  .hero-header-card { padding: 14px; }
}
