:root {
  color-scheme: dark;
  --bg: #0a0d13;
  --panel: #11151d;
  --panel-2: #161b25;
  --line: #252c3a;
  --text: #e8ecf5;
  --muted: #8d97a9;
  --accent: #7c9cff;
  --accent-2: #5b7cfa;
  --ok: #53c58a;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 70% -10%, #1a2336 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button { font: inherit; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 19, .82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .2px; font-size: 18px; }
.brand span { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.status { color: var(--muted); font-size: 13px; }
.status.live { color: var(--ok); }
.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: #3a4458; }
.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 92px);
}
.library {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.library-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.library-head h1 { font-size: 16px; margin: 0; }
.count { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.files { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; }
.file {
  text-align: left;
  width: 100%;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}
.file:hover { border-color: #384258; }
.file.active { border-color: var(--accent); background: #1a2236; }
.file .name { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.file:disabled { opacity: .55; cursor: default; }
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.hint code { color: #b9c6e8; }
.stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.video-wrap {
  position: relative;
  flex: 1;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
#player { width: 100%; height: 100%; max-height: calc(100vh - 190px); object-fit: contain; background: #000; }
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 14, .78);
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }
.overlay-card {
  width: min(420px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
}
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; margin: 0 0 8px; }
.overlay-card h2 { margin: 0 0 8px; font-size: 21px; }
.overlay-card p { color: var(--muted); margin: 0 0 16px; }
.primary {
  background: var(--accent-2);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}
.primary:hover { background: #6d8cff; }
.underbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
#nowPlaying { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--muted); }
.role.host { color: var(--accent); border-color: #3b4f86; }
.footer {
  height: 36px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: 10px; }
  .library { max-height: 230px; }
  .video-wrap { min-height: 240px; }
  #player { max-height: 52vh; }
  .top-actions .ghost { display: none; }
}
