:root {
  --bg: #17212b; --surface: #1e2a36; --raise: #243241; --line: #2d3c4a; --text: #e7eef4; --muted: #93a6b7;
  --avoid: #f0775a; --unsurv: #b69cff; --heal: #69d39a; --def: #e9c46a; --ok: #69d39a; --flag: #f0775a;
  font-family: "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif; color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body { margin: 0; font-size: 16px; line-height: 1.35; padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--def); outline-offset: 2px; }
.bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; justify-content: flex-start; padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(12px, 3vw, 40px) 0; }
.brand { font-size: 26px; font-weight: 700; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 2px 18px; }
nav a { text-decoration: none; color: var(--muted); font-size: 18px; padding: 6px 0; border-bottom: 2px solid transparent; }
nav a.on { color: var(--text); border-bottom-color: var(--def); }
.scope { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px clamp(12px, 3vw, 40px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 10; }
.scope label { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
select, input, textarea, button { font: inherit; color: var(--text); }
select, input[type=text], input[type=password], input[type=number], textarea { background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
button, .btn { background: var(--raise); border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px;
  cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--def); color: #1a1a1a; border-color: var(--def); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
main { padding: 8px clamp(12px, 3vw, 40px) 60px; max-width: 1400px; }
h1 { font-size: clamp(26px, 3.5vw, 36px); margin: 18px 0 4px; }
h2 { font-size: 22px; margin: 30px 0 10px; }
p.lead, .muted { color: var(--muted); }
.kpis { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 14px 0 6px; }
.kpi b { display: block; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); }
.kpi.bad b { color: var(--avoid); }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 40px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 22px minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0;
  border-bottom: 1px solid var(--line); }
.board .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.board .name { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.board .val small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.barbg { height: 8px; background: var(--raise); border-radius: 4px; overflow: hidden; }
.barbg i { display: block; height: 100%; background: var(--avoid); border-radius: 4px; }
.barbg i.neutral { background: #7d8f9f; }
.killers li { grid-template-columns: 26px minmax(120px, 220px) 1fr auto; }
.killers img { width: 22px; height: 22px; border-radius: 4px; }
.tagtxt.avoidable { color: var(--avoid); } .tagtxt.unsurvivable { color: var(--unsurv); } .tagtxt.unavoidable, .tagtxt.untagged { color: var(--muted); }
.tablewrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; }
table.data th.sorted { color: var(--text); }
table.data td.num, table.data th.num { text-align: right; }
table.data td.bad { color: var(--avoid); font-weight: 600; }
table.data a.player { font-weight: 600; text-decoration: none; }
table.data tr > :first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 14px 0; }
.filters label { display: inline-flex; gap: 6px; align-items: center; }
.death { border-left: 4px solid #7d8f9f; padding: 14px 0 14px 16px; margin: 18px 0; }
.death.flag { border-left-color: var(--flag); } .death.ok { border-left-color: var(--ok); }
.death .top { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.death .who { font-size: 22px; font-weight: 700; text-decoration: none; }
.death .who:hover { text-decoration: underline; }
.death .order { margin-left: auto; font-weight: 600; }
.death .verdict { margin-top: 4px; font-size: 18px; font-weight: 600; }
.death.flag .verdict { color: var(--flag); } .death.ok .verdict { color: var(--ok); } .death.muted .verdict { color: var(--muted); }
.death .kb { margin-top: 4px; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.death .kb img { width: 22px; height: 22px; border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; color: var(--muted); }
.chips b { color: var(--text); font-weight: 600; } .chips b.bad { color: var(--avoid); } .chips b.good { color: var(--ok); }
.notice { border-left: 3px solid var(--def); padding: 6px 12px; background: var(--surface); }
span.bad { color: var(--avoid); }
.review { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.review button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.review input { flex: 1 1 220px; max-width: 420px; }
.ignored { opacity: .7; }
.matrix td.cell { text-align: center; min-width: 44px; }
.bosslist { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bosslist button.on { background: var(--text); color: var(--bg); }
.bosslist .count { color: var(--avoid); font-weight: 600; }
.abil img { width: 20px; height: 20px; border-radius: 3px; vertical-align: -4px; margin-right: 6px; }
tr.untagged td:first-child { box-shadow: inset 3px 0 0 var(--def); padding-left: 8px; }
.joblog { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px; white-space: pre-wrap;
  font-size: 14px; max-height: 280px; overflow: auto; margin-top: 10px; }
.form { display: grid; gap: 16px; max-width: 760px; margin-top: 12px; }
.form .field { display: grid; gap: 4px; }
.form .help { color: var(--muted); font-size: 14px; }
.empty { padding: 30px 0; color: var(--muted); font-size: 18px; }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 6px; font-weight: 600; display: none; z-index: 50; }
#toast.bad { background: var(--avoid); color: #1a1a1a; }
@media (max-width: 640px) { .scope { position: static; } .death .order { margin-left: 0; } .kpi b { font-size: 28px; } }

.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: 24px minmax(110px, 200px) 1fr minmax(64px, auto); gap: 10px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--line); }
.hbars li > a:first-child img { width: 22px; height: 22px; border-radius: 4px; display: block; }
.hbars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.hbars a.lbl:hover { text-decoration: underline; }
.hbars .val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.hbars .val small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.barbg i.cons { background: var(--def); }
.legend { display: flex; gap: 6px 14px; align-items: center; color: var(--muted); margin: 0 0 6px; }
.legend .sw { display: inline-block; width: 14px; height: 8px; border-radius: 4px; background: var(--avoid); margin-right: -8px; }
.legend .sw.cons { background: var(--def); }
.habits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 17px; }
.habits a { color: inherit; }
.unused-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px 40px; }
.unused-player .uh { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 4px; }
.unused-player .uh .player { font-size: 19px; font-weight: 700; text-decoration: none; }
@media (max-width: 640px) { .unused-grid { grid-template-columns: 1fr; } .hbars li { grid-template-columns: 22px minmax(90px, 1fr) 70px auto; } }

div.lead p { margin: 6px 0; }
div.lead ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 2px; }

#user { margin-left: auto; display: flex; gap: 14px; align-items: baseline; }
#user a { color: var(--muted); }
.pkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 24px; margin: 14px 0; }
.pkpi { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; display: grid; }
.pkpi b { font-size: 28px; font-variant-numeric: tabular-nums; }
.pkpi span { color: var(--muted); }
.pkpi small { color: var(--muted); font-size: 13px; }
.pkpi.bad { border-left-color: var(--avoid); } .pkpi.bad b { color: var(--avoid); }
.pkpi.good { border-left-color: var(--ok); } .pkpi.good b { color: var(--ok); }
tr.counted td:first-child { box-shadow: inset 3px 0 0 var(--avoid); }
input.big { width: 20px; height: 20px; accent-color: var(--avoid); cursor: pointer; }
form.form { display: grid; gap: 12px; }
p.bad { color: var(--avoid); }
b.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; color: var(--def); }

.fightpos { display: inline-block; position: relative; width: 70px; height: 6px; border-radius: 3px; background: var(--raise);
  vertical-align: middle; margin-left: 4px; }
.fightpos i { position: absolute; top: -3px; width: 3px; height: 12px; border-radius: 2px; background: var(--avoid); transform: translateX(-50%); }
