:root {
  --bg: #101216;
  --panel: #181b21;
  --panel-2: #21252d;
  --line: #2c313b;
  --text: #f1f2f4;
  --muted: #9aa1ad;
  --accent: #f2b632;
  --accent-ink: #1a1405;
  --danger: #ff7a6b;
  --ok: #6fd08c;
  --hover-line: #454c59;
  --hover: #2c323d;
  --plot: #c9cdd4;
  --current: #3a3220;
  --toast: #2d323c;
  --accent-text: var(--accent);
  --radius: 10px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-lg: 14px;
  --rail: 76px;
  --tabbar: 58px;
  --vh: 1dvh; /* schermhoogte; op de tv gecorrigeerd voor de tekstgrootte */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
#app { height: calc(100 * var(--vh)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.filled { fill: currentColor; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.error { color: var(--danger); }

/* Formulieren */
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  /* 16px voorkomt dat iOS inzoomt zodra je in een veld tikt. */
  font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.form { display: grid; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-weight: 600;
}
.btn:hover { border-color: var(--hover-line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.compact { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.on { color: var(--accent); }

/* Inlogscherm */
.auth { min-height: calc(100 * var(--vh)); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.auth-card { width: min(380px, 100%); display: grid; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand img { width: 34px; height: 34px; }

/* Hoofdindeling */
.shell {
  height: calc(100 * var(--vh));
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "nav stage" "nav view";
}
.nav {
  grid-area: nav;
  display: flex; flex-direction: column; gap: 4px;
  padding: calc(10px + var(--safe-t)) 6px 10px calc(6px + var(--safe-l));
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.nav .logo { width: 34px; height: 34px; margin: 2px auto 12px; }
.nav a {
  display: grid; justify-items: center; gap: 3px;
  padding: 9px 2px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nav .bottom { margin-top: auto; }
.view { grid-area: view; min-width: 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page { padding: 16px; padding-right: calc(16px + var(--safe-r)); max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 44px; }

/* Speler */
.stage { grid-area: stage; display: none; background: #000; min-width: 0; }
.stage.active { display: flex; flex-direction: column; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: calc(56 * var(--vh)); margin: 0 auto; background: #000; }
video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-msg {
  position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 12px;
  padding: 20px; text-align: center; background: rgba(0, 0, 0, .72); z-index: 2;
}
.video-msg.show { display: grid; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.close-video { display: none; position: absolute; z-index: 3; top: calc(6px + var(--safe-t)); right: calc(6px + var(--safe-r)); background: rgba(0, 0, 0, .55); color: #fff; }
.now-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.now-bar .title { font-weight: 650; }
.stage-info { display: none; }
.tv-hint, .tv-progress, .tv-controls { display: none; }
.schedule-item { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.schedule-item:first-child { border-top: 0; }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters select { flex: 0 1 42%; min-width: 0; }
.filters input { flex: 1 1 58%; min-width: 0; }
.filters.three { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters.three input { grid-column: 1 / -1; }
.browse { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.groups { display: none; }

/* Zenderlijst */
.rows { display: grid; gap: 2px; }
.row {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 62px; padding: 7px 4px 7px 8px;
  border-radius: var(--r-sm); text-align: left;
  content-visibility: auto; contain-intrinsic-size: auto 62px;
}
.row:hover { background: var(--panel); }
.row.playing { background: color-mix(in srgb, var(--accent) 11%, transparent); box-shadow: inset 3px 0 var(--accent); }
.row-main { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; text-align: left; }
.logo-box { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); font-weight: 700; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.row .name { font-weight: 600; }
.row .sub { color: var(--muted); font-size: 13px; }
.meter { height: 3px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* Films en series */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 14px 10px; }
.poster { text-decoration: none; display: block; min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 230px; }
.poster .art { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-sm); background: var(--panel-2); overflow: hidden; display: grid; place-items: center; padding: 8px; color: var(--muted); text-align: center; font-size: 13px; }
.poster .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster .art .meter { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; }
.poster .label { margin-top: 6px; font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.poster:hover .art { outline: 2px solid var(--accent); }
.shelf { margin-bottom: 24px; }
.poster-sub { font-size: 12px; color: var(--muted); }
.all-heading { margin: 4px 0 12px; }
.removed-note { align-self: center; }
/* Home: rijen die je zijwaarts doorloopt */
.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 140px); gap: 12px;
  overflow-x: auto; padding: 4px 4px 8px; margin: 0 -4px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row.channels { grid-auto-columns: minmax(170px, 210px); }
.shelf-row .poster { content-visibility: visible; }
.tile { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; }
.tile:hover { border-color: var(--hover-line); }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tile .name { font-weight: 650; }
.tile .sub { font-size: 13px; color: var(--muted); }
.tile .pill { color: var(--accent); }
.shelf h2 { margin-bottom: 10px; }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.sentinel { height: 1px; }

/* Detailpagina */
.detail { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.detail .art { aspect-ratio: 2 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--panel-2); }
.detail .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.plot { color: var(--plot); max-width: 70ch; }
.seasons { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.seasons button { min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); white-space: nowrap; font-weight: 600; font-size: 14px; }
.seasons button.active { background: var(--accent); color: var(--accent-ink); }

/* Tv-gids */
.guide { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100 * var(--vh) - 150px - var(--safe-b)); background: var(--panel); -webkit-overflow-scrolling: touch; }
.guide-inner { position: relative; width: max-content; min-width: 100%; }
.guide-times, .guide-row { display: flex; }
.guide-times { position: sticky; top: 0; z-index: 3; background: var(--panel-2); height: 32px; border-bottom: 1px solid var(--line); }
.guide-corner, .guide-channel { position: sticky; left: 0; z-index: 2; width: 104px; flex: none; background: var(--panel); border-right: 1px solid var(--line); }
.guide-corner { background: var(--panel-2); z-index: 4; }
.guide-channel { display: flex; align-items: center; gap: 6px; padding: 6px; height: 58px; font-size: 12px; font-weight: 600; text-align: left; }
.guide-channel .logo-box { width: 30px; height: 30px; border-radius: 5px; }
.guide-track, .guide-scale { position: relative; flex: none; }
.guide-row { height: 58px; border-bottom: 1px solid var(--line); }
.guide-scale span { position: absolute; top: 7px; font-size: 12px; color: var(--muted); padding-left: 5px; border-left: 1px solid var(--line); }
.guide-show { position: absolute; top: 4px; bottom: 4px; padding: 5px 8px; border-radius: 5px; background: var(--panel-2); overflow: hidden; text-align: left; font-size: 12px; line-height: 1.25; }
.guide-show:hover { background: var(--hover); }
.guide-show.current { background: var(--current); }
.guide-show b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.guide-show span { color: var(--muted); }
.guide-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }

/* Instellingen */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel > h2 { margin-bottom: 12px; }
.settings { max-width: 760px; margin: 0 auto; }
.cc-btn { font-size: 12px; font-weight: 800; letter-spacing: .04em; width: auto; min-width: 40px; padding: 0 6px; }
video::cue { background: rgba(0, 0, 0, .62); color: #fff; font-size: 1.05em; line-height: 1.3; }
.theme-picker { display: grid; gap: 8px; padding: 12px 0 14px; border-top: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.swatch.active { outline: 3px solid var(--text); outline-offset: 3px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-item:first-of-type { border-top: 0; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--panel-2); border-radius: var(--r-sm); }
.tabs button { min-height: 38px; border-radius: var(--r-xs); font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.tabs button.active { background: var(--bg); color: var(--text); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.pill.ok { color: var(--ok); }
.pill.fout { color: var(--danger); }
.pill.bezig { color: var(--accent); }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 28px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(76px + var(--safe-b)); max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: var(--r-sm); background: var(--toast); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

/* Telefoon: tabbalk onderaan, speler bovenaan */
@media (max-width: 699px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "stage" "view" "nav";
  }
  .shell { padding-top: var(--safe-t); }
  .nav {
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 4px 4px calc(4px + var(--safe-b));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .nav .logo { display: none; }
  .nav a { flex: 1; padding: 6px 0; font-size: 10.5px; }
  .nav .bottom { margin-top: 0; }
  .page { padding: 12px; }
  h1 { font-size: 20px; }
  .guide { max-height: calc(100 * var(--vh) - 190px - var(--safe-b)); }
}

/* Telefoon gedraaid: de video vult het hele scherm */
@media (max-height: 520px) and (orientation: landscape) {
  .shell { padding-top: 0; }
  .stage.active { position: fixed; inset: 0; z-index: 20; }
  .stage.active .video-wrap { flex: 1; aspect-ratio: auto; max-height: none; }
  .stage.active .now-bar { display: none; }
  .close-video { display: grid; }
}

/* Schermvullend: ook het stukje naast de cameranotch is zwart */
.stage:fullscreen { background: #000; }
.stage:fullscreen .close-video { right: calc(6px + var(--safe-r)); }

/* Laptop en iPad liggend: vaste speler rechts naast de lijst */
@media (min-width: 1000px) and (min-height: 521px) {
  .shell {
    grid-template-columns: var(--rail) minmax(340px, 1fr) minmax(460px, 1.4fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "nav view stage";
  }
  .shell.idle { grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-areas: "nav view"; }
  .stage { border-left: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
  .stage.active { display: flex; }
  .video-wrap { max-height: none; background: #000; }
  .stage-info { display: block; padding: 0 16px 14px; }
  .now-bar { border-bottom: 0; }
}

/* Breed scherm: groepen als aparte kolom */
@media (min-width: 1280px) and (min-height: 521px) {
  .browse.with-groups { grid-template-columns: 220px minmax(0, 1fr); }
  .browse.with-groups .groups {
    display: grid; gap: 1px; align-content: start;
    position: sticky; top: 0; max-height: calc(100 * var(--vh) - 90px); overflow-y: auto;
  }
  .groups button { display: flex; gap: 8px; justify-content: space-between; width: 100%; padding: 8px 10px; border-radius: var(--r-xs); text-align: left; font-size: 14px; color: var(--muted); }
  .groups button:hover { background: var(--panel); color: var(--text); }
  .groups button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
  .filters.has-column .group-select { display: none; }
  .filters.three.has-column { grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
  .filters.three.has-column input { grid-column: auto; }
}

@media (min-width: 700px) {
  .posters { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
  .detail { grid-template-columns: 200px minmax(0, 1fr); gap: 22px; }
}

/* ---- Weergave: licht en OLED-zwart (de standaard is donker) */
:root[data-appearance="light"] {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #e8ebf0; --line: #d5d9e0;
  --text: #15181d; --muted: #5a6371; --plot: #2b3038;
  --hover-line: #b4bac4; --hover: #e1e5eb; --current: color-mix(in srgb, var(--accent) 22%, #fff); --toast: #22262d;
  --danger: #c4372a; --ok: #1f8a46;
  --accent-text: color-mix(in srgb, var(--accent) 62%, #000);
  color-scheme: light;
}
:root[data-appearance="light"] .nav a.active, :root[data-appearance="light"] .tile .pill,
:root[data-appearance="light"] .icon-btn.on { color: var(--accent-text); }
:root[data-appearance="oled"] {
  --bg: #000; --panel: #0b0b0c; --panel-2: #161719; --line: #232529;
  --hover: #1c1e22; --toast: #1f2125;
}

/* ---- Films en series: één kaart met een taalkeuze */
.poster .art .versions {
  position: absolute; top: 6px; right: 6px; z-index: 1; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .7); color: #fff;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.chip:hover { border-color: var(--hover-line); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-sub { font-weight: 400; font-size: 12px; opacity: .75; }
.versions-pick { display: grid; gap: 8px; margin-top: 16px; }

/* ---- Groot achtergrondbeeld op de detailpagina */
.detail-page { position: relative; }
.hero-backdrop { position: absolute; inset: 0 0 auto 0; height: min(calc(62 * var(--vh)), 520px); z-index: -1; overflow: hidden; opacity: 0; transition: opacity .5s; pointer-events: none; }
.hero-backdrop.loaded { opacity: 1; }
.hero-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.hero-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 35%, transparent), var(--bg) 92%), linear-gradient(to right, var(--bg), transparent 70%); }
.view { isolation: isolate; }

/* ---- Uitgelicht bovenaan Home */
.featured { position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 24px; min-height: 240px; display: grid; align-items: end; background: var(--panel); }
.featured > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; opacity: 0; transition: opacity .5s; }
.featured.loaded > img { opacity: 1; }
.featured::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .15) 70%), linear-gradient(to right, rgba(0, 0, 0, .6), transparent 65%); }
.featured-text { position: relative; z-index: 1; padding: 22px; display: grid; gap: 8px; justify-items: start; max-width: 640px; color: #fff; }
.featured-text h2 { font-size: 26px; }
.featured-text .muted { color: rgba(255, 255, 255, .78); }
.featured-text .pill { background: var(--accent); color: var(--accent-ink); }
.featured-plot { margin: 0; color: rgba(255, 255, 255, .88); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
@media (min-width: 700px) { .featured { min-height: 340px; } .featured-text h2 { font-size: 34px; } }

/* ---- Filterbalk met sorteren of weergaveknop */
.filters.three.with-extra { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.filters.three.with-extra input { grid-column: 1 / 3; }
.filters.with-extra:not(.three) > :last-child { flex: none; }
.layout-btn { align-self: center; }
@media (min-width: 1280px) and (min-height: 521px) {
  .filters.three.has-column.with-extra { grid-template-columns: 220px minmax(0, 1fr) auto; }
  .filters.three.has-column.with-extra input { grid-column: auto; }
}

/* ---- Live als tegels */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.live-tile { display: grid; gap: 5px; align-content: start; min-width: 0; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; content-visibility: auto; contain-intrinsic-size: auto 190px; }
.live-tile:hover { border-color: var(--hover-line); }
.live-tile.playing { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.live-tile-logo { height: 70px; border-radius: var(--r-sm); background: var(--panel-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 800; font-size: 22px; margin-bottom: 4px; }
.live-tile-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.live-tile .name { font-weight: 650; }
.live-tile .sub { font-size: 13px; color: var(--muted); }
.live-tile .next { font-size: 12px; color: var(--muted); opacity: .8; }
@media (min-width: 700px) { .live-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

/* ---- Laadblokken in de vorm van de pagina */
.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--panel-2) 25%, color-mix(in srgb, var(--panel-2) 60%, var(--line)) 45%, var(--panel-2) 65%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.skeleton .filters { display: flex; }
.sk-input { height: 44px; flex: 1; }
.sk-poster { display: grid; gap: 8px; min-width: 0; }
.sk-poster .sk-art, .detail .sk-art { aspect-ratio: 2 / 3; }
.shelf-row .sk-poster { width: 130px; }
.sk-line { height: 12px; margin: 6px 0; }
.sk-line.short { width: 55%; }
.sk-title { height: 26px; width: 40%; margin: 8px 0 16px; }
.sk-hero { height: 240px; border-radius: var(--r-lg); margin-bottom: 24px; }
.sk-row { display: flex; gap: 11px; align-items: center; padding: 8px 4px; }
.sk-logo { width: 48px; height: 48px; flex: none; }

/* ---- Verbergen: vinklijsten */
.checklist { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-xs); cursor: pointer; }
.check:hover { background: var(--panel-2); }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--accent); }
.panel details { margin-top: 10px; }
.panel details > input[type=search] { margin-top: 10px; }

/* Bestandskeuze verstopt in een knop (back-up terugzetten) */
label.btn input[type=file] { display: none; }

/* ---- Updates */
.whats-new {
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}
.whats-new b { display: block; margin-bottom: 6px; }
.update-new { padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); }
.update-new p { margin: 0 0 6px; }
.update-notes { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); max-height: 220px; overflow-y: auto; }

/* ---- Tv: wie kijkt er? */
.profiles-screen { text-align: center; }
.profiles-card { display: grid; gap: 26px; justify-items: center; width: min(1100px, 100%); }
.profiles-card .brand { justify-content: center; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.profile-tile { display: grid; justify-items: center; gap: 10px; padding: 14px; border-radius: 16px; min-width: 140px; }
.profile-tile .avatar {
  width: 110px; height: 110px; border-radius: 24px; display: grid; place-items: center;
  background: var(--c, var(--panel-2)); color: #111; font-size: 48px; font-weight: 800;
}
.profile-tile.add .avatar { background: var(--panel-2); color: var(--muted); border: 2px dashed var(--line); }
.profile-tile.add .avatar .icon { width: 44px; height: 44px; }
.profile-tile:hover .avatar { outline: 3px solid var(--accent); outline-offset: 3px; }
.profile-name { font-size: 18px; font-weight: 650; }
.profile-tile.removing .avatar { opacity: .55; }
.profile-tile.confirm .avatar { opacity: 1; outline: 3px solid var(--danger); outline-offset: 3px; }
.profile-action { font-size: 13px; color: var(--danger); font-weight: 600; }
.profile-hint { min-height: 1.4em; margin: 0; }

/* Statuspaneel voor de beheerder */
.panel h3 { font-size: 0.95rem; margin: 16px 0 4px; }
.status-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.status-row > span:last-child { text-align: right; }
.badge { font-size: 0.75rem; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft, rgba(34, 197, 94, 0.15)); color: var(--accent, #22c55e); white-space: nowrap; }

/* Melding: de server heeft een nieuwe versie, de pagina nog niet */
.update-notice { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: var(--r-lg); background: var(--panel, #1b1e24); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 32px); }

/* ---- Profielfoto's */
.avatar { display: grid; place-items: center; overflow: hidden; background: var(--c, var(--panel-2)); font-weight: 800; flex: none; }
.avatar svg { width: 100%; height: 100%; display: block; }
.list-item > .avatar { width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }
.nav .nav-profile { display: grid; place-items: center; margin: 2px auto 12px; padding: 0; border-radius: 50%; text-decoration: none; }
.nav-profile .avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
.nav-profile:hover .avatar, .nav-profile:focus-visible .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-avatar { display: contents; }
.nav .bottom .nav-avatar.mini { display: none; }
.account-avatar .avatar, .account-head > .avatar { width: 52px; height: 52px; border-radius: 50%; font-size: 24px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; max-width: 560px; }
.avatar-choice { padding: 3px; border-radius: 50%; border: 2px solid transparent; }
.avatar-choice .avatar { width: 100%; aspect-ratio: 1; border-radius: 50%; font-size: 22px; }
.avatar-choice:hover { border-color: var(--hover-line); }
.avatar-choice.active { border-color: var(--accent); }
.swatch.custom { position: relative; display: grid; place-items: center; cursor: pointer;
  background: var(--swatch, conic-gradient(#ff5f5f, #f2b632, #4ade80, #2dd4bf, #4c9dff, #a78bfa, #f472b6, #ff5f5f)); }
.swatch.custom .color-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.swatch.active { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 699px) {
  .nav .nav-profile { display: none; }
  .nav .bottom .nav-avatar.mini { display: contents; }
  .nav .bottom .nav-avatar.mini .avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 12px; }
  .nav .bottom > .icon { display: none; }
}

/* ---- Tijdelijk wachtwoord */
.temp-password { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; margin-bottom: 12px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.temp-password code { display: inline-block; margin: 6px 0; font-size: 20px; font-weight: 700; letter-spacing: 1px; user-select: all; }

/* ---- Instellingen: onderdelen */
.settings-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.settings-tabs a { text-decoration: none; color: inherit; }
.settings-sep { margin: 0 2px 0 8px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }

/* ---- Rijen met pijltjes */
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shelf-arrows { display: flex; gap: 6px; }
.shelf-arrows[hidden] { display: none; }
.shelf-arrow { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 50%; }
.shelf-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.shelf-arrow:disabled { opacity: .35; cursor: default; }
.shelf-arrow .icon { width: 18px; height: 18px; }
@media (hover: none) { .shelf-arrows { display: none; } }

/* ---- Eigen stijl (per account) */
:root[data-corners="round"] { --r-xs: 10px; --r-sm: 14px; --radius: 18px; --r-lg: 24px; }
:root[data-corners="square"] { --r-xs: 0; --r-sm: 2px; --radius: 2px; --r-lg: 2px; }
:root[data-corners="square"] .chip, :root[data-corners="square"] .pill, :root[data-corners="square"] .seasons button { border-radius: 2px; }
:root[data-buttons="pill"] .btn, :root[data-buttons="pill"] .icon-btn { border-radius: 999px; }
:root[data-buttons="outline"] .btn.primary, :root[data-buttons="outline"] .chip.active {
  background: transparent; color: var(--accent-text); border: 2px solid var(--accent); }
:root[data-buttons="outline"] .btn { border-width: 2px; }
:root[data-font="rounded"] { font-family: ui-rounded, "SF Pro Rounded", "Varela Round", "Nunito", "Trebuchet MS", sans-serif; }
:root[data-font="serif"] { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; }
:root[data-font="mono"] { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; letter-spacing: -.01em; }
:root[data-font] button, :root[data-font] input, :root[data-font] select { font-family: inherit; }
:root[data-cards="small"] .posters { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
:root[data-cards="small"] .shelf-row { grid-auto-columns: minmax(88px, 110px); }
:root[data-cards="large"] .posters { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
:root[data-cards="large"] .shelf-row { grid-auto-columns: minmax(140px, 180px); }
@media (min-width: 700px) {
  :root[data-cards="small"] .posters { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  :root[data-cards="large"] .posters { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
}
:root[data-background="gradient"] body, :root[data-background="glass"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-background="gradient"] .nav, :root[data-background="glass"] .nav { background: color-mix(in srgb, var(--panel) 70%, transparent); }
:root[data-background="glass"] .panel, :root[data-background="glass"] .tile, :root[data-background="glass"] .live-tile,
:root[data-background="glass"] .nav, :root[data-background="glass"] .btn:not(.primary), :root[data-background="glass"] .chip:not(.active) {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
/* Vervagen is zwaar voor tv's: daar alleen doorzichtig. */
body.tv .panel, body.tv .tile, body.tv .live-tile, body.tv .nav, body.tv .btn, body.tv .chip { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* ---- Terugkijken in de gids */
.guide-days { margin: 0 0 12px; flex-wrap: wrap; }
.guide-days[hidden] { display: none; }
.guide-show.past { opacity: .55; }
.guide-show.past.replay { opacity: 1; background: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); }
.guide-show.past.replay:hover { background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); }
.guide-show .icon { width: 12px; height: 12px; vertical-align: -1px; color: var(--accent); }
.guide-show .replay-start { position: absolute; right: 6px; bottom: 5px; padding: 1px 6px; border-radius: 999px; background: var(--panel); color: var(--text); font-size: 11px; font-weight: 600; }
.guide-show .replay-start:hover { background: var(--accent); color: var(--accent-ink); }
.guide-show .replay-start:hover .icon { color: inherit; }
.archive-mark { margin-left: auto; color: var(--accent); display: inline-flex; flex: none; }
.archive-mark .icon { width: 13px; height: 13px; }

/* ---- Play-knop op posters waar je mee bezig bent */
.poster-play {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgba(10, 12, 16, .62); color: #fff; border: 2px solid rgba(255, 255, 255, .85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); transition: transform .15s, background .15s, border-color .15s;
}
.poster-play .icon { width: 24px; height: 24px; margin-left: 3px; }
.poster-play:hover { transform: scale(1.12); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) {
  .poster[data-resume] .poster-play { opacity: .9; }
  .poster[data-resume]:hover .poster-play { opacity: 1; }
}
body.tv .poster-play { pointer-events: none; width: 50px; height: 50px; margin: -25px 0 0 -25px; }

/* ---- Achtergrondpatronen (volgen de kleur van je profiel)
   Elk patroon zet --pat-bg (kleur/verloop) en eventueel --pat-mask (vorm). De vorm is een SVG-masker,
   zodat de kleur gewoon uit --accent komt. Dezelfde klassen tekenen de voorbeeldtegels. */
:root { --pat-ink: color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-appearance="light"] { --pat-ink: color-mix(in srgb, var(--accent) 55%, transparent); }
[data-pattern="dots"], .pat-dots {
  --pat-bg: radial-gradient(var(--pat-ink) 2.4px, transparent 2.8px) 0 0 / 26px 26px; --pat-mask: none; }
[data-pattern="grid"], .pat-grid {
  --pat-bg: linear-gradient(var(--pat-ink) 1.5px, transparent 1.5px) 0 0 / 44px 44px, linear-gradient(90deg, var(--pat-ink) 1.5px, transparent 1.5px) 0 0 / 44px 44px;
  --pat-mask: linear-gradient(160deg, #000 20%, rgba(0,0,0,.25) 100%); }
[data-pattern="lines"], .pat-lines {
  --pat-bg: repeating-linear-gradient(135deg, var(--pat-ink) 0 1.6px, transparent 1.6px 20px);
  --pat-mask: linear-gradient(200deg, #000 20%, rgba(0,0,0,.25) 100%); }
[data-pattern="waves"], .pat-waves {
  --pat-bg: var(--pat-ink);
  --pat-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='48'%3E%3Cpath d='M0 24 C40 4 40 44 80 24 S120 4 160 24' fill='none' stroke='black' stroke-width='2.6'/%3E%3C/svg%3E") 0 0 / 160px 48px; }
[data-pattern="stars"], .pat-stars {
  --pat-bg: var(--pat-ink);
  --pat-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='black'%3E%3Cpath d='M40 30l3 9 9 3-9 3-3 9-3-9-9-3 9-3z'/%3E%3Cpath d='M160 120l2 6 6 2-6 2-2 6-2-6-6-2 6-2z'/%3E%3Cpath d='M90 180l2.5 7.5 7.5 2.5-7.5 2.5-2.5 7.5-2.5-7.5-7.5-2.5 7.5-2.5z'/%3E%3Ccircle cx='120' cy='40' r='2'/%3E%3Ccircle cx='190' cy='70' r='1.5'/%3E%3Ccircle cx='20' cy='130' r='1.8'/%3E%3Ccircle cx='70' cy='100' r='1.2'/%3E%3Ccircle cx='200' cy='190' r='2'/%3E%3Ccircle cx='140' cy='200' r='1.2'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 180px 180px; }
[data-pattern="bubbles"], .pat-bubbles {
  --pat-bg: var(--pat-ink);
  --pat-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cg fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='50' cy='60' r='28'/%3E%3Ccircle cx='180' cy='40' r='12'/%3E%3Ccircle cx='200' cy='170' r='40'/%3E%3Ccircle cx='80' cy='200' r='16'/%3E%3Ccircle cx='130' cy='120' r='6'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 260px 260px; }
[data-pattern="topo"], .pat-topo {
  --pat-bg: var(--pat-ink);
  --pat-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='M200 90c70 0 120 40 110 100s-70 110-130 100S80 240 90 180s40-90 110-90z'/%3E%3Cpath d='M200 130c45 0 75 25 68 62s-45 70-82 63-63-40-58-75 27-50 72-50z'/%3E%3Cpath d='M202 165c22 0 36 12 33 30s-22 33-40 30-30-19-27-35 12-25 34-25z'/%3E%3Cpath d='M-20 30c60-20 120 10 160-20M260 0c40 30 100 30 160 10M-20 380c70-30 140 10 200-15s110-20 240 10M0 300c20-40 10-90 -20-120M400 280c-30-50-20-110 20-140'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 400px 400px; }
[data-pattern="aurora"], .pat-aurora {
  --pat-bg:
    radial-gradient(45% 40% at 12% 8%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%),
    radial-gradient(40% 45% at 88% 32%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    radial-gradient(50% 40% at 45% 100%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%);
  --pat-mask: none; }

:root[data-pattern] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: var(--pat-bg); -webkit-mask: var(--pat-mask); mask: var(--pat-mask);
}
:root[data-pattern] #app { position: relative; z-index: 1; }

/* Voorbeeldtegels */
.pattern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; max-width: 640px; }
.pattern-choice { display: grid; gap: 6px; justify-items: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0; }
.pattern-choice .swatch-box { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--bg); border: 2px solid var(--line); overflow: hidden; }
/* Op halve grootte, zodat je in het kleine vakje meer van het patroon ziet. */
.pattern-choice .swatch-box::before { content: ""; position: absolute; left: 0; top: 0; width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0;
  background: var(--pat-bg, none); -webkit-mask: var(--pat-mask, none); mask: var(--pat-mask, none); }
.pat-none { --pat-bg: none; --pat-mask: none; }
.pattern-choice.active { color: var(--text); }
.pattern-choice.active .swatch-box { border-color: var(--accent); }
.pattern-choice:hover .swatch-box { border-color: var(--hover-line); }

/* ---- Telefoon: de pagina schuift nooit zijwaarts.
   Rijen die je wél zijwaarts veegt (posters, gids, dagen) hebben hun eigen scroll. */
.view { overflow-x: hidden; overscroll-behavior-x: none; }
html, body { overflow-x: hidden; }
/* Keuzes in Weergave: het raster mag niet breder worden dan het paneel (anders kwamen alle
   profielfoto's naast elkaar en schoof de pagina opzij). */
.theme-picker { grid-template-columns: minmax(0, 1fr); }
.theme-picker > * { min-width: 0; }
.page { min-width: 0; }

/* ---- Melding (bijv. "er kijkt iemand" bij een update) */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.modal { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); display: grid; gap: 12px; }
.modal h2 { margin: 0; }
.modal-list { margin: 0; padding: 10px 12px 10px 28px; border-radius: var(--r-sm); background: var(--panel-2); display: grid; gap: 4px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal .btn.danger { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }

/* ---- Eigen speler: knoppen over het beeld (computer, telefoon, iPhone) */
.pc { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-rows: 1fr auto; opacity: 0; transition: opacity .2s;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, .7)); color: #fff; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.pc.show, .pc.paused { opacity: 1; }
.pc:not(.show):not(.paused) { cursor: none; }
.pc:not(.show):not(.paused) .pc-bottom, .pc:not(.show):not(.paused) .pc-center > *, .pc:not(.show):not(.paused) .pc-top { pointer-events: none; }
.pc-center { position: absolute; left: 0; right: 0; top: 45%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; gap: 28px; pointer-events: none; }
.pc-center > * { pointer-events: auto; }
.pc-big { width: 68px; height: 68px; border-radius: 50%; display: none; place-items: center;
  background: rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .85); color: #fff; }
.pc.paused .pc-big { display: grid; }
/* Film of serie: de grote afspeel-/pauzeknop staat in het midden zolang de knoppen in beeld zijn. */
.pc.show:not(.live) .pc-big { display: grid; }
.pc-big.is-pause .icon { margin-left: 0; }
.pc-big .icon { width: 30px; height: 30px; margin-left: 4px; }
.pc-bottom { grid-row: 2; padding: 0 10px calc(6px + var(--safe-b)); display: grid; gap: 2px; }
.pc-line { display: flex; align-items: center; gap: 10px; }
.pc-time { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.pc-scrub-wrap { position: relative; flex: 1; height: 28px; display: grid; align-items: center; }
.pc-avail { display: none; }
/* Eén balk: gekleurd tot waar je bent, lichtgrijs tot waar de server al is, daarna donker. */
.pc-scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --played: 0%; --avail: 0%; }
.pc-scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--played), rgba(255, 255, 255, .45) var(--played) var(--avail), rgba(255, 255, 255, .18) var(--avail)); }
.pc-scrub::-moz-range-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--played), rgba(255, 255, 255, .45) var(--played) var(--avail), rgba(255, 255, 255, .18) var(--avail)); }
.pc-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.pc-scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.pc-scrub:disabled { opacity: .4; }
.pc-live { display: none; font-size: 12px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; background: #e5484d; }
.pc.live .pc-live { display: inline-block; }
.pc.live .pc-scrub-wrap, .pc.live .pc-time, .pc.live .pc-row > .pc-btn:nth-child(n+2):nth-child(-n+5), .pc.live .pc-next { display: none; }
.pc.live .pc-line { justify-content: flex-start; }
.pc-row { display: flex; align-items: center; gap: 2px; }
.pc-btn { min-width: 38px; height: 38px; padding: 0 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  color: #fff; font-size: 12px; font-weight: 700; }
@media (hover: hover) { .pc-btn:hover { background: rgba(255, 255, 255, .14); } }
.pc-btn .icon { width: 20px; height: 20px; }
.pc-btn[hidden] { display: none; }
.pc-btn.pc-cc { font-size: 13px; letter-spacing: .04em; }
.pc-btn.pc-cc.on { color: var(--accent); }
.pc-next { background: rgba(255, 255, 255, .92); color: #111; padding: 0 12px; }
.pc-next:hover { background: #fff; }
/* Volume: knop plus schuif, alleen met een muis (telefoons en tv's hebben eigen volumeknoppen). */
.pc-volume { display: inline-flex; align-items: center; }
.pc-vol { -webkit-appearance: none; appearance: none; width: 80px; height: 28px; margin: 0 6px 0 2px; padding: 0; border: 0; min-height: 0; box-shadow: none;
  background: transparent; cursor: pointer; --vol: 100%; }
.pc-vol:focus { outline: none; border: 0; box-shadow: none; background: transparent; }
.pc-vol::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #fff 0 var(--vol), rgba(255, 255, 255, .25) var(--vol)); }
.pc-vol::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #fff 0 var(--vol), rgba(255, 255, 255, .25) var(--vol)); }
.pc-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; }
.pc-vol::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
@media (pointer: coarse) { .pc-volume { display: none; } }
@media (max-width: 420px) {
  .pc-label { display: none; }
  .pc-row { gap: 0; }
  .pc-btn { min-width: 32px; padding: 0 3px; gap: 1px; font-size: 11px; }
  .pc-btn .icon { width: 18px; height: 18px; }
  .pc-next { padding: 0 8px; }
  .pc-time { min-width: 32px; font-size: 12px; }
}
.pc-ripple { position: absolute; top: 0; bottom: 0; width: 40%; display: grid; place-items: center; font-size: 22px; font-weight: 800; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); }
.pc-ripple.left { left: 0; }
.pc-ripple.right { right: 0; }
.pc-ripple.go { animation: pc-ripple .45s ease-out; }
@keyframes pc-ripple { from { opacity: 1; } to { opacity: 0; } }
.pc-next-card { position: absolute; right: 12px; bottom: 96px; z-index: 2; display: grid; gap: 6px; max-width: min(320px, calc(100% - 24px)); padding: 12px 14px;
  border-radius: var(--r-sm); background: rgba(16, 18, 22, .92); border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.pc-next-card[hidden] { display: none; }
.pc-next-card b { font-size: 15px; }
.pc-next-actions { display: flex; gap: 8px; margin-top: 4px; }
/* Schermvullend binnen de pagina (iPhone): de speler bedekt het hele scherm */
.stage.pseudo-fs { position: fixed; inset: 0; z-index: 30; }
.stage.pseudo-fs .video-wrap { flex: 1; aspect-ratio: auto; max-height: none; }
.stage.pseudo-fs .now-bar, .stage.pseudo-fs .stage-info { display: none; }
/* Volledig scherm in de browser: alleen beeld en de knoppen die vanzelf verdwijnen, geen vaste balk eronder. */
.stage:fullscreen .now-bar, .stage:fullscreen .stage-info { display: none; }
.stage.pseudo-fs .close-video, .stage:fullscreen .close-video { display: grid; }
.stage:fullscreen .video-wrap { flex: 1; aspect-ratio: auto; max-height: none; }
.pc.counting .pc-big, .pc.counting .pc-mid { display: none; }

/* ---- Compacte speler (telefoon rechtop): knoppen verdeeld over boven, midden en onder */
.pc-mid { display: none; }
.pc-top { display: none; }
.pc.compact { background: linear-gradient(rgba(0, 0, 0, .5), transparent 28%, transparent 60%, rgba(0, 0, 0, .7)); }
.pc.compact .pc-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 2px; padding: calc(4px + var(--safe-t)) 6px 0 8px; }
.stage.pseudo-fs .pc.compact .pc-top, .stage:fullscreen .pc.compact .pc-top { padding-right: 56px; }
.pc.compact .pc-center { top: 50%; gap: 22px; }
.pc.compact .pc-big { width: 58px; height: 58px; }
.pc.compact .pc-big .icon { width: 26px; height: 26px; }
.pc.compact:not(.live) .pc-mid { display: inline-flex; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.pc.compact.live.show .pc-big { display: grid; }
.pc.compact .pc-row { display: none; }
.pc.compact .pc-line { gap: 6px; }
.pc.compact .pc-line .pc-btn { min-width: 34px; }
.pc.compact .pc-next { height: 30px; padding: 0 10px; font-size: 12px; }
.pc.compact .pc-next .pc-label { display: inline; }
.pc.compact.live .pc-line > .pc-btn { margin-left: auto; }
/* Ondertitels staan al in de speler; niet nog eens in de balk eronder. */
@media (max-width: 699px) { .now-bar .cc-btn { display: none; } }
/* Het kruisje verdwijnt samen met de knoppen tijdens het afspelen; één tik haalt alles terug. */
.close-video { transition: opacity .2s; }
.pc:not(.show):not(.paused) ~ .close-video { opacity: 0; pointer-events: none; }
.pc-scrub, .pc-scrub:focus { border: 0; padding: 0; min-height: 0; box-shadow: none; outline: none; background: transparent; border-radius: 0; }

/* ---- Begroeting bovenaan Home */
.greeting { display: flex; align-items: center; gap: 16px; margin: 6px 0 26px; }
.greeting-icon { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.greeting-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.greeting h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.5px; margin: 0 0 2px; }
.greeting .muted { font-size: 15px; }
@media (max-width: 699px) { .greeting { margin-bottom: 18px; } .greeting-icon { width: 44px; height: 44px; border-radius: 13px; } .greeting-icon svg { width: 24px; height: 24px; } }

/* ---- Video altijd binnen het vlak (iPhone liggend)
   Safari rekent de hoogte van een video in een flexibel vak niet uit het vak, maar uit de breedte
   van de video. Liggend werd hij daardoor hoger dan het scherm en vielen de onderkant en de
   ondertitels weg. Daarom ligt de video precies over het vak heen. */
.video-wrap { overflow: hidden; min-height: 0; }
.video-wrap > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Compacte speler: knoppen rechtsboven op een donker plaatje, met schaduw, leesbaar op een licht beeld */
.pc-tools { display: flex; align-items: center; gap: 0; padding: 0 2px; border-radius: 999px;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pc-tools:empty { display: none; }
.pc-tools .pc-btn { height: 34px; min-width: 36px; }
.pc.compact .pc-btn .icon, .pc.compact .pc-time { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.pc.compact .pc-mid { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background: rgba(0, 0, 0, .4); }
