/* KinoRoom — тёмная кинотеатральная тема */
:root {
  --bg: #0b0e14;
  --bg2: #121722;
  --panel: #161d2b;
  --line: #232c3f;
  --text: #e8ecf4;
  --muted: #8b94a7;
  --accent: #7c5cff;
  --accent2: #ff4d6d;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #1a2338 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex; flex-direction: column;
}

/* ── шапка ─────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: rgba(11,14,20,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.logo { font-weight: 700; font-size: 19px; letter-spacing: .3px; }
.logo span { color: var(--muted); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.room-chip b { color: var(--accent); font-size: 15px; letter-spacing: 1px; }

/* ── layout ────────────────────────────────────── */
main {
  flex: 1; display: grid; grid-template-columns: 1fr 330px; gap: 16px;
  padding: 16px 20px 24px; min-height: 0;
}
.stage { display: flex; flex-direction: column; min-width: 0; }
.now-title {
  min-height: 22px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px;
}
#player-wrap {
  flex: 1; background: #000; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line); position: relative; min-height: 320px;
}
#video { width: 100%; height: 100%; }

.join-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(5,8,14,.75);
}

/* ── пустой экран ──────────────────────────────── */
.empty-card {
  flex: 1; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--bg2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 40px 30px;
}
.empty-card h1 { margin: 0 0 4px; font-size: 28px; }
.empty-card p { margin: 0; color: var(--muted); max-width: 520px; }
.empty-card code { background: var(--panel); padding: 1px 6px; border-radius: 6px; }

form { display: flex; gap: 8px; width: 100%; max-width: 560px; }
input[type=text] {
  flex: 1; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px;
  outline: none; min-width: 0;
}
input[type=text]:focus { border-color: var(--accent); }

/* ── боковая панель ────────────────────────────── */
.side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px;
}
.panel h3 {
  margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 8px;
}
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 220px; }
.chat-log {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px; min-height: 120px;
}
.chat-msg { font-size: 13.5px; }
.chat-msg b { color: var(--accent); margin-right: 6px; }
.chat-msg.mine b { color: var(--accent2); }
.chat-panel form { max-width: none; }

.users-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.users-list li { padding: 3px 0; color: var(--text); }
.users-list li::before { content: "●"; color: #2ecc71; margin-right: 8px; font-size: 11px; }

.episodes-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow-y: auto;
}
.ep-btn {
  text-align: left; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-btn:hover { border-color: var(--accent); }
.ep-btn.active { border-color: var(--accent); background: rgba(124,92,255,.15); }

/* ── кнопки ────────────────────────────────────── */
.btn {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 16px; cursor: pointer; font-size: 14px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 999px; }
.btn.big { padding: 14px 26px; font-size: 17px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.join-overlay .hint { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }

/* ── toast ─────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1d2637; border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 10px; z-index: 50; max-width: 80vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 14px;
}

/* ── адаптив ───────────────────────────────────── */
@media (max-width: 960px) {
  main { grid-template-columns: 1fr; }
  .stage { min-height: 46vh; }
  .side { flex-direction: column; }
}
