:root {
  --bg: #05070f; --panel: #0d1222; --panel2: #111830; --line: #1e2742;
  --text: #e8ecff; --muted: #7d88b3; --cyan: #4ff0ff; --pink: #ff5cf0;
  --gold: #ffc53d; --green: #4ade80; --red: #ff6b6b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Space Grotesk", system-ui, sans-serif; overflow-x: hidden;
  background-image: linear-gradient(rgba(79,240,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(79,240,255,.04) 1px, transparent 1px);
  background-size: 40px 40px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.mono { font-family: "JetBrains Mono", monospace; }
.muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

header { display: flex; align-items: center; gap: 14px; padding: 18px 0; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 22px; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.logo .sq { width: 28px; height: 28px; background: conic-gradient(from 45deg, var(--cyan), var(--pink), var(--cyan)); border-radius: 7px; }
.logo b { color: var(--cyan); } .logo i { color: var(--pink); font-style: normal; }
.search { flex: 1; min-width: 220px; display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.search input { flex: 1; background: transparent; border: 0; padding: 12px 16px; outline: none; min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search button { background: linear-gradient(135deg, var(--cyan), #38a8ff); color: #031320; font-weight: 700; padding: 0 18px; }
.hbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.hb { padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.hb:hover { border-color: var(--cyan); }
.hb.dc { background: #5865f2; border-color: #5865f2; }

.hero { padding: 26px 0 20px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin: 12px 0; letter-spacing: -.5px; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); max-width: 640px; font-size: 17px; }
.cta { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; align-items: stretch; }
.big { display: flex; flex-direction: column; align-items: flex-start; padding: 14px 22px; border-radius: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--pink)); color: #06070d; font-weight: 700; font-size: 22px; }
.big small { font-size: 12px; font-weight: 600; opacity: .7; }
.bed { display: flex; flex-direction: column; justify-content: center; padding: 12px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.bed b { font-size: 13px; color: var(--muted); }
.pulse { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 700; font-size: 13px;
  background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.25); padding: 5px 10px; border-radius: 999px; }
.pulse i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pl 1.6s infinite; }
.pulse.off { color: var(--red); background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.3); }
@keyframes pl { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); } 70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }

.live { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; position: relative; overflow: hidden; }
.tile small { color: var(--muted); font-weight: 600; font-size: 13px; }
.tile b { display: block; font-size: 34px; margin-top: 4px; font-weight: 700; }
.tile .hint { color: var(--muted); font-size: 12px; }
.tile:first-child { background: linear-gradient(135deg, rgba(79,240,255,.14), rgba(255,92,240,.10)); }
.spark { position: absolute; right: 10px; bottom: 8px; opacity: .8; }

.sec { font-size: 22px; margin: 28px 0 12px; }
.boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.board h3 { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 17px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.board h3 span { font-size: 12px; color: var(--muted); font-weight: 600; }
.row { display: grid; grid-template-columns: 34px 30px 1fr auto; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid rgba(30,39,66,.6); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(255,255,255,.03); }
.rank { font-weight: 700; color: var(--muted); text-align: center; }
.row:nth-child(1) .rank { color: var(--gold); } .row:nth-child(2) .rank { color: #cfd6ff; } .row:nth-child(3) .rank { color: #e0965a; }
.head { width: 30px; height: 30px; border-radius: 6px; image-rendering: pixelated; background: var(--panel2); }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val { font-weight: 700; }
.empty { color: var(--muted); padding: 16px 18px; font-size: 14px; }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.card h2 { font-size: 20px; margin-bottom: 2px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.card .small { margin: 12px 0 0; }
.card .empty { padding: 8px 0; }
.player { display: flex; gap: 16px; align-items: center; }
.avatar { width: 84px; height: 84px; border-radius: 14px; flex: none; image-rendering: pixelated; box-shadow: 0 0 0 3px var(--line); background: var(--panel2); }
.pname { font-size: 24px; font-weight: 700; }
.rk { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  background: rgba(79,240,255,.12); color: var(--cyan); border: 1px solid rgba(79,240,255,.35); }
.rk.st { background: rgba(125,136,179,.12); color: var(--muted); border-color: var(--line); }
.rk.st.on { background: rgba(74,222,128,.12); color: var(--green); border-color: rgba(74,222,128,.35); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.kpi { background: var(--panel2); border-radius: 14px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 22px; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bars { margin-top: 12px; display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.bar div { height: 10px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.bar div i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.bar b { color: var(--text); text-align: right; }
.olist { display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.orow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); width: 100%; text-align: left; }
.orow img { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; }
.orow .where { margin-left: auto; font-size: 13px; color: var(--cyan); font-weight: 600; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.game b { display: block; font-size: 16px; }
.game .gs { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 20px; }
.game .tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.game .tg { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--panel2); color: var(--muted); }
.game .tg.run { color: var(--pink); background: rgba(255,92,240,.12); }
.game .tg.wait { color: var(--gold); background: rgba(255,197,61,.12); }
.game .tg.bot { color: var(--cyan); background: rgba(79,240,255,.1); }
.game .warp { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); margin-top: 8px; }

.join { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin: 30px 0; align-items: center; }
.join ol { margin: 10px 0 0 20px; display: grid; gap: 8px; color: var(--muted); }
.join ol b { color: var(--text); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts div { background: var(--panel2); border-radius: 14px; padding: 14px; text-align: center; }
.facts b { display: block; font-size: 26px; }
.facts span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* owner card */
.owner { display: flex; align-items: center; gap: 18px; margin: 0 0 30px; }
.owner img { width: 96px; height: 96px; border-radius: 22px; flex: none; box-shadow: 0 0 0 3px var(--line), 0 10px 30px rgba(255,92,240,.25); }
.owner h2 { font-size: 24px; }
.owner p { font-size: 14px; }
.owner .yt { margin-left: auto; background: #ff0033; border-color: #ff0033; color: #fff; white-space: nowrap; }
@media (max-width: 620px) { .owner { flex-wrap: wrap; } .owner .yt { margin-left: 0; width: 100%; text-align: center; } }

footer { text-align: center; color: var(--text); font-size: 14px; padding: 24px 0 60px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
footer a:hover { color: var(--cyan); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--text); color: var(--bg);
  font-weight: 700; padding: 10px 16px; border-radius: 12px; pointer-events: none; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* API docs page */
.doc h1 { font-size: 38px; margin: 18px 0 6px; }
.endpoint { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; }
.endpoint .path { font-family: "JetBrains Mono", monospace; font-weight: 700; }
.endpoint .path em { color: var(--pink); font-style: normal; }
.get { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: rgba(74,222,128,.15); color: var(--green); margin-right: 8px; }
.endpoint p { color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.try { display: flex; gap: 8px; flex-wrap: wrap; }
.try input { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none; min-width: 0; }
.try button { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.try button:hover { border-color: var(--cyan); }
pre { background: #070a16; border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow: auto; font-family: "JetBrains Mono", monospace;
  font-size: 13px; color: #cfe8ff; margin-top: 10px; max-height: 360px; }
pre:empty { display: none; }
code { font-family: "JetBrains Mono", monospace; background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

@media (max-width: 980px) {
  .live { grid-template-columns: 1fr 1fr; }
  .boards, .split, .join { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hbtns { width: 100%; } .hb { flex: 1; text-align: center; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .tile b { font-size: 28px; }
  .bar { grid-template-columns: 90px 1fr 30px; }
  .big { width: 100%; } .bed { width: 100%; }
}
