:root { --bg:#0b0d10; --panel:#151a20; --line:#242c35; --text:#e9eef3; --dim:#8b97a3; --accent:#e31937; --ok:#2fbf71; --warn:#f0a531; --bad:#e5534b; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text);
  font: 18px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

#stage { position: fixed; background: var(--bg); overflow: hidden; }
body.passenger #stage { outline: 2px solid #ffffff22; }
#view { position: absolute; inset: 0; overflow-y: auto; padding: 0 22px 40px; }

header { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center;
  padding: 14px 0; background: linear-gradient(var(--bg) 75%, transparent); }
.logo { font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.logo::first-letter { color: var(--accent); }
.search, .field { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; }
.iconbtn { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 22px; cursor: pointer; }

h1 { font-size: 30px; margin: 8px 0 14px; }
h2 { font-size: 20px; margin: 22px 0 10px; color: var(--dim); font-weight: 600; }
.row { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card { position: relative; flex: 0 0 160px; width: 160px; min-width: 0; scroll-snap-align: start; }
.grid .card { width: auto; }
.card img, .noposter { width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: 12px; background: var(--panel); display: block; }
.noposter { display: grid; place-items: center; padding: 10px; text-align: center; color: var(--dim); }
.card span { display: block; margin-top: 6px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { display: block; height: 4px; background: var(--accent); border-radius: 2px; margin-top: 4px; }

.meta { display: flex; gap: 22px; padding: 18px; border-radius: 18px; position: relative;
  background: linear-gradient(90deg, #0b0d10ee 40%, #0b0d1099), var(--mbg, none) center/cover; }
.mposter { width: 190px; border-radius: 14px; align-self: flex-start; }
.sub { color: var(--dim); margin-bottom: 10px; }
.desc { color: #c9d2db; max-width: 70ch; }
.btn { display: inline-block; padding: 13px 20px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); }

.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 20px 0 10px; }
.tabs button { padding: 10px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.tabs button.on { background: var(--text); color: #000; }
.eps { display: grid; gap: 10px; }
.ep { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: 14px; padding: 10px; }
.ep img, .nothumb { width: 170px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: #0003; flex: none; }
.ep div { min-width: 0; flex: 1; } .ep small { color: var(--dim); display: block; }

.toggles { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.toggle input { width: 26px; height: 26px; accent-color: var(--accent); }
.streams { display: grid; gap: 10px; }
.stream { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; }
.sname { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stitle { color: var(--dim); font-size: 15px; white-space: pre-line; margin-top: 4px; }
.tag { font-style: normal; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.direct { background: #2fbf7122; color: var(--ok); }
.tag.audio { background: #f0a53122; color: var(--warn); }
.tag.heavy { background: #e5534b22; color: var(--bad); }
.note, .hint, .empty, .loading { color: var(--dim); padding: 10px 0; }

.panel { background: var(--panel); border-radius: 16px; padding: 4px 18px 18px; margin-bottom: 16px; }
.addon { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.addon small { color: var(--dim); word-break: break-all; grid-column: 1; }
.addon button { grid-row: 1 / span 2; grid-column: 2; }
.inline { display: flex; gap: 10px; margin-top: 12px; }
.slider { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 12px; padding: 6px 0; }
.slider input { width: 100%; accent-color: var(--accent); }
.login { display: grid; gap: 14px; max-width: 360px; margin: 18vh auto 0; text-align: center; }
.pin { text-align: center; font-size: 28px; letter-spacing: 6px; }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: #000c;
  padding: 10px 16px; border-radius: 10px; z-index: 50; }

/* Player */
.player { position: absolute; inset: 0; background: #000; z-index: 20; }
.canvas-host { position: absolute; inset: 0; }
.pp-canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #000a;
  padding: 12px 18px; border-radius: 12px; pointer-events: none; text-align: center; max-width: 90%; }
.controls { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px; background: linear-gradient(#000b, transparent 25%, transparent 70%, #000c);
  opacity: 0; pointer-events: none; transition: opacity .25s; }
.player.show .controls { opacity: 1; pointer-events: auto; }
.ctlrow { display: flex; align-items: center; gap: 14px; }
.ctlrow.center { justify-content: center; gap: 40px; }
.ctl { min-width: 64px; height: 64px; border-radius: 32px; background: #ffffff1a; border: 0; font-size: 20px; cursor: pointer; padding: 0 16px; }
.ctl.big { width: 96px; height: 96px; border-radius: 48px; font-size: 34px; }
.ptitle { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode { color: var(--dim); font-size: 14px; }
.seek { flex: 1; accent-color: var(--accent); height: 36px; }
.time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.locked { color: var(--warn); }
.slider input:disabled { opacity: .35; }
.calib { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; cursor: pointer;
  background: repeating-linear-gradient(45deg, #fff 0 40px, #e31937 40px 80px); outline: 6px solid #fff; outline-offset: -6px; }
.calib-text { background: #000; padding: 18px 24px; border-radius: 14px; display: grid; gap: 6px; text-align: center; font-size: 20px; }
.calib-text b { font-size: 34px; letter-spacing: 2px; }

.status.withbar { min-width: 260px; }
.loadbar { display: none; height: 6px; background: #ffffff22; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.status.withbar .loadbar { display: block; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.stats { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.iconbtn.yt { color: #ff4040; font-size: 20px; }
.card.wide { flex-basis: 260px; width: 260px; }
.card.wide img { aspect-ratio: 16/9; }
.ytgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 14px; margin-top: 14px; }
.ytcard { display: grid; gap: 4px; }
.ytthumb { position: relative; }
.ytthumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; background: var(--panel); display: block; }
.ytthumb em { position: absolute; right: 8px; bottom: 8px; background: #000c; font-style: normal; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.ytcard b { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytcard small { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }

.ytbar { display: flex; gap: 10px; align-items: center; margin: 6px 0 4px; }
.ytlogo { font-weight: 800; color: #ff4040; white-space: nowrap; font-size: 20px; margin-right: 6px; }
.tabbtn { padding: 10px 18px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.tabbtn.on { background: var(--text); color: #000; }
.chip.on { background: var(--text); color: #000; }
.ytthumb em.live { background: #e31937; }
.ytch { cursor: pointer; }
.ytsignin { margin-top: 14px; }
.ytsignin p { color: #c9d2db; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; margin-top: 14px; }
.chcard { display: grid; justify-items: center; gap: 8px; text-align: center; }
.chcard img, .chavatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--panel); }
.chavatar { display: grid; place-items: center; font-size: 36px; font-weight: 700; }
.chcard span { font-size: 15px; line-height: 1.25; }

.spacer { flex: 1; }
.switch { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; flex: none; }
.switch a { padding: 9px 16px; border-radius: 999px; white-space: nowrap; font-weight: 600; color: var(--dim); }
.switch a.on { background: var(--text); color: #000; }
.switch a.yt.on { background: #ff3b3b; color: #fff; }
.launcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 6vh; }
.tile { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 260px; border-radius: 24px;
  border: 1px solid var(--line); text-align: center; padding: 24px; }
.tile b { font-size: 34px; } .tile small { color: #ffffffbb; font-size: 17px; }
.ticon { font-size: 64px; line-height: 1; }
.tile.stremio { background: linear-gradient(150deg, #4b2a8a, #1b1430); }
.tile.youtube { background: linear-gradient(150deg, #c4161c, #2a0b0c); }

.upnext { position: absolute; right: 24px; bottom: 110px; z-index: 30; background: #000d; border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; display: grid; gap: 12px; max-width: 70%; }
.upnext small { display: block; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.upnext b { font-size: 20px; }
.watched { display: inline-block; margin-top: 4px; color: var(--ok); font-size: 14px; font-weight: 600; }
.steps { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 6px; color: #c9d2db; }

/* v0.6 player */
.ctl { min-width: 72px; height: 72px; border-radius: 36px; font-size: 22px; }
.ctl.big { width: 108px; height: 108px; border-radius: 54px; font-size: 38px; }
.ctlrow.center { gap: 48px; }
.seekrow { gap: 16px; }
.seekwrap { position: relative; flex: 1; display: flex; align-items: center; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; }
.seek::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #ffffff40; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); margin-top: -11px; border: 3px solid #fff; }
.seektip { position: absolute; bottom: 46px; transform: translateX(-50%); background: #000d; padding: 6px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; pointer-events: none; }
.subs { position: absolute; left: 6%; right: 6%; bottom: 9%; z-index: 15; text-align: center; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; line-height: 1.25; }
.subs span { background: #000a; color: #fff; padding: 2px 10px; border-radius: 6px; text-shadow: 0 1px 2px #000; }
.player.show .subs { bottom: 24%; }
.skipbubble { position: absolute; top: 50%; transform: translateY(-50%); z-index: 25; background: #000b; padding: 16px 24px;
  border-radius: 40px; font-size: 26px; font-weight: 700; pointer-events: none; }
.skipbubble.left { left: 8%; } .skipbubble.right { right: 8%; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 92%); z-index: 40; background: #0e1116f2;
  border-left: 1px solid var(--line); padding: 16px 18px 24px; overflow-y: auto; }
.sheethead { display: flex; justify-content: space-between; align-items: center; font-size: 22px; }
.sheet h3 { margin: 18px 0 8px; color: var(--dim); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.chips.col { flex-direction: column; align-items: stretch; }
.chipbtn { padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; font-size: 17px; cursor: pointer; }
.chipbtn.on { background: var(--text); color: #000; }
.chipbtn:disabled { opacity: .4; }
.selrow { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; padding: 6px 0; }
select.field { appearance: auto; }

/* ---------- volume ---------- */
.volpop { position: absolute; top: 70px; right: 14px; z-index: 70; width: min(460px, 92%); padding: 16px 18px;
  background: #151821; border: 1px solid #ffffff1a; border-radius: 18px; box-shadow: 0 12px 40px #0009; }
.volbox { display: grid; gap: 14px; }
.volrow { display: grid; grid-template-columns: 110px 1fr 64px; align-items: center; gap: 12px; font-size: 18px; }
.volrow input[type=range] { width: 100%; height: 40px; accent-color: #4fc3ff; }
.volval { text-align: right; font-variant-numeric: tabular-nums; }
.tile.radar { background: linear-gradient(150deg, #123a7a, #3a0b14); }

/* ---------- background police / hazard strip ---------- */
.radar-strip { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); width: min(720px, 94%);
  z-index: 60; background: #0e1118ee; border-radius: 0 0 16px 16px; overflow: hidden; box-shadow: 0 6px 24px #000a; }
#stage:has(.player) .radar-strip { top: 0; }
.radar-strip[hidden] { display: none; }
.rs-lights { display: flex; height: 10px; } .rs-lights i { flex: 1; background: #ffb020; }
.radar-strip.police .rs-lights i:nth-child(odd) { background: #ff3b5c; animation: rsR .5s steps(1) infinite; }
.radar-strip.police .rs-lights i:nth-child(even) { background: #2f7bff; animation: rsB .5s steps(1) infinite; }
@keyframes rsR { 50% { background: #3a0b14; } }
@keyframes rsB { 0% { background: #0b1a3a; } 50% { background: #2f7bff; } }
.rs-body { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 18px; }
.rs-icon { font-size: 28px; } .rs-title { font-size: 20px; }
.rs-sub { color: #8b95a7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; flex: 1; }
.rs-dist { font-size: 22px; }
.rs-map { color: #4fc3ff; text-decoration: none; padding: 8px 12px; border: 1px solid #4fc3ff55; border-radius: 10px; }
.rs-x { width: 44px; height: 44px; border: 0; border-radius: 10px; background: #ffffff12; color: inherit; font-size: 18px; }
