/* Deliberately single-theme: a dark slate-and-bronze palette that suits the subject and keeps
   the charts legible. There is no light variant to keep in sync. */

:root {
  --bg: #12151a;
  --bg-raised: #191d24;
  --bg-sunken: #0d1014;
  --line: #262c35;
  --line-soft: #1e232b;
  --ink: #e7e3da;
  --ink-dim: #9aa1ad;
  --ink-faint: #6b7280;
  --gold: #c9a227;
  --gold-soft: #e0be4d;
  --blood: #b4472f;
  --moss: #6f8f5a;
  --frost: #6d93b8;
  --radius: 10px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1c222b 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  padding-block: 28px 22px;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.brand h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--gold-soft);
}

.tagline {
  margin: 4px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
}

.headline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}

.headline div { min-width: 84px; }

.headline dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.headline dd {
  margin: 2px 0 0;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- tabs ---------- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(18, 21, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.tabs-inner {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-inner::-webkit-scrollbar { display: none; }

.tabs button {
  flex: 0 0 auto;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 14px;
  padding: 13px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button:hover { color: var(--ink); }

.tabs button.active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
}

/* ---------- layout blocks ---------- */

main { padding-block: 26px 40px; min-height: 50vh; }

.status { color: var(--ink-dim); }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.card-grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
}

.card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.card .value {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.card .sub {
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 16px;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

select {
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button:hover { color: var(--ink); }

.segmented button.active {
  background: var(--gold);
  color: #17140a;
  font-weight: 600;
}

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

td.num, th.num { text-align: right; }

.rank {
  color: var(--ink-faint);
  width: 1%;
  font-variant-numeric: tabular-nums;
}

tbody tr:nth-child(1) .rank { color: var(--gold); font-weight: 700; }
tbody tr:nth-child(2) .rank { color: #b9bec7; font-weight: 700; }
tbody tr:nth-child(3) .rank { color: #a9743f; font-weight: 700; }

.who { display: flex; flex-direction: column; gap: 1px; }
.who .owner { font-size: 11px; color: var(--ink-faint); }

.muted { color: var(--ink-dim); }
.empty { color: var(--ink-faint); font-style: italic; padding: 18px 2px; }

/* ---------- charts ---------- */

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

figure { margin: 0; }

figcaption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 110px;
}

.bars .bar {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, var(--gold-soft), #8a6f18);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
}

.bars .bar[data-zero="1"] { background: var(--line); }

.bar-labels {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.bar-labels span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 10px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

svg.spark { display: block; }

/* ---------- skills ---------- */

.skill-row {
  display: grid;
  grid-template-columns: 140px 1fr 52px;
  gap: 12px;
  align-items: center;
  padding: 5px 0;
}

.skill-row .name { font-size: 13px; color: var(--ink-dim); }

.meter {
  background: var(--bg-sunken);
  border-radius: 4px;
  height: 9px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--moss), #9dbb82);
  border-radius: 4px;
}

.skill-row .lvl {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* ---------- feed ---------- */

.feed { list-style: none; margin: 0; padding: 0; }

.feed li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.feed li:last-child { border-bottom: 0; }

.feed time {
  color: var(--ink-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 118px;
}

.feed .actor { color: var(--gold-soft); }

.tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}

.tag.kill { border-color: #4d3a2a; color: #d09a6d; }
.tag.death { border-color: #5a2f27; color: #dd8b7a; }
.tag.boss { border-color: var(--gold); color: var(--gold-soft); }
.tag.gather { border-color: #35452c; color: #a3c188; }
.tag.build { border-color: #2d3f4d; color: #8fb6d4; }
.tag.skill { border-color: #453a56; color: #b39ddb; }
.tag.travel { border-color: #2a4a4a; color: #86c5c0; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 20px 40px;
  color: var(--ink-faint);
  font-size: 12px;
}

.foot p { margin: 0 0 6px; max-width: 74ch; }

@media (max-width: 600px) {
  .headline { gap: 10px 18px; }
  .headline dd { font-size: 18px; }
  .skill-row { grid-template-columns: 104px 1fr 46px; }
  .feed time { min-width: 100%; }
}
