:root {
  --bg: #0b1020;
  --panel: rgba(12, 18, 36, .82);
  --line: rgba(255, 255, 255, .09);
  --text: #e8ecf6;
  --muted: #8f9ab3;
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5d6c;
  --gold: #f5c451;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 Inter, system-ui, sans-serif; overflow: hidden; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }

#labels { position: fixed; inset: 0; pointer-events: none; }
.lbl { position: absolute; transform: translate(-50%, -100%); white-space: nowrap;
  background: rgba(10, 14, 28, .85); border: 1px solid rgba(245, 196, 81, .55);
  color: #fff; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600;
  pointer-events: auto; cursor: pointer; transition: opacity .2s; }
.lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.lbl.hq { border-color: var(--gold); font-size: 13px; }
.lbl .st { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; box-shadow: 0 0 8px var(--ok); }
.lbl.alert .st { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.lbl.flash { border-color: #fff; box-shadow: 0 0 18px rgba(255, 255, 255, .5); }

.top { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 18px; align-items: center;
  padding: 12px 18px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
.brand { font-weight: 700; letter-spacing: .02em; }
.brand .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold);
  margin-right: 8px; box-shadow: 0 0 10px var(--gold); }
.place { color: var(--muted); }
.mode { margin-left: auto; margin-right: 330px; font-size: 12px; color: var(--warn);
  border: 1px solid rgba(255, 181, 71, .4); padding: 2px 8px; border-radius: 20px; }

.panel { position: fixed; top: 12px; right: 12px; bottom: 12px; width: 310px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; backdrop-filter: blur(10px);
  display: flex; flex-direction: column; min-height: 0; }
.panel h3 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 11px; }
.svc { list-style: none; margin: 0; padding: 0; }
.svc li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.svc li:hover { background: rgba(255, 255, 255, .05); }
.svc i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.svc li.alert i { background: var(--bad); }
.svc em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.feed li { padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 12px; animation: in .4s ease; }
.feed li b { color: var(--gold); font-weight: 600; }
.feed li.alert b { color: var(--bad); }
.feed time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }

.room-bar { position: fixed; top: 54px; left: 18px; display: flex; gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.room-bar[hidden] { display: none; }
.room-bar button { background: var(--gold); color: #1b1606; border: 0; border-radius: 7px; padding: 7px 12px;
  font: 600 13px Inter, sans-serif; cursor: pointer; }
.room-bar span { display: block; color: var(--muted); font-size: 12px; }

.tip { position: fixed; max-width: 280px; background: rgba(10, 14, 28, .95); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; z-index: 5; }
.tip b { display: block; margin-bottom: 2px; }
.tip[hidden] { display: none; }
.hint { position: fixed; left: 18px; bottom: 14px; color: var(--muted); font-size: 12px; background: var(--panel); padding: 5px 10px; border-radius: 8px; }

@media (max-width: 760px) {
  .panel { top: auto; left: 8px; right: 8px; width: auto; height: 38vh; bottom: 8px; }
  .mode { margin-right: 0; }
  .place, .hint { display: none; }
}
