html, body { height: 100%; }
[hidden] { display: none !important; }

/* ---------- Inloggen ---------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-art {
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 400px at 30% 40%, rgba(185,142,82,.28), transparent 70%),
    radial-gradient(600px 500px at 80% 90%, rgba(120,30,50,.6), transparent 70%),
    var(--velvet-2);
  border-right: 1px solid var(--line);
}
.login-art::after {
  content: 'Live'; position: absolute; left: 6%; bottom: 4%;
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(120px, 18vw, 280px); line-height: .8; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(233,215,177,.4);
}
.login-card { align-self: center; justify-self: center; width: min(420px, 100% - 32px); padding: 48px 0; }
.login-card .wordmark { display: inline-block; margin-bottom: 44px; }
.login-card h1 { font-family: var(--display); font-weight: 500; font-size: 46px; line-height: 1.02; letter-spacing: -.02em; margin: 0 0 10px; }
.login-sub { color: var(--muted); margin: 0 0 30px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span:first-child { font-size: 14px; font-weight: 600; color: #DCCFC2; }
.field input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 12px;
  background: rgba(0,0,0,.25); border: 1px solid var(--line-strong);
}
.field input:focus { outline: none; border-color: var(--champagne); box-shadow: 0 0 0 3px rgba(233,215,177,.15); }
.pw { position: relative; display: block; }
.pw input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--muted); cursor: pointer; font-size: 14px; }
.form-error { margin: 0 0 14px; color: #F09A8E; }
.form-error:empty { display: none; }
.btn-block { width: 100%; }
.login-foot { margin: 22px 0 0; color: var(--muted); font-size: 15px; }
.login-foot a { color: var(--champagne); }

/* ---------- App-layout ---------- */
.app {
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: 230px 340px 1fr;
  grid-template-rows: 68px 1fr;
  grid-template-areas: 'top top top' 'cats chans stage';
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 24px;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--velvet);
}
.topbar .wordmark { font-size: 24px; width: 210px; flex: none; }
.search { position: relative; flex: 0 1 340px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.search input:focus { outline: none; border-color: var(--champagne); }
.account-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 999px; }
.account-btn:hover { background: rgba(255,255,255,.05); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--champagne); color: #2A1519; font-weight: 700; text-transform: uppercase; }
.account-name { color: #DCCFC2; font-weight: 500; font-size: 15px; }

.cats { grid-area: cats; overflow-y: auto; border-right: 1px solid var(--line); padding: 14px 10px 40px; }
.cat-select { display: none; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list button {
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: 15px; line-height: 1.3;
  display: flex; justify-content: space-between; gap: 8px;
}
.cat-list button:hover { color: var(--ivory); background: rgba(255,255,255,.04); }
.cat-list button[aria-current='true'] { color: var(--champagne); background: rgba(233,215,177,.09); font-weight: 600; }
.cat-list small { color: rgba(168,150,143,.7); font-variant-numeric: tabular-nums; }
.cat-sep { height: 1px; background: var(--line); margin: 10px 12px; }

.channels { grid-area: chans; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.channels-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; }
.channels-head h2 { font-family: var(--display); font-weight: 500; font-size: 24px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channels-head span { color: var(--muted); font-size: 14px; flex: none; }
.chan-list { list-style: none; margin: 0; padding: 0 8px 40px; overflow-y: auto; flex: 1; }
.chan {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 10px; border-radius: 12px; border: 0; background: none; cursor: pointer; text-align: left;
}
.chan:hover { background: rgba(255,255,255,.04); }
.chan[aria-selected='true'] { background: linear-gradient(90deg, rgba(233,215,177,.16), rgba(233,215,177,.04)); box-shadow: inset 2px 0 0 var(--champagne); }
.chan-logo { flex: none; width: 52px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.06); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; }
.chan-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.chan-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-star { flex: none; width: 16px; height: 16px; fill: var(--champagne); }
.empty { padding: 40px 18px; color: var(--muted); }
.empty b { display: block; color: var(--ivory); margin-bottom: 4px; }

.stage { grid-area: stage; overflow-y: auto; padding: 22px 24px 40px; min-width: 0; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line); }
.player video { width: 100%; height: 100%; background: #000; }
.player-overlay {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 20px;
  background: radial-gradient(500px 300px at 50% 50%, rgba(120,30,50,.45), transparent), #0E0709;
}
.overlay-title { font-family: var(--display); font-size: clamp(24px, 3vw, 36px); margin: 0 0 6px; }
.overlay-sub { color: var(--muted); margin: 0; }
.overlay-err .overlay-title { color: #F09A8E; }
.player-spinner { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; border: 3px solid rgba(233,215,177,.2); border-top-color: var(--champagne); animation: spin .9s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.now { padding: 22px 4px 0; }
.now-head { display: flex; align-items: center; gap: 16px; }
.now-head img { width: 72px; height: 54px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.06); padding: 6px; }
.now-head > div { flex: 1; min-width: 0; }
.now-live { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; color: var(--live); font-weight: 600; font-size: 14px; }
.now-head h1 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; cursor: pointer; font-weight: 600; font-size: 14px; }
.fav-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--champagne); stroke-width: 1.8; stroke-linejoin: round; }
.fav-btn[aria-pressed='true'] { border-color: var(--champagne); color: var(--champagne); }
.fav-btn[aria-pressed='true'] svg { fill: var(--champagne); }

.epg { margin-top: 22px; display: grid; gap: 2px; }
.epg-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.epg-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }
.epg-title { font-weight: 600; margin: 0; }
.epg-desc { color: var(--muted); margin: 4px 0 0; font-size: 15px; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.epg-item.is-now .epg-title { color: var(--champagne); }
.epg-bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; max-width: 420px; }
.epg-bar i { display: block; height: 100%; background: var(--champagne); }
.epg-none { color: var(--muted); padding-top: 14px; border-top: 1px solid var(--line); }


/* ---------- Tabbladen ---------- */
.modes { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line); flex: none; }
.modes button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 18px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 15px; transition: background .2s, color .2s;
}
.modes button:hover { color: var(--ivory); }
.modes button[aria-current='true'] { background: var(--champagne); color: #2A1519; }
.modes .live-dot { width: 7px; height: 7px; }
.modes button[aria-current='true'] .live-dot { background: #B22D24; }

.app[data-mode='movies'], .app[data-mode='series'] {
  grid-template-columns: 230px 1fr;
  grid-template-areas: 'top top' 'cats browse';
}
.app[data-mode='movies'] .channels, .app[data-mode='movies'] .stage,
.app[data-mode='series'] .channels, .app[data-mode='series'] .stage { display: none; }
.app[data-mode='live'] .browse { display: none; }

/* ---------- Films en series: overzicht ---------- */
.browse { grid-area: browse; overflow-y: auto; min-width: 0; position: relative; }
.browse-list { padding: 0 24px 60px; }
.browse-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 22px 0 18px; }
.browse-head h2 { font-family: var(--display); font-weight: 500; font-size: 34px; letter-spacing: -.01em; margin: 0; }
.browse-head span { color: var(--muted); font-size: 14px; }
.poster-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 26px 18px; }
.poster { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; }
.poster-img {
  position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--velvet-3), var(--velvet-2));
  box-shadow: 0 0 0 1px var(--line); transition: transform .25s, box-shadow .25s;
}
.poster-img img { width: 100%; height: 100%; object-fit: cover; }
.poster-img .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; font-family: var(--display); font-size: 19px; line-height: 1.15; color: var(--champagne); }
.poster:hover .poster-img, .poster:focus-visible .poster-img { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--champagne), 0 18px 30px -18px rgba(0,0,0,.9); }
.poster-rating { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(20,9,13,.82); color: var(--champagne); font-size: 12.5px; font-weight: 700; }
.poster-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.5); }
.poster-progress i { display: block; height: 100%; background: var(--champagne); }
.poster-name { display: block; margin-top: 10px; font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.grid-more { height: 1px; }
.skeleton .poster-img { animation: shimmer 1.4s infinite; }
@keyframes shimmer { 50% { opacity: .55; } }

/* ---------- Detailpagina ---------- */
.detail { position: relative; min-height: 100%; }
.detail-backdrop {
  position: absolute; inset: 0 0 auto 0; height: 520px; background-size: cover; background-position: center 20%;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
          mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.detail-in { position: relative; padding: 18px 28px 60px; max-width: 1180px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(20,9,13,.6); cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 22px; }
.back-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-btn:hover { border-color: var(--champagne); color: var(--champagne); }
.vplayer { margin-bottom: 28px; }
.detail-main { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
.detail-poster { aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--velvet-3); box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px -30px #000; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4vw, 56px); line-height: 1.02; letter-spacing: -.02em; margin: 6px 0 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.detail-meta span { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; color: #DCCFC2; }
.detail-meta .score { border-color: var(--champagne); color: var(--champagne); font-weight: 700; }
.detail-plot { color: #DCCFC2; font-size: 17px; max-width: 64ch; margin: 0 0 18px; }
.detail-credits { margin: 0 0 24px; display: grid; gap: 6px; max-width: 64ch; }
.detail-credits div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; font-size: 15px; }
.detail-credits dt { color: var(--muted); }
.detail-credits dd { margin: 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.detail-actions .btn svg { width: 18px; height: 18px; fill: currentColor; }
.format-note { color: var(--muted); font-size: 14px; margin: 14px 0 0; max-width: 60ch; }

.episodes { margin-top: 44px; }
.season-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.season-tabs button { flex: none; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.season-tabs button[aria-selected='true'] { background: var(--champagne); border-color: var(--champagne); color: #2A1519; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep {
  display: grid; grid-template-columns: 44px 168px 1fr; gap: 18px; align-items: center; width: 100%;
  padding: 14px 10px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; text-align: left; border-radius: 0;
}
.ep:hover { background: rgba(255,255,255,.03); }
.ep[aria-current='true'] { background: rgba(233,215,177,.08); }
.ep-num { font-family: var(--display); font-size: 28px; color: var(--champagne); text-align: center; }
.ep-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--velvet-3); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-title { display: block; font-weight: 600; margin-bottom: 4px; }
.ep-plot { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 14.5px; }
.ep-dur { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.copy-link { display: inline-flex; margin-top: 16px; min-height: 44px; font-size: 15px; }
.err-detail { display: block; margin-top: 8px; font-size: 12.5px; color: rgba(168,150,143,.8); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Account ---------- */
.account { width: min(440px, 100% - 24px); padding: 0; border: 1px solid rgba(233,215,177,.35); border-radius: 24px; background: linear-gradient(170deg, #2E1B23, #1E1016); color: var(--ivory); }
.account::backdrop { background: rgba(12,5,8,.72); backdrop-filter: blur(4px); }
.account-in { position: relative; padding: 32px 28px 26px; }
.account h2 { font-family: var(--display); font-weight: 500; font-size: 32px; margin: 0 0 18px; }
.dlg-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; border-radius: 50%; }
.acc-list { margin: 0 0 24px; }
.acc-list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.acc-list dt { color: var(--muted); }
.acc-list dd { margin: 0; font-weight: 600; text-align: right; }
.acc-list .warn { color: #F0C27A; }
.acc-actions { display: grid; gap: 10px; }
.acc-help { color: var(--muted); font-size: 14px; margin: 18px 0 0; }

/* ---------- Responsief ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 300px 1fr; grid-template-areas: 'top top' 'chans stage'; }
  .app[data-mode='movies'], .app[data-mode='series'] { grid-template-columns: 1fr; grid-template-areas: 'top' 'browse'; }
  .cats { display: none; }
  .topbar .wordmark { width: auto; }
  .cat-select {
    display: block; margin: 12px 14px 0; width: calc(100% - 28px); height: 44px; padding: 0 12px;
    border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ivory);
  }
  .cat-select option { background: var(--velvet-2); }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app {
    height: auto; min-height: 100dvh;
    grid-template-columns: 1fr; grid-template-rows: auto auto auto;
    grid-template-areas: 'top' 'stage' 'chans';
  }
  .topbar { position: sticky; top: 0; z-index: 5; gap: 10px 12px; padding: 10px 14px; height: auto; flex-wrap: wrap; }
  .modes { order: 3; width: 100%; }
  .modes button { flex: 1; justify-content: center; padding: 0 8px; }
  .app[data-mode='movies'], .app[data-mode='series'] { grid-template-rows: auto 1fr; }
  .browse { overflow: visible; }
  .browse-list { padding: 0 14px 40px; }
  .browse-list .cat-select { margin: 14px 0 0; width: 100%; }
  .browse-head h2 { font-size: 28px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
  .poster-name { font-size: 13.5px; }
  .detail-in { padding: 14px 14px 40px; }
  .detail-main { grid-template-columns: 110px 1fr; gap: 18px; }
  .detail-info h1 { font-size: 28px; margin-top: 0; }
  .detail-plot { font-size: 15.5px; }
  .vplayer { margin: 0 -14px 20px; border-radius: 0; position: sticky; top: var(--topbar-h, 108px); z-index: 4; }
  .ep { grid-template-columns: 32px 110px 1fr; gap: 12px; }
  .ep-num { font-size: 22px; }
  .topbar .wordmark { font-size: 21px; }
  .search { flex: 1; }
  .account-name { display: none; }
  .stage { padding: 0; overflow: visible; }
  .player { position: sticky; top: var(--topbar-h, 108px); z-index: 4; border-radius: 0; box-shadow: none; }
  .now { padding: 16px 16px 0; }
  .now-head img { width: 56px; height: 42px; }
  .fav-btn span { display: none; }
  .fav-btn { padding: 0 12px; }
  .epg-item { grid-template-columns: 90px 1fr; gap: 12px; }
  .epg { margin-top: 14px; }
  .epg-item:nth-child(n+3) { display: none; }
  .channels { border-right: 0; border-top: 1px solid var(--line); margin-top: 12px; }
  .chan-list { overflow: visible; }
}
