:root {
  --bg: #0e0d12;
  --panel: #17151d;
  --panel-2: #201d28;
  --line: #2c2836;
  --text: #f3f0f7;
  --muted: #9a93a8;
  --accent: #f5b841;
  --accent-ink: #1b1405;
  --danger: #ff7a7a;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.err { color: var(--danger); margin: 0; }

.view { min-height: 100dvh; }
.center { display: grid; place-items: center; padding: 16px; }
.card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 14px;
}
.card p { margin: 0; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.brand.small { font-size: 16px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); }
.logo::before { left: 5px; }
.logo::after { left: 13px; opacity: .6; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: #463f55; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.icon { padding: 9px; width: 40px; height: 40px; }
.btn svg, .code svg { width: 18px; height: 18px; fill: currentColor; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; justify-self: center; text-decoration: underline; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; text-transform: uppercase; letter-spacing: .15em; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.active { display: grid; gap: 8px; }
.active-title { font-size: 13px; color: var(--muted); font-weight: 600; }
.room-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.room-item:hover { border-color: var(--accent); }
.room-item .info { flex: 1; min-width: 0; display: grid; }
.room-item .info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item .info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item .rc { font-weight: 700; letter-spacing: .12em; font-size: 13px; color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5bd17a; flex: none; box-shadow: 0 0 0 3px rgba(91,209,122,.18); }
.dot.paused { background: var(--muted); box-shadow: none; }

/* kamer */
#v-room { display: flex; flex-direction: column; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.code { display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.code b { color: var(--text); letter-spacing: .15em; }
.members { margin-left: auto; display: flex; gap: 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #111; flex: none; }

.room { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.player { position: relative; background: #000; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.nowbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.now { display: grid; min-width: 0; flex: 1; }
.now b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now span { font-size: 13px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools select { padding: 8px 10px; max-width: 170px; }
.empty { flex: 1; display: grid; place-items: center; padding: 24px; text-align: center; }
.empty h2 { margin: 8px 0 4px; }
.empty p { margin: 0 0 18px; }
.big { font-size: 56px; }

.toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(20,18,26,.85); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; }
.tap-play { position: absolute; inset: auto; padding: 14px 22px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; cursor: pointer; }
.loading { position: absolute; pointer-events: none; }
.loading span { display: block; width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; bottom: 70px; font-size: 38px; animation: up 2.6s ease-out forwards; text-align: center; }
.float small { display: block; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
@keyframes up { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1); } 100% { transform: translateY(-260px) scale(1.1); opacity: 0; } }

/* chat */
.chat { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.msg .who { font-size: 12px; color: var(--muted); }
.msg .who b { color: var(--text); margin-right: 6px; }
.msg .text { word-wrap: break-word; overflow-wrap: anywhere; }
.sysmsg { text-align: center; font-size: 12px; color: var(--muted); }
.react-bar { display: flex; gap: 2px; padding: 6px 10px; border-top: 1px solid var(--line); justify-content: space-between; }
.react-bar button { background: none; border: 0; font-size: 20px; padding: 4px; border-radius: 8px; cursor: pointer; }
.react-bar button:hover { background: var(--panel-2); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }

/* volledig scherm: chat als doorzichtige kolom over de film */
#v-room:fullscreen .topbar, #v-room:fullscreen .nowbar { display: none; }
#v-room:fullscreen .room { grid-template-columns: minmax(0,1fr) 320px; }
#v-room:fullscreen .chat { background: rgba(14,13,18,.72); }
#v-room.fs-hide-chat:fullscreen .room { grid-template-columns: 1fr 0; }

/* kiezer */
.picker { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 10; }
.picker-box { width: min(1000px, 100%); height: min(760px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.picker-head { display: flex; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); align-items: center; }
.picker-head input { flex: 1; }
.tabs { display: flex; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--bg); color: var(--text); }
.picker-body { flex: 1; overflow-y: auto; padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.tile { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: grid; gap: 6px; }
.tile .poster { aspect-ratio: 2/3; border-radius: 10px; background: var(--panel-2) center/cover no-repeat; border: 1px solid var(--line); }
.tile:hover .poster { border-color: var(--accent); }
.tile .t { font-size: 13px; line-height: 1.3; }
.tile .y { font-size: 12px; color: var(--muted); }
.back { margin-bottom: 14px; }
.season { margin: 18px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.ep { display: grid; grid-template-columns: 150px 1fr; gap: 12px; background: none; border: 1px solid transparent; border-radius: 12px; padding: 6px; text-align: left; cursor: pointer; width: 100%; }
.ep:hover { border-color: var(--line); background: var(--panel-2); }
.ep .thumb { aspect-ratio: 16/9; border-radius: 8px; background: var(--panel-2) center/cover no-repeat; }
.ep .t { font-weight: 600; }
.ep .o { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note { color: var(--muted); text-align: center; padding: 30px; }

/* telefoon */
@media (max-width: 820px) {
  .room { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .player { flex: none; aspect-ratio: 16/9; }
  .stage { min-height: auto; }
  .empty { flex: none; padding: 28px 16px; }
  .chat { border-left: 0; border-top: 1px solid var(--line); }
  .hide-sm { display: none; }
  .tools select { max-width: 130px; }
  .ep { grid-template-columns: 110px 1fr; }
  .picker { padding: 0; }
  .picker-box { border-radius: 0; height: 100%; }
}
