:root {
  --bg: #0e1015;
  --panel: #171a21;
  --panel-2: #1f232c;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #eef0f4;
  --ink-2: rgba(238, 240, 244, 0.72);
  --muted: rgba(238, 240, 244, 0.48);
  --accent: #5865f2;
  --cyan: #5ce1ff;
  --up: #3ddc84;
  --down: #ff6b81;
  --warn: #f5c84c;
  --radius: 12px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
}
h1 {
  font-size: 18px;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}
a {
  color: var(--cyan);
}
.muted {
  color: var(--muted);
  margin: 0;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.up {
  color: var(--up);
}
.down {
  color: var(--down);
}

/* Login and error pages */
.card.narrow {
  max-width: 380px;
  text-align: center;
  display: grid;
  gap: 12px;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(14, 16, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-size: 26px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
}
.me form {
  margin: 0;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.status {
  font-size: 12px;
  color: var(--down);
}
.status.live {
  color: var(--up);
}
button.link {
  background: none;
  border: 0;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px;
  font: inherit;
}
button.link:hover {
  color: var(--ink);
}

main {
  padding: 16px 20px 40px;
  max-width: 1500px;
  margin: 0 auto;
}

/* Key numbers */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  overflow: hidden;
}
.tile .label {
  font-size: 12px;
  color: var(--muted);
}
.tile .value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tile .sub {
  font-size: 12px;
  color: var(--ink-2);
  min-height: 1.2em;
}
.spark {
  width: 100%;
  height: 32px;
  margin-top: 4px;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
}
.card.wide {
  grid-column: span 2;
}
.card.full {
  grid-column: 1 / -1;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .card.wide {
    grid-column: auto;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
}
tbody tr + tr td {
  border-top: 1px solid var(--line);
}
.scroll {
  max-height: 440px;
  overflow: auto;
}
td.player {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}
td.player span {
  overflow: hidden;
  text-overflow: ellipsis;
}
td.player img,
.list img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
}
tr.fresh td {
  animation: fresh 2s ease-out;
}
@keyframes fresh {
  from {
    background: rgba(88, 101, 242, 0.25);
  }
  to {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  tr.fresh td {
    animation: none;
  }
}

/* Lists and facts */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.list li {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.list li > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.results li {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.results li:hover,
.results li:focus-visible {
  background: var(--panel-2);
  outline: none;
}
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 10px 0 0;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Inputs */
input[type='search'] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  min-width: 200px;
}
input[type='search']:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 2px;
}
.seg button {
  background: none;
  border: 0;
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.seg button.on {
  background: var(--accent);
  color: #fff;
}
.check {
  color: var(--ink-2);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Logs */
.logs {
  margin: 0;
  height: 380px;
  overflow: auto;
  background: #0a0c10;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: 12px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.logs .t {
  color: var(--muted);
}
.logs .warn {
  color: var(--warn);
}
.logs .error {
  color: var(--down);
}

/* Player detail */
.detail {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.detail-head img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.stat {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 8px 10px;
}
.stat .label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.stat .value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  background: var(--panel-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--ink-2);
}
