/* Self-hosted so there's no third-party request and no flash of unstyled text.
   Variable fonts: one file each covers every weight we use. */
@font-face {
  font-family: 'Cinzel';
  src: url('fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-latin.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  /* Cinzel is engraved Roman capitals — Diablo-ish, but only legible at display
     sizes. It is used for headings and zone names, never for body copy. */
  --font-display: 'Cinzel', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Open Sans', 'Segoe UI', Roboto, system-ui, sans-serif;

  --bg: #0b0b0d;
  --bg-panel: #16161a;
  --bg-head: #1e1e24;
  --bg-alt: #121216;
  --border: #2e2a26;
  --border-strong: #4a4038;

  --text: #cabfa9;
  --text-dim: #8c8171;
  --gold: #c7a45a;
  --gold-bright: #e8c87a;
  --red: #a63525;
  --red-bright: #d4553f;
  --blue: #6f8fd6;

  /* The colors D2 uses for each damage type. Immunities are the most scanned
     thing on the page, so they get to read as their element rather than as prose. */
  --el-fire: #e2673c;
  --el-cold: #6fb7e0;
  --el-lightning: #e5cf62;
  --el-poison: #7fae4e;
  --el-physical: #b0a695;
  --el-magic: #b382d8;

  /* D2's unique-item gold. */
  --unique: #c7b377;

  --s: #d4553f;
  --a: #c7a45a;
  --b: #7fa06a;
  --c: #6f8fd6;
  --d: #8a8079;
  --f: #5e5850;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(140, 60, 35, .16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 var(--font-body);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(180deg, #1a1a1f, #101013);
  border-bottom: 2px solid var(--border-strong);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px;
}
.brand {
  margin: 0; font-family: var(--font-display); font-size: 23px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--red-bright); font-weight: 700;
  text-shadow: 0 0 14px rgba(212, 85, 63, .35);
}
.brand span { color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.conn { font-size: 12px; color: var(--text-dim); }
.conn.ok { color: var(--b); }
.conn.ok::before { content: "● "; }
.conn.down { color: var(--red-bright); }
.conn.down::before { content: "● "; }

/* ---------- buttons ---------- */
.btn {
  background: #24242b; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #2e2e37; color: var(--gold-bright); }
.btn-primary {
  background: linear-gradient(180deg, #8c2c1e, #6d2317);
  border-color: #b8492f; color: #f0e2cc; font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(180deg, #a53625, #7d2a1b); color: #fff; }
.btn-primary[disabled] {
  background: #24242b; border-color: var(--border); color: var(--text-dim);
  cursor: default; font-weight: 400;
}
.btn-tier.on, .btn.on { background: #3a3320; border-color: var(--gold); color: var(--gold-bright); }

/* ---------- banner ---------- */
.banner {
  margin: 16px 0 0; padding: 10px 14px; border-radius: 3px;
  border: 1px solid var(--border-strong); border-left: 3px solid var(--gold);
  background: #1d1a14; color: var(--gold-bright); font-size: 14px;
}
.banner.err { border-left-color: var(--red-bright); background: #1f1512; color: #e8b0a2; }

/* ---------- panels ---------- */
.panel {
  /* A faint top-light gradient plus a hairline inner highlight reads as a bevelled
     stone panel rather than a flat div. */
  background: linear-gradient(180deg, #191920, #141418);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 16px 0;
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, .05), 0 2px 10px rgba(0, 0, 0, .35);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #23232b, #1a1a20);
  border-bottom: 1px solid var(--border);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, .06);
}
.panel-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 14px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.panel-body { padding: 14px; }
.panel-body-flush { padding: 0; }

.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .zones { grid-template-columns: 1fr; } }

.panel-current { border-color: #5a2a1e; }
.panel-current .panel-head { background: linear-gradient(180deg, #37160f, #24120c); border-bottom-color: #5a2a1e; }
.panel-current .panel-head h2 { color: var(--red-bright); }
.panel-next .panel-head { background: linear-gradient(180deg, #2a2517, #1d1a12); }

.pill {
  font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--text-dim); background: #0e0e11;
  border: 1px solid var(--border); border-radius: 10px; padding: 2px 9px;
}

.zone-name {
  font-family: var(--font-display); font-size: 23px; font-weight: 700;
  letter-spacing: .01em; color: var(--gold-bright); line-height: 1.3;
}
.zone-name.pending {
  font-family: var(--font-body); color: var(--text-dim);
  font-style: italic; font-size: 16px; font-weight: 400; letter-spacing: 0;
}
.zone-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  border: 1px solid #3b352e; border-radius: 2px;
  background: rgba(255, 235, 200, .03);
  padding: 2px 7px; color: #9a8f80;
}
.tier {
  font-weight: 700; border-radius: 2px; padding: 2px 8px; font-size: 10px;
  letter-spacing: .06em; color: #14120d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.tier-S { background: var(--s); } .tier-A { background: var(--a); }
.tier-B { background: var(--b); } .tier-C { background: var(--c); }
.tier-D { background: var(--d); } .tier-F { background: var(--f); color: #cfc6b8; }

.facts {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px;
}
.facts dt {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: #6f665c; padding-top: 2px; white-space: nowrap;
}
.facts dd { margin: 0; color: var(--text); }
.facts .num { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; }
.facts .areas { color: #9b9081; }
.sep { color: #4e4740; padding: 0 5px; }

/* Super uniques are named monsters — give them the weight D2 gives a unique drop. */
.unique { color: var(--unique); font-weight: 600; text-shadow: 0 0 9px rgba(199, 179, 119, .3); }

/* ---------- immunities ---------- */
.imms { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.imm {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 2px; line-height: 1.4;
  border: 1px solid currentColor;
  /* Tint the fill from the text color so each chip glows in its own element. */
  background: color-mix(in srgb, currentColor 13%, transparent);
}
.imm-fire { color: var(--el-fire); }
.imm-cold { color: var(--el-cold); }
.imm-lightning { color: var(--el-lightning); }
.imm-poison { color: var(--el-poison); }
.imm-physical { color: var(--el-physical); }
.imm-magic { color: var(--el-magic); }
.none { color: #5e5850; font-style: italic; font-size: 12px; }

/* ---------- watchlist ---------- */
.hint { font-size: 12px; color: var(--text-dim); margin: 0 0 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.toggle { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; margin-left: auto; cursor: pointer; }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
.act-head {
  grid-column: 1 / -1; margin: 14px 0 5px; padding-bottom: 4px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.zone-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 3px; cursor: pointer; font-size: 13px;
}
.zone-row:hover { background: #1e1e24; }
.zone-row input { accent-color: var(--red); flex: none; }
.zone-row .zl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-row.checked .zl { color: var(--gold-bright); }

/* ---------- history ---------- */
.history { width: 100%; border-collapse: collapse; font-size: 13px; }
.history th {
  text-align: left; padding: 9px 14px; font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: #6f665c; font-weight: 700;
  background: #101014; border-bottom: 1px solid var(--border);
}
.history td { padding: 8px 14px; border-bottom: 1px solid #1c1c21; }
.history tbody tr:nth-child(even) { background: rgba(255, 235, 200, .015); }
.history tr:last-child td { border-bottom: 0; }
.history tbody tr:hover { background: rgba(199, 164, 90, .07); }
.history .t {
  color: #8a7f6d; font-variant-numeric: tabular-nums; white-space: nowrap;
  font-size: 12px; letter-spacing: .04em;
}
.history .z { color: var(--text); }

/* The active zone should be obvious at a glance from across the room. */
.history tr.live td { background: rgba(166, 53, 37, .1); }
.history tr.live td:first-child { box-shadow: inset 3px 0 0 var(--red-bright); }
.history tr.live .z {
  color: var(--red-bright); font-weight: 700;
  text-shadow: 0 0 10px rgba(212, 85, 63, .35);
}
/* A zone you're watching, so the history doubles as feedback on your watchlist. */
.history tr.watched .z { color: var(--gold-bright); }
@media (max-width: 620px) { .col-imm { display: none; } }

.foot { padding: 20px 16px 32px; font-size: 12px; color: var(--text-dim); }
.foot a { color: var(--blue); }

/* Notification status. Always visible: a silent notification failure is the whole
   bug class we're trying to make impossible. */
.diag {
  margin: 12px 0 0; padding: 7px 11px;
  font-size: 12px; color: #8a8f7a;
  background: rgba(127, 174, 78, .06);
  border: 1px solid #2c3326; border-left: 3px solid var(--el-poison);
  border-radius: 3px;
}
.diag.err {
  color: #e0b09f;
  background: rgba(166, 53, 37, .08);
  border-color: #4a2a22; border-left-color: var(--red-bright);
}
