/* WoWHub brand kit: brand.css (loaded in index.html) supplies the --wh-* tokens.
   The site is dark only, like the brand. Fallbacks keep it readable if brand.css fails to load. */
:root {
  --bg: var(--wh-bg, #120D0D);
  --surface: var(--wh-surface, #1C1515);
  --raised: var(--wh-raised, #251B1B);
  --border: var(--wh-border, #3A2B2B);
  --control: #4A3735;
  --text: var(--wh-text, #F0E6E2);
  --muted: var(--wh-muted, #B39F9B);
  --body: #D9CBC7;
  --track: #2A1F1E;
  --accent: var(--wh-accent, #E5675C);
  --on-accent: var(--wh-on-accent, #1C0806);
  --link: var(--wh-accent, #E5675C);
  --link-hover: var(--wh-accent-hover, #EE8279);
  --warn-bg: rgba(245, 176, 98, 0.12);
  --warn-fg: #F5C38A;
  --info-bg: var(--wh-beta-bg, rgba(140, 195, 255, 0.14));
  --info-fg: var(--wh-beta, #9CCBFF);
  --font-display: var(--wh-font-display, Cinzel, Georgia, serif);
  --font-body: var(--wh-font-body, Inter, system-ui, sans-serif);
  --font-mono: var(--wh-font-mono, "JetBrains Mono", ui-monospace, monospace);
  /* Rank brackets, top ranks lightest: gold, coral, violet. Each is at least 3:1 on the panel. */
  --b1: #FFE2B0;
  --b2: #FBC57E;
  --b3: #F5A563;
  --b4: #EE855A;
  --b5: #E5675C;
  --b6: #D2546F;
  --b7: #B84D82;
  --b8: #9C4F92;
  --b9: #81549C;
  /* Heatmap "Ember" scale. Light text on h0-h3, dark on h4-h5; all at least 4.5:1. */
  --h0: #33221F;
  --h1: #4E2822;
  --h2: #7A3326;
  --h3: #A3462A;
  --h4: #E68A3E;
  --h5: #F6C76E;
  --hf-lo: #F0E6E2;
  --hf-hi: #1C0806;
  --empty: transparent;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
main { display: flex; flex-direction: column; gap: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.titles { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: 0.03em; text-wrap: balance; }
.sub { font-size: 15px; color: var(--muted); }
.pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--info-bg); color: var(--info-fg); font-size: 13px; font-weight: 600; }

.banner { padding: 20px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); font-size: 15px; line-height: 1.5; }
.banner strong { display: block; font-size: 17px; margin-bottom: 4px; }
.progress { margin-top: 12px; height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.progress div { height: 100%; background: var(--warn-fg); border-radius: 999px; }

.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 12px; font-weight: 600; color: var(--muted); }
select {
  height: 44px; min-width: 120px; max-width: 100%; padding: 0 12px;
  border: 1px solid var(--control); border-radius: 8px;
  font: inherit; font-size: 15px; background: var(--raised); color: var(--text);
}
#tier { min-width: 220px; }
#boss { min-width: 200px; }
#week { min-width: 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 1px solid var(--control); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer;
}
.chip[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
.chip[aria-pressed="false"] .dot { opacity: 0.25; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ring { background: transparent; border: 2px solid; }
.chip.sub { font-size: 13px; }
.row.sub .row-label { padding-left: 12px; }
.heat tbody tr.sub th { padding-left: 22px; font-weight: 400; color: var(--body); }
.legend .lg {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.legend .lg[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
.legend .lg[aria-pressed="false"] .dot { opacity: 0.25; }

.block { display: flex; flex-direction: column; gap: 12px; }
.card-groups { display: flex; flex-direction: column; gap: 20px; }
.card-group { display: flex; flex-direction: column; gap: 10px; }
.card-group .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.heat [data-boss] { cursor: pointer; }
h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.picker { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.pgroup { display: flex; flex-direction: column; gap: 6px; }
.pgroup .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.chip.small { height: 36px; padding: 0 12px; font-size: 13px; }
.picker .chip[aria-pressed="false"] { border-style: solid; }
.picker .chip[aria-pressed="false"] { color: var(--body); }
.picker .chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.chip:focus-visible, .lg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.heat th.tiercol, .heat td.tiercol { font-family: var(--font-mono); background: transparent; color: var(--text); white-space: nowrap; }
.heat thead th.tiercol { font-family: var(--font-body); color: var(--muted); }
.heat td.tiercol .mult { color: var(--muted); }
.heat th.tiercol.first, .heat td.tiercol.first { border-left: 3px solid var(--border); border-radius: 0; }
.stack { display: flex; height: 14px; background: var(--track); border-radius: 4px; overflow: hidden; }
.stack div { height: 100%; }
.dot.sq { border-radius: 2px; }
.none { margin: 0; font-size: 14px; color: var(--muted); }
#curve svg, #gear svg { width: 100%; height: auto; display: block; }
h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.03em; text-wrap: balance; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; }
.card-hint { font-size: 13px; color: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.row-label { font-size: 13px; color: var(--muted); }
.bar { height: 14px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar div { height: 100%; border-radius: 4px; }
.val { font-family: var(--font-mono); font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; }
.mult { color: var(--muted); font-weight: 400; }
.n { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 400; color: var(--muted); }
.card-foot { font-size: 12px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

.split { display: flex; flex-wrap: wrap; gap: 16px; }
.panel { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.heat-panel { flex-basis: 100%; }
.panel-head { display: flex; flex-direction: column; gap: 2px; }
.panel-head p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.scroll { overflow-x: auto; }
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 14px; }
.heat th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; }
.heat thead th { text-align: center; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.heat thead th:first-child { text-align: left; }
.heat tbody th { text-align: left; font-size: 14px; font-weight: 500; color: var(--text); padding: 8px; white-space: nowrap; }
.heat tbody th .dot { margin-right: 8px; }
.heat td { text-align: center; padding: 10px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 13px; min-width: 56px; }
.heat td .mult { display: block; font-size: 11px; margin-top: 2px; color: inherit; opacity: 0.85; }
.heat td.h0 { background: var(--h0); color: var(--hf-lo); }
.heat td.h1 { background: var(--h1); color: var(--hf-lo); }
.heat td.h2 { background: var(--h2); color: var(--hf-lo); }
.heat td.h3 { background: var(--h3); color: var(--hf-lo); }
.heat td.h4 { background: var(--h4); color: var(--hf-hi); }
.heat td.h5 { background: var(--h5); color: var(--hf-hi); }
.heat td.empty { background: var(--empty); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.heat td.sel { box-shadow: inset 0 0 0 2px var(--text); }
.heat thead th.boss.sel { color: var(--accent); }

#chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.defs { font-size: 14px; line-height: 1.5; color: var(--body); }
.defs h2 { font-size: 16px; color: var(--text); }
.defs p { margin: 0; }

.foot { font-size: 13px; color: var(--muted); }

@media (max-width: 600px) {
  .page { padding: 20px 16px 40px; }
  h1 { font-size: 26px; }
  .field { flex: 1 1 140px; }
  select, #tier, #boss, #week { min-width: 0; width: 100%; }
  .panel, .heat-panel { flex-basis: 100%; padding: 16px; }
  .cards, .card-group .cards { grid-template-columns: 1fr; }
}

/* Tabs and the Head to head / Against peers views (compare.js). */
:root { --ga: #E5675C; --gb: #6FC3DF; --peer: #6B5856; --band: #3A2826; --good: #7FE0A8; --bad: #F5B062; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; margin-bottom: -1px; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tab:hover { color: var(--text); }
.tab:focus-visible, .swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.guild-view .panel { flex-basis: 100%; gap: 16px; }
.guild-view .controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; }
.gsearch { position: relative; flex: 0 1 340px; }
.gsearch input { height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--control); border-radius: 8px; font: inherit; font-size: 15px; background: var(--raised); color: var(--text); }
.gs-list { position: absolute; z-index: 5; top: 68px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--control); border-radius: 8px; box-shadow: 0 18px 40px rgb(0 0 0 / 0.5); }
.gs-list li { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.gs-list li[aria-selected="true"], .gs-list li[data-id]:hover { background: var(--raised); color: var(--text); }
.gs-list li.gs-empty { cursor: default; color: var(--muted); }
.gs-meta { font-size: 12px; color: var(--muted); }
.gs-current { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.gs-current.none { color: var(--muted); }
.swap { align-self: flex-start; margin-top: 22px; height: 44px; width: 44px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--raised); min-width: 0; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .vs, .stat .unit { font-size: 13px; font-weight: 500; color: var(--muted); }
.ga { color: var(--ga); }
.gb { color: var(--gb); }
.muted { color: var(--muted); font-weight: 400; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.cmp th, .cmp td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.cmp thead th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cmp tbody th { font-weight: 500; white-space: nowrap; }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }
.cmp .num { text-align: right; white-space: nowrap; font-family: var(--font-mono); font-size: 13px; }
.cmp thead .num { font-family: var(--font-body); font-size: 12px; }
.cmp .mid { text-align: center; }
.cmp .verdict { font-size: 13px; white-space: nowrap; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; min-width: 200px; }
.duo .bar { position: relative; }
.duo .bar div { position: absolute; top: 0; bottom: 0; }
.duo .bar.l div { right: 0; background: var(--ga); }
.duo .bar.r div { left: 0; background: var(--gb); }
.stripcell { width: 45%; min-width: 220px; }
.strip { display: block; width: 100%; height: auto; max-height: 40px; }
.pct { display: inline-block; min-width: 44px; text-align: center; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 1px 6px; background: var(--track); color: var(--body); }
.pct.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pct.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
@media (max-width: 600px) {
  .gsearch { flex-basis: 100%; }
  .swap { margin-top: 0; }
}

.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.grid thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.grid thead th .dot { margin-right: 6px; }
.grid tbody th { text-align: left; font-weight: 500; color: var(--text); }
.grid td { text-align: right; font-family: var(--font-mono); }
.grid tr.total th, .grid tr.total td { border-bottom: none; color: var(--muted); }
.grid td .n { text-align: right; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn-fg); font-size: 11px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
