:root {
  --bg: #0b0c10;
  --panel: rgba(28, 30, 36, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f2f3f5;
  --text-2: rgba(242, 243, 245, 0.62);
  --accent-1: #5b8cff;
  --accent-2: #36d1c4;
  --ok: #34c77b;
  --warn: #f5a524;
  --danger: #ff5d5d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }

video {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #000; outline: none;
  cursor: default;
}
body.live video { cursor: none; }
body.live.show-cursor video { cursor: default; }

.panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px)); padding: 28px 24px 22px;
  background: var(--panel); border: 0.5px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.panel[hidden] { display: none; }
.panel.small { padding: 22px; gap: 12px; }
.logo {
  width: 56px; height: 56px; border-radius: 15px; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  position: relative;
}
.logo::after {
  content: ""; position: absolute; left: 20px; top: 18px; width: 12px; height: 12px;
  border: solid #fff; border-width: 0 4px 4px 0; transform: rotate(-45deg); border-radius: 2px;
}
h1 { margin: 0; font-size: 22px; font-weight: 650; }
.sub { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; }
form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
input[type="password"] {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 0.5px solid var(--line);
  background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; font-size: 14px; outline: none;
}
input[type="password"]:focus { border-color: var(--accent-1); }
.check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); justify-content: center; }
.primary {
  height: 40px; border-radius: 10px; font-weight: 600; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}
.primary:hover { filter: brightness(1.08); }
.error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.error[hidden] { display: none; }
.hint { color: var(--text-2); font-size: 11.5px; margin: 14px 0 0; line-height: 1.45; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11px; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}
.panel.small.stopped .spinner { display: none; }
#status-text { margin: 0; font-size: 14px; line-height: 1.45; }
#retry { width: 100%; }
#retry[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

#bar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px;
  background: var(--panel); border: 0.5px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  font-size: 12.5px; white-space: nowrap; z-index: 2;
  transition: opacity 200ms, transform 200ms;
}
#bar[hidden] { display: none; }
#bar.away { opacity: 0; transform: translate(-50%, -14px); pointer-events: none; }
#bar button {
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
}
#bar button:hover { background: rgba(255, 255, 255, 0.16); }
#bar button.on { background: rgba(91, 140, 255, 0.35); }
#leave { color: var(--danger); }
#host-name { font-weight: 600; }
.stats { color: var(--text-2); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot.warn { background: var(--warn); }

@media (max-width: 640px) {
  .stats { display: none; }
}
