/* Huisstijl Thomas Bultstra — gelijk aan de factuur-app */
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/work-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/work-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/work-sans-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f1ea;
  --ink: #15150f;
  --ink-soft: #66655a;
  --ink-faint: #9d9c8f;
  --line: #e4e2d6;
  --line-strong: #c9c7b7;
  --live: #c8321e;
  --live-soft: #fbe9e5;
  --danger: #a8341f;
  --danger-soft: #f6e4df;
  --success: #2e7d32;
  --shadow: 0 1px 2px rgba(21,21,15,.04), 0 8px 24px -12px rgba(21,21,15,.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 'Work Sans', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: 'Poppins', 'Work Sans', sans-serif; font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- kopbalk ---------- */
.masthead {
  background: #fff; border-bottom: 1px solid #e7e5d9;
  padding: 14px 28px; display: flex; align-items: center; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
.masthead .logo { height: 24px; width: auto; max-width: 300px; display: block; flex: 0 1 auto; min-width: 0; object-fit: contain; object-position: left center; }
.masthead .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.masthead .project { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead .divider { width: 1px; height: 22px; background: var(--line); flex: 0 0 auto; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- live-label ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px 4px 9px; border-radius: 20px; background: var(--surface-2); color: var(--ink-soft);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.badge.live { background: var(--live-soft); color: var(--live); }
.badge.live::before { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border-radius: 9px; padding: 10px 16px; border: 1px solid transparent;
  background: var(--ink); color: #fff; text-decoration: none;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost { background: transparent; color: var(--ink-soft); padding: 7px 11px; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); opacity: 1; }
.btn.danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn.danger:hover { background: var(--danger-soft); opacity: 1; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; padding: 13px 16px; font-size: 15px; }

/* ---------- kijken ---------- */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 28px 56px; flex: 1; }
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0e0e0b;
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #0e0e0b; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; color: #f1efe4; background: #15150f;
}
.overlay h2 { font-size: 20px; font-weight: 600; color: #fff; }
.overlay p { margin: 0; font-size: 14px; color: #a9a897; max-width: 420px; }
.overlay .icon { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid #4a4839; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.overlay .icon svg { width: 22px; height: 22px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #4a4839; border-top-color: #f1efe4; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unmute {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  background: rgba(255,255,255,.94); color: var(--ink); border: none; border-radius: 22px;
  padding: 9px 15px 9px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.unmute svg { width: 18px; height: 18px; }
.below { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 20px; flex-wrap: wrap; }
.below h1 { font-size: 24px; font-weight: 700; }
.below .sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.footer { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 18px; }

/* ---------- formulieren ---------- */
label.lbl { font-size: 12px; font-weight: 600; color: var(--ink-soft); display: block; margin: 0 0 5px; }
.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 14px; padding: 10px 12px; border-radius: 8px;
}
.input:focus { outline: none; border-color: var(--ink-faint); box-shadow: 0 0 0 3px rgba(21,21,15,.06); }
.input[readonly] { background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.field + .field { margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.code-input {
  font-family: 'Poppins', sans-serif; font-size: 30px; font-weight: 600; letter-spacing: .32em;
  text-align: center; padding: 12px 8px 12px 18px;
}
.code-input.small { font-size: 22px; padding: 8px 8px 8px 14px; }
.code-input::placeholder { color: var(--line-strong); }
.stat { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.stat b { color: var(--ink); font-weight: 600; }
.ico { width: 16px; height: 16px; }
.logo-box { display: flex; align-items: center; justify-content: center; height: 84px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: #fff; padding: 14px; margin-top: 12px; }
.logo-box img { max-height: 44px; max-width: 100%; }
.note { font-size: 12.5px; color: var(--success); opacity: 0; transition: opacity .3s; }
.note.show { opacity: 1; }
.note.bad { color: var(--danger); }

/* ---------- popups ---------- */
body.locked .page, body.locked .footer { filter: blur(6px); pointer-events: none; user-select: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(21,21,15,.38); overflow-y: auto;
}
.modal {
  width: 100%; background: var(--surface); border-radius: 16px; border: 1px solid var(--line);
  box-shadow: 0 20px 60px -20px rgba(21,21,15,.45); margin: auto;
}
.modal.login { max-width: 400px; padding: 32px 30px 26px; text-align: center; }
.modal.login .logo { height: 28px; width: auto; max-width: 100%; display: block; margin: 0 auto 24px; }
.modal.login h2 { font-size: 22px; font-weight: 700; }
.modal.login .lead { color: var(--ink-soft); font-size: 14px; margin: 8px 0 20px; }
.modal.login .code-input { margin-bottom: 14px; }
.modal.login.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.error { color: var(--danger); font-size: 13.5px; min-height: 20px; margin: 12px 0 0; }
.modal.settings { max-width: 520px; padding: 22px 24px 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; }
details.more { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: '+'; color: var(--ink-faint); font-weight: 400; font-size: 18px; line-height: 1; }
details.more[open] summary::after { content: '\2212'; }
details.more .field:first-of-type { margin-top: 12px; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 20px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 760px) {
  .masthead { padding: 12px 16px; gap: 12px; }
  .masthead .logo { height: 18px; max-width: 46vw; }
  .masthead .grow { flex: 0 0 auto; margin-left: auto; }
  .unmute { left: 10px; bottom: 10px; padding: 7px 12px 7px 10px; font-size: 12.5px; }
  .masthead .divider, .masthead .hide-sm { display: none; }
  .page { padding: 16px 12px 40px; }
  .player { border-radius: 10px; }
  .below h1 { font-size: 20px; }
  .modal.login { padding: 28px 20px 22px; }
  .modal.settings { padding: 18px 16px 14px; }
  #open-settings span { display: none; }
}

/* ---------- kijkpagina met chat ---------- */
.page.watch { max-width: 1360px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.stage { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.side-head .count { font-family: 'Work Sans', sans-serif; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); border-radius: 20px; padding: 2px 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px 4px 8px; border-radius: 20px; background: var(--surface-2); color: var(--ink); max-width: 100%; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.host { background: var(--ink); color: #fff; }
.chip.host::before { background: #fff; }
.chips .none { font-size: 13px; color: var(--ink-faint); }
.chat { display: flex; flex-direction: column; }
.messages { height: calc(100vh - 420px); min-height: 260px; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 8px; }
.messages .empty { margin: auto; color: var(--ink-faint); font-size: 13px; text-align: center; }
.msg { font-size: 14px; line-height: 1.4; position: relative; padding-right: 22px; }
.msg .meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--ink-faint); margin-bottom: 1px; }
.msg .who { font-weight: 600; color: var(--ink); font-size: 13px; }
.msg .badge-host { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; background: var(--ink); color: #fff; border-radius: 4px; padding: 1px 5px; }
.msg .text { word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine .who { color: var(--ink-soft); }
.msg .del { position: absolute; right: 0; top: 0; border: none; background: none; color: var(--ink-faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; opacity: 0; }
.msg:hover .del, .msg .del:focus { opacity: 1; }
.composer { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.composer .input { flex: 1; min-width: 0; padding: 9px 11px; }
.me { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.me b { color: var(--ink); font-weight: 600; }
.link { background: none; border: none; padding: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 13px; }
.name-input { font-size: 17px; padding: 12px 14px; text-align: center; margin-bottom: 14px; }

/* ---------- volledig scherm ---------- */
.fs {
  position: absolute; right: 14px; top: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 10px; border: none;
  background: rgba(21,21,15,.55); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.fs:hover { background: rgba(21,21,15,.8); }
.fs svg { width: 20px; height: 20px; }
.fs .fs-off { display: none; }
.player:fullscreen, .player:-webkit-full-screen { border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto; box-shadow: none; background: #000; }
.player:fullscreen .fs-on, .player:-webkit-full-screen .fs-on { display: none; }
.player:fullscreen .fs-off, .player:-webkit-full-screen .fs-off { display: block; }
.player:fullscreen video, .player:-webkit-full-screen video { object-fit: contain; background: #000; }

@media (max-width: 1000px) {
  .page.watch { grid-template-columns: 1fr; }
  .side { position: static; }
  .messages { height: 320px; max-height: none; }
}
@media (max-width: 760px) {
  .below { flex-direction: column; gap: 8px; }
  .fs { right: 10px; top: 10px; width: 34px; height: 34px; }
}
.player:fullscreen .unmute, .player:-webkit-full-screen .unmute { top: 16px; bottom: auto; left: 16px; }
