/* ============================================================
   AlbionOracle — "The Oracle's Ledger"
   Arcane illuminated-manuscript theme: obsidian ink, burnished
   gold (Albion Light), cold scrying teal (the Oracle), and the
   canonical colors of the royal cities.
   ============================================================ */

:root {
  /* ===== Albion palette: black / bone-white / crimson red ===== */
  /* surfaces (neutral near-black) */
  --ink:        #0c0c0e;
  --ink-2:      #121216;
  --panel:      #17171c;
  --panel-2:    #202027;
  --panel-3:    #2a2a32;
  --line:       #34343d;
  --line-soft:  #26262d;

  /* crimson (primary accent) */
  --red:        #d43f33;
  --red-bright: #f05646;
  --red-dim:    #a12e24;
  --red-deep:   #6e1d16;

  /* bone / silver (secondary) */
  --bone:       #efece4;
  --silver:     #c2beb4;

  /* ---- aliases: existing selectors keep working, new colors flow in ---- */
  --gold:       var(--red);
  --gold-bright:var(--red-bright);
  --gold-dim:   var(--red-dim);
  --gold-deep:  var(--red-deep);
  --teal:       #cfcabf;   /* was scrying teal -> now bone-silver */
  --teal-dim:   #9a968c;
  --teal-deep:  #3a3934;
  --vellum:     #efece4;
  --vellum-dim: #a7a49b;
  --vellum-mut: #6e6c65;

  /* status */
  --fresh:      #6bbf79;
  --stale:      #e0a53a;
  --old:        #c07a6e;

  /* royal-city sigils (canonical Albion colors) */
  --c-caerleon:      #c24a3f;
  --c-bridgewatch:   #e0913f;
  --c-lymhurst:      #6bb267;
  --c-martlock:      #5a92cf;
  --c-fort-sterling: #c4ccd4;
  --c-thetford:      #a678d6;
  --c-brecilien:     #cf78bb;
  --c-black-market:  #a83b3b;

  --radius: 4px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .55);
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Spectral", Georgia, serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--vellum);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--ink);
}

/* layered atmosphere: gold dawn-glow, teal under-glow, vignette, grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 520px at 68% -12%, rgba(212,63,51,.14), transparent 62%),
    radial-gradient(900px 600px at 8% 108%, rgba(196,192,182,.07), transparent 60%),
    radial-gradient(1400px 900px at 50% 50%, transparent 55%, rgba(0,0,0,.5) 100%),
    linear-gradient(180deg, #101014 0%, #0c0c0e 100%),
    var(--ink);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(212,63,51,.28); color: #fff; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 26px;
  background: linear-gradient(180deg, rgba(18,18,23,.96) 0%, rgba(12,12,15,.92) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(212,63,51,.10), 0 10px 30px rgba(0,0,0,.4);
}

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; }
.brand-eye {
  width: 46px; height: 46px; flex: none;
  filter: drop-shadow(0 0 10px rgba(196,192,182,.35));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-eye { transform: rotate(8deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 2.5px;
  color: var(--vellum);
  text-transform: uppercase;
}
.brand-name .accent {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(212,63,51,.4);
}
.brand-tag {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 11.5px;
  letter-spacing: .4px;
  color: var(--teal-dim);
  margin-top: 5px;
}

.search-wrap { flex: 1; max-width: 540px; position: relative; display: flex; align-items: center; }
.search-rune {
  position: absolute; left: 15px;
  color: var(--gold-dim); font-size: 15px; pointer-events: none;
}
#search {
  width: 100%;
  padding: 11px 16px 11px 38px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--vellum);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
#search::placeholder { color: var(--vellum-mut); font-style: italic; }
#search:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(212,63,51,.12), inset 0 0 22px rgba(212,63,51,.05);
}

.controls { display: flex; gap: 9px; margin-left: auto; }
.pill {
  appearance: none;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--vellum);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pill:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------------- Module nav ---------------- */
.module-nav {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(16,16,20,.55), transparent);
  overflow-x: auto;
}
.module {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: var(--radius);
  font-family: var(--font-display); font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--vellum-dim);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color .14s, border-color .14s, background .14s;
}
.module:hover { color: var(--vellum); border-color: var(--line); }
.module.active {
  color: var(--red-bright);
  background: linear-gradient(180deg, #2a1512, #170e0c);
  border-color: var(--red-deep);
  box-shadow: inset 0 0 14px rgba(212,63,51,.12);
}
.module.is-soon { color: var(--vellum-mut); }
.module.is-soon:hover { color: var(--vellum-dim); }
.soon-tag {
  font-family: var(--font-body); font-style: italic; text-transform: none;
  font-size: 9.5px; letter-spacing: 0; color: var(--vellum-mut);
  border: 1px solid var(--line-soft); border-radius: 3px; padding: 1px 5px;
}
.module-eye { width: 20px; height: 20px; }

/* ---------------- Views ---------------- */
.view { display: block; }
.view[hidden] { display: none; }

/* ---------------- Home hub ---------------- */
.hub { max-width: 1080px; margin: 0 auto; padding: 40px 24px 60px; }
.hub-hero { text-align: center; margin-bottom: 40px; }
.hub-hero-eye {
  width: 86px; height: 86px;
  filter: drop-shadow(0 6px 20px rgba(212,63,51,.35));
}
.hub-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 6vw, 46px); letter-spacing: 4px;
  text-transform: uppercase; margin: 14px 0 6px; color: var(--vellum);
}
.hub-title .accent { color: var(--red); text-shadow: 0 0 22px rgba(212,63,51,.45); }
.hub-sub {
  font-family: var(--font-body); font-style: italic;
  color: var(--vellum-dim); font-size: 15px; margin: 0; letter-spacing: .5px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.hub-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 30px 20px 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(212,63,51,.07), transparent 65%),
    linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer; color: var(--vellum);
  font-family: inherit;
  transition: transform .14s ease, border-color .16s, box-shadow .16s;
  animation: rise .5s backwards;
}
.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--red-dim);
  box-shadow: var(--shadow), 0 0 0 1px rgba(212,63,51,.15);
}
.hub-ico {
  width: 74px; height: 74px; display: grid; place-items: center;
  color: var(--bone);
  margin-bottom: 6px;
  transition: color .16s, transform .16s;
}
.hub-ico svg { width: 56px; height: 56px; }
.hub-card:hover .hub-ico { color: var(--red-bright); transform: scale(1.06); }
.hub-card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: 1px; text-transform: uppercase;
}
.hub-card-sub { font-size: 13px; color: var(--vellum-dim); line-height: 1.35; }
.hub-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .6px;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
  color: var(--vellum-mut); border: 1px solid var(--line);
}
.hub-badge.live { color: var(--red-bright); border-color: var(--red-deep); background: rgba(212,63,51,.08); }
.hub-card.is-soon { cursor: default; }
.hub-card.is-soon .hub-ico { color: var(--vellum-mut); }
.hub-card.is-soon:hover { transform: none; border-color: var(--line-soft); box-shadow: none; }
.hub-card.is-soon:hover .hub-ico { color: var(--vellum-mut); transform: none; }

/* ---------------- Layout ---------------- */
.layout { display: flex; align-items: flex-start; max-width: 1500px; margin: 0 auto; }

.filters {
  position: sticky;
  top: 76px;
  flex: none;
  display: flex;
  gap: 16px;
  padding: 24px 16px 24px 22px;
  height: calc(100vh - 76px);
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
}
/* leftmost: the category index — scrolls internally only if it overflows,
   so the page itself doesn't scroll. */
.filter-cats { width: 184px; height: 100%; overflow-y: auto; padding-right: 6px; }
/* to its right: tier + enchant as their own short lists */
.filter-subs { width: 120px; flex: none; }
.filter-subs .filter-group:first-child { margin-top: 2px; }
.filter-group { margin-bottom: 28px; }
.filter-group h3 {
  margin: 0 0 13px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.filter-group h3::after {
  content: "❖";
  position: absolute; right: 0; bottom: 6px;
  font-size: 9px; color: var(--gold-dim);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--vellum-dim);
  cursor: pointer;
  user-select: none;
  transition: all .14s;
}
.chip:hover { color: var(--vellum); border-color: var(--gold-dim); background: var(--panel-2); }
.chip.active {
  background: linear-gradient(180deg, #331512, #1e0d0b);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: inset 0 0 12px rgba(212,63,51,.14);
}
.chip small { opacity: .5; margin-left: 3px; font-family: var(--font-mono); font-size: 11px; }

/* category index — illuminated table of contents */
#cat-chips { flex-direction: column; gap: 2px; }
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--vellum-dim);
  cursor: pointer; user-select: none;
  transition: all .13s;
}
.cat-mark {
  width: 6px; height: 6px; flex: none;
  transform: rotate(45deg);
  border: 1px solid var(--gold-dim);
  transition: all .13s;
}
.cat-name { flex: 1; font-size: 14px; }
.cat-count { font-family: var(--font-mono); font-size: 11px; color: var(--vellum-mut); }
.cat-row:hover { color: var(--vellum); background: var(--panel-2); }
.cat-row:hover .cat-mark { border-color: var(--gold); }
.cat-row.active {
  color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(212,63,51,.13), transparent 85%);
  border-left: 2px solid var(--gold);
  padding-left: 9px;
}
.cat-row.active .cat-mark { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px var(--gold); }
.cat-row.active .cat-count { color: var(--gold-dim); }

/* tier ramp — dim gold (T1) to bright gold (T8) */
.tier-chip { font-family: var(--font-mono); font-weight: 600; min-width: 36px; text-align: center; color: var(--tc); }
.tier--1 { --tc: #7c6f6c; } .tier--2 { --tc: #90635e; } .tier--3 { --tc: #a55952; }
.tier--4 { --tc: #ba4f45; } .tier--5 { --tc: #cd453a; } .tier--6 { --tc: #d43f33; }
.tier--7 { --tc: #e64b3d; } .tier--8 { --tc: #f4594a; }
.tier-chip:hover { border-color: var(--tc); color: var(--tc); }
.tier-chip.active {
  background: var(--tc); color: #17130c; border-color: var(--tc); font-weight: 700;
  box-shadow: 0 0 12px -2px var(--tc);
}

/* enchant chips — canonical Albion enchant colors */
.ench-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-weight: 600; }
.ench--0 { --ec: #cfc8b4; } .ench--1 { --ec: #5fa860; } .ench--2 { --ec: #4a86c5; }
.ench--3 { --ec: #a678d6; } .ench--4 { --ec: #e0913f; }
.ench-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ec); box-shadow: 0 0 7px var(--ec); }
.ench-chip:hover { border-color: var(--ec); color: var(--vellum); }
.ench-chip.active {
  border-color: var(--ec); color: var(--ec);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 12px rgba(255,255,255,.05);
}

.content { flex: 1; padding: 26px 30px; min-width: 0; }
.results-meta {
  color: var(--vellum-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .3px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------------- Grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(212,63,51,.05), transparent 70%),
    linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .13s ease, border-color .16s, box-shadow .16s;
  animation: rise .45s backwards;
}
.card::before {
  content: "";
  position: absolute; inset: 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  pointer-events: none;
  transition: border-color .16s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-dim);
  box-shadow: var(--shadow), 0 0 0 1px rgba(212,63,51,.12);
}
.card:hover::before { border-color: rgba(212,63,51,.25); }
.thumb { position: relative; width: 78px; height: 78px; display: grid; place-items: center; }
.thumb::before {
  content: ""; position: absolute; inset: 4px; border-radius: 6px;
  background: linear-gradient(110deg, #17171c 30%, #26262d 50%, #17171c 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
  opacity: .55;
}
.thumb.loaded::before { display: none; }
.card img {
  width: 78px; height: 78px;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.5));
  opacity: 0;
  transition: opacity .3s ease;
}
.card img.loaded { opacity: 1; }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.card .name {
  font-size: 13.5px;
  line-height: 1.28;
  margin-top: 8px;
  color: var(--vellum);
}
.card .meta { margin-top: 7px; }
.tier-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .5px;
  background: var(--panel-3);
  color: var(--gold-bright);
  border: 1px solid var(--gold-deep);
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.load-more {
  display: block;
  margin: 30px auto 10px;
  padding: 12px 30px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--gold);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .16s;
}
.load-more:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 18px rgba(212,63,51,.15); }

/* ---------------- Drawer ---------------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(6,5,3,.62); backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(640px, 100%);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(212,63,51,.08), transparent 60%),
    linear-gradient(180deg, #16161b 0%, #0e0e11 100%);
  border-left: 1px solid var(--gold-deep);
  box-shadow: var(--shadow);
  padding: 30px 30px 40px;
  overflow-y: auto;
  animation: slideIn .22s ease-out;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .3; } to { transform: none; opacity: 1; } }
.drawer-close {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px;
  background: var(--panel); color: var(--vellum-dim);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: all .15s;
}
.drawer-close:hover { color: var(--gold-bright); border-color: var(--gold-dim); }

.detail-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.detail-icon-frame {
  width: 104px; height: 104px; flex: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(212,63,51,.12), transparent 70%), var(--ink-2);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  box-shadow: inset 0 0 20px rgba(0,0,0,.5);
}
.detail-icon { width: 88px; height: 88px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.detail-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.15;
  color: var(--vellum);
}
.detail-sub { color: var(--vellum-mut); font-family: var(--font-mono); font-size: 12px; letter-spacing: .3px; }

.quality-tabs { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }

.price-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th, .price-table td { padding: 10px 11px; text-align: left; }
.price-table thead th {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.3px;
  border-bottom: 1px solid var(--gold-deep);
}
.price-table tbody tr { border-top: 1px solid var(--line-soft); transition: background .12s; }
.price-table tbody tr:hover { background: rgba(212,63,51,.045); }

.city-name { font-weight: 500; display: flex; align-items: center; gap: 9px; }
.city-sigil {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: var(--sig, var(--gold));
  box-shadow: 0 0 8px var(--sig, var(--gold)), inset 0 0 3px rgba(0,0,0,.4);
}
.city--caerleon      { --sig: var(--c-caerleon); }
.city--bridgewatch   { --sig: var(--c-bridgewatch); }
.city--lymhurst      { --sig: var(--c-lymhurst); }
.city--martlock      { --sig: var(--c-martlock); }
.city--fort-sterling { --sig: var(--c-fort-sterling); }
.city--thetford      { --sig: var(--c-thetford); }
.city--brecilien     { --sig: var(--c-brecilien); }
.city--black-market  { --sig: var(--c-black-market); }
.city--black-market .city-label { color: var(--c-black-market); font-weight: 600; letter-spacing: .3px; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.num.sell { color: var(--gold-bright); }
.num.buy { color: var(--teal); }
.num.avg24 { color: var(--vellum); }
.num.vol24 { color: var(--teal-dim); }
.num.empty { color: var(--vellum-mut); }

/* freshness dot carried onto the sell price (exact age via title) */
.age-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.age-dot.fresh { background: var(--fresh); box-shadow: 0 0 6px var(--fresh); }
.age-dot.stale { background: var(--stale); box-shadow: 0 0 6px var(--stale); }
.age-dot.old { background: var(--old); }
.age-dot.none { background: #4a4436; }

.age { font-family: var(--font-body); font-size: 12.5px; color: var(--vellum-dim); display: inline-flex; align-items: center; }
.age .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.age.fresh .dot { background: var(--fresh); box-shadow: 0 0 7px var(--fresh); }
.age.stale .dot { background: var(--stale); box-shadow: 0 0 7px var(--stale); }
.age.old   .dot { background: var(--old); }
.age.none  .dot { background: #4a4436; }
.age.none  { color: var(--vellum-mut); font-style: italic; }

.disclaimer {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--teal-dim);
  border-radius: var(--radius);
  background: rgba(196,192,182,.03);
  color: var(--vellum-dim);
  font-size: 12.5px; font-style: italic; line-height: 1.55;
}

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--gold-dim); color: var(--vellum);
  padding: 11px 20px; border-radius: var(--radius); z-index: 60; box-shadow: var(--shadow);
}

/* ---------------- Arbitrage ---------------- */
.arb { max-width: 780px; margin: 0 auto; padding: 30px 22px 60px; }
.arb-head { margin-bottom: 22px; }
.arb-title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--vellum);
}
.arb-title-ico { width: 30px; height: 30px; color: var(--red); }
.arb-lead { margin: 0; color: var(--vellum-dim); font-style: italic; }

.arb-controls { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.arb-search-wrap { position: relative; flex: 1; min-width: 240px; display: flex; align-items: center; }
#arb-search {
  width: 100%; padding: 12px 16px 12px 38px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--vellum); font-family: var(--font-body); font-size: 15px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
#arb-search:focus { border-color: var(--red-dim); box-shadow: 0 0 0 3px rgba(212,63,51,.12); }
.arb-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 340px; overflow-y: auto;
}
.arb-sugg { display: flex; align-items: center; gap: 11px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.arb-sugg:hover { background: var(--panel-2); }
.arb-sugg img { border-radius: 4px; background: var(--ink-2); flex: none; }
.arb-sugg-n { flex: 1; font-size: 14px; }
.arb-sugg-t { font-family: var(--font-mono); font-size: 11px; color: var(--red); }
.arb-premium { display: flex; align-items: center; gap: 7px; color: var(--vellum-dim); font-size: 14px; cursor: pointer; user-select: none; white-space: nowrap; }
.arb-premium input { accent-color: var(--red); width: 16px; height: 16px; }

.arb-empty, .arb-loading { padding: 40px 20px; text-align: center; color: var(--vellum-mut); font-style: italic; }

.arb-item { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.arb-item img { border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); }
.arb-item-n { font-family: var(--font-display); font-size: 18px; color: var(--vellum); }
.arb-item-s { font-family: var(--font-mono); font-size: 12px; color: var(--vellum-mut); }
.arb-qtabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }

.arb-route {
  display: flex; align-items: stretch; gap: 12px; margin-bottom: 16px;
}
.arb-leg {
  flex: 1; padding: 16px; border-radius: 8px; text-align: center;
  background: linear-gradient(180deg, var(--panel), var(--ink-2)); border: 1px solid var(--line);
}
.arb-leg.buy { border-color: rgba(107,191,121,.35); }
.arb-leg.sell { border-color: var(--red-deep); }
.arb-leg-h { font-family: var(--font-display); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--vellum-mut); margin-bottom: 8px; }
.arb-city { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.arb-price { font-family: var(--font-mono); font-size: 20px; color: var(--vellum); }
.arb-leg.buy .arb-price { color: var(--fresh); }
.arb-leg.sell .arb-price { color: var(--red-bright); }
.arb-arrow { display: flex; align-items: center; color: var(--red); font-size: 24px; }

.arb-summary { display: flex; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.arb-metric {
  flex: 1; min-width: 120px; padding: 14px 16px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); text-align: center;
}
.arb-metric span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--vellum-mut); margin-bottom: 5px; }
.arb-metric b { font-family: var(--font-mono); font-size: 19px; color: var(--vellum); }
.arb-metric.big b { font-size: 24px; }
.arb-metric.pos b { color: var(--fresh); }
.arb-metric.neg b { color: var(--red-bright); }
.arb-taxnote { font-size: 11.5px; color: var(--vellum-mut); font-style: italic; margin-bottom: 18px; line-height: 1.5; }

.arb-bm {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 20px; border-radius: 8px;
  background: rgba(168,59,59,.08); border: 1px solid var(--c-black-market);
}
.arb-bm-h { font-family: var(--font-display); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--c-black-market); }
.arb-bm span:not(.arb-bm-h) { flex: 1; font-family: var(--font-mono); font-size: 13px; color: var(--vellum-dim); }
.arb-bm b { font-family: var(--font-mono); font-size: 17px; }
.arb-bm b.pos, .arb-metric.pos b, .num.pos { color: var(--fresh); }
.arb-bm b.neg { color: var(--red-bright); }

.arb-tbl tbody tr.is-buy { background: rgba(107,191,121,.07); }
.arb-tbl tbody tr.is-sell { background: rgba(212,63,51,.07); }
.arb-tbl em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--vellum-mut); margin-left: 4px; }

/* ---------------- Gold tracker ---------------- */
.gold { max-width: 780px; margin: 0 auto; padding: 30px 22px 60px; }
.gold-head { margin-bottom: 22px; }
.gold-title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--vellum);
}
.gold-title-ico { width: 30px; height: 30px; color: var(--red); }
.gold-lead { margin: 0; color: var(--vellum-dim); font-style: italic; }

.gold-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.gold-now-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--vellum-mut); margin-bottom: 4px; }
.gold-now-price { font-family: var(--font-mono); font-size: 34px; color: var(--vellum); line-height: 1; }
.gold-now-price span { font-size: 15px; color: var(--vellum-mut); }
.gold-chg { font-family: var(--font-mono); font-size: 14px; margin-top: 8px; }
.gold-chg.pos { color: var(--fresh); }
.gold-chg.neg { color: var(--red-bright); }
.gold-ranges { display: flex; gap: 6px; }

.gold-chart {
  width: 100%; height: 220px; display: block;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: linear-gradient(180deg, var(--panel), var(--ink-2));
  margin-bottom: 16px;
}

.gold-stats { display: flex; gap: 12px; margin-bottom: 14px; }
.gold-stat { flex: 1; text-align: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.gold-stat span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--vellum-mut); margin-bottom: 5px; }
.gold-stat b { font-family: var(--font-mono); font-size: 18px; color: var(--vellum); }
.gold-note { font-size: 12px; color: var(--vellum-mut); font-style: italic; }

/* ---------------- Killboard ---------------- */
.kb { max-width: 860px; margin: 0 auto; padding: 30px 22px 60px; }
.kb-head { margin-bottom: 18px; }
.kb-title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--vellum);
}
.kb-title-ico { width: 30px; height: 30px; color: var(--red); }
.kb-lead { margin: 0; color: var(--vellum-dim); font-style: italic; }

.kb-tabs { display: flex; gap: 8px; margin: 18px 0; border-bottom: 1px solid var(--line-soft); }
.kb-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--vellum-dim); font-family: var(--font-display); font-size: 13px;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px 6px; cursor: pointer;
  transition: color .14s, border-color .14s;
}
.kb-tab:hover { color: var(--vellum); }
.kb-tab.active { color: var(--red-bright); border-bottom-color: var(--red); }

.kb-loading, .kb-empty { padding: 32px; text-align: center; color: var(--vellum-mut); font-style: italic; }

.kb-kill {
  background: linear-gradient(180deg, var(--panel), var(--ink-2));
  border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 8px; overflow: hidden;
  transition: border-color .14s;
}
.kb-kill:hover { border-color: var(--line); }
.kb-main {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer;
}
.kb-side { min-width: 0; }
.kb-side.killer { text-align: left; }
.kb-side.victim { text-align: right; }
.kb-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-side.killer .kb-name { color: var(--fresh); }
.kb-side.victim .kb-name { color: var(--red-bright); }
.kb-guild { font-size: 12px; color: var(--vellum-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-ip { font-family: var(--font-mono); font-size: 11px; color: var(--vellum-dim); margin-top: 2px; }
.kb-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kb-swords { width: 24px; height: 24px; color: var(--vellum-mut); }
.kb-fame { font-family: var(--font-mono); font-size: 13px; color: var(--red); }
.kb-time { font-size: 11px; color: var(--vellum-mut); white-space: nowrap; }

.kb-gear { border-top: 1px solid var(--line-soft); padding: 14px 16px; background: rgba(0,0,0,.2); }
.kb-gear-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.kb-gear-item { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 58px; }
.kb-gear-item img { background: var(--ink-2); border: 1px solid var(--line); border-radius: 5px; }
.kb-gear-val { font-family: var(--font-mono); font-size: 11px; color: var(--vellum-dim); }
.kb-gear-total { text-align: right; font-size: 14px; color: var(--vellum-dim); }
.kb-gear-total b { font-family: var(--font-mono); font-size: 17px; color: var(--red-bright); }

.kb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.kb-col h3 {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--vellum); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.kb-col h3 span { color: var(--red); font-family: var(--font-mono); }
.kb-kill.compact .kb-main { padding: 9px 12px; gap: 8px; }
.kb-kill.compact .kb-name { font-size: 13px; }
.kb-kill.compact .kb-swords { width: 18px; height: 18px; }

/* ---------------- Mobile ---------------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 14px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .layout { flex-direction: column; }
  .filters {
    position: static; width: 100%; height: auto; overflow: visible;
    flex-direction: column; gap: 14px;
    border-right: none; border-bottom: 1px solid var(--line-soft);
    padding: 16px;
  }
  .filter-cats, .filter-subs { width: 100%; height: auto; overflow: visible; }
  .filter-subs { display: flex; gap: 26px; }
  .filter-group { margin-bottom: 0; }
  /* categories become a horizontal scroll strip to save vertical space */
  #cat-chips { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .cat-row { flex: none; }
  .cat-row .cat-count { display: none; }
  .content { padding: 18px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
  .card img { width: 64px; height: 64px; }
  .drawer-panel { padding: 24px 18px 34px; }
  .arb-route { flex-direction: column; }
  .arb-arrow { transform: rotate(90deg); justify-content: center; }
  .hub-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .kb-cols { grid-template-columns: 1fr; }
  .kb { padding: 22px 14px 50px; }
}
