:root {
  --black: #0a0a0a;
  --panel: #121212;
  --white: #f5f5f5;
  --yellow: #EBFF00;
  --muted: #a8a8a8;
  --line: rgba(245, 245, 245, .18);
  --red: #ff5a5a;
}
* { box-sizing: border-box; }
html { background: var(--black); color: var(--white); font-family: 'Space Mono', ui-monospace, monospace; }
html:not(.fonts-ready) body { opacity: 0; }
body { margin: 0; min-height: 100vh; opacity: 1; transition: opacity .18s ease; overflow-x: hidden; }
a, button { color: inherit; }
a { text-decoration: none; }

.shell {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 54px);
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  align-content: start;
  max-width: 1480px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { font-family: 'Unbounded', system-ui, sans-serif; font-size: clamp(2.1rem, 7vw, 6rem); line-height: .9; font-weight: 900; letter-spacing: 0; }
.brand span { color: var(--yellow); }
nav { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  transition: border-color .15s ease, color .15s ease;
}
.pill:hover { border-color: var(--yellow); color: var(--yellow); }

.hero { display: grid; gap: 18px; }
.online { display: flex; align-items: baseline; gap: 16px; }
.online .big {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(5rem, 18vw, 16rem);
  line-height: .85;
  color: var(--yellow);
}
.online .muted { font-size: clamp(1.2rem, 2.4vw, 2.4rem); color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-weight: 700; }
.players { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.players li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.players li.you { border-color: var(--yellow); color: var(--yellow); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(10px, 1.6vw, 18px); }
.tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px clamp(18px, 2.4vw, 26px);
  background: var(--panel);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.tile .key { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }
.tile .val { font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: clamp(1.2rem, 2.6vw, 2.1rem); }

.graph-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 18px; }
#graph { width: 100%; height: 120px; display: block; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(18px, 2vw, 28px); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr; } }

.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; grid-template-rows: auto 1fr auto; min-height: 360px; max-height: 440px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--muted); }
.panel-head a { color: var(--muted); }
.panel-head a:hover { color: var(--yellow); }

.list { overflow-y: auto; padding: 6px 0; }
.scroller::-webkit-scrollbar { width: 8px; }
.scroller::-webkit-scrollbar-thumb { background: rgba(245,245,245,.18); border-radius: 8px; }

.line {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 6px 18px;
  font-size: 13px;
  align-items: baseline;
}
.line .ts { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.line .who { color: var(--yellow); font-weight: 700; margin-right: 6px; }
.line.web .who::before { content: 'web '; color: #999; font-weight: 400; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
.line.death { color: var(--red); }
.line.system { color: var(--muted); font-style: italic; }

.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { background: var(--black); color: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: inherit; }
.chat-form input:focus { border-color: var(--yellow); outline: none; }
.chat-form input:disabled { opacity: .5; }
.chat-form button { background: var(--yellow); color: var(--black); border: 0; border-radius: 6px; padding: 10px 18px; font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; cursor: pointer; }
.chat-form button:disabled { opacity: .35; cursor: not-allowed; }

.map-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; grid-template-rows: auto 1fr; }
#map { width: 100%; height: clamp(360px, 60vh, 760px); border: 0; background: #000; }

.toast { position: fixed; top: 22px; right: 22px; max-width: min(420px, calc(100vw - 44px)); background: var(--yellow); color: #0a0a0a; border-radius: 8px; padding: 14px 16px; font-weight: 700; transform: translateY(-18px); opacity: 0; pointer-events: none; transition: all .18s ease; z-index: 20; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
