:root {
  --bg: #0b0b0d;
  --panel: #141418;
  --panel2: #1b1b21;
  --line: #2a2a33;
  --text: #e8e6e3;
  --muted: #8d8b93;
  --accent: #c1121f;
  --accent2: #e63946;
  --good: #3ccf6e;
  --purple: #b47cff;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: .04em; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; color: var(--muted); font-weight: 600; }
h3 { font-size: 1rem; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.2rem; border-bottom: 1px solid var(--line); background: #08080a;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 800; letter-spacing: .15em; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: .3rem; flex-wrap: wrap; }
nav a { color: var(--muted); padding: .35rem .75rem; border-radius: 6px; }
nav a:hover, nav a.on { color: var(--text); background: var(--panel2); text-decoration: none; }

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem 16px 3rem; flex: 1; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; border-top: 1px solid var(--line); }

.hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.hero h1 { font-size: 2.4rem; letter-spacing: .2em; }
.hero img { border-radius: 12px; }
.status { font-size: 1.05rem; margin: .6rem 0 .3rem; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); margin-right: .3rem; vertical-align: middle; }
.status.up .dot, .dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status.down .dot { background: var(--accent); }
.online { color: var(--good); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.more { display: inline-block; margin-top: .6rem; font-size: .9rem; }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: 1rem 0; }
.totals div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.totals b { display: block; font-size: 1.6rem; line-height: 1.2; }
.totals span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.small-totals { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); margin: .8rem 0; }
.small-totals div { background: var(--panel2); padding: .5rem .7rem; }
.small-totals b { font-size: 1.2rem; }

.rank, .feed { list-style: none; margin: 0; padding: 0; }
.rank li, .feed li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.rank li:last-child, .feed li:last-child { border-bottom: 0; }
.rank { counter-reset: r; }
.rank li { display: flex; justify-content: space-between; gap: 1rem; counter-increment: r; }
.rank li span::before { content: counter(r) ". "; color: var(--muted); }
.feed .muted { display: block; font-size: .85rem; }
.tag { color: var(--purple); font-style: normal; font-weight: 600; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.toolbar p { margin: 0; }
.switch { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.switch button { background: none; border: 0; color: var(--muted); padding: .45rem .9rem; border-radius: 6px; cursor: pointer; font: inherit; }
.switch button.on { background: var(--accent); color: #fff; }
input[type=search], select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .8rem; font: inherit; min-width: 220px; max-width: 100%;
}

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: .55rem .7rem; text-align: left; white-space: nowrap; }
.board th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); user-select: none; }
.board th[data-sort] { cursor: pointer; }
.board th[data-sort]:hover, .board th.sorted { color: var(--text); }
.board th.sorted::after { content: " ▾"; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board td.sorted { color: #fff; font-weight: 600; }
.board .pos { color: var(--muted); width: 2.5rem; }
.board tr.row { cursor: pointer; border-top: 1px solid var(--line); }
.board tr.row:hover, .board tr.row:focus { background: var(--panel2); outline: none; }
.board tr.row.open { background: var(--panel2); }
.board tr.row .who { font-weight: 600; }
.board tr.cardrow > td { padding: 0 .7rem 1rem; background: var(--panel2); white-space: normal; }
.board.plain td { border-top: 1px solid var(--line); white-space: normal; }
.card { padding: .5rem .2rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.card-head h3 { color: var(--text); text-transform: none; font-size: 1.2rem; margin: 0; }
.weapons { margin-top: .5rem; background: var(--panel); border-radius: 8px; }

@media (max-width: 900px) { .hide-m { display: none; } }
@media (max-width: 640px) {
  .hide-s { display: none; }
  .hero h1 { font-size: 1.7rem; }
  .grid.two { grid-template-columns: 1fr; }
  input[type=search] { min-width: 0; width: 100%; }
  .board th, .board td { padding: .5rem .4rem; }
  .board tr.row .who { white-space: normal; }
  .board tr.cardrow > td { padding: 0 .4rem .8rem; }
  .small-totals { grid-template-columns: repeat(2, 1fr); }
}

/* ---- admin ---- */
.adminbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; margin-bottom: 1.2rem; }
.adminbar form { display: flex; align-items: center; gap: .6rem; }
.btn { display: inline-block; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem 1rem; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn.steam { background: #171a21; border-color: #2a475e; padding: .8rem 1.4rem; font-weight: 600; margin: 1rem 0; }
.btn.steam:hover { border-color: #66c0f4; }
.narrow { max-width: 480px; margin: 2rem auto; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: .8rem 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.filters select { min-width: 160px; }
tr.link { cursor: pointer; }
tr.link:hover { background: var(--panel2); }
.nowrap { white-space: nowrap; }
.logs .t-admin_log td:nth-child(2) { color: var(--purple); }
.logs .t-player_kill td:nth-child(2) { color: #ff8a8a; }
code { background: var(--panel2); padding: .1rem .3rem; border-radius: 4px; }
nav a.adminlink { color: var(--purple); }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: .05rem .45rem; vertical-align: middle; }
.switch a { color: var(--muted); padding: .45rem .9rem; border-radius: 6px; }
.switch a.on { background: var(--accent); color: #fff; text-decoration: none; }
.warn { background: #3a1a1d; border: 1px solid var(--accent); border-radius: 8px; padding: .6rem .9rem; }
.ok { background: #14301f; border: 1px solid var(--good); border-radius: 8px; padding: .6rem .9rem; }
.chat { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
.msg { background: var(--panel2); border-radius: 10px; padding: .6rem .8rem; max-width: 85%; border-left: 3px solid var(--muted); }
.msg.staff { align-self: flex-end; border-left-color: var(--accent); }
.msg.bot { align-self: center; background: none; border: 0; color: var(--muted); font-size: .85rem; }
.msg .who { font-weight: 600; margin-bottom: .2rem; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.reply textarea, .settings textarea { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; font: inherit; resize: vertical; }
.reply .row { display: flex; justify-content: flex-end; margin: .5rem 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { border-color: var(--accent); color: var(--accent2); }
.settings label { display: block; margin: .8rem 0; }
.settings label select, .settings label textarea { display: block; width: 100%; margin-top: .3rem; }
.settings label.check { display: flex; gap: .5rem; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
