:root {
  --bg: #090404;
  --panel: #140808;
  --line: #5a1616;
  --text: #f0e4d4;
  --muted: #9a8070;
  --accent: #d31812;
  --hot: #ff5a1f;
  --ok: #7dff6a;
  --empty: #d8b44a;
  --dead: #8a3a3a;
  --input: #1c0b0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #3a0a0a 0, transparent 42%),
    linear-gradient(#120606, #070303);
}

.top, .stats, .controls, .table-wrap, .cards, .empty, footer, .status-line, .stale, .page-wrap {
  width: min(1200px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}

.top {
  padding: 28px 0 10px;
  border-bottom: 1px solid var(--line);
}
.eyebrow, .subtitle {
  margin: 0;
  letter-spacing: .28em;
  font-size: 12px;
  color: var(--hot);
}
h1 {
  margin: 6px 0 2px;
  font-size: clamp(28px, 6vw, 54px);
  letter-spacing: .08em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(211, 24, 18, .45);
}
.tagline { color: var(--muted); max-width: 46rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.stats article {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px;
}
.stats span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.stats strong { display: block; margin-top: 6px; font-size: 22px; }

.stale { color: #ffb347; font-weight: 700; }
.hidden { display: none !important; }

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin: 18px auto;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button, select, .copy-row button, #copy-ip {
  background: linear-gradient(#5a1410, #2a0707);
  color: var(--text);
  border: 1px solid #8a2420;
  padding: 8px 12px;
  cursor: pointer;
  letter-spacing: .04em;
}
.filters button.active { background: linear-gradient(#c41212, #6a0808); }
.search, .sort { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
input, select {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 10px;
  min-width: 220px;
}

.status-line { color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); background: #0d0505; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--hot);
  padding: 10px;
  background: #1a0808;
}
td { padding: 10px; border-top: 1px solid #2a1010; vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #220c0c; }
tbody tr.active-row { outline: 1px solid var(--hot); }
.server { font-weight: 700; }
.addr { color: var(--muted); font-family: Consolas, monospace; }
.ping-ok { color: var(--ok); }
.ping-mid { color: var(--empty); }
.ping-bad { color: #ff6b6b; }
.badge { display: inline-block; min-width: 3.4rem; }
.row-empty { opacity: .78; }
.row-offline { opacity: .45; }

.cards { display: none; gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px;
}
.card a.card-main { color: inherit; text-decoration: none; display: block; }
.card a.card-main:hover h3 { color: var(--hot); }
.card h3 { margin: 0 0 8px; }
.card .meta { color: var(--muted); margin: 4px 0; }
.card button { margin-top: 8px; }

.page-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  margin-top: 18px;
}
.page-wrap h2 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.page-wrap h3 { margin: 18px 0 8px; letter-spacing: .08em; color: var(--hot); }
.page-meta { margin: 0 0 12px; color: var(--muted); }
.back-link {
  color: var(--hot);
  text-decoration: none;
  letter-spacing: .08em;
}
.back-link:hover { text-decoration: underline; }
.facts { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.players {
  margin-top: 8px;
  width: 100%;
  table-layout: fixed;
}
.players tbody tr { cursor: default; }
.server a {
  color: inherit;
  text-decoration: none;
}
.server a:hover { color: var(--hot); }
.players th:nth-child(1),
.players td:nth-child(1) { width: 70%; }
.players th:nth-child(2),
.players td:nth-child(2),
.players th:nth-child(3),
.players td:nth-child(3) {
  width: 15%;
  white-space: nowrap;
}
.players td:nth-child(1) {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.week-table { table-layout: auto; }
.week-table th:nth-child(1),
.week-table td:nth-child(1) { width: auto; }
.week-table th:nth-child(2),
.week-table td:nth-child(2),
.week-table th:nth-child(3),
.week-table td:nth-child(3),
.week-table th:nth-child(4),
.week-table td:nth-child(4) {
  width: auto;
  white-space: nowrap;
}
.week-now { color: var(--ok); font-size: 11px; letter-spacing: .08em; margin-left: 8px; }

footer { padding: 24px 0 40px; color: var(--muted); }

@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .desktop { display: none; }
  .cards { display: grid; }
  .search input, .sort select { min-width: 0; width: 100%; }
  .controls { flex-direction: column; align-items: stretch; }
  .facts { grid-template-columns: 1fr; }
  .week-table th:nth-child(2),
  .week-table td:nth-child(2),
  .week-table th:nth-child(3),
  .week-table td:nth-child(3),
  .week-table th:nth-child(4),
  .week-table td:nth-child(4) {
    white-space: normal;
    font-size: 12px;
  }
}
@media (min-width: 861px) {
  .mobile { display: none; }
}
