/* EverlookDB. Tooltip-midnight base, WoW UI gold for focus/keywords, item quality colors as data. */

:root {
  color-scheme: dark;
  --bg: #121826;
  --panel: #182033;
  --raise: #1f2940;
  --line: #2b3652;
  --text: #e6eaf2;
  --muted: #8c97ae;
  --gold: #ffd100;
  --field: #8fc7ff;
  --str: #9fe07e;
  --num: #f2b56b;
  --err: #ff6b6b;

  --q-poor: #9d9d9d;
  --q-common: #e6eaf2;
  --q-uncommon: #1eff00;
  --q-rare: #3d9bff;
  --q-epic: #b65cff;
  --q-legendary: #ff8000;
  --q-artifact: #e6cc80;
  --q-heirloom: #00ccff;

  --r-orange: #ff8040;
  --r-yellow: #ffd100;
  --r-green: #40c040;
  --r-gray: #808080;

  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --code: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f1f4f8;
    --panel: #ffffff;
    --raise: #e8edf4;
    --line: #d3dae6;
    --text: #141b2b;
    --muted: #5b667c;
    --gold: #9a7300;
    --field: #1d5ea8;
    --str: #2e7a10;
    --num: #a3570a;
    --err: #c62828;
    --q-poor: #6f6f6f;
    --q-common: #141b2b;
    --q-uncommon: #1b8a00;
    --q-rare: #0062c4;
    --q-epic: #8a2bd1;
    --q-legendary: #c25e00;
    --q-artifact: #8a7330;
    --q-heirloom: #00809f;
    --r-yellow: #d9a800;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.top {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px var(--gutter) 0;
  max-width: 1400px; margin: 0 auto;
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.build { color: var(--muted); font-size: 13px; }

main { max-width: 1400px; margin: 0 auto; padding: 18px var(--gutter) 48px; }

/* ---------- the query line: the one loud element ---------- */
.query { position: relative; }
.editor {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .12s;
}
.editor:focus-within { border-color: var(--gold); }
.editor textarea, .editor .hl {
  font: 20px/1.4 var(--code);
  padding: 14px 16px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}
.editor textarea {
  position: relative; display: block;
  width: 100%; resize: none; overflow: hidden;
  background: transparent;
  border: 0;
  outline: none;
  color: transparent;
  caret-color: var(--gold);
}
.editor textarea::placeholder { color: var(--muted); }
.editor .hl {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--text);
}
.hl .kw { color: var(--gold); }
.hl .field { color: var(--field); }
.hl .str { color: var(--str); }
.hl .num { color: var(--num); }
.hl .op, .hl .pipe { color: var(--muted); }
.hl .bad { text-decoration: underline wavy var(--err); text-underline-offset: 4px; }

.suggest {
  position: absolute; z-index: 5; left: 0; top: 58px;
  min-width: 260px; max-width: 520px; max-height: 300px; overflow: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--raise); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.suggest li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 10px; border-radius: 5px; cursor: pointer;
  font-family: var(--code); font-size: 14px;
}
.suggest li small { font-family: var(--ui); color: var(--muted); font-size: 12px; }
.suggest li[aria-selected="true"] { background: var(--line); }

/* ---------- builder blocks ---------- */
.builder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 32px; align-items: center; }
.block {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 4px 0 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  font-size: 13.5px; white-space: nowrap; cursor: pointer;
}
.block:hover { border-color: var(--muted); }
.block.source { padding-right: 10px; font-weight: 600; }
.block .k { color: var(--muted); }
.block .f { color: var(--field); }
.block .v { color: var(--text); font-weight: 600; }
.block .x {
  border: 0; background: none; width: 22px; height: 22px; border-radius: 4px;
  color: var(--muted); cursor: pointer; line-height: 1;
}
.block .x:hover { background: var(--raise); color: var(--text); }
.add {
  height: 30px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  background: none; border: 1px dashed var(--line); color: var(--muted); font-size: 13.5px;
}
.add:hover { color: var(--text); border-color: var(--muted); }

.pop {
  position: absolute; z-index: 6;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.pop select, .pop input {
  height: 30px; padding: 0 8px; border-radius: 5px;
  background: var(--panel); border: 1px solid var(--line);
}
.pop input { width: 140px; }
.pop button {
  height: 30px; padding: 0 12px; border-radius: 5px; cursor: pointer;
  background: var(--gold); color: #1a1400; border: 0; font-weight: 600;
}

.statusbar { display: flex; align-items: center; gap: 12px; margin: 12px 2px 8px; }
.statusbar .status { margin: 0; flex: 1; }
.tools { display: flex; gap: 6px; flex-shrink: 0; }
.tools[hidden] { display: none; }
.tool {
  height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
.tool:hover { border-color: var(--muted); }
.tool:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.tool .count { color: var(--muted); margin-left: 4px; }

/* column picker and CSV export popovers */
.pop.wide { flex-direction: column; align-items: stretch; gap: 10px; width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 560px); }
.pop.wide .colsearch { width: 100%; }
.pop .colgroups { overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; }
.pop .colgroup h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pop .colgroup .opts { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pop .colgroup label, .pop .choice label { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; cursor: pointer; }
.pop .colgroup label[hidden] { display: none; }
.pop .colgroup input, .pop .choice input { width: auto; height: auto; margin: 0; }
.pop .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pop .row .grow { flex: 1; color: var(--muted); font-size: 12px; }
.pop .link { background: none; color: var(--field); padding: 0 6px; font-weight: 500; }
.pop .choice { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; }
.pop .choice legend { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.pop .note { margin: 0; font-size: 12px; color: var(--muted); }

.statusbar { display: flex; align-items: center; gap: 12px; margin: 12px 2px 8px; }
.statusbar .status { margin: 0; flex: 1; }
.tools { display: flex; gap: 6px; flex-shrink: 0; }
.tools[hidden], .tool[hidden] { display: none; }
.tool {
  height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
.tool:hover { border-color: var(--muted); }
.tool:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.tool .count { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* column picker and CSV export popovers */
.pop.wide { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 10px; width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 560px); }
.pop.wide .colsearch { width: 100%; }
.pop .colgroups { overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; }
.pop .colgroup[hidden] { display: none; }
.pop .colgroup h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pop .colgroup .opts { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.pop .colgroup label, .pop .choice label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.pop .colgroup label[hidden] { display: none; }
.pop .colgroup input, .pop .choice input { width: auto; height: auto; margin: 0; }
.pop .row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pop .row .grow { flex: 1; text-align: right; color: var(--muted); font-size: 12px; }
.pop button.link { background: none; color: var(--field); padding: 0 6px; font-weight: 500; height: 24px; }
.pop button.link:hover { color: var(--gold); }
.pop .choice { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; }
.pop .choice legend { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; padding: 0; }
.pop .note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

.status { margin: 12px 2px 8px; color: var(--muted); font-size: 13px; min-height: 19px; }
.status .err { color: var(--err); }
.status b { color: var(--text); font-weight: 600; }

/* ---------- results ---------- */
.results { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th {
  position: sticky; top: 0;
  background: var(--bg);
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  cursor: pointer; white-space: nowrap; user-select: none;
}
th:hover { color: var(--text); }
/* row headers (a table's first column as th) are plain cells, not the sticky column headers above */
tbody th { position: static; background: none; cursor: auto; user-select: auto; font-size: inherit; color: inherit; }
th[aria-sort] { color: var(--text); }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
td.n { text-align: right; }
th.n { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--panel); }
tbody tr.sel td { background: var(--raise); }
td.dim { color: var(--muted); }

.q-poor { color: var(--q-poor); } .q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); }
.q-rare { color: var(--q-rare); } .q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }
.q-artifact { color: var(--q-artifact); } .q-heirloom { color: var(--q-heirloom); }

.examples { color: var(--muted); padding: 8px 2px; }
.examples ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.examples button {
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text); text-align: left;
}
.examples button:hover { color: var(--gold); }
.big-count { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; padding: 12px 2px; font-variant-numeric: tabular-nums; }

/* ---------- detail drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 20px 20px 32px; overflow: auto; z-index: 10;
  box-shadow: -20px 0 40px rgba(0, 0, 0, .25);
}
.drawer .close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 22px; cursor: pointer;
}
.drawer .close:hover { background: var(--raise); color: var(--text); }
.drawer h2 { margin: 0 40px 2px 0; font-size: 21px; line-height: 1.25; }
.drawer .sub { color: var(--muted); margin: 0 0 14px; font-size: 13.5px; }
.drawer .desc { margin: 0 0 16px; color: var(--str); }
.drawer dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 13.5px; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.drawer a { color: var(--field); }

/* recipe skill bar: orange -> yellow -> green -> gray */
.skillbar { margin: 4px 0 18px; }
.skillbar .bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; }
.skillbar .bar span { display: block; height: 100%; }
.skillbar .ticks { position: relative; height: 18px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.skillbar .ticks span { position: absolute; transform: translateX(-50%); top: 3px; white-space: nowrap; }
.skillbar .ticks span:first-child { transform: none; }
.skillbar .ticks span:last-child { transform: translateX(-100%); }

@media (max-width: 640px) {
  .editor textarea, .editor .hl { font-size: 16px; padding: 12px; }
  .suggest { top: 48px; }
  .big-count { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- shell: left sidebar + centered content (shared by every page) ---------- */
body.has-side { padding-left: 188px; min-height: 100vh; position: relative; isolation: isolate; }
.side {
  position: fixed; top: 0; left: 0; bottom: 0; width: 188px; z-index: 4; background: var(--bg);
  display: flex; flex-direction: column;
  padding: 18px 10px 16px 14px; border-right: 1px solid var(--line);
}
.side-brand { font-weight: 700; font-size: 18px; color: var(--gold); text-decoration: none; padding: 0 10px 14px; letter-spacing: -0.01em; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side ul[hidden] { display: none; }
.side-groups { gap: 6px !important; overflow-y: auto; min-height: 0; }
.side-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 6px 10px; border: 0; border-radius: 6px; background: none; cursor: pointer; font: inherit;
  color: var(--text); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; text-align: left;
}
.side-head::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.side-head[aria-expanded="true"]::after { transform: rotate(45deg); }
.side-head:hover { background: var(--panel); }
.side-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.side-group > ul { margin: 2px 0 2px 10px; padding-left: 6px; border-left: 1px solid var(--line); }
.side-group > ul a { font-size: 14px; padding: 6px 10px; }
@media (prefers-reduced-motion: reduce) { .side-head::after { transition: none; } }
.side li a {
  display: block; padding: 7px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: 14.5px;
}
.side li a:hover { color: var(--text); background: var(--panel); }
.side li a[aria-current="page"] { color: var(--text); background: var(--raise); box-shadow: inset 2px 0 0 var(--gold); }
.side-foot { margin-top: auto; padding: 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.side-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.side-foot a:hover { color: var(--gold); }
/* optional sidebar card (EthicalAds, Carbon or our own), only drawn when the server configures one.
   No "ad"/"banner"/"sponsor" in class names: ad blockers hide those. */
.side-card { margin: auto 6px 12px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.side-card + .langs { margin-top: 0; }
.side-card img { display: block; max-width: 100%; height: auto; border-radius: 4px; margin-bottom: 6px; }
.side-card a { color: var(--muted); text-decoration: none; }
.side-card a:hover { color: var(--text); }
.side-card-link { display: block; }
.side-card-label { display: block; margin-top: 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.side-card #carbonads { max-width: 100%; }
.side-card #carbonads > span, .side-card #carbonads a { display: block; }
.side-card .carbon-poweredby { display: block; margin-top: 4px; font-size: 10.5px; opacity: .75; }
/* the card goes before it pushes the navigation off a short screen */
.side-spot { min-height: 0; }
.side-spot .side-card-label { margin: 0 0 4px; }
/* end-of-page spot: thin, below everything, never sticky */
.page-spot { width: calc(100% - 32px); max-width: 970px; margin: 40px auto 16px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.page-spot .side-card-label { margin: 0 0 4px; }
.page-spot .adsbygoogle { max-height: 100px; overflow: hidden; }
.page-note { width: calc(100% - 32px); max-width: 760px; margin: 40px auto 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.page-note a { color: var(--field); }
.page-note button { margin-left: 6px; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.page-note button:hover { color: var(--text); }

@media (max-height: 860px) { .side-card { display: none; } .side-card + .langs { margin-top: auto; } }
body.has-side > .top, body.has-side > main { width: 100%; max-width: 1180px; margin: 0 auto; }
body.has-side > .top .brand { display: none; }

/* home: the query box alone in the middle of the page, like an early search engine */
body.home main { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 18vh; }
body.home .query { width: min(640px, 100%); margin: 0 auto; }
body.home .hero { display: block; }
.hero { display: none; text-align: center; margin-bottom: 26px; }
.hero h1 { margin: 0; font-size: clamp(54px, 9vw, 92px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; color: var(--gold); }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
body.home .editor { border-radius: 26px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
body.home .editor textarea, body.home .editor .hl { padding: 13px 22px; font-size: 18px; }
body.home .suggest { top: 54px; }
body.home .builder, body.home .status { display: none; }
body.home .results { width: min(640px, 100%); margin: 22px auto 0; }
body.home .examples { text-align: center; }
body.home .examples ul { justify-items: center; }

/* icons */
.ic { width: 20px; height: 20px; border-radius: 3px; vertical-align: -5px; margin-right: 8px; background: var(--raise); }
.ic-lg { width: 52px; height: 52px; border-radius: 6px; float: left; margin: 2px 14px 6px 0; border: 1px solid var(--line); }
td.name-cell { max-width: 460px; }

@media (max-width: 760px) {
  body.has-side { padding-left: 0; }
  .side { position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 4px; overflow-x: auto;
          border-right: 0; border-bottom: 1px solid var(--line); padding: 8px var(--gutter); }
  .side-brand { padding: 0 8px 0 0; }
  .side ul { display: flex; gap: 2px; }
  /* phones: one flat scrolling row, no section headings */
  .side-groups, .side-group { display: contents !important; }
  .side-head { display: none; }
  .side-group > ul, .side-group > ul[hidden] { display: contents; margin: 0; padding: 0; border: 0; }
  .side li a { white-space: nowrap; padding: 6px 9px; }
  .side-foot { display: none; }
  .side-card { display: none; }
  body.home main { padding-bottom: 10vh; }
}

/* language switcher, bottom of the sidebar */
.langs {
  display: flex; flex-wrap: wrap; gap: 2px; margin: auto 6px 12px; padding: 3px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
}
.langs + .side-foot { margin-top: 0; }
.langs button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: 600 11.5px/1 var(--ui); letter-spacing: .02em; padding: 5px 6px; border-radius: 5px;
}
.langs button:hover { color: var(--text); }
.langs button[aria-pressed="true"] { background: var(--raise); color: var(--gold); }
@media (max-width: 760px) {
  .langs { flex-wrap: nowrap; margin: 0 0 0 auto; }
}


/* ---------- in-game tooltip card ---------- */
.tt-wrap { display: flex; gap: 6px; align-items: flex-start; margin: 4px 36px 16px 0; }
.tt-ic { width: 46px; height: 46px; flex: none; border-radius: 4px; border: 1px solid #5d5d5d; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.tt {
  flex: 1; min-width: 0; padding: 8px 10px 9px;
  background: rgba(8, 10, 24, .96); color: #fff;
  border: 1px solid #6e7180; border-radius: 5px; box-shadow: inset 0 0 0 1px #11131c, 0 4px 16px rgba(0,0,0,.45);
  font: 13px/1.38 var(--ui);
}
.tt-l { display: flex; justify-content: space-between; gap: 14px; }
.tt-l > span:first-child { overflow-wrap: anywhere; }
.tt-r { flex: none; text-align: right; }
.tt-name { font-size: 15px; font-weight: 600; margin-bottom: 1px; }
.tt-desc { margin-top: 2px; }
.coin { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 2px; vertical-align: -1px; }
.coin.g { background: radial-gradient(circle at 35% 35%, #fff3a0, #d4a017 60%, #8a6400); }
.coin.s { background: radial-gradient(circle at 35% 35%, #ffffff, #b8bcc4 60%, #6b6f78); }
.coin.c { background: radial-gradient(circle at 35% 35%, #ffd0a0, #b8682a 60%, #6d3a12); }
.fields summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 6px 0 8px; }
.fields summary:hover { color: var(--text); }


/* ---------- hover card (follows the mouse) ---------- */
.hc {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  display: flex; gap: 8px; align-items: flex-start; max-width: 330px;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(8, 10, 24, .97); color: #fff;
  border: 1px solid #6e7180; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font: 12.5px/1.38 var(--ui);
}
.hc[hidden] { display: none; }
.hc-ic { width: 36px; height: 36px; flex: none; border-radius: 4px; border: 1px solid #5d5d5d; }
.hc-body { min-width: 0; }
.hc-name { font-size: 14px; font-weight: 600; display: flex; gap: 10px; justify-content: space-between; }
.hc-name small { color: #9a9a9a; font-weight: 400; font-size: 12px; white-space: nowrap; }
.hc-l { display: flex; justify-content: space-between; gap: 14px; }
.hc-gold { color: #ffd100; }
.hc-dim { color: #9a9a9a; }
.hc-desc {
  color: #ffd100; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.hc-hint { position: absolute; right: 8px; bottom: -18px; color: var(--muted); font-size: 11px; }
@media (hover: none) { .hc { display: none; } }


/* ---------- backdrop art (loading-screen paintings) ---------- */
.backdrop {
  position: absolute; z-index: -1; top: 0; left: 188px; right: 0; height: 460px; overflow: hidden;
  pointer-events: none;
}
.backdrop img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
  opacity: 0; transition: opacity .9s ease;
  /* clear middle, soft sides, long fade into the page at the bottom */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 86%), linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 86%), linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-composite: intersect;
}
.backdrop.in img { opacity: .34; }
.backdrop-cap {
  position: absolute; right: 20px; top: 14px; color: var(--muted); font-size: 11.5px; opacity: 0;
  transition: opacity .9s ease .3s;
}
.backdrop.in .backdrop-cap { opacity: .8; }
/* the home page lets the painting carry the screen behind the search box */
.backdrop-home { height: 100vh; }
.backdrop-home img { object-position: center 45%; }
.backdrop-home.in img { opacity: .42; }
body:not(.home) .backdrop-home { height: 460px; }
body:not(.home) .backdrop-home.in img { opacity: .22; }
body.home .hero h1 { text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
body.home .hero p { color: var(--text); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
@media (max-width: 760px) { .backdrop { left: 0; height: 300px; } .backdrop-home { height: 70vh; } }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .backdrop.in img { opacity: .18; } }
@media (prefers-reduced-motion: reduce) { .backdrop img, .backdrop-cap { transition: none; } }

/* long queries: a step smaller, wrapped over as many lines as they need */
.editor.long textarea, .editor.long .hl { font-size: 16.5px; line-height: 1.55; padding-top: 12px; padding-bottom: 12px; }
body.home .editor.long { border-radius: 18px; }
body.home .editor.long textarea, body.home .editor.long .hl { font-size: 16px; }
@media (max-width: 760px) { .editor.long textarea, .editor.long .hl { font-size: 14.5px; } }
.editor textarea, .editor .hl { transition: font-size .12s ease; }
@media (prefers-reduced-motion: reduce) { .editor textarea, .editor .hl { transition: none; } }


/* ---------- compare: pin button, tray, side-by-side panel ---------- */
.pin-btn {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; height: 32px; padding: 0 12px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--raise); color: var(--text); cursor: pointer; font-size: 13.5px;
}
.pin-btn:hover { border-color: var(--muted); }
.pin-btn small { color: var(--muted); font-size: 12px; }
.pin-btn.on { border-color: var(--gold); color: var(--gold); }

.cmp-tray {
  position: fixed; z-index: 9; bottom: 14px; left: calc(188px + 16px); max-width: calc(100vw - 188px - 32px);
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  font-size: 13.5px;
}
.cmp-tray[hidden] { display: none; }
.cmp-tray-label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.cmp-tray ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; min-width: 0; overflow-x: auto; }
.cmp-tray li { display: flex; align-items: center; background: var(--raise); border-radius: 6px; min-width: 0; }
.cmp-chip { display: flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 3px 2px 3px 4px; min-width: 0; }
.cmp-chip img { border-radius: 3px; flex: none; }
.cmp-chip span { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tray .x, .cmp .x {
  border: 0; background: none; width: 24px; height: 24px; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; flex: none;
}
.cmp-tray .x:hover, .cmp .x:hover { background: var(--line); color: var(--text); }
.cmp-open {
  height: 30px; padding: 0 12px; border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap;
  background: var(--gold); color: #1a1400; font-weight: 600;
}
.cmp-clear { height: 30px; padding: 0 8px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.cmp-clear:hover { color: var(--text); }
.cmp-flash {
  position: fixed; z-index: 30; left: 50%; bottom: 70px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px; background: var(--raise); border: 1px solid var(--line); font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.cmp-flash[hidden] { display: none; }

.cmp {
  position: fixed; inset: 0; z-index: 20; overflow: auto; padding: 28px 16px;
  background: rgba(6, 9, 18, .62); backdrop-filter: blur(2px);
}
.cmp[hidden] { display: none; }
body.cmp-on { overflow: hidden; }
.cmp-box {
  margin: 0 auto; max-width: calc(var(--n) * 340px + 40px); min-width: min(100%, 360px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.cmp-head { display: flex; align-items: center; gap: 10px; }
.cmp-head h2 { margin: 0; font-size: 20px; flex: 1; }
.cmp-link {
  height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--raise); cursor: pointer; font-size: 13px;
}
.cmp-link:hover { border-color: var(--muted); }
.cmp-head .close { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.cmp-head .close:hover { background: var(--raise); color: var(--text); }
.cmp-note { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
.cmp-cards { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; align-items: start; }
.cmp-card { min-width: 0; }
.cmp-card-top { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.cmp-tag { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.cmp-card .tt-wrap { margin: 2px 0 12px; }
.cmp-tablewrap { overflow-x: auto; margin-top: 6px; }
.cmp-table { font-size: 13.5px; }
.cmp-table th, .cmp-table td { cursor: default; position: static; background: none; }
.cmp-table thead th { vertical-align: bottom; white-space: normal; color: var(--text); font-size: 13px; }
.cmp-table thead th .ic { margin-right: 6px; }
.cmp-table tbody th { text-align: left; font-weight: 400; color: var(--muted); font-family: var(--code); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp-table td { max-width: none; }
.cmp-table tbody tr:hover td, .cmp-table tbody tr:hover th { background: var(--raise); }
.cmp-table td.best { color: var(--gold); font-weight: 700; }
.cmp-enum td { color: var(--muted); }
.cmp-d { display: inline-block; min-width: 3.2em; margin-left: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: right; }
.cmp-d.up { color: #3ccf5a; }
.cmp-d.down { color: #ff6b6b; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .cmp-d.up { color: #1b8a2e; }
  :root:not([data-theme="dark"]) .cmp-d.down { color: #c62828; }
  :root:not([data-theme="dark"]) .cmp { background: rgba(20, 27, 43, .35); }
}

@media (max-width: 760px) {
  .cmp-tray { left: 8px; right: 8px; bottom: 8px; max-width: none; padding-left: 10px; }
  .cmp-tray-label { display: none; }
  .cmp-chip span { max-width: 90px; }
  .cmp { padding: 0; }
  .cmp-box { border-radius: 0; min-height: 100%; padding: 14px 12px 24px; border: 0; }
  /* cards scroll sideways, one and a bit per screen, so the next one peeks in */
  .cmp-cards { grid-template-columns: repeat(var(--n), 82%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cmp-card { scroll-snap-align: start; }
  .cmp-table thead th { font-size: 12px; }
  .cmp-table thead th .ic { display: block; margin: 0 0 4px auto; }
  .cmp-table td, .cmp-table tbody th { padding: 6px 6px; }
  .cmp-d { display: block; margin-left: 0; min-width: 0; }
}
@media (max-width: 760px) and (min-width: 0) { .cmp-cards:has(.cmp-card:only-child) { grid-template-columns: 100%; } }

/* ---------- EverlookDB addon data: item details, and the note under the home search ---------- */
.crowd { margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.crowd-h { margin: 10px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.crowd-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crowd-t td { padding: 4px 0; border-bottom: 1px solid var(--line); white-space: normal; max-width: none; }
.crowd-t tr:last-child td { border-bottom: 0; }
.crowd-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.crowd-dim { color: var(--muted); font-size: 12.5px; }
.crowd-l { margin: 0; padding-left: 18px; font-size: 13.5px; }
.crowd-src { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.home-more { display: none; }
body.home .home-more { display: block; text-align: center; color: var(--muted); font-size: 13.5px; margin: 26px auto 0; max-width: 640px; }
body.home .home-more a { color: var(--field); }
.crowd-t tbody tr { cursor: default; }
.crowd-t tbody tr:hover td { background: none; }

/* ---------- quest details: the "done yet?" macro ---------- */
.macro { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.macro code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 12.5px/1.4 var(--code); padding: 6px 8px; border-radius: 6px; background: var(--raise); border: 1px solid var(--line); user-select: all; }
.copy-btn { flex: none; height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--raise); color: var(--text); cursor: pointer; font-size: 13px; }
.copy-btn:hover { border-color: var(--muted); }

/* auction house prices in the item drawer */
.ah-house { margin: 8px 0 4px; font-size: 13.5px; }
.ah .crowd-t th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 0 4px; text-align: left; }
.ah .crowd-t th.crowd-n { text-align: right; }
.ah-spark { display: block; margin-left: auto; }
.ah-spark path { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; }
