:root{
  --bg:#0b1020;
  --panel:#121a33;
  --card:#0f1730;
  --card2:#101b3a;
  --text:#e9eeff;
  --muted:#aab3d6;
  --accent:#6aa6ff;
  --accent2:#9cffd0;
  --danger:#ff4d6d;
  --line:rgba(255,255,255,.08);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background: radial-gradient(1200px 700px at 10% 0%, rgba(106,166,255,.18), transparent 50%),
              radial-gradient(900px 600px at 85% 10%, rgba(156,255,208,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(10,14,28,.65);
  backdrop-filter: blur(10px);
  position: sticky;
  top:0;
  z-index:10;
}
.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:40px;height:40px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(106,166,255,.9), rgba(156,255,208,.75));
  color:#061022;
  font-weight:800;
}
.title{ font-weight:800; letter-spacing:.2px; }
.subtitle{ color:var(--muted); font-size:12px; margin-top:2px; }
.topbarRight{ display:flex; gap:12px; align-items:center; }
.link{ color:var(--muted); text-decoration:none; padding:8px 10px; border-radius:10px; border:1px solid transparent; }
.link:hover{ border-color: var(--line); color:var(--text); }

.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:14px;
  padding:14px;
  max-width: 1400px;
  margin:0 auto;
}
.layout.single{ grid-template-columns: 1fr; max-width: 980px; }
.panel{
  background: rgba(18,26,51,.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel.play{ padding: 12px; }

h2{ margin:4px 0 12px; }
.card{
  background: linear-gradient(180deg, rgba(16,27,58,.9), rgba(10,14,28,.55));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
@media (max-width: 1100px){
  .layout{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }
}

.field{ display:grid; gap:6px; margin:10px 0; }
.field span{ color:var(--muted); font-size:12px; }
input{
  padding:10px 10px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,10,20,.65);
  color: var(--text);
  outline: none;
}
input:focus{ border-color: rgba(106,166,255,.5); box-shadow: 0 0 0 3px rgba(106,166,255,.12); }

.btn{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,.09); }
.btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}
.btn.primary{
  border-color: rgba(106,166,255,.55);
  background: linear-gradient(135deg, rgba(106,166,255,.26), rgba(156,255,208,.16));
}
.btn.small{ padding:8px 10px; border-radius: 10px; font-size: 13px; }

.hint{ color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.3; }

.netBox{ margin-top: 12px; }
.statusLine{ display:flex; align-items:center; gap:8px; color: var(--muted); }
.dot{ width:10px;height:10px;border-radius:999px; background: rgba(255,255,255,.2); }
.dot.on{ background: rgba(156,255,208,.95); box-shadow: 0 0 0 4px rgba(156,255,208,.14); }
.error{ color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
.hidden{ display:none !important; }

.lobbyHeader{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.k{ color:var(--muted); font-size: 12px; margin-top: 10px; }
.code{ font-weight: 900; font-size: 24px; letter-spacing: 3px; }
.players{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 8px; }
.playerTag{ display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.18); }
.swatch{ width:12px;height:12px;border-radius:999px; }
.host{ font-size: 11px; color: rgba(156,255,208,.95); border:1px solid rgba(156,255,208,.25); padding:2px 6px; border-radius: 999px; }

.scoreboard{ display:grid; gap:6px; margin-top: 8px; }
.scoreRow{ display:flex; justify-content:space-between; align-items:center; padding:8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.14); }
.scoreRow b{ display:flex; align-items:center; gap:8px; }

.playHeader{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 10px; }
.round{ color: var(--muted); font-size: 12px; }
.map{ font-weight: 800; }
.hud{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.pill{ padding:7px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.16); font-size: 13px; }

.canvasWrap{ position: relative; }
canvas{
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: radial-gradient(900px 500px at 30% 20%, rgba(106,166,255,.09), transparent 55%),
              radial-gradient(800px 450px at 70% 30%, rgba(156,255,208,.06), transparent 55%),
              rgba(5,7,14,.55);
}
.overlay{
  position:absolute; inset: 0;
  display:grid; place-items:center;
  pointer-events:none;
}
.overlayCard{
  pointer-events:auto;
  width:min(520px, 92%);
  background: rgba(10,14,28,.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.overlayTitle{ font-weight: 900; font-size: 18px; }
.overlayText{ color: var(--muted); margin-top: 6px; line-height: 1.35; }
.overlayActions{ display:flex; gap:8px; margin-top: 12px; flex-wrap:wrap; }

.controls{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top: 10px; }
.controlGroup{ flex: 1; min-width: 280px; padding: 10px; border:1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.14); }
.row{ display:flex; gap:8px; flex-wrap:wrap; margin-top: 8px; }
.eventInfo{ color: var(--muted); font-size: 13px; margin-top: 8px; }

.bullets{ margin:8px 0 0; color: var(--text); line-height: 1.45; }
.p{ color: var(--muted); line-height: 1.5; }
