:root {
  --bg: #0e0f13; --bg2: #15171d; --panel: #1a1d25; --line: #2a2e3a; --text: #e6e3da;
  --muted: #8d8f99; --gold: #e8b64c; --gold2: #b8862b; --good: #4fd17f; --bad: #ef6b5f;
  --alliance: #4a8fe0; --horde: #d9534f; --neutral: #c9a24a;
  --q0: #9d9d9d; --q1: #ffffff; --q2: #1eff00; --q3: #0070dd; --q4: #a335ee; --q5: #ff8000; --q6: #e6cc80;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: radial-gradient(1200px 500px at 50% -200px, #2a2112 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; }
.good { color: var(--good); } .bad { color: var(--bad); }
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); } .q3 { color: var(--q3); }
.q4 { color: var(--q4); } .q5 { color: var(--q5); } .q6 { color: var(--q6); }

/* header */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 16px; align-items: center;
  padding: 10px 24px; background: rgba(14, 15, 19, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font: 700 20px Cinzel, serif; color: var(--gold); }
.brand img { width: 28px; height: 28px; }
.brand:hover { text-decoration: none; }
.groups { display: flex; gap: 6px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; color: var(--muted); }
.menu[open] summary, .menu summary:hover { background: var(--panel); }
.menu-body {
  position: absolute; top: 38px; left: 0; width: 240px; padding: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px #0009;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.menu-body a { color: var(--text); padding: 4px 8px; border-radius: 6px; font-size: 14px; }
.menu-body a:hover { background: var(--bg2); text-decoration: none; color: var(--gold); }
.menu-body a:first-child { grid-column: 1 / -1; }
.menu-head { grid-column: 1 / -1; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 8px 2px; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--gold2); }
.suggest {
  position: absolute; top: 42px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: 0 12px 40px #0009;
}
.suggest a { display: block; padding: 4px 6px; border-radius: 6px; }
.suggest a.active, .suggest a:hover { background: var(--bg2); text-decoration: none; }
.account .me { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.account img { width: 28px; height: 28px; border-radius: 50%; }

/* buttons */
.btn {
  display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--gold2);
  background: linear-gradient(#e8b64c, #b8862b); color: #1a1408; font-weight: 600; cursor: pointer; font: inherit; font-weight: 600;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.discord { background: #5865f2; border-color: #4752c4; color: #fff; }
.btn.bnet { background: #148eff; border-color: #0b6fd0; color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.small { padding: 2px 8px; }

/* layout */
main { max-width: 1240px; margin: 0 auto; padding: 24px; }
footer { max-width: 1240px; margin: 40px auto; padding: 0 24px; color: var(--muted); font-size: 13px; }
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font: 700 34px Cinzel, serif; color: var(--gold); margin: 0 0 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 12px; font: 700 20px Cinzel, serif; color: var(--gold); }
.panel h3 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.more { font-size: 12px; text-transform: none; letter-spacing: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font: 700 28px Cinzel, serif; color: var(--gold); margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: 5px 10px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); font-size: 13px; }
.tabs a.on, .tabs a:hover { color: var(--gold); border-color: var(--gold2); text-decoration: none; }
.flash { background: #2a2312; border: 1px solid var(--gold2); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
.data th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th:hover { color: var(--gold); }
.data td { padding: 7px 8px; border-bottom: 1px solid #22252f; vertical-align: middle; }
.data tr:hover td { background: #1f232c; }
.data.compact td { padding: 3px 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* items */
.item { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.item:hover { text-decoration: none; } .item:hover .name { text-decoration: underline; }
.icon { width: 26px; height: 26px; border-radius: 5px; border: 1px solid currentColor; background: #000; flex: none; }
.icon.blank { display: inline-block; opacity: .4; }
.item.md .icon { width: 36px; height: 36px; }
.icon.lg { width: 64px; height: 64px; border-width: 2px; border-radius: 10px; box-shadow: 0 0 24px #0008; }
.name { font-weight: 500; }
.item-head { display: flex; gap: 18px; align-items: center; margin: 4px 0 20px; }
.item-head h1 { margin: 0 0 6px; font-size: 30px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.tag.link { color: var(--gold); }
.house { font-weight: 600; }
.house.alliance { color: var(--alliance); } .house.horde { color: var(--horde); } .house.blackwater { color: var(--neutral); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 12px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--gold2); color: #1a1408; font-weight: 600; }
.chart-box { position: relative; height: 320px; } .chart-box.small { height: 140px; margin-top: 8px; }
.craft { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg2); }
.craft-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.craft-body { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.reagents { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.craft-sum { text-align: right; } .known { margin-top: 4px; color: var(--good); }
.pill { margin-left: auto; padding: 2px 10px; border-radius: 999px; font-weight: 600; background: #13261b; }
.pill.bad { background: #2b1513; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.book h3 { margin: 0 0 6px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.results { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

/* forms */
.settings { display: grid; gap: 10px; }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.settings label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.settings input:not([type=checkbox]), .settings select {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit;
}
.settings fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.settings legend { color: var(--gold); padding: 0 6px; }
.settings .btn { justify-self: start; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .search { order: 5; max-width: none; flex-basis: 100%; }
  main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
