:root {
  color-scheme: dark;
  --bg: #05070c;
  --bg2: #0b0f18;
  --panel: rgba(16, 21, 32, 0.78);
  --panel2: rgba(8, 12, 20, 0.92);
  --line: rgba(255,255,255,.09);
  --text: #f5f7fb;
  --muted: #8e98aa;
  --accent: #5c7cff;
  --accent2: #8d5cff;
  --danger: #ff5d6c;
  --ok: #34d399;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(92,124,255,.14), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(141,92,255,.10), transparent 30%),
    linear-gradient(180deg, #070a11 0%, var(--bg) 100%);
  color: var(--text);
}

button, input { font: inherit; }
a { color: inherit; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: #9fb0ff; font-size: 11px; letter-spacing: .18em; font-weight: 800; }

.topbar {
  height: 68px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: rgba(5,7,12,.78); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand-mark {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; font-weight: 900; font-size: 25px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 12px 34px rgba(92,124,255,.28);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }

.shell { width: min(1240px, calc(100% - 32px)); margin: 26px auto 48px; }
.hero-card { border-radius: 24px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hero-card h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.035em; }
.hero-card p { margin: 0; }
.status-cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.badge.live { color: #a7f3d0; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.badge.offline { color: #c5cad4; background: rgba(255,255,255,.035); }
.badge.neutral { color: #c8d0ff; background: rgba(92,124,255,.08); }

.grid.two { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 18px; margin-top: 18px; }
.panel { border-radius: 22px; padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 16px; }
.video-frame, .cinema-screen { position: relative; border-radius: 18px; overflow: hidden; background: #020307; border: 1px solid rgba(255,255,255,.07); }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame video, .cinema-screen video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; text-align: center; padding: 24px; color: var(--muted); }
.video-placeholder strong { color: var(--text); font-size: 18px; }
.video-placeholder[hidden] { display: none; }
.screen-icon { font-size: 44px; color: #8195ff; text-shadow: 0 0 28px rgba(92,124,255,.42); }
.actions { display: flex; gap: 10px; margin-top: 14px; }

.btn {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; color: var(--text); cursor: pointer; background: rgba(255,255,255,.04);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255,255,255,.18); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn.primary { background: linear-gradient(135deg, #526fff, #7358f6); border-color: rgba(142,159,255,.4); box-shadow: 0 10px 28px rgba(82,111,255,.2); }
.btn.danger { background: rgba(255,93,108,.10); color: #ff9ca7; border-color: rgba(255,93,108,.25); }
.btn.ghost { background: rgba(255,255,255,.03); }

.info-list { display: grid; gap: 8px; }
.info-list > div { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.info-list span { color: var(--muted); font-size: 12px; }
code { color: #cad3ff; overflow-wrap: anywhere; }
.notice { margin-top: 16px; padding: 14px; border-radius: 14px; background: rgba(92,124,255,.075); border: 1px solid rgba(92,124,255,.16); color: #b8c2da; line-height: 1.55; font-size: 13px; }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); border-radius: 24px; padding: 30px; }
.auth-card h1 { margin: 18px 0 8px; font-size: 28px; }
.auth-card .muted { line-height: 1.55; }
.stack { display: grid; gap: 10px; margin-top: 24px; }
.stack label { font-size: 12px; color: #bbc4d6; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #090d15; color: var(--text); padding: 13px 14px; outline: none; }
input:focus { border-color: rgba(92,124,255,.6); box-shadow: 0 0 0 3px rgba(92,124,255,.10); }
.text-link { display: inline-block; margin-top: 18px; color: #aebaff; text-decoration: none; font-size: 13px; }
.alert { padding: 11px 13px; border-radius: 12px; margin-top: 18px; font-size: 13px; }
.alert.error { background: rgba(255,93,108,.10); color: #ffb1b9; border: 1px solid rgba(255,93,108,.2); }

.viewer-body { overflow: hidden; }
.viewer-shell { height: calc(100vh - 68px); padding: 16px; }
.cinema { height: 100%; border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cinema-screen { flex: 1; min-height: 0; }
.viewer-placeholder { background: radial-gradient(circle at 50% 40%, rgba(92,124,255,.08), transparent 32%); }
.viewer-placeholder .btn { margin-top: 8px; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; min-height: 42px; }

@media (max-width: 820px) {
  .topbar { padding: 0 16px; }
  .shell { width: min(100% - 20px, 1240px); margin-top: 10px; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .grid.two { grid-template-columns: 1fr; }
  .viewer-shell { padding: 8px; }
  .cinema { border-radius: 16px; padding: 8px; }
  .viewer-topbar .brand-row span { display: none; }
}
