/* TesCast — "Fluid dark": near-black, the artwork's colour blurred behind the
   page, frosted-glass controls, white primary pills, system blue only for
   switches and ticks. body.flat swaps the glass for solid panels (Settings →
   Display) on cars where blur is slow. */
:root {
  --bg: #050506;
  --fg: #F5F5F7;
  --fg-2: #9A9AA1;
  --fg-3: #636366;
  --panel: #161618;
  --panel-2: #1F1F22;
  --line: rgba(255,255,255,.10);
  --glass: rgba(40,40,44,.55);
  --glass-strong: rgba(36,36,40,.78);
  --glass-line: rgba(255,255,255,.14);
  --blur: blur(30px) saturate(180%);
  --blue: #0A84FF;
  --accent: #F5F5F7;
  --danger: #FF453A;
  --ok: #30D158;
  --star: #FFD60A;
  --radius: 18px;
  --font: -apple-system, "SF Pro Display", Inter, system-ui, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
/* body stays transparent so the blurred artwork (z-index -1) shows through */
html, body { margin: 0; color: var(--fg); font: 18px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--fg-2); }
.small { font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.03em; margin: 6px 0 16px; }
h2 { font-size: 24px; letter-spacing: -.02em; margin: 30px 0 14px; display: flex; align-items: center; gap: 8px; }
h2 a { display: inline-flex; align-items: center; gap: 6px; }
h2 a::after { content: ''; width: 10px; height: 10px; border: solid var(--fg-2); border-width: 0 2.6px 2.6px 0; transform: rotate(-45deg); margin-left: 2px; }
.err { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; }

.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
body.flat .glass, body.flat .glass-btn, body.flat .dock, body.flat .search input, body.flat .t-btn, body.flat .menu, body.flat .sheet-card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background-color: var(--panel-2) !important; }
body.flat .backdrop { display: none; }

/* Artwork colour behind the page */
.backdrop { position: fixed; left: -10%; top: -20%; width: 120%; height: 90%; object-fit: cover; filter: blur(90px) saturate(140%); opacity: .45; pointer-events: none; z-index: -1; }

/* ---- Header ------------------------------------------------------------------------ */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 18px 40px; background: linear-gradient(var(--bg) 30%, rgba(5,5,6,0)); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; flex: 0 0 auto; }
.search { flex: 1; display: flex; justify-content: center; position: relative; }
.search .s-wrap { position: relative; width: 520px; max-width: 100%; }
.s-wrap > svg { position: absolute; left: 18px; top: 16px; color: var(--fg-2); pointer-events: none; }
.search input { width: 100%; height: 52px; padding: 0 20px 0 48px; border-radius: 26px; border: 1px solid var(--line); background: rgba(255,255,255,.08); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); font-weight: 500; outline: none; }
.search input:focus { border-color: rgba(255,255,255,.3); }
.glass-btn { position: relative; flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid var(--line); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); color: var(--fg); }
.glass-btn.on { background: var(--fg); color: var(--bg); }
.remote-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }

.view { padding: 8px 40px 130px; max-width: 1680px; margin: 0 auto; }

/* ---- Floating tab bar ----------------------------------------------------------------- */
.dock { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 10; max-width: calc(100vw - 48px); height: 68px; padding: 6px; border-radius: 34px; background: rgba(30,30,32,.62); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); box-shadow: 0 20px 50px rgba(0,0,0,.55); display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.dock a { flex: 0 0 auto; height: 56px; padding: 0 22px; border-radius: 28px; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.dock a small { font-weight: 500; font-size: 14px; color: var(--fg-3); }
.dock a.on { background: rgba(255,255,255,.16); color: var(--fg); }

/* ---- Buttons ------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; padding: 0 28px; border-radius: 30px; border: 0; background: var(--fg); color: var(--bg); font-size: 20px; font-weight: 600; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn.ghost { background: rgba(255,255,255,.14); color: var(--fg); border: 1px solid var(--glass-line); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
.btn-s { position: relative; overflow: hidden; display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--fg); font-weight: 600; font-size: 16px; }
.btn-s.hold { color: var(--danger); touch-action: none; user-select: none; }
.btn-s.hold .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,69,58,.25); }
.btn-s.hold .lbl { position: relative; }
.row-btns { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }

/* ---- Hero --------------------------------------------------------------------------------- */
.hero { position: relative; height: 420px; border-radius: 32px; overflow: hidden; background: #111; box-shadow: 0 30px 80px rgba(0,0,0,.5); margin-bottom: 8px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 28%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.5) 38%, rgba(0,0,0,0) 62%), linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%); }
.hero-text { position: absolute; z-index: 1; left: 48px; bottom: 44px; width: min(640px, 80%); display: flex; flex-direction: column; gap: 10px; }
.hero-text .eyebrow { font-size: 17px; font-weight: 500; color: rgba(245,245,247,.75); }
.hero-text h1 { font-size: 64px; line-height: 1; margin: 0; }
.hero-text .line { font-size: 20px; font-weight: 500; color: rgba(245,245,247,.85); }
.hero-text .row-btns { margin: 14px 0 0; }

/* Home's billboard (app.js billboard): full width under the header, the show's
   fanart and logo, cycling through Continue Watching; the next row rises into it. */
:root { --gut: 40px; }
.bb { position: relative; z-index: 0; height: 720px; width: calc(100vw - var(--sbw, 0px)); margin: calc(-8px - var(--bar-h, 92px)) 0 -170px calc(50% - (100vw - var(--sbw, 0px)) / 2); }
.bb ~ * { position: relative; z-index: 1; }
.bb-art { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.bb-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 34%, rgba(0,0,0,0) 60%), linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 22%); }
.bb-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.bb-slide.on { opacity: 1; }
.bb-slide img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.bb-slide.on img { animation: bb-drift 7s ease-out forwards; }
@keyframes bb-drift { from { transform: scale(1); } to { transform: scale(1.05); } }
.bb-text { position: absolute; z-index: 2; left: max(var(--gut), calc((100vw - var(--sbw, 0px) - 1680px) / 2 + var(--gut))); bottom: 250px; width: min(900px, 70%); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; transition: opacity .22s; }
.bb-text.swap { opacity: 0; }
.bb-text .eyebrow { font-size: 18px; font-weight: 500; color: rgba(245,245,247,.78); }
.bb-text h1 { font-size: 80px; line-height: 1; margin: 0; letter-spacing: -.03em; font-weight: 800; }
.bb-logo { display: block; width: auto; height: auto; max-width: min(560px, 60vw); max-height: 160px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 6px 24px rgba(0,0,0,.6)); }
.bb-text .line { font-size: 21px; font-weight: 500; color: rgba(245,245,247,.88); }
.bb-text .row-btns { margin: 8px 0 0; }
.bb-ticks { position: absolute; z-index: 2; left: max(var(--gut), calc((100vw - var(--sbw, 0px) - 1680px) / 2 + var(--gut))); bottom: 196px; display: flex; gap: 4px; }
.bb-tick { width: 52px; height: 44px; padding: 0 3px; border: 0; background: none; display: grid; align-items: center; cursor: pointer; }
.bb-tick span { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.bb-tick i { display: block; height: 100%; width: 0; background: #fff; transition: width .1s linear; }
.bb-tick.done i { width: 100%; }
.bb-count { align-self: center; margin-left: 10px; font-size: 15px; font-weight: 600; color: rgba(245,245,247,.75); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Sideways rows (app.js rowNav): the edge with more fades, and our glass button sits on it. */
.rw { position: relative; }
.rw > .row, .rw > .eps { -webkit-mask-image: linear-gradient(90deg, var(--fade-l, #000) 0, #000 72px, #000 calc(100% - 110px), var(--fade-r, #000) 100%); mask-image: linear-gradient(90deg, var(--fade-l, #000) 0, #000 72px, #000 calc(100% - 110px), var(--fade-r, #000) 100%); }
.rw.more-l > .row, .rw.more-l > .eps { --fade-l: transparent; }
.rw.more-r > .row, .rw.more-r > .eps { --fade-r: transparent; }
.rw-btn { position: absolute; z-index: 3; top: calc(4px + var(--art-h, 120px) / 2); transform: translateY(-50%); display: none; cursor: pointer; }
.rw-btn.l { left: calc(10px - var(--gut)); }
.rw-btn.r { right: calc(10px - var(--gut)); }
.rw.more-l .rw-btn.l, .rw.more-r .rw-btn.r { display: grid; }
@media (max-width: 640px) { .rw .rw-btn { display: none; } }
.row .card.bb-cur .art::after { content: ''; position: absolute; inset: 0; z-index: 3; border: 3px solid var(--fg); border-radius: inherit; pointer-events: none; }
body:has(#bb) .bar { background: linear-gradient(rgba(5,5,6,.55), rgba(5,5,6,0)); }
@media (max-width: 1000px) {
  :root { --gut: 24px; }
  .bb { height: 600px; margin-bottom: -150px; }
  .bb-text { bottom: 225px; }
  .bb-text h1 { font-size: 60px; }
  .bb-ticks { bottom: 176px; }
}
@media (max-width: 640px) {
  :root { --gut: 14px; }
  .bb { height: 520px; margin-bottom: -120px; }
  .bb-text { bottom: 180px; width: calc(100% - 2 * var(--gut)); gap: 8px; }
  .bb-text h1 { font-size: 36px; }
  .bb-logo { max-height: 90px; }
  .bb-ticks { bottom: 134px; }
}
@media (prefers-reduced-motion: reduce) { .bb-slide, .bb-text { transition: none; } .bb-slide.on img { animation: none; } }
.resume-left { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; color: #48484A; }
.resume-left .mini { width: 44px; height: 4px; border-radius: 2px; background: #C7C7CC; }
.resume-left .mini i { display: block; height: 4px; border-radius: 2px; background: var(--bg); }

/* ---- Rows and cards --------------------------------------------------------------------------- */
/* Rows stop at the content column's edge (no peeking past it); drag or swipe to scroll. */
.row { display: flex; gap: 20px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.row::-webkit-scrollbar, .eps::-webkit-scrollbar { display: none; }
.dragging { cursor: grabbing; user-select: none; }
.dragging a, .dragging img { pointer-events: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px 20px; }
.card { display: flex; flex-direction: column; gap: 10px; flex: 0 0 180px; min-width: 0; }
.card.wide { flex-basis: 300px; }
.card .art { position: relative; aspect-ratio: 2/3; border-radius: 16px; overflow: hidden; background: var(--panel-2); }
.card.wide .art { aspect-ratio: 16/9; border-radius: 18px; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .t { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.card .s { font-size: 16px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; margin-top: -8px; min-height: 1.2em; }
.prog { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); }
.prog i { display: block; height: 5px; border-radius: 3px; background: var(--fg); }
.card .badge { position: absolute; top: 10px; right: 10px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.noart { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; color: var(--fg-2); font-weight: 600; background: linear-gradient(160deg, #2a2a30, #151517); }
.card.chan { flex-basis: 160px; }
.card.short { flex-basis: 200px; }
.card.short .art { aspect-ratio: 9/16; border-radius: 18px; }
.shorts-ico { display: inline-flex; }
.card.chan .art { aspect-ratio: 1; background: #fff; border-radius: 22px; }
.card.chan .art img { object-fit: contain; padding: 18px; }
.src-tag { font-size: 14px; font-weight: 600; color: var(--fg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.count { color: var(--fg-2); font-weight: 500; font-size: 26px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.chip { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: 23px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-weight: 600; font-size: 16px; color: var(--fg-2); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.more { margin: 26px auto 0; display: flex; }
.loading { color: var(--fg-2); padding: 40px 0; }

/* ---- Show page ---------------------------------------------------------------------------------- */
.show-head { position: relative; min-height: 360px; margin: 0 -40px 12px; padding: 0 40px; display: flex; align-items: flex-end; }
.show-head .bg { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.show-head .bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; opacity: .7; }
.show-head .txt { position: relative; padding-bottom: 20px; max-width: 760px; }
.show-head h1 { font-size: 60px; margin: 0 0 8px; }
.show-head .meta { color: rgba(245,245,247,.8); font-size: 19px; }
.eps { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 12px; overscroll-behavior-x: contain; }
.ep { flex: 0 0 340px; display: flex; flex-direction: column; gap: 10px; }
.ep .art { position: relative; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: var(--panel-2); }
.ep.current .art { outline: 3px solid var(--fg); outline-offset: 3px; }
.ep img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep .done { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 16px; }
.ep .t { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .d { font-size: 16px; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: -6px; }

/* ---- Centered panels: sign in, messages ------------------------------------------------------------ */
.center { min-height: calc(100vh - 160px); display: grid; place-items: center; text-align: center; }
.panel { width: min(560px, 100%); border-radius: 32px; padding: 40px; }
.panel h1 { margin-top: 0; }
.panel p { font-size: 19px; }
.field { width: 100%; height: 72px; font: 600 30px/1 var(--font); letter-spacing: .14em; text-align: center; text-transform: uppercase; border-radius: 22px; border: 1px solid var(--glass-line); background: rgba(0,0,0,.35); color: var(--fg); outline: none; }
.field:focus { border-color: rgba(255,255,255,.4); }
.hint-box { text-align: left; margin-top: 22px; padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.06); font-size: 16px; color: var(--fg-2); }
.hint-box b { color: var(--fg); }
.code { font: 700 52px/1.1 var(--font); letter-spacing: .12em; margin: 14px 0; }
.signin-qr { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 18px 0 6px; }
.signin-qr .qr { width: 280px; height: 280px; }
.signin-qr .muted b { overflow-wrap: anywhere; }

/* ---- Welcome: no sources yet ------------------------------------------------------------- */
.onboard { position: relative; max-width: 1080px; margin: 0 auto; padding: 48px 0 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ob-glow { position: fixed; inset: -20% -10% auto; height: 80vh; z-index: -1; pointer-events: none; filter: blur(90px); opacity: .55;
  background: radial-gradient(40% 50% at 22% 40%, rgba(229,160,13,.55), transparent 70%), radial-gradient(38% 50% at 55% 30%, rgba(170,92,195,.5), transparent 70%), radial-gradient(40% 50% at 82% 45%, rgba(0,164,220,.45), transparent 70%); }
body.flat .ob-glow { display: none; }
.ob-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 26px; }
.onboard h1 { font-size: 64px; letter-spacing: -.04em; margin: 0 0 10px; }
.ob-lede { font-size: 21px; color: var(--fg-2); margin: 0 0 30px; max-width: 640px; }
.ob-card { width: 100%; border-radius: 40px; padding: 40px; display: grid; grid-template-columns: 340px 1fr; gap: 44px; text-align: left; background: rgba(36,36,40,.6); box-shadow: 0 40px 100px rgba(0,0,0,.5); }
.ob-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ob-qr .qr { width: 300px; height: 300px; border-radius: 28px; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.ob-scan { font-size: 18px; font-weight: 600; margin: 16px 0 6px; }
.ob-alt { font-size: 15px; color: var(--fg-2); margin: 0; line-height: 1.7; }
.ob-alt .code-tiles span { width: 34px; height: 44px; font-size: 21px; border-radius: 10px; }
.ob-right { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.ob-step { display: flex; align-items: center; gap: 14px; font-size: 20px; font-weight: 600; margin: 0; }
.ob-step span { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.ob-provs { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 4px 48px; }
.ob-prov { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.ob-prov > span:last-child { display: flex; flex-direction: column; font-size: 15px; color: var(--fg-2); }
.ob-prov b { color: var(--fg); font-size: 18px; }
.ob-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; }
.ob-ico.plex, .ob-ico.jf { background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.ob-ico.iptv { background: #30D158; }
.ob-right .waiting { margin: 8px 0 0 48px; }
.ob-foot { margin-top: 24px; color: var(--fg-2); font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
.hint-box.warn { margin: 0 0 20px; border: 1px solid rgba(255,69,58,.5); color: var(--fg); width: 100%; }

/* ---- Choose libraries ----------------------------------------------------------------------- */
.libs-page { max-width: 760px; margin: 20px auto 0; text-align: center; }
.libs-page .ob-lede { color: var(--fg-2); font-size: 19px; margin: 0 0 24px; }
.lib-card { width: min(720px, 100%); margin: 0 auto 16px; border-radius: 32px; padding: 12px 12px 20px; text-align: left; background: rgba(36,36,40,.6); }
.lib-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; min-height: 72px; border-radius: 20px; cursor: pointer; }
.lib-row + .lib-row { border-top: 1px solid var(--line); border-radius: 0; }
.lib-ico { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: 0 0 auto; }
.lib-name { flex: 1; display: flex; flex-direction: column; }
.lib-name b { font-size: 20px; }
.lib-name span { color: var(--fg-2); font-size: 15px; }
.lib-card .btn { margin: 16px 8px 0; width: calc(100% - 16px); }

/* ---- Pairing (add a source, phone remote) ---------------------------------------------------------------- */
.pair { display: flex; gap: 44px; align-items: center; justify-content: center; }
.pair-wrap { min-height: calc(100vh - 170px); display: grid; place-items: center; }
.pair-card { border-radius: 36px; padding: 40px; max-width: 1080px; }
.qr { flex: 0 0 auto; width: 320px; height: 320px; background: #fff; border-radius: 24px; padding: 16px; }
.qr.sm { width: 250px; height: 250px; padding: 12px; border-radius: 20px; }
.qr svg { width: 100%; height: 100%; display: block; }
.pair-text { max-width: 560px; text-align: left; }
.pair-text h1 { font-size: 44px; }
.steps { padding-left: 24px; font-size: 19px; line-height: 1.5; margin: 0 0 14px; }
.steps li { margin: 8px 0; }
.code-tiles { display: inline-flex; gap: 6px; vertical-align: middle; }
.code-tiles span { width: 44px; height: 56px; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.code-tiles .gap { width: 10px; background: none; }
.waiting { display: flex; align-items: center; gap: 12px; color: var(--fg-2); }
.waiting::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.2); border-top-color: var(--fg); animation: spin .9s linear infinite; }

/* ---- YouTube ---------------------------------------------------------------------------------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 20px; }
.vgrid .card { flex: none; }
.yt-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.yt-head h1 { margin: 6px 0; }
.yt-search { flex: 1; max-width: 560px; }
.yt-search input { width: 100%; height: 56px; padding: 0 22px; border-radius: 28px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--fg); font-weight: 500; outline: none; }
.yt-signin { display: flex; align-items: center; gap: 20px; justify-content: space-between; border-radius: 26px; padding: 20px 24px; margin: 14px 0 20px; }
.yt-signin div { display: flex; flex-direction: column; }
.yt-signin b { font-size: 21px; }
.yt-signin span { color: var(--fg-2); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pl-tile { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 0 20px; border-radius: 22px; font-size: 18px; }
.kind-youtube { background: #fff; }

/* ---- Live TV ------------------------------------------------------------------------------------------- */
.tv { display: grid; grid-template-columns: 290px 1fr; gap: 26px; align-items: start; }
.rail { position: sticky; top: 100px; border-radius: 26px; padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 230px); overflow-y: auto; scrollbar-width: none; }
.rail .chips { margin: 6px 6px 10px; }
.rail-item { display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 16px; border-radius: 16px; font-weight: 600; font-size: 18px; color: var(--fg-2); gap: 10px; }
.rail-item span { font-weight: 500; font-size: 15px; color: var(--fg-3); }
.rail-item.on { background: rgba(255,255,255,.14); color: var(--fg); }
.chan-list { display: flex; flex-direction: column; gap: 10px; }
.chan-row { display: flex; align-items: stretch; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.chan-main { flex: 1; min-width: 0; display: flex; gap: 18px; align-items: center; padding: 12px; }
.chan-logo { flex: 0 0 88px; height: 88px; border-radius: 18px; background: #fff; display: grid; place-items: center; overflow: hidden; color: #333; font-weight: 700; }
.chan-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.chan-text { min-width: 0; flex: 1; }
.chan-text .t { font-weight: 650; font-size: 20px; }
.chan-text .num { color: var(--fg-3); font-weight: 500; margin-right: 10px; font-variant-numeric: tabular-nums; }
.chan-text .now { margin-top: 2px; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-text .next { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-prog { height: 4px; background: rgba(255,255,255,.16); border-radius: 2px; margin: 8px 0; max-width: 460px; }
.bar-prog i { display: block; height: 100%; background: var(--fg); border-radius: 2px; }
.star { flex: 0 0 80px; border: 0; border-left: 1px solid var(--line); background: transparent; font-size: 30px; color: var(--fg-3); }
.star.on { color: var(--star); }

/* ---- Settings ------------------------------------------------------------------------------------------- */
.settings { display: grid; grid-template-columns: 300px 1fr; gap: 28px; max-width: 1240px; margin: 0 auto; align-items: start; }
.set-nav { position: sticky; top: 100px; border-radius: 26px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; border-radius: 16px; font-weight: 600; font-size: 18px; }
.set-nav a.on { background: rgba(255,255,255,.14); }
.set-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.set-main h1 { font-size: 36px; margin-top: 4px; }
.group { border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--line); margin-bottom: 26px; overflow: hidden; }
.group-h { font-size: 15px; font-weight: 600; color: var(--fg-2); margin: 0 0 8px 6px; }
.set-intro { margin: -4px 0 24px 6px; max-width: 64ch; font-size: 18px; line-height: 1.45; color: var(--fg-2); }
.set-intro b { color: var(--fg); font-weight: 600; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; min-height: 64px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-label { font-weight: 600; display: block; }
.hint { display: block; color: var(--fg-2); font-size: 15px; font-weight: 400; }
.seg { display: flex; background: rgba(255,255,255,.08); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 48px; border: 0; border-radius: 12px; background: transparent; font-weight: 600; color: var(--fg-2); }
.seg button.on { background: rgba(255,255,255,.9); color: var(--bg); }
.switch { appearance: none; -webkit-appearance: none; width: 64px; height: 38px; border-radius: 19px; background: rgba(120,120,128,.36); position: relative; flex: 0 0 auto; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(26px); }
.src-card { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.src-card:last-child { border-bottom: 0; }
.src-head { display: flex; gap: 14px; align-items: center; }
.src-name { min-width: 0; flex: 1; }
.src-name .t { font-weight: 650; font-size: 19px; }
.kind { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: 0 0 auto; }
.kind-plex, .kind-jellyfin { background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.kind-xtream, .kind-m3u { background: #30D158; color: #04260F; }
.src-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.add-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--blue); font-weight: 600; min-height: 60px; }
.field-s { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--fg); width: min(320px, 60vw); }
.rename { display: flex; gap: 8px; align-items: center; }
.cap-preview { height: 130px; border-radius: 16px; background: linear-gradient(135deg, #2b3440, #151a20); display: flex; align-items: flex-end; justify-content: center; padding: 14px; margin-top: 6px; }
.diag-row { display: grid; grid-template-columns: 16px 280px 1fr; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 52px; }
.diag-row:last-child { border-bottom: 0; }
.diag-row .muted { overflow-wrap: anywhere; font-size: 15px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--danger); } .dot.na { background: var(--fg-3); }

/* ---- Sheet, toast ----------------------------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 24px; }
.sheet-card { width: min(1000px, 100%); border-radius: 36px; padding: 36px; background: var(--glass-strong); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.toast-act { margin-left: 18px; padding: 6px 14px; border: 0; border-radius: 16px; background: rgba(5,5,6,.12); color: inherit; font-weight: 700; }
/* Watched / unwatched (app.js openItemSheet): a compact sheet in the game menu's style */
.sheet-card.compact { width: min(520px, 100%); padding: 24px; background: var(--glass); } /* the same glass as the game menu and dock */
.sheet:has(.sheet-card.compact) { background: rgba(0,0,0,.3); }
.item-sheet { display: flex; flex-direction: column; gap: 10px; }
.item-sheet .btn.block { margin-top: 0; }
.is-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; min-width: 0; }
.is-head img { width: 64px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.is-head img.wide { width: 128px; height: 72px; }
.is-head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.is-head b { font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-head span { font-size: 16px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-cancel { color: var(--fg-2); }
[data-item] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.row-btns .more-btn { flex: 0 0 60px; width: 60px; height: 60px; }
.show-sum { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 720px; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg); font-weight: 600; padding: 16px 26px; border-radius: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: min(720px, 90vw); text-align: center; }
.tapgate { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 70; border: 0; border-radius: 34px; padding: 30px 46px; font-size: 26px; font-weight: 700; background: var(--fg); color: var(--bg); box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* ---- Player ------------------------------------------------------------------------------------------------- */
.player { position: fixed; inset: 0; z-index: 30; background: #000; }
.screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 3; }
.controls { position: absolute; inset: 0; transition: opacity .25s; z-index: 4; }
.controls.hide { opacity: 0; pointer-events: none; }
.shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 62%, rgba(0,0,0,.72)); pointer-events: none; }
.round-60 { width: 60px; height: 60px; flex-basis: 60px; background: var(--glass); border-color: var(--glass-line); }
.p-close { position: absolute; left: 36px; top: 30px; }
.p-tools { position: absolute; right: 36px; top: 30px; height: 60px; padding: 4px; border-radius: 30px; display: flex; gap: 2px; z-index: 6; }
.cap { height: 50px; min-width: 50px; padding: 0 18px; border-radius: 25px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 17px; white-space: nowrap; }
.cap.icon { padding: 0; width: 50px; }
.cap[aria-expanded="true"] { background: rgba(255,255,255,.18); }
.cap .q-h { color: var(--fg-2); font-weight: 500; }
#p-fav { font-size: 26px; padding: 0 12px; }
#p-fav[aria-pressed="true"] { color: var(--star); }
.transport { position: absolute; left: 0; right: 0; top: 0; bottom: 150px; display: flex; align-items: center; justify-content: center; gap: 72px; pointer-events: none; }
.t-btn { pointer-events: auto; width: 96px; height: 96px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: rgba(40,40,44,.45); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: grid; place-items: center; color: var(--fg); }
.t-btn.big { width: 128px; height: 128px; border-color: var(--glass-line); }
/* Centred on the same line as the play controls (the screen above the 150 px bottom bar). */
.vbright { position: absolute; right: 36px; top: calc((100% - 150px) / 2); transform: translateY(-50%); margin-top: 0; width: 84px; height: clamp(150px, calc(100% - 340px), 300px); border-radius: 28px; overflow: hidden; touch-action: none; z-index: 6; cursor: pointer; }
.vfill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: var(--fg); pointer-events: none; }
.vbright .sun { position: absolute; left: 26px; bottom: 22px; color: #1C1C1E; pointer-events: none; }
.vbright.low .sun { color: var(--fg); }
.p-bottom { position: absolute; left: 48px; right: 48px; bottom: 30px; display: flex; flex-direction: column; gap: 10px; }
.p-meta-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.p-meta { min-width: 0; }
.p-next { flex: 0 1 auto; max-width: 46%; min-height: 56px; padding: 0 16px 0 20px; border-radius: 28px; display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 17px; font-weight: 600; }
.p-next .pn-h { color: var(--fg-2); font-weight: 500; white-space: nowrap; }
.p-next .pn-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-next .pn-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; }
.p-sub { font-size: 16px; font-weight: 600; color: rgba(245,245,247,.75); min-height: 1.2em; }
.p-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.p-times { display: flex; justify-content: space-between; font-size: 17px; font-weight: 600; color: rgba(245,245,247,.75); font-variant-numeric: tabular-nums; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; --pct: 0%; }
.seek::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--fg) var(--pct), rgba(255,255,255,.22) var(--pct)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.seek::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.22); }
.seek::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--fg); }
.seek::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--fg); }
.live-row { display: flex; align-items: center; gap: 14px; font-size: 18px; color: rgba(245,245,247,.8); }
.live-badge { background: var(--danger); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .08em; padding: 6px 10px; border-radius: 8px; }
.menu { position: absolute; z-index: 20; right: 136px; top: 104px; width: 380px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 8px; border-radius: 26px; background: rgba(36,36,40,.72); backdrop-filter: blur(50px) saturate(180%); -webkit-backdrop-filter: blur(50px) saturate(180%); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.menu .mh { padding: 10px 16px 6px; font-size: 15px; font-weight: 600; color: var(--fg-2); }
.menu .mi { width: 100%; height: 52px; padding: 0 16px 0 14px; border-radius: 14px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 500; text-align: left; }
.menu .mi::before { content: ''; flex: 0 0 22px; text-align: center; font-weight: 800; }
.menu .mi.on { background: rgba(255,255,255,.10); }
.menu .mi.on::before { content: '✓'; }
.menu .mi .note { margin-left: auto; font-size: 17px; color: var(--fg-2); }
.menu .mi-note { color: var(--fg-2); padding: 6px 16px 12px; font-size: 16px; }
.captions { position: absolute; left: 8%; right: 8%; bottom: 6%; text-align: center; pointer-events: none; transition: bottom .25s; line-height: 1.35; z-index: 2; }
.player:not(.osd-hidden) .captions { bottom: 190px; }
.captions span, .cap-preview span { background: rgba(0,0,0,.78); color: #fff; padding: 2px 10px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.cap-s { font-size: 22px; } .cap-m { font-size: 30px; } .cap-l { font-size: 40px; }
.cap-preview.cap-s span { font-size: 18px; } .cap-preview.cap-m span { font-size: 24px; } .cap-preview.cap-l span { font-size: 32px; }
/* Loading: a ring around the play button (the controls sit 75 px above centre, see .transport). */
.spinner { position: absolute; left: 50%; top: calc(50% - 75px); width: 146px; height: 146px; margin: -73px; border-radius: 50%; border: 4px solid rgba(255,255,255,.18); border-top-color: #fff; animation: spin .9s linear infinite; pointer-events: none; z-index: 5; }
@keyframes spin { to { transform: rotate(360deg); } }
.perror { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--glass-strong); padding: 22px 28px; border-radius: 22px; max-width: 70%; text-align: center; font-size: 19px; z-index: 5; }
.stats { position: absolute; left: 36px; top: 110px; margin: 0; padding: 14px 16px; background: rgba(0,0,0,.7); border-radius: 16px; font: 13px/1.5 ui-monospace, Menlo, monospace; pointer-events: none; z-index: 7; }

/* ---- Phone pages (connect, remote) ------------------------------------------------------------------------------ */
.phone .btn, .rm .btn { display: flex; width: 100%; margin-top: 14px; min-height: 56px; font-size: 18px; }
.phone .seg, .rm .seg { margin-top: 18px; }
.rm .rb.big { background: var(--fg); color: var(--bg); }
.rm .np-status { color: var(--blue); }

/* ---- Smaller screens ---------------------------------------------------------------------------------------------
   The car's screen is ~1440 px wide; the same page also has to work on tablets
   and phones (setting up, testing, passengers). Two steps: tablet (≤ 1000 px)
   and phone (≤ 640 px). Safe areas keep clear of notches and home bars. */
.search { min-width: 0; }
.bar { padding-top: max(18px, env(safe-area-inset-top)); }
.dock { bottom: max(22px, env(safe-area-inset-bottom)); }

@media (max-width: 1000px) {
  .bar { padding-left: 24px; padding-right: 24px; gap: 10px; }
  .view { padding: 8px 24px 130px; }
  .hero { height: 360px; }
  .hero-text h1 { font-size: 48px; }
  .tv { grid-template-columns: 230px 1fr; }
  .settings { grid-template-columns: 240px 1fr; }
  .ob-card { grid-template-columns: 1fr; justify-items: center; }
  .ob-right { width: 100%; }
  .menu { right: 120px; }
}

@media (max-width: 640px) {
  html, body { font-size: 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 20px; margin: 24px 0 10px; }

  /* Header: logo, search that fills the space, settings. Add-a-source and
     the phone remote live in Settings on small screens. */
  .bar { padding: max(10px, env(safe-area-inset-top)) 14px 10px; gap: 8px; }
  .brand { font-size: 0; gap: 0; }
  .brand svg { width: 34px; height: 34px; }
  .bar .glass-btn { width: 44px; height: 44px; flex-basis: 44px; }
  .bar a[href="#/add"], .bar #remote-btn { display: none; }
  .search input { height: 44px; padding-left: 42px; font-size: 16px; }
  .s-wrap > svg { left: 14px; top: 12px; }

  .view { padding: 4px 14px calc(96px + env(safe-area-inset-bottom)); }
  .row, .eps { margin-right: -14px; padding-right: 14px; gap: 12px; }

  /* Tab bar: a full-width bar with icon over label, like a phone app. */
  .dock { left: 8px; right: 8px; transform: none; max-width: none; height: auto; bottom: max(8px, env(safe-area-inset-bottom)); padding: 4px; border-radius: 24px; gap: 2px; justify-content: space-between; }
  .dock a { flex: 1 1 0; min-width: 54px; height: 56px; padding: 4px 4px; border-radius: 18px; flex-direction: column; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; }
  .dock a svg { width: 22px; height: 22px; }
  .dock a small { display: none; }

  /* Home */
  .hero { height: auto; min-height: 300px; border-radius: 24px; display: flex; align-items: flex-end; }
  .hero::after { background: linear-gradient(0deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.1) 100%); }
  .hero-text { position: relative; left: auto; bottom: auto; width: 100%; padding: 120px 18px 18px; gap: 6px; }
  .hero-text .eyebrow { font-size: 14px; }
  .hero-text h1 { font-size: 30px; }
  .hero-text .line { font-size: 16px; }
  .hero-text { padding-right: 18px; }
  .hero-text .row-btns { margin-top: 10px; gap: 8px; flex-wrap: wrap; }
  .hero-text .btn { min-height: 48px; padding: 0 18px; font-size: 17px; gap: 10px; white-space: nowrap; }
  .resume-left { font-size: 14px; }
  .resume-left .mini { width: 32px; }
  .btn { min-height: 52px; font-size: 18px; padding: 0 22px; }
  .card { flex-basis: 132px; gap: 8px; }
  .card.wide { flex-basis: 240px; }
  .card .t { font-size: 16px; }
  .card .s { font-size: 14px; margin-top: -6px; }
  .card.chan { flex-basis: 110px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 18px 12px; }
  .vgrid { grid-template-columns: 1fr; gap: 18px; }
  .chips { gap: 6px; margin-bottom: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
  .chip { min-height: 40px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
  .count { font-size: 20px; }

  /* Show page */
  .show-head { min-height: 260px; margin: 0 -14px 10px; padding: 0 14px; }
  .show-head h1 { font-size: 32px; }
  .show-head .meta { font-size: 15px; }
  .ep { flex-basis: 250px; }

  /* Live TV */
  .tv { grid-template-columns: 1fr; gap: 12px; }
  .rail { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding: 6px; border-radius: 20px; }
  .rail .chips { display: none; }
  .rail-item { white-space: nowrap; min-height: 44px; font-size: 15px; }
  .chan-main { gap: 12px; padding: 10px; }
  .chan-logo { flex-basis: 60px; height: 60px; border-radius: 14px; }
  .chan-text .t { font-size: 17px; }
  .chan-text .now { font-size: 15px; }
  .star { flex-basis: 56px; font-size: 24px; }

  /* YouTube */
  .yt-head { gap: 10px; }
  .yt-search { max-width: none; width: 100%; flex-basis: 100%; }
  .yt-search input { height: 48px; }
  .yt-signin { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .pl-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pl-tile { min-height: 64px; padding: 0 14px; font-size: 16px; }

  /* Settings */
  .settings { grid-template-columns: 1fr; gap: 14px; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 20px; scrollbar-width: none; }
  .set-nav a { white-space: nowrap; min-height: 46px; font-size: 15px; gap: 8px; padding: 0 10px; }
  .set-ico { width: 28px; height: 28px; }
  .set-main h1 { font-size: 28px; }
  .set-row { flex-wrap: wrap; padding: 12px 14px; }
  .seg button { min-height: 44px; font-size: 14px; }
  .diag-row { grid-template-columns: 14px 1fr; padding: 10px 14px; }
  .diag-row .muted { grid-column: 2; }

  /* Sign in, welcome, pairing, libraries */
  .center { min-height: calc(100vh - 120px); }
  .panel { padding: 26px 20px; border-radius: 26px; }
  .signin-qr .qr { width: 220px; height: 220px; }
  .onboard { padding-top: 20px; }
  .onboard h1 { font-size: 34px; }
  .ob-lede { font-size: 17px; margin-bottom: 18px; }
  .ob-card { padding: 20px; gap: 20px; border-radius: 28px; }
  .ob-qr .qr { width: 220px; height: 220px; }
  .ob-step { font-size: 17px; }
  .ob-provs, .ob-right .waiting { margin-left: 0; }
  .pair { flex-direction: column; gap: 20px; }
  .pair-card { padding: 22px; border-radius: 28px; }
  .pair-text h1 { font-size: 30px; }
  .qr { width: 220px; height: 220px; }
  .steps { font-size: 16px; }
  .code-tiles span { width: 30px; height: 40px; font-size: 19px; border-radius: 8px; }
  .lib-card { border-radius: 24px; }
  .sheet { padding: 10px; }
  .sheet-card { padding: 20px; border-radius: 26px; max-height: 92vh; overflow-y: auto; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); font-size: 15px; }

  /* Player */
  .p-close { left: 14px; top: max(14px, env(safe-area-inset-top)); width: 48px; height: 48px; }
  .p-tools { right: 14px; top: max(14px, env(safe-area-inset-top)); height: 48px; padding: 2px; }
  .cap { height: 42px; min-width: 42px; padding: 0 10px; font-size: 14px; }
  .cap.icon { width: 42px; }
  .p-tools .cap span:not(.q-h) { display: none; }
  .transport { gap: 26px; bottom: 120px; }
  .t-btn { width: 64px; height: 64px; }
  .t-btn svg { width: 34px; height: 34px; }
  .t-btn.big { width: 84px; height: 84px; }
  .t-btn.big svg { width: 40px; height: 40px; }
  .spinner { top: calc(50% - 60px); width: 100px; height: 100px; margin: -50px; border-width: 3px; }
  .vbright { right: 14px; top: calc(72px + env(safe-area-inset-top)); transform: none; margin-top: 0; width: 48px; height: 160px; border-radius: 18px; }
  .vbright .sun { left: 13px; bottom: 12px; width: 26px; height: 26px; }
  .p-bottom { left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); gap: 6px; }
  .p-title { font-size: 20px; }
  .p-sub { font-size: 14px; }
  .p-times { font-size: 14px; }
  .menu { left: 12px; right: 12px; width: auto; top: 76px; max-height: 60vh; z-index: 20; }
  .stats { left: 14px; top: 76px; font-size: 11px; }
  .captions { left: 4%; right: 4%; }
  .player:not(.osd-hidden) .captions { bottom: 130px; }
  .cap-s { font-size: 16px; } .cap-m { font-size: 20px; } .cap-l { font-size: 26px; }
}

/* Short screens (a phone on its side): keep the player's controls inside the height. */
@media (max-height: 520px) {
  .p-close { top: 10px; left: 14px; width: 46px; height: 46px; }
  .p-tools { top: 10px; right: 14px; height: 46px; padding: 2px; }
  .cap { height: 40px; min-width: 40px; padding: 0 10px; font-size: 14px; }
  .cap.icon { width: 40px; }
  .transport { gap: 40px; bottom: 90px; }
  .t-btn { width: 60px; height: 60px; }
  .t-btn svg { width: 32px; height: 32px; }
  .t-btn.big { width: 78px; height: 78px; }
  .t-btn.big svg { width: 38px; height: 38px; }
  .spinner { top: calc(50% - 45px); width: 92px; height: 92px; margin: -46px; border-width: 3px; }
  .vbright { right: 14px; top: 64px; transform: none; margin-top: 0; width: 46px; height: calc(100vh - 170px); max-height: 200px; border-radius: 16px; }
  .vbright .sun { left: 11px; bottom: 10px; width: 24px; height: 24px; }
  .p-bottom { left: 18px; right: 74px; bottom: 8px; gap: 2px; }
  .p-title { font-size: 18px; }
  .p-sub, .p-times { font-size: 13px; }
  .menu { top: 62px; max-height: calc(100vh - 76px); }
  .player:not(.osd-hidden) .captions { bottom: 96px; }
  .bar { padding-top: 8px; padding-bottom: 8px; }
  .hero { height: 260px; }
}

/* ---- Setup screens (sign in, add media, libraries, Plex link, YouTube, phone remote) ----
   A glass card over the colour glow: QR left, a few words right. */
.setup { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 110px 40px 120px; }
.view:has(> .setup) { padding: 0; max-width: none; }
.step-bar { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.sb-step { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--fg-2); }
.sb-step.done { color: #D1D1D6; }
.sb-step.cur { color: var(--fg); }
.sb-dot { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.14); color: #D1D1D6; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.sb-step.done .sb-dot { background: var(--ok); color: #000; }
.sb-step.cur .sb-dot { background: var(--fg); color: #000; }
.sb-line { width: 48px; height: 2px; border-radius: 1px; background: rgba(255,255,255,.18); }
.sb-line.on { background: rgba(255,255,255,.55); }
.setup-card { position: relative; width: min(980px, 100%); padding: 48px; border-radius: 40px; display: flex; gap: 56px; align-items: center; background: rgba(30,30,32,.72); box-shadow: 0 40px 120px rgba(0,0,0,.55); }
.setup-card.narrow { width: min(760px, 100%); justify-content: center; }
.sc-close, .sc-back { position: absolute; top: 24px; }
.sc-close { right: 24px; }
.sc-back { left: 24px; }
.sc-qr .qr { width: 360px; height: 360px; border-radius: 28px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.qr-wait { background: rgba(255,255,255,.08); }
.sc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.sc-body h1 { font-size: 50px; margin: 0; }
.sc-center { align-items: center; text-align: center; }
.sc-lede { margin: 0; font-size: 22px; line-height: 1.4; color: #D1D1D6; }
.sc-lede b { color: var(--fg); }
.sc-body .err:empty { display: none; }
.sc-body .err { margin: 0; }
.sc-badge { margin: 0; min-height: 44px; padding: 8px 18px; border-radius: 22px; background: rgba(255,159,10,.14); color: #FFB340; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.sc-badge.warn { background: rgba(255,69,58,.14); color: #FF8A80; }
.sc-provs { margin: 0; padding: 0; list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
.sc-provs li { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: #D1D1D6; }
.sc-provs .ob-ico { width: 40px; height: 40px; border-radius: 11px; }
.ob-ico svg { width: 60%; height: 60%; }
.ob-ico.big { width: 76px; height: 76px; border-radius: 22px; }
.ob-ico.sm { width: 28px; height: 28px; border-radius: 8px; }
.ob-ico.yt { background: #fff; width: 56px; height: 56px; border-radius: 16px; flex: 0 0 auto; }
.ob-ico.yt svg { width: 70%; height: 70%; }
.sc-title { display: flex; align-items: center; gap: 16px; }
.sc-title h1 { font-size: 42px; }
.sc-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 21px; color: #D1D1D6; }
.sc-steps li { display: flex; align-items: center; gap: 14px; }
.sc-steps li > span:first-child { flex: 0 0 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 16px; font-weight: 700; color: var(--fg); }
.sc-steps b { color: var(--fg); }
.sc-steps li { min-width: 0; flex-wrap: wrap; }
/* Google's TV codes are 10+ characters: smaller tiles so they fit beside the QR. */
.sc-steps .code-tiles { gap: 4px; flex-wrap: wrap; }
.sc-steps .code-tiles span { width: 36px; height: 50px; font-size: 24px; border-radius: 10px; }
.sc-steps .code-tiles .gap { width: 8px; }
.big-tiles { display: flex; gap: 12px; }
.big-tiles span { width: 92px; height: 108px; border-radius: 20px; background: rgba(255,255,255,.10); display: grid; place-items: center; font-size: 60px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-tile { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; }
.sc-tile.orange { background: #FF9F0A; }
.sc-count { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; color: #D1D1D6; }
.sc-count .dot.ok { box-shadow: 0 0 8px rgba(48,209,88,.7); }
.setup-foot { font-size: 16px; color: var(--fg-2); text-align: center; overflow-wrap: anywhere; }
.setup-foot b { color: #D1D1D6; font-weight: 600; }
.setup-foot:empty { display: none; }
/* Sign-in poster wall (Plex's trending titles) */
.sw-box { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.sw { position: absolute; inset: -25%; display: flex; justify-content: center; gap: 18px; transform: rotate(-12deg); opacity: .5; pointer-events: none; }
.sw-col { display: flex; flex-direction: column; gap: 18px; width: 170px; flex: 0 0 auto; animation: sw-down 150s linear infinite; }
.sw-col.up { animation-name: sw-up; }
.sw-col img { width: 170px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,.04); opacity: 0; transition: opacity .8s; }
.sw-col img.on { opacity: 1; }
.sw-shade { position: absolute; inset: 0; background: radial-gradient(60% 70% at 50% 50%, rgba(5,5,6,.55), rgba(5,5,6,.92)); }
.setup.has-wall .ob-glow { display: none; }
.setup.has-wall > .setup-foot, .setup.has-wall > .step-bar { position: relative; }
@keyframes sw-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes sw-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sw-col { animation: none; } .sw-col img { transition: none; } }
.setup-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.setup-links .btn { min-height: 50px; font-size: 17px; padding: 0 22px; }
.mono { letter-spacing: .04em; }
.fade-in { animation: tc-fade .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tc-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }
body.flat .setup-card { background: var(--panel-2); }

/* Choose libraries */
.libs-setup { justify-content: flex-start; padding-top: 120px; }
.libs-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.libs-head h1 { font-size: 48px; margin: 0; }
.libs-src { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; color: #D1D1D6; }
.libs-setup .lib-card, .libs-page .lib-card { width: min(760px, 100%); margin: 0 auto; }
.libs-cap { margin: 0; text-align: center; font-size: 16px; color: var(--fg-2); }
.libs-page { display: flex; flex-direction: column; gap: 18px; }

/* Phone remote sheet on the car */
.pair-sheet { display: flex; gap: 48px; align-items: center; }
.pair-sheet .sc-body h1 { font-size: 46px; }
.pair-sheet .qr { width: 320px; height: 320px; }
.sheet-foot { margin: 22px 0 0; text-align: center; font-size: 16px; color: var(--fg-2); }
.sheet-foot b { color: #D1D1D6; font-weight: 600; }

@media (max-width: 1000px) {
  .setup-card { flex-direction: column; gap: 28px; text-align: center; }
  .setup-card .sc-body { align-items: center; }
  .pair-sheet { flex-direction: column; gap: 24px; text-align: center; }
  .pair-sheet .sc-body { align-items: center; }
}
@media (max-width: 640px) {
  .setup { padding: 84px 14px 40px; gap: 16px; }
  .step-bar { top: 22px; gap: 8px; }
  .sb-step { font-size: 0; gap: 0; }
  .sb-line { width: 28px; }
  .setup-card { padding: 24px 18px; border-radius: 28px; }
  .sc-qr .qr, .pair-sheet .qr { width: 220px; height: 220px; padding: 14px; border-radius: 20px; }
  .sc-body { gap: 14px; }
  .sc-body h1, .libs-head h1 { font-size: 32px; }
  .sc-title h1 { font-size: 28px; }
  .sc-lede { font-size: 17px; }
  .sc-provs { gap: 14px; justify-content: center; }
  .sc-provs li { font-size: 15px; }
  .sc-steps { font-size: 16px; }
  .big-tiles span { width: 60px; height: 72px; font-size: 38px; border-radius: 14px; }
  .sc-close, .sc-back { top: 12px; width: 44px; height: 44px; flex-basis: 44px; }
  .sc-close { right: 12px; } .sc-back { left: 12px; }
  .libs-setup { padding-top: 84px; }
  .p-next { min-height: 42px; font-size: 14px; padding: 0 12px; }
  .p-next .pn-h { display: none; }
}

/* ---- Settings: glass groups over the artwork ---- */
.group { background: rgba(30,30,32,.55); border: 1px solid rgba(255,255,255,.10); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
body.flat .group { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel-2); }
.set-row .grow, .grow { flex: 1; min-width: 0; }
.set-row .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.set-row, a.set-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); text-align: left; font: inherit; justify-content: flex-start; }
button.set-row:last-child, a.set-row:last-child { border-bottom: 0; }
.set-row .chev { flex: 0 0 auto; color: #6E6E73; }
.set-row.act { color: var(--blue); font-weight: 600; }
.set-row.hold { position: relative; overflow: hidden; color: var(--danger); font-weight: 600; touch-action: none; user-select: none; }
.set-row.hold .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,69,58,.22); }
.set-row.hold .lbl { position: relative; }
.src-row { gap: 16px; }
.src-row .kind, .src-title .kind { width: 48px; height: 48px; }
.kind svg { width: 62%; height: 62%; }
.kind.car-ico { background: rgba(255,255,255,.12); color: var(--fg); width: 40px; height: 40px; }
.set-back { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); font-weight: 600; font-size: 17px; margin: 4px 0 10px; }
.src-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.src-title h1 { margin: 0; }
.set-row.who { gap: 14px; }
.set-row .av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff; }
.tag { flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: #D1D1D6; }
.tag.ok { background: rgba(48,209,88,.16); color: var(--ok); }
.btn-s.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-s.danger-txt { color: #FF6961; }
.set-row .field-s { width: auto; border: 0; background: transparent; padding: 10px 0; font-size: 18px; }
.rename .field-s { flex: 1; border: 1px solid var(--line); background: rgba(0,0,0,.3); padding: 10px 12px; }
.set-main .row-btns { margin: 0 0 16px; }

/* ---- Library pages ---- */
.lib-head { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.lib-head h1 { margin: 6px 0 0; }
.lib-tabs { margin: 0 0 4px; }
.lib-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0 18px; }
.lib-tools .chips { margin: 0; }
.lib-tools button.chip { cursor: pointer; }
.grid-end { height: 1px; }
.az { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 9; display: flex; flex-direction: column; gap: 1px; padding: 8px 4px; border-radius: 22px; background: rgba(30,30,32,.55); border: 1px solid rgba(255,255,255,.10); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); max-height: calc(100vh - 200px); overflow-y: auto; scrollbar-width: none; }
.az button { width: 34px; min-height: 26px; border: 0; border-radius: 13px; background: transparent; color: var(--fg-2); font-size: 14px; font-weight: 700; }
.az button:hover, .az button.on { background: var(--fg); color: var(--bg); }
.view:has(.az:not([hidden])) .grid { margin-right: 44px; }
.genre-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.genre-tile { position: relative; min-height: 110px; padding: 18px; border-radius: 22px; display: flex; align-items: flex-end; font-size: 22px; font-weight: 700; letter-spacing: -.01em; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 55%, transparent), color-mix(in srgb, var(--tint) 15%, transparent)); border: 1px solid rgba(255,255,255,.12); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.genre-tile:active { transform: scale(.97); }
@media (max-width: 640px) {
  .lib-head { gap: 10px; }
  .lib-tabs, .lib-tools .chips { flex-wrap: nowrap; overflow-x: auto; }
  .az { right: 4px; padding: 6px 2px; }
  .az button { width: 24px; min-height: 18px; font-size: 11px; }
  .view:has(.az:not([hidden])) .grid { margin-right: 28px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .genre-tile { min-height: 80px; font-size: 17px; padding: 12px; border-radius: 16px; }
}

/* ---- Search dropdown ---- */
.s-wrap > svg { z-index: 1; }
.search-drop { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 130px); overflow-y: auto; overscroll-behavior: contain; z-index: 30; padding: 8px; border-radius: 24px;
  background: rgba(30,30,34,.88); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: sd-in .18s ease both; text-align: left; }
@keyframes sd-in { from { opacity: 0; } to { opacity: 1; } }
body.flat .search-drop { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel-2); }
.sd-head { padding: 10px 14px 8px; font-size: 18px; font-weight: 700; text-align: center; }
.sd-sub { padding: 14px 14px 6px; font-size: 15px; font-weight: 600; color: var(--fg-2); }
.sd-row { display: flex; align-items: center; gap: 6px; border-radius: 16px; }
.sd-row + .sd-row { border-top: 1px solid rgba(255,255,255,.06); }
.sd-row:hover { background: rgba(255,255,255,.06); }
.sd-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px 10px; min-height: 76px; }
.sd-thumb { flex: 0 0 48px; height: 72px; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, #2a2a30, #151517); }
.sd-thumb.wide { flex-basis: 96px; height: 54px; }
.sd-thumb.chan { flex-basis: 56px; height: 56px; background: #fff; }
.sd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-thumb.chan img { object-fit: contain; padding: 6px; }
.sd-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sd-txt b { font-size: 18px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-txt span { font-size: 15px; color: #D1D1D6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-txt em { font-style: normal; font-size: 14px; color: var(--fg-2); }
.sd-play { flex: 0 0 52px; height: 52px; margin-right: 6px; border-radius: 50%; display: grid; place-items: center; color: var(--fg); }
.sd-play:hover { background: rgba(255,255,255,.12); }
.sd-empty { padding: 12px 14px 16px; color: var(--fg-2); text-align: center; margin: 0; }
.sd-wait { justify-content: center; padding: 10px 0 12px; margin: 0; }
.sd-foot { display: flex; justify-content: flex-end; padding: 10px 8px 6px; }
.sd-more { min-height: 46px; font-size: 16px; padding: 0 20px; }
@media (max-width: 640px) {
  .search-drop { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; transform: none; max-height: calc(100vh - 150px); border-radius: 20px; }
  .sd-main { min-height: 64px; gap: 10px; }
  .sd-thumb { flex-basis: 40px; height: 60px; }
  .sd-txt b { font-size: 16px; }
  .sd-txt span { font-size: 13px; }
}

/* Full screen */
.fs-btn.on svg { transform: scale(.85); }
.fs-hop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 24px; animation: sd-in .2s ease both; }
.fs-hop-card { max-width: 560px; border-radius: 32px; padding: 32px 36px; text-align: center; background: rgba(30,30,32,.85); }
.fs-hop-card h2 { justify-content: center; margin: 0 0 8px; font-size: 30px; }
.fs-hop-card p { margin: 0 0 18px; font-size: 20px; color: #D1D1D6; }
.fs-hop-card b { color: var(--fg); }
.fs-hop-skip { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; color: var(--fg-2); }
.fs-hop-skip input { width: 20px; height: 20px; }

/* Home: phone remote tip */
.remote-tip { margin: 34px 0 10px; padding: 16px 16px 16px 18px; border-radius: 26px; display: flex; align-items: center; gap: 16px; max-width: 760px; }
.remote-tip .grow { display: flex; flex-direction: column; }
.remote-tip b { font-size: 20px; }
.remote-tip .grow span { color: #D1D1D6; font-size: 16px; }
.remote-tip .btn { min-height: 50px; font-size: 17px; padding: 0 22px; }
.remote-tip .glass-btn { width: 44px; height: 44px; flex-basis: 44px; }
@media (max-width: 640px) { .remote-tip { gap: 12px; padding: 12px; } .remote-tip .sc-tile { display: none; } .remote-tip .btn { min-height: 44px; padding: 0 14px; font-size: 15px; } }

/* Placeholders while things load (a soft shimmer, no spinner) */
.sk { background: linear-gradient(100deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 70%); background-size: 300% 100%; animation: sk-shine 1.4s ease-in-out infinite; border-radius: 16px; }
.hero.sk { box-shadow: none; }
.sk-h2 { width: 240px; height: 26px; margin: 30px 0 16px; border-radius: 8px; }
.sk-line { height: 16px; width: 70%; border-radius: 6px; margin-top: 2px; }
.sk-row { pointer-events: none; }
.sk-line.short { width: 45%; }
.sk-title { width: min(460px, 70%); height: 64px; border-radius: 12px; margin-bottom: 14px; }
.sk-meta { width: 220px; margin-bottom: 18px; }
.show-head .txt.sk-row { display: flex; flex-direction: column; gap: 10px; width: min(720px, 100%); }
.sk-btn { width: 220px; height: 60px; border-radius: 30px; margin-top: 14px; }
.sk-chip { display: inline-block; width: 112px; height: 46px; border-radius: 23px; }
.sk-chan { height: 92px; border-radius: 22px; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.home-miss { display: flex; align-items: center; gap: 12px; margin: 24px 0 8px; color: var(--fg-2); }

/* Games */
.sc-tile.blue { background: var(--blue); color: #fff; }
.sc-tile.ps { background: #1F4FD1; color: #fff; }
.g-empty { min-height: calc(100vh - 200px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; text-align: center; padding: 40px 0 120px; }
.g-empty h1 { margin: 0; font-size: 52px; letter-spacing: -.035em; }
.g-empty > p { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; }
.g-choices { width: 100%; display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.g-choice { flex: 0 1 500px; min-width: 0; height: 236px; padding: 32px 36px; border-radius: 36px; border: 1px solid var(--glass-line); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; color: var(--fg); font: inherit; cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.g-choice:active { transform: scale(.98); }
.g-choice .sc-tile { width: 72px; height: 72px; border-radius: 20px; }
.g-choice b { font-size: 32px; letter-spacing: -.02em; }
.g-choice > span:last-child { font-size: 19px; color: #D1D1D6; }
.g-pc h2 { gap: 14px; }
.g-status { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--fg-2); }
.g-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fg-3); }
.g-status.ready { color: var(--ok); } .g-status.ready .dot { background: var(--ok); }
.g-status.playing { color: #64D2FF; } .g-status.playing .dot { background: #64D2FF; }
.g-status.resting { color: #FF9F0A; } .g-status.resting .dot { background: #FF9F0A; }
.g-card { flex: 0 0 300px; border: 0; padding: 0; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.g-card .g-art { aspect-ratio: 460/215; display: grid; place-items: center; background: linear-gradient(135deg, #1F1F22, #2C2C30); }
.g-card .g-art.g-steam, .g-card .g-art.g-bigpicture { background: linear-gradient(135deg, #0E1C2F, #1B3A63); }
.g-card .g-art.g-epic { background: linear-gradient(135deg, #1C1C1E, #3A3A3C); }
/* Desktop: a little desktop (wallpaper glow, two windows, a taskbar) */
.g-art.g-desktop { display: block; background: radial-gradient(60% 80% at 25% 20%, #3B7BFF 0%, transparent 60%), radial-gradient(55% 70% at 85% 70%, #9B5CF6 0%, transparent 65%), linear-gradient(160deg, #10204A, #1A0F35); }
.gd-win { position: absolute; border-radius: 7px; background: rgba(245,245,247,.88); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.gd-win::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 11px; border-radius: 7px 7px 0 0; background: rgba(5,5,6,.12); }
.gd-win.a { left: 13%; top: 16%; width: 46%; height: 50%; }
.gd-win.b { left: 44%; top: 30%; width: 40%; height: 44%; background: rgba(230,232,238,.95); }
.gd-bar { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); height: 18px; padding: 0 8px; border-radius: 9px; background: rgba(20,20,28,.55); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 5px; }
.gd-bar i { width: 9px; height: 9px; border-radius: 3px; background: rgba(255,255,255,.8); }
.gd-bar i:first-child { background: #4C9AFF; }
/* Steam Big Picture: Steam's navy and its mark */
.g-art.g-bigpicture { background: radial-gradient(70% 90% at 80% 10%, rgba(102,192,244,.35), transparent 60%), linear-gradient(135deg, #171A21 0%, #1B2838 50%, #2A475E 100%); }
.gb-mark { display: flex; align-items: center; gap: 12px; }
.gb-mark span { font-size: 21px; font-weight: 800; letter-spacing: .14em; color: #fff; }
.g-name { padding: 0 18px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-align: center; color: rgba(245,245,247,.85); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-card img + .g-name { display: none; }
.g-foot { margin: 30px 0 120px; }
.pc-add .pc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 20px; }
.pc-steps li { display: flex; gap: 14px; align-items: baseline; }
.pc-steps li > span { color: var(--fg-2); font-weight: 700; }
.pc-code { flex: 0 0 380px; display: flex; flex-direction: column; gap: 14px; }
.pc-code label { font-size: 17px; font-weight: 600; }
.code-input { width: 100%; height: 84px; border-radius: 22px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.08); color: var(--fg); text-align: center; font: 700 40px/1 Inter, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; outline: none; }
.code-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.35); }
.code-input::placeholder { color: var(--fg-3); }
.pc-code .err { margin: 0; min-height: 1.4em; }
.pc-code .row-btns { margin: 0; }
@media (max-width: 900px) { .pc-code { flex-basis: auto; width: 100%; } }

/* PlayStation tile, linking, and the game screen */
.ps-tile { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 26px; max-width: 760px; border: 1px solid var(--glass-line); }
.ps-tile .grow { display: flex; flex-direction: column; gap: 2px; font-size: 20px; }
.ps-tile .muted { font-size: 16px; }
.ps-found { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.ps-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px; border-radius: 18px; border: 2px solid transparent; background: rgba(255,255,255,.08); color: var(--fg); font: inherit; font-size: 19px; text-align: left; cursor: pointer; }
.ps-pick.on { border-color: var(--blue); }
.ps-pick .muted { font-size: 15px; }
.ps-ip { display: flex; gap: 8px; width: 100%; }
.ps-ip .field-s { flex: 1; }
.game { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; place-items: center; }
.game canvas { width: 100%; height: 100%; object-fit: contain; }
.game-msg { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 16px; font-size: 22px; color: #D1D1D6; text-align: center; max-width: 640px; padding: 0 24px; }
.game-msg .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--fg); animation: g-spin .9s linear infinite; }
.game-msg.ended .spin { display: none; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.game-more { position: absolute; top: 20px; right: 20px; opacity: .55; font-weight: 800; letter-spacing: .05em; }
.game.menu-open .tpad { opacity: 0; pointer-events: none; }
.game-menu { position: absolute; z-index: 5; width: min(460px, calc(100% - 32px)); padding: 18px; border-radius: 32px; display: flex; flex-direction: column; gap: 10px; }
.game-menu .btn { width: 100%; }
.game-menu p { margin: 6px 0 0; text-align: center; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .game-msg .spin { animation: none; } }

/* PS5 card: PlayStation blue, the face-button shapes, a Play pill */
.g-art.g-ps { display: block; background: radial-gradient(80% 120% at 85% 0%, #3C7BFF 0%, transparent 55%), linear-gradient(135deg, #061A4D 0%, #0B2F8C 55%, #071640 100%); }
.gp-glyphs { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; }
.gp-play { position: absolute; left: 16px; bottom: 14px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--fg); color: var(--bg); display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.gp-play svg { width: 13px; height: 13px; }
.g-art.g-psnow { background: linear-gradient(135deg, #10204A, #2B3F8F 60%, #4C2E8A); }
.gp-badge { position: absolute; left: 10px; top: 10px; height: 24px; padding: 0 9px; border-radius: 12px; background: rgba(0,0,0,.55); display: flex; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .04em; }

/* Games in Search */
.sd-thumb.sd-game { background: linear-gradient(135deg, #1F1F22, #2C2C30); }
.sd-thumb.sd-game.ps { background: linear-gradient(135deg, #061A4D, #0B2F8C); }
.sd-thumb.sd-game.desktop { background: linear-gradient(160deg, #10204A, #5B3FB0); }
.sd-thumb.sd-game.bigpicture { background: linear-gradient(135deg, #171A21, #2A475E); }
.g-card.g-focus .art { box-shadow: 0 0 0 3px var(--fg), 0 14px 40px rgba(0,0,0,.45); transition: box-shadow .3s; }

/* Touch controller: thin white wireframe, front-on, grips off the bottom edge */
/* Touch controller (touchpad.js): lines baked from a 3D model; .pm = its parts */
.tpad { position: absolute; left: 50%; bottom: 2vh; transform: translateX(-50%); width: min(760px, 92vw); z-index: 2; touch-action: none; transition: opacity .5s; }
.tpad.tp-idle { opacity: .3; }
.tpad svg { display: block; touch-action: none; width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overflow: visible; }
.pm path, .pm circle { vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
/* a soft dark under-stroke keeps the lines readable over bright video */
.pm-shell { fill: none; stroke: rgba(0,0,0,.5); stroke-width: 4; }
.pm-line { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.5; }
.pm-part { fill: none; stroke: rgba(255,255,255,.92); stroke-width: 1.5; transition: stroke .08s, transform .08s; }
.pm-part.on { stroke: #fff; stroke-width: 2.2; transform: translateY(var(--dip)); }
.pm-fill { fill: rgba(255,255,255,0); transition: fill .08s, transform .08s; }
.pm-fill.on { fill: rgba(255,255,255,.28); transform: translateY(var(--dip)); }
.pm-sym { fill: none; stroke: rgba(255,255,255,.92); stroke-width: 1.5; pointer-events: none; }
.pm-ps { fill: none; stroke: rgba(255,255,255,.92); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: transform .07s, stroke .07s; }
.pm-ps.on { stroke: #fff; stroke-width: 2; transform: translateY(var(--dip)); filter: drop-shadow(0 0 4px rgba(255,255,255,.8)); }
.pm-stick { pointer-events: none; }
.pm-boot { fill: rgba(16,16,20,.75); stroke: rgba(255,255,255,.7); stroke-width: 1.4; }
.pm-stem { fill: rgba(16,16,20,.9); stroke: rgba(255,255,255,.75); stroke-width: 1.4; }
.pm-cap { fill: rgba(28,28,33,.95); stroke: rgba(255,255,255,.92); stroke-width: 1.5; }
.pm-rim { fill: rgba(38,38,44,.95); stroke: rgba(255,255,255,.85); stroke-width: 1.4; }
.pm-dish { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 1.2; }
.pm-stick.on .pm-cap, .pm-stick.on .pm-rim { stroke: #fff; }
.pm-stick.on .pm-rim { fill: rgba(255,255,255,.18); }
@media (prefers-reduced-motion: reduce) { .tpad, .pm-part, .pm-fill { transition: none; } }

/* Game menu switch */
.game-sw { display: flex; justify-content: space-between; align-items: center; }
.sw { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.25); position: relative; flex: 0 0 50px; transition: background-color .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.sw.on { background: var(--ok); }
.sw.on i { transform: translateX(20px); }

/* Pull down to shrink: a handle that follows the finger */
.game-pull { position: absolute; top: 14px; left: 50%; margin-left: -60px; width: 120px; height: 34px; display: grid; place-items: center; z-index: 3; pointer-events: none; opacity: .35; transition: opacity .2s; }
.game-pull span { width: 54px; height: 6px; border-radius: 3px; background: #fff; transition: width .2s; }
.game-pull.on { opacity: .9; }
.game-pull.go span { width: 84px; }

/* Picture in picture: the game in a corner while you browse */
.game-pip-x { display: none; }
.game.pip { inset: auto 24px 112px auto; width: min(420px, 46vw); height: auto; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; z-index: 70; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.14); cursor: pointer; transition: box-shadow .2s; }
.game.pip .tpad, .game.pip .game-more, .game.pip .game-menu, .game.pip .game-pull { display: none; }
.game.pip .game-msg { font-size: 14px; gap: 8px; }
.game.pip .game-pip-x { display: grid; place-items: center; position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; z-index: 2; }
.game.pip .game-pip-x svg { width: 16px; height: 16px; }

/* Plex sign-in: the wordmark on a faint gold button. */
.btn.btn-plex { background: rgba(247,198,0,.10); border: 1px solid rgba(247,198,0,.45); color: #fff; }
.btn-plex .plex-word { height: 26px; width: auto; }

/* ---- Friends and Plex Home profiles ---- */
/* The profile picture in the header: switches profile */
.who-btn { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; padding: 0; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--glass-line); overflow: hidden; }
.who-btn-av { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; font-size: 24px; font-weight: 700; color: #fff; }
/* A red dot on Settings while a friend is waiting */
#settings-btn.badged::after { content: ''; position: absolute; right: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.set-nav .nav-badge { margin-left: auto; min-width: 26px; height: 26px; padding: 0 8px; box-sizing: border-box; border-radius: 13px; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.set-row img.av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sk-av { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; }

/* A friend waiting to be let in */
.fw { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--glass); }
.fw-pics { display: flex; margin-bottom: 10px; }
.fw-av { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; font-size: 40px; font-weight: 700; color: #fff; box-shadow: 0 0 0 4px rgba(40,40,44,.9); }
.fw-av.fw-owner { margin-left: -18px; }
.fw h1 { margin-bottom: 4px; }
.fw .btn { margin-top: 18px; }

/* Who's watching */
.whos { min-height: calc(100vh - 200px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px; text-align: center; }
.whos h1 { margin: 0; font-size: 52px; letter-spacing: -.03em; }
.who-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 48px; }
.who-p { border: 0; padding: 0; background: none; color: var(--fg); display: flex; flex-direction: column; align-items: center; gap: 16px; font: inherit; cursor: pointer; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.who-p:active { transform: scale(.95); }
.who-pic { position: relative; }
.who-av { width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; font-size: 68px; font-weight: 700; color: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.who-p.on .who-av { box-shadow: 0 0 0 4px var(--fg), 0 20px 50px rgba(0,0,0,.45); }
.who-lock { position: absolute; right: 4px; bottom: 4px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.who-name { font-size: 22px; font-weight: 600; }
.who-ask { display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 24px; border-radius: 30px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--fg-2); font-size: 19px; cursor: pointer; }

/* A profile's PIN */
.pin-card { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pin-av { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; font-size: 32px; font-weight: 700; color: #fff; }
.pin-card h2 { margin: 0; font-size: 26px; }
.pin-dots { display: flex; gap: 18px; margin: 2px 0 6px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); box-sizing: border-box; transition: background-color .12s; }
.pin-dots span.on { background: var(--fg); }
.pin-dots.shake { animation: pin-shake .4s; }
@keyframes pin-shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-keys { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pin-key { height: 72px; border-radius: 36px; border: 0; background: rgba(255,255,255,.12); color: var(--fg); font: 500 30px var(--font); cursor: pointer; transition: transform .15s, background-color .15s; }
.pin-key:active { transform: scale(.94); background: rgba(255,255,255,.28); }
.pin-key.del { background: transparent; }
@media (prefers-reduced-motion: reduce) { .who-p, .pin-key, .pin-dots span { transition: none; } .pin-dots.shake { animation: none; } }
