@font-face { font-family: "NeoDGM"; src: url("neodgm.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #17111f;
  --panel: #221a2e;
  --panel-2: #2c2240;
  --line: #3b2f52;
  --text: #ece6f5;
  --muted: #a99bbd;
  --gold: #fbb954;
  --green: #5ac54f;
  --red: #e83b3b;
  --blue: #4d9be6;
  --violet: #a884f3;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
button { cursor: pointer; }
button:hover { border-color: var(--gold); }
button.primary { background: var(--gold); color: #2a1b06; border-color: var(--gold); font-weight: 700; }

header { position: sticky; top: 0; z-index: 5; background: rgba(23, 17, 31, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 20px; max-width: 1400px; margin: 0 auto; }
.logo { font-family: "NeoDGM", monospace; font-size: 22px; color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.logo small { font-size: 14px; color: var(--muted); margin-left: 6px; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { padding: 5px 10px; border-radius: 8px; color: var(--muted); }
nav a.on { background: var(--panel-2); color: var(--text); text-decoration: none; }
nav a:hover { color: var(--text); text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.filters label { color: var(--muted); display: flex; align-items: center; gap: 4px; }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 18px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 14px; }
.grid.wide { grid-template-columns: 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .k { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .v.live::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--green); }
.chart { position: relative; height: 260px; }
.chart.tall { height: 360px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
.scroll { overflow: auto; max-height: 560px; }
.meter { position: relative; height: 18px; background: var(--panel-2); border-radius: 4px; min-width: 120px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--gold); border-radius: 4px; }
.meter span { position: relative; padding-left: 6px; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.good { color: var(--green); }
.bad { color: var(--red); }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); font-size: 12px; color: var(--muted); }
.pill.gold { color: #2a1b06; background: var(--gold); }
.empty { color: var(--muted); padding: 30px; text-align: center; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.timeline li.session { background: var(--panel-2); color: var(--gold); font-weight: 600; grid-template-columns: 1fr; }
.timeline code { color: var(--muted); font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.ev-match_end .name, .ev-season_end .name { color: var(--gold); }
.ev-error .name { color: var(--red); }
.ev-feature_opened .name, .ev-level_up .name { color: var(--violet); }

textarea { width: 100%; min-height: 140px; font-family: ui-monospace, Consolas, monospace; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.err { color: var(--red); white-space: pre-wrap; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: min(360px, 92vw);
  display: grid; gap: 12px; }
.login .logo { font-size: 28px; text-align: center; }
.login #pw { display: grid; gap: 12px; }
.login #pw[hidden], .login .google[hidden], .login .or[hidden] { display: none; }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  background: #fff; color: #1f1f1f; font-weight: 600; border: 1px solid #dadce0; }
.google:hover { text-decoration: none; background: #f3f3f3; }
.or { text-align: center; font-size: 12px; }
.who { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  main { padding: 14px; }
  .bar { padding: 10px 14px; }
  .filters { margin-left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
