/* RecommendedStats Analyzer: same tokens as ctrlshiftzed.com. */
:root {
  --bg: #121214;
  --bg-2: #17171a;
  --panel: #1c1c20;
  --panel-2: #232328;
  --line: #2c2c33;
  --line-strong: #3a3a42;
  --text: #f3f3f5;
  --dim: #a3a3ad;
  --faint: #6e6e78;
  --y: #ffd21f;
  --y-soft: rgba(255, 210, 31, .08);
  --green: #4ade80;
  --orange: #fb923c;
  --red: #f87171;
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--y); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
/* main.wrap: .wrap's side padding would otherwise reset the top and bottom. */
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; min-width: 0; }
/* Wide tables scroll inside their box instead of widening the page. */
main > *, section.block { min-width: 0; max-width: 100%; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }

/* Header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 2px solid var(--y); color: var(--y); font: 700 13px var(--font-display);
}
.brand-name { font: 600 17px var(--font-display); }
.brand-name b { color: var(--y); font-weight: 700; }
.mini-search input { width: min(320px, 46vw); }
.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 18px; padding-bottom: 18px; }
.foot p { margin: 0; }
.foot a { color: var(--dim); }

/* Forms */
input, select, button { font: inherit; color: var(--text); }
input, select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--y); outline-offset: 1px; border-color: transparent; }
button, .btn {
  background: var(--y); color: #121214; border: 0; border-radius: var(--radius-sm);
  padding: 10px 18px; font-weight: 700; cursor: pointer; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }

/* Home */
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); }
.hero h1 span { color: var(--y); }
.hero p { color: var(--dim); max-width: 640px; margin: 12px auto 0; }
.search-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; max-width: 760px; margin: 24px auto 0;
}
.search-row { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 10px; }
.search-or { text-align: center; color: var(--faint); margin: 14px 0; font-size: 13px; }
.report-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 900px; margin: 34px auto 0; }
.how div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.how h3 { font-size: 16px; color: var(--y); margin-bottom: 6px; }
.how p { margin: 0; color: var(--dim); font-size: 14px; }
.recent { max-width: 760px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip-link {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--dim);
}

/* Page headings */
.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--dim); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(24px, 4vw, 34px); }
.page-head .sub { color: var(--dim); margin-top: 4px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--dim); border: 1px solid var(--line-strong); vertical-align: middle;
}
.tag.y { color: var(--y); border-color: rgba(255, 210, 31, .4); background: var(--y-soft); }

/* Raid nights and pulls (like WoWAnalyzer's fight list) */
.night { margin-bottom: 26px; }
.night h2 { font-size: 18px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.night h2 small { font: 400 13px var(--font-body); color: var(--faint); }
.boss {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.boss h3 { font-size: 18px; margin-bottom: 10px; }
.boss h3 .muted { font-weight: 500; }
.pulls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px; }
.pull {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text);
}
.pull:hover { border-color: var(--y); text-decoration: none; }
.pull.current { border-color: var(--y); background: var(--y-soft); }
.pull .res { font-weight: 700; color: var(--orange); }
.pull.kill .res { color: var(--y); }
.pull .n { color: var(--faint); font-size: 13px; }
.pull .dur { color: var(--dim); font-size: 13px; font-family: var(--font-mono); }
.bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: #0d0d0f; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 3px; }
.pull.kill .bar i { background: var(--green); }

/* Report: player picker */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 24px; }
/* Each player in their class colour: solid border, faded fill, name in the colour. */
.player {
  --c: var(--dim);
  background: color-mix(in srgb, var(--c) 9%, var(--panel));
  border: 1px solid var(--c); border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--c); cursor: pointer; text-align: left; font-weight: 600;
  transition: background .15s ease;
}
.player:hover { background: color-mix(in srgb, var(--c) 18%, var(--panel)); text-decoration: none; }
.player small { display: block; color: var(--dim); font-weight: 400; }
.player.on { background: color-mix(in srgb, var(--c) 26%, var(--panel)); box-shadow: 0 0 0 2px var(--c); }

/* Analysis */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font: 700 24px var(--font-display); }
.stat span { color: var(--dim); font-size: 13px; }
.stat b.bad { color: var(--orange); }
.stat b.good { color: var(--green); }
.note {
  background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--faint);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--dim); font-size: 14px; margin-bottom: 10px;
}
section.block { margin-top: 26px; }
section.block > h2 { font-size: 20px; margin-bottom: 4px; }
section.block > p.lead { color: var(--dim); margin: 0 0 12px; font-size: 14px; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.finding {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--y);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.finding.major { border-left-color: var(--orange); }
.finding .sev { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--y); }
.finding.major .sev { color: var(--orange); }
.finding p { margin: 2px 0 0; }
.good-news {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.icon {
  width: 36px; height: 36px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel-2);
  display: block; object-fit: cover;
}
.icon.sm { width: 26px; height: 26px; border-radius: 5px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
/* Scoped to .table-wrap: Wowhead's tooltips are tables too and must keep their own styles. */
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th, .table-wrap td { padding: 9px 12px; text-align: right; white-space: nowrap; }
.table-wrap th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.table-wrap td { border-bottom: 1px solid var(--line); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.table-wrap td.spell { display: flex; align-items: center; gap: 10px; white-space: normal; min-width: 180px; }
.table-wrap td.spell a { color: var(--text); }
.table-wrap td .low { color: var(--orange); font-weight: 700; }
.table-wrap td .ok { color: var(--text); }
.table-wrap td .high { color: var(--green); font-weight: 700; }
.range { position: relative; width: 140px; height: 8px; background: #0d0d0f; border-radius: 4px; display: inline-block; vertical-align: middle; }
.range .band { position: absolute; top: 0; bottom: 0; background: rgba(255, 210, 31, .3); border-radius: 4px; }
.range .you { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: var(--text); border-radius: 2px; }
.range .you.low { background: var(--orange); }

/* States */
.loading { color: var(--dim); padding: 40px 0; text-align: center; }
.loading::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--y); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.empty { color: var(--dim); text-align: center; padding: 30px 0; }

/* Privacy page */
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(26px, 4vw, 36px); margin: 4px 0 12px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--dim); }
.prose strong, .prose code { color: var(--text); }
.prose .lead-text { color: var(--text); font-size: 17px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
button.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
button.btn-ghost:hover { border-color: var(--y); filter: none; }

/* Analytics consent banner */
.consent {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
  width: min(760px, calc(100% - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .8);
}
.consent p { margin: 0; flex: 1 1 320px; font-size: 14px; color: var(--dim); }
.consent-actions { display: flex; gap: 8px; }

@media (max-width: 720px) {
  .search-row { grid-template-columns: 80px 1fr; }
  .search-row button { grid-column: 1 / -1; }
  .report-row { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .mini-search { display: none; }
  .range { width: 90px; }
}
