/* Horizon op de telefoon. Dezelfde warme donkere basis als de beheerpagina en de app; wit is de hoofdknop, glas voor wat
   over beeld zweeft. Formaten als witte, iets doorzichtige logo's: geen bliksem, geen "P5". */
:root {
  --bg: #0d0a08;
  --card: #1b1612;
  --card-2: #241d18;
  --line: #2c241d;
  --text: #f3ece6;
  --muted: #a99d91;
  --faint: #6f655c;
  --glass: rgba(27, 22, 18, 0.62);
  --accent: #c8794a;
  --ok: #e9e2da;
  --warn: #e0a35a;
  --bad: #e58b7c;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
img { display: block; }
[hidden] { display: none !important; }

/* MARK: Binnenkomen */

.gate {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(32px + var(--safe-top)) 28px calc(32px + var(--safe-bottom));
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(200, 121, 74, 0.16), transparent 60%),
    var(--bg);
}
.gate .mark { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.gate h1 { font-size: 30px; letter-spacing: -0.02em; margin: 20px 0 4px; }
.gate p { color: var(--muted); margin: 0 0 28px; text-align: center; }
.gate form { width: 100%; max-width: 340px; display: grid; gap: 12px; }
.field {
  width: 100%; height: 50px; border-radius: 14px; padding: 0 16px;
  background: var(--card); border: 1px solid var(--line); outline: none;
}
.field:focus { border-color: #5a4b3e; }
.error { color: var(--bad); min-height: 22px; font-size: 14px; text-align: center; margin: 0; }

.profiles { display: flex; flex-wrap: wrap; gap: 26px; justify-content: center; max-width: 360px; }
.profile { display: grid; justify-items: center; align-content: start; align-self: start; gap: 10px; width: 92px; }
.face {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 700; color: #14100d;
  box-shadow: inset 0 -6px 18px rgba(0,0,0,.18), 0 8px 26px rgba(0,0,0,.4);
}
.profile span { font-weight: 600; }
.profile small { color: var(--muted); font-size: 12px; margin-top: -8px; }
.pin { display: flex; gap: 12px; justify-content: center; margin: 8px 0 4px; }
.pin i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pin i.on { background: var(--text); border-color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; margin-top: 18px; }
.keys button { height: 72px; border-radius: 50%; background: var(--card); font-size: 26px; font-weight: 500; }
.keys button:active { background: var(--card-2); }

/* MARK: Pillen */

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: #fff; color: #14100d; font-weight: 650;
  transition: transform .12s ease, opacity .12s ease;
}
.pill:active { transform: scale(.97); }
.pill[disabled] { opacity: .5; }
.pill.ghost { background: rgba(255,255,255,.1); color: var(--text); }
.pill.small { height: 34px; padding: 0 14px; font-size: 14px; }
.pill svg { width: 18px; height: 18px; }

/* MARK: Bovenbalk en tabbladen */

.top {
  position: sticky; top: 0; z-index: 5;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: linear-gradient(var(--bg) 70%, rgba(13,10,8,0));
}
.brand { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.brand b { font-size: 24px; letter-spacing: -0.02em; }
.me {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #14100d;
}
.search { position: relative; margin-top: 8px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); opacity: .55; }
.search .field { padding-left: 42px; padding-right: 44px; height: 46px; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; opacity: .6; }
.row { position: relative; display: flex; gap: 8px; align-items: center; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; background: var(--card); border-radius: 999px; padding: 3px; }
.seg button { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--muted); font-weight: 600; }
.seg button.on { background: rgba(255,255,255,.14); color: var(--text); }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600;
}
.chip.on { background: #fff; color: #14100d; }

main { padding: 4px 16px calc(96px + var(--safe-bottom)); }
.hint { color: var(--muted); text-align: center; margin: 56px 24px; }
.hint b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

.tabs {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); z-index: 6;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.07); box-shadow: 0 12px 34px rgba(0,0,0,.45);
}
.tabs button { white-space: nowrap; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: rgba(255,255,255,.14); color: var(--text); }
.tabs svg { width: 20px; height: 20px; }

/* MARK: Posters */

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.tile { text-align: left; min-width: 0; display: flex; flex-direction: column; align-self: start; }
.poster {
  width: 100%; aspect-ratio: 2 / 3; border-radius: 10px; object-fit: cover;
  background: var(--card); box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.tile:active .poster { transform: scale(.97); }
.tile .name { margin-top: 7px; font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .sub { font-size: 12px; color: var(--muted); }
.tile .sub.rule { color: var(--text); opacity: .7; }
.section-title { font-size: 20px; font-weight: 700; margin: 18px 0 12px; letter-spacing: -0.01em; }
.skeleton .poster { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* MARK: Titel */

.title-page {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--bg);
  animation: slide-in .22s ease-out;
  overscroll-behavior: contain;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.hero { position: relative; aspect-ratio: 16 / 10; max-height: 56vh; width: 100%; overflow: hidden; background: var(--card); }
.hero img.backdrop { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,10,8,.35) 0%, rgba(13,10,8,0) 30%, rgba(13,10,8,.2) 60%, var(--bg) 100%); }
.back {
  position: fixed; top: calc(12px + var(--safe-top)); left: 14px; z-index: 12;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.back svg { width: 20px; height: 20px; }
.head { padding: 0 20px; margin-top: -64px; position: relative; z-index: 2; }
.head .logo { max-width: 72%; max-height: 92px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 4px 18px rgba(0,0,0,.6)); }
.head h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.meta { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.actions { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; }
.rule-line { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.overview { color: #d9d0c7; font-size: 15px; margin: 16px 0 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.overview.open { -webkit-line-clamp: unset; }
.body { padding: 0 20px calc(40px + var(--safe-bottom)); }

/* MARK: Versies */

.versions-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 4px; }
.versions-head h2 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.versions-head button { color: var(--muted); font-size: 14px; }
.best { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.best b { color: var(--text); font-weight: 600; }
.versions { display: grid; gap: 8px; }
.version {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--card);
}
.version.ready { background: var(--card-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.55); color: rgba(255,255,255,.88);
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.badge.res { text-transform: none; }
.badge.solid { background: rgba(255,255,255,.88); color: #14100d; border-color: transparent; }
.badge.dv { font-style: italic; letter-spacing: .02em; text-transform: none; font-weight: 800; font-size: 12px; }
.badge.warn { border-color: rgba(224,163,90,.7); color: var(--warn); }
.version .label { grid-column: 1; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version .side { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 4px; }
.version .size { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.state svg { width: 16px; height: 16px; }
.state.ready { color: var(--ok); }
.legend { color: var(--faint); font-size: 12px; margin: 12px 2px 0; }
.loading { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; padding: 14px 2px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { color: var(--muted); background: var(--card); border-radius: 14px; padding: 14px; font-size: 14px; }

/* MARK: Serie */

.seasons { margin-top: 24px; }
.episodes { display: grid; gap: 2px; margin-top: 12px; }
.episode { border-radius: 14px; }
.episode > button { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px 4px; text-align: left; }
.episode > button > span:nth-child(2) { min-width: 0; }
.episode .nr { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.episode .ep-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode .when { color: var(--muted); font-size: 12px; }
.episode .chev { width: 16px; height: 16px; opacity: .45; transition: transform .2s; }
.episode.open .chev { transform: rotate(90deg); }
.episode.later { opacity: .5; }
.episode .inner { padding: 0 0 14px 44px; }
.episode.next .nr { color: var(--text); }

/* MARK: Venster onderin */

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88dvh; overflow-y: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  background: rgba(32, 26, 21, .9); backdrop-filter: blur(28px) saturate(1.5); -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border-top: 1px solid rgba(255,255,255,.08);
  animation: up .24s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 640px) { .sheet { left: 50%; width: 520px; transform: translateX(-50%); bottom: 24px; border-radius: 26px; } }
@keyframes up { from { transform: translateY(30%); opacity: 0; } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 14px; }
.sheet h3 { font-size: 21px; margin: 0; letter-spacing: -0.01em; }
.sheet .q { color: var(--muted); margin: 4px 0 16px; font-size: 15px; }
.sheet .row { margin-top: 8px; }
.options { display: grid; gap: 6px; margin-top: 16px; }
.option { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left; padding: 13px 14px; border-radius: 14px; background: rgba(255,255,255,.06); }
.option:active { background: rgba(255,255,255,.12); }
.option b { display: block; font-size: 16px; }
.option small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.option svg { width: 20px; height: 20px; }
.option.danger b { color: var(--bad); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 6px; text-align: left; font-weight: 600; }
.menu-item .face { width: 40px; height: 40px; font-size: 17px; box-shadow: none; }
.menu-item.out { color: var(--bad); }
.menu-item svg { width: 20px; height: 20px; margin-left: auto; flex: none; }
.tile svg, .version svg, .actions svg { flex: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 14px;
  background: rgba(243,236,230,.95); color: #14100d; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: up .2s ease-out;
}
