:root {
  --bg: #121212;
  --panel: #1b1b1b;
  --panel-2: #222;
  --line: #2e2e2e;
  --text: #e8e2d6;
  --dim: #9a9387;
  --hev: #ff9d00;
  --hev-soft: rgba(255, 157, 0, .14);
  --good: #7fd36b;
  --bad: #e5604d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 10% -10%, rgba(255,157,0,.08), transparent 60%);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0 16px;
}
.top, main, footer { max-width: 1120px; margin: 0 auto; }
.top {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between;
  padding: 28px 0 20px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.lambda {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--hev); color: #141414; font: 700 32px/1 Arial, sans-serif;
  box-shadow: 0 0 24px rgba(255,157,0,.35);
}
h1 { margin: 0; font-size: 26px; letter-spacing: .02em; }
h1 .dim, .dim { color: var(--dim); font-weight: 500; }
.sub { margin: 2px 0 0; color: var(--dim); }
.sub b { color: var(--text); font-weight: 600; }
h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; color: var(--hev); }

.status { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.status-line { display: flex; gap: 8px; align-items: center; color: var(--dim); }
.status-line b { color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #555; flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 10px rgba(127,211,107,.7); }
.dot.off { background: var(--bad); }
.connect { display: flex; gap: 6px; align-items: center; }
code {
  font: 14px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
}
button {
  font: inherit; font-size: 13px; color: #141414; background: var(--hev); border: 0; border-radius: 6px;
  padding: 8px 12px; cursor: pointer;
}
button:hover { filter: brightness(1.1); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 18px 16px; margin: 0 0 18px;
}
.card-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.card-head h2 { margin: 0; }
.hint { margin: 6px 0 12px; color: var(--dim); font-size: 13px; }
input[type=search] {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 10px; min-width: 0; width: 220px; max-width: 100%;
}

.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 18px; }
.record {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--hev);
  border-radius: 10px; padding: 12px 14px; min-width: 0;
}
.record .label { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.record .value { font-size: 24px; font-weight: 700; color: var(--hev); font-variant-numeric: tabular-nums; }
.record .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.roster li {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.roster li b { color: var(--hev); margin-left: 6px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 8px; text-align: left; white-space: nowrap; }
th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim);
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
th:hover { color: var(--text); }
th.sorted { color: var(--hev); }
th.sorted::after { content: " ▾"; }
th.sorted.asc::after { content: " ▴"; }
.num { text-align: right; }
tbody tr.player { border-bottom: 1px solid var(--line); cursor: pointer; }
tbody tr.player:hover { background: var(--hev-soft); }
tbody tr.player.open { background: var(--hev-soft); }
td.name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
td.name a { color: inherit; text-decoration: none; }
td.name a:hover { color: var(--hev); text-decoration: underline; }
.medal { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; }
.m1, .m2, .m3 { border-radius: 50%; color: #141414; line-height: 22px; }
.m1 { background: #ffcc33; } .m2 { background: #cfd6dc; } .m3 { background: #d8945a; }
.kd-good { color: var(--good); } .kd-bad { color: var(--bad); }
tr.detail td { padding: 4px 8px 18px; white-space: normal; background: #171717; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.detail-facts { color: var(--dim); font-size: 14px; }
.detail-facts b { color: var(--text); }

.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; }
.bar .wname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 12px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, #c66f00, var(--hev)); border-radius: 6px; }
.bar .count { color: var(--dim); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.bar .count b { color: var(--text); }
.empty { color: var(--dim); }

footer {
  display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between;
  color: var(--dim); font-size: 12px; padding: 4px 0 28px;
}

@media (max-width: 720px) {
  .status { align-items: flex-start; }
  .opt { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .bar { grid-template-columns: minmax(90px, 120px) 1fr auto; }
  h1 { font-size: 22px; }
}
