:root {
  --bg: #14110d; --bg2: #1b1712; --panel: #211c15; --panel2: #2a2319; --line: #3a3024;
  --text: #ece3d0; --muted: #a99a80; --gold: #e2b866; --gold2: #f3d58f; --red: #e0614f; --green: #6fcf6a;
  --blue: #5aa7ff; --radius: 12px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans);
  background-image: radial-gradient(1200px 500px at 50% -200px, #3a2a14 0%, transparent 70%);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: .6em 0 .3em; color: var(--gold2); }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.1rem; color: #d8ccb4; max-width: 70ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--gold); color: #000; padding: 6px 10px; z-index: 99; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(20,17,13,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.15rem; color: var(--gold2); font-weight: 700; }
.brand:hover { text-decoration: none; }
.search { flex: 1; min-width: 200px; }
.search input { width: 100%; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); }
.nav a[aria-current] { color: var(--gold2); }
.badge { background: var(--red); color: #fff; border-radius: 99px; padding: 0 6px; font-size: .75rem; }

input, select, button { font: inherit; }
input[type=search], input:not([type]), input[type=text], select {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
label { display: block; margin: 8px 0; }
label select { display: block; margin-top: 4px; width: 100%; max-width: 480px; }

.btn {
  display: inline-block; background: linear-gradient(180deg, #e9c171, #b98a37); color: #1a1208; border: 0;
  border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); color: #1a1208; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn-ghost:hover { background: rgba(226,184,102,.1); color: var(--gold2); }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn-danger { background: var(--red); color: #fff; }

.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.center { text-align: center; }
.notice { background: #3a2c14; border: 1px solid #7a5a22; border-radius: 8px; padding: 10px 14px; }
.notice.ok { background: #1f3a1a; border-color: #3f7a32; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card { margin: 0; }
.grid-2 { margin: 16px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }

/* hero */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-bottom: .2em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 24px 0; }
.feature { margin: 0; }
.feature-icon { font-size: 1.6rem; }
.feature h2 { margin-top: .4em; }
.feature p { color: var(--muted); margin: 0; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

/* tables */
.table-wrap { overflow-x: auto; }
table.prices { width: 100%; border-collapse: collapse; }
.prices th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.prices td { padding: 6px 8px; border-bottom: 1px solid rgba(58,48,36,.5); vertical-align: middle; }
.prices tr.current td { background: rgba(226,184,102,.08); }
.num { text-align: right; white-space: nowrap; }
.down { color: var(--green); }
.up { color: var(--red); }
.item-link { display: inline-flex; align-items: center; gap: 8px; }
.icon { border-radius: 6px; border: 1px solid #000; flex: none; background: #000; }
.icon-empty { display: inline-block; }
.icon.q-POOR { border-color: #9d9d9d; } .icon.q-UNCOMMON { border-color: #1eff00; } .icon.q-RARE { border-color: #0070dd; }
.icon.q-EPIC { border-color: #a335ee; } .icon.q-LEGENDARY { border-color: #ff8000; }
.q-text-POOR { color: #9d9d9d; } .q-text-COMMON { color: #f4f0e8; } .q-text-UNCOMMON { color: #1eff00; }
.q-text-RARE { color: #3d9bff; } .q-text-EPIC { color: #b96cf5; } .q-text-LEGENDARY { color: #ff8000; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.money span { margin-left: 4px; }
.money span:first-child { margin-left: 0; }
.money .g::after { content: "g"; color: #e2b866; margin-left: 1px; }
.money .s::after { content: "s"; color: #c0c0c0; margin-left: 1px; }
.money .c::after { content: "c"; color: #c98b50; margin-left: 1px; }
.pager { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }

.crumbs { margin-top: 18px; font-size: .9rem; color: var(--muted); }
.house-select { margin: 8px 0; }
.house-select select { max-width: 420px; }

/* item */
.item-head { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.item-head h1 { margin: 0; }
.item-head p { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.35rem; font-weight: 700; }
.stat .value.small { font-size: 1rem; }
.stat .delta { font-size: .85rem; }
.ranges { display: flex; gap: 4px; }
.ranges button { background: var(--bg2); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.ranges button[aria-selected=true] { color: #1a1208; background: var(--gold); border-color: var(--gold); }
.chart { position: relative; height: 280px; margin-top: 8px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .tip { position: absolute; pointer-events: none; background: #000d; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .8rem; white-space: nowrap; }
.legend { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.legend span { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.l-min { background: var(--gold); } .l-med { background: var(--blue); }
.alert-form label { margin: 6px 0; }
.alert-form .row { display: flex; gap: 8px; margin-top: 10px; }
.alert-form .row input { flex: 1; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid rgba(58,48,36,.4); }
.results { list-style: none; padding: 0; }
.results li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* characters */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.char { color: var(--text); margin: 0; transition: border-color .15s; }
.char:hover { border-color: var(--gold); text-decoration: none; color: var(--text); }
.char-head { display: flex; gap: 12px; align-items: center; }
.char h2 { margin: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg2); flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.faction-HORDE { color: #e0614f; } .faction-ALLIANCE { color: #5aa7ff; }
.char-banner { display: flex; gap: 16px; align-items: center; }
.char-banner .inset { width: 120px; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.char-banner h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--gold2); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.gear { list-style: none; padding: 0; margin: 0; }
.gear li { display: grid; grid-template-columns: 110px 1fr auto; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid rgba(58,48,36,.5); align-items: baseline; }
.gear li > .small:last-child { grid-column: 2 / -1; color: var(--green); }
.bar { display: block; height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #b98a37, var(--gold2)); }
.zone { border-bottom: 1px solid var(--line); padding: 8px 0; }
.zone summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.zone summary .bar { grid-column: 1 / -1; }
.zone ul { margin-top: 8px; columns: 2 220px; }
.reps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 24px; }
.reps li { display: grid; grid-template-columns: 1fr auto; }
.reps .bar { grid-column: 1 / -1; }
.alerts { list-style: none; padding: 0; margin: 0; }
.alerts li { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alerts li > .muted { grid-column: 1 / 3; }
.notifs li.unread strong { color: var(--gold2); }
.danger { border-color: #6a2a22; }

/* donate */
.donate-card { max-width: 720px; margin: 32px auto; text-align: center; }
.donate-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.coffee-fab {
  position: fixed; right: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #e9c171, #b98a37); font-size: 1.5rem; box-shadow: 0 6px 20px #0008; z-index: 30;
}
.coffee-fab:hover { text-decoration: none; transform: translateY(-2px); }
.prose { max-width: 820px; }
.prose li { margin: 4px 0; }

.footer { border-top: 1px solid var(--line); padding: 20px 0 80px; color: var(--muted); font-size: .9rem; }
.disclaimer { font-size: .78rem; opacity: .8; max-width: 90ch; }

@media (max-width: 640px) {
  .topbar-inner { gap: 8px; }
  .search { order: 3; flex-basis: 100%; }
  .nav { gap: 10px; font-size: .95rem; }
  .gear li { grid-template-columns: 1fr auto; }
  .gear li .slot { grid-column: 1 / -1; }
  .char-banner .inset { width: 72px; }
  .prices td, .prices th { padding: 6px 4px; }
}
