:root {
  --bg: #0b0c10;
  --bg-2: #0f1116;
  --panel: #171a22;
  --panel-2: #1e222d;
  --line: #262b38;
  --text: #f4f6fb;
  --muted: #9aa1b4;
  --accent: #6c5cff;
  --accent-2: #37c2ff;
  --grad: linear-gradient(120deg, #6c5cff, #37c2ff);
  --hot: #ff4d6d;
  --r-card: 7px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-card: 0 10px 34px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 26px 70px rgba(0, 0, 0, 0.75);
  --edge: 4vw;
}

* { box-sizing: border-box; }

/* scroll-padding keeps arrow-key focus (scrollIntoView) from sliding items
   under the fixed nav — and makes upward navigation actually scroll up. */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
.detail { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- Top navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 26px;
  padding: 16px var(--edge);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.85), rgba(6, 7, 10, 0));
}
.nav.scrolled {
  background: rgba(9, 10, 14, 0.92);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.brand {
  font-size: 21px; font-weight: 800; letter-spacing: 0.3px; margin: 0;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 6px; }
.nav-link {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 8px;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ''; display: block; height: 2px; margin-top: 5px; border-radius: 2px; background: var(--grad);
}
.nav .spacer { flex: 1; }
.nav-search {
  background: rgba(20, 22, 30, 0.7); border: 1px solid var(--line); color: var(--text);
  padding: 9px 15px; border-radius: 999px; width: 210px; outline: none; transition: border-color 0.15s ease, width 0.2s ease;
}
.nav-search:focus { border-color: var(--accent); width: 260px; }
.icon-btn {
  background: rgba(20, 22, 30, 0.7); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.pill-update {
  background: var(--grad); color: #fff; border: none; padding: 9px 16px; border-radius: 999px;
  cursor: pointer; font-weight: 700; font-size: 13px; animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(108, 92, 255, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(108, 92, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 92, 255, 0); }
}

/* ---------- Hero billboard ---------- */
.hero {
  position: relative; height: 78vh; min-height: 520px; max-height: 820px;
  display: flex; align-items: flex-end;
  margin-bottom: 8px;
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 18%;
  transition: opacity 0.8s ease;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 12, 16, 0.95) 0%, rgba(11, 12, 16, 0.55) 32%, rgba(11, 12, 16, 0) 62%),
    linear-gradient(0deg, var(--bg) 2%, rgba(11, 12, 16, 0.4) 34%, rgba(11, 12, 16, 0) 68%);
}
.hero-content {
  position: relative; z-index: 2; padding: 0 var(--edge) 7vh; max-width: 720px;
}
.hero-title {
  font-size: clamp(30px, 5vw, 58px); font-weight: 800; line-height: 1.05; margin: 0 0 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.hero-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-overview {
  font-size: 16px; color: #dfe3ee; max-width: 60ch; margin: 0 0 22px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.hero-actions { display: flex; gap: 12px; align-items: center; }
.hero-dots { position: absolute; right: var(--edge); bottom: 7vh; z-index: 3; display: flex; gap: 8px; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); cursor: pointer; border: none; }
.hero-dot.active { background: #fff; width: 22px; border-radius: 4px; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: rgba(40, 44, 56, 0.75); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 11px 20px; border-radius: 8px; font-weight: 600; font-size: 15px; backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: rgba(60, 66, 82, 0.9); }
.btn:active { transform: scale(0.97); }
.btn-play {
  background: #fff; color: #0b0c10; border: none; font-weight: 800;
}
.btn-play:hover { background: #e7e9f2; }
.btn-grad { background: var(--grad); color: #fff; border: none; font-weight: 700; }
.btn-grad:hover { filter: brightness(1.08); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.chip {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px; color: var(--muted);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.chip.rating { color: #ffd76a; border-color: rgba(255, 215, 106, 0.3); }
.chip.q { color: #cfe0ff; border-color: rgba(80, 130, 255, 0.35); }
.chip.new { color: #fff; background: var(--hot); border-color: transparent; }

/* ---------- Content rows ---------- */
.rows { padding-bottom: 60px; }
.row { margin: 8px 0 4px; position: relative; }
.row-head {
  display: flex; align-items: baseline; gap: 10px; padding: 0 var(--edge); margin-bottom: 4px;
}
.row-title { font-size: 20px; font-weight: 700; margin: 0; }
.see-all { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.see-all:hover { color: var(--accent-2); }
.row-track {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth;
  padding: 26px var(--edge); scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-nav {
  position: absolute; top: 26px; bottom: 26px; width: calc(var(--edge) + 20px); z-index: 5;
  background: none; border: none; color: #fff; font-size: 30px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s ease; display: flex; align-items: center;
}
.row:hover .row-nav { opacity: 0.9; }
.row-nav.left { left: 0; justify-content: flex-start; padding-left: 10px; background: linear-gradient(90deg, rgba(11,12,16,0.8), transparent); }
.row-nav.right { right: 0; justify-content: flex-end; padding-right: 10px; background: linear-gradient(270deg, rgba(11,12,16,0.8), transparent); }

/* ---------- Cards (hover-preview) ---------- */
.card {
  flex: 0 0 auto; width: 188px; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  position: relative;
}
.card:hover { transform: scale(1.13); z-index: 6; }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-card); overflow: hidden;
  background: linear-gradient(160deg, #232838, #14161d); box-shadow: var(--shadow-card);
}
.card:hover .poster { box-shadow: var(--shadow-pop); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px; color: var(--muted); font-size: 13px; font-weight: 600;
}
.card .badge {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  background: rgba(8, 9, 13, 0.82); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eaf0ff; font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px;
}
.card .badge.new { background: var(--hot); border-color: transparent; }
.card .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.18); }
.card .prog > i { display: block; height: 100%; background: var(--grad); }

/* hover info overlay (stays within the poster box, so rows never clip) */
.card-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 26px 12px 12px; opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: linear-gradient(0deg, rgba(6, 7, 11, 0.95) 20%, rgba(6, 7, 11, 0) 100%);
}
.card:hover .card-info { opacity: 1; transform: translateY(0); }
.card-info .ci-title { font-size: 13px; font-weight: 700; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.round {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
  border: 1.5px solid rgba(255, 255, 255, 0.55); background: rgba(20, 22, 30, 0.6); color: #fff;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.round:hover { border-color: #fff; }
.round.play { background: #fff; color: #0b0c10; border-color: #fff; }
.card-sub { color: var(--muted); font-size: 11.5px; margin-top: 7px; }

.row-empty { color: var(--muted); padding: 0 var(--edge) 10px; }
.row-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 30px 16px; padding: 14px var(--edge) 26px; }
.lib-grid .card { width: 100%; }

/* Library A–Z */
.lib-head { display: flex; align-items: center; gap: 14px; padding: 0 var(--edge) 6px; }
.lib-head .tabs { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.lib-head .tab { background: none; border: none; color: var(--muted); cursor: pointer; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.lib-head .tab.active { background: var(--grad); color: #fff; }
.lib-scroll { padding: 0 calc(var(--edge) + 26px) 60px var(--edge); }
.lib-letter { scroll-margin-top: 84px; }
.lib-letter-h { font-size: 26px; font-weight: 800; margin: 24px 0 12px; color: var(--accent-2); }
.az-rail { position: fixed; right: 4px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; }
.az { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; padding: 1px 7px; line-height: 1.35; transition: color 0.1s ease, transform 0.1s ease; }
.az:hover { color: var(--accent-2); transform: scale(1.55); }

/* ---------- Collections tab ---------- */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; padding: 16px var(--edge) 60px; }
.coll-card { cursor: pointer; transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1); }
.coll-card:hover, .coll-card.tv-focus { transform: scale(1.05); z-index: 6; }
.coll-poster {
  position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #232838, #14161d); box-shadow: var(--shadow-card);
}
.coll-card.tv-focus .coll-poster { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--accent), 0 0 40px rgba(108, 92, 255, 0.7); }
.coll-poster img { width: 100%; height: 100%; object-fit: cover; }
.coll-poster .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; color: var(--muted); font-weight: 700; }
.coll-count { position: absolute; top: 8px; right: 8px; background: rgba(8, 9, 13, 0.85); border: 1px solid rgba(255, 255, 255, 0.18); color: #eaf0ff; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.coll-name { font-size: 15px; font-weight: 700; margin-top: 10px; }

/* ---------- Requests (Radarr / Sonarr) ---------- */
.requests { padding: 0 var(--edge) 60px; max-width: 1100px; margin: 0 auto; }
.req-head { margin-bottom: 20px; }
.req-title { font-size: 30px; font-weight: 800; margin: 0 0 6px; }
.req-input {
  width: 100%; margin-top: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 15px 20px; border-radius: 12px; font-size: 17px; outline: none; transition: border-color 0.15s ease;
}
.req-input:focus { border-color: var(--accent); }
.req-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.req-controls .req-input { flex: 1; min-width: 260px; margin-top: 0; }
.req-quality { display: flex; gap: 10px; flex-wrap: wrap; }
.req-qsel { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; color: var(--muted); text-transform: uppercase; }
.req-qsel select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px; font-size: 14px; font-weight: 600; cursor: pointer; outline: none;
}
.req-qsel select:focus { border-color: var(--accent); }

/* Downloading queue */
.req-queue { margin: 22px 0 8px; }
.req-qhead { font-size: 15px; font-weight: 800; letter-spacing: 0.3px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.req-qrow { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.req-qrow .req-badge { position: static; }
.req-qbody { flex: 1; min-width: 0; }
.req-qtitle { font-size: 14px; font-weight: 600; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-qbar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.14); overflow: hidden; }
.req-qbar > i { display: block; height: 100%; background: var(--grad); transition: width 0.5s ease; }
.req-qmeta { text-align: right; min-width: 120px; }
.req-qpct { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.req-qstate { font-size: 11.5px; color: var(--muted); }
.req-err { color: var(--hot); }

.req-results { display: flex; flex-direction: column; gap: 12px; }
.req-empty { text-align: center; padding: 40px 10px; }
.req-empty p { margin: 0 0 10px; }
.req-card {
  display: flex; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; align-items: center;
  cursor: pointer; transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.req-card.tv-focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 22px rgba(108, 92, 255, 0.5); }
.req-poster { position: relative; width: 80px; flex: 0 0 80px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden;
  background: linear-gradient(160deg, #232838, #14161d); }
.req-poster img { width: 100%; height: 100%; object-fit: cover; }
.req-poster .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.req-badge { position: absolute; top: 5px; left: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 5px; color: #fff; }
.req-badge.movie { background: #24408f; }
.req-badge.tv { background: #7a3d17; }
.req-info { flex: 1; min-width: 0; }
.req-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.req-over { font-size: 13px; color: var(--muted); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-btn { font-size: 13.5px; }
.req-btn.req-done { color: #6ee7a8; border-color: rgba(110, 231, 168, 0.4); }
.arr-row { display: flex; gap: 8px; }
.arr-row .sa-input { flex: 1; }
@media (max-width: 700px) { .arr-row { flex-direction: column; } }

/* ---------- Live TV (DirecTV-style guide) ---------- */
/* Fills the viewport below the fixed nav: a preview pane on top, a scrolling
   EPG grid below. padding-top clears the nav so nothing overlaps it. */
.livetv { height: 100vh; padding-top: 66px; box-sizing: border-box; display: flex; flex-direction: column; }
.lt-preview {
  position: relative; flex: 0 0 40%; min-height: 250px; background-size: cover; background-position: center 30%;
  display: flex; align-items: flex-end; transition: background-image 0.4s ease;
}
.lt-preview-fade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg-2) 2%, rgba(11,12,16,0.5) 45%, rgba(11,12,16,0.1) 100%),
    linear-gradient(90deg, rgba(11,12,16,0.9) 0%, rgba(11,12,16,0) 62%);
}
.lt-preview-body { position: relative; z-index: 2; padding: 0 4vw 22px; max-width: 720px; }
.lt-chan-badge { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.lt-num { background: var(--grad); color: #fff; font-weight: 800; font-size: 15px; padding: 3px 12px; border-radius: 8px; }
.lt-name { font-weight: 800; letter-spacing: 2px; font-size: 14px; color: #eaf0ff; }
.lt-onair { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--hot); }
.lt-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(255,77,109,0.6); animation: pulse 2s infinite; display: inline-block; }
.lt-title { font-size: clamp(26px, 3.4vw, 42px); font-weight: 800; line-height: 1.05; margin: 0 0 10px; text-shadow: 0 2px 18px rgba(0,0,0,0.6); }
.lt-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lt-over { font-size: 14.5px; color: #dfe3ee; max-width: 62ch; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 10px rgba(0,0,0,0.5); }
.lt-prog { height: 5px; border-radius: 4px; background: rgba(255,255,255,0.22); overflow: hidden; margin-bottom: 7px; max-width: 520px; }
.lt-prog-fill { height: 100%; background: var(--grad); }
.lt-times { display: flex; justify-content: space-between; gap: 16px; max-width: 520px; font-size: 12.5px; font-weight: 600; margin-bottom: 16px; }
.lt-actions { display: flex; gap: 12px; }

.lt-epg { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); border-top: 1px solid var(--line); }
.lt-epg-head { display: flex; align-items: stretch; height: 34px; border-bottom: 1px solid var(--line); background: #0d0f15; }
.lt-epg-title { width: 168px; flex: 0 0 168px; display: flex; align-items: center; gap: 7px; padding-left: 16px; font-weight: 800; letter-spacing: 1px; font-size: 12px; color: #eaf0ff; border-right: 1px solid var(--line); }
.lt-timebar { position: relative; flex: 1; }
.lt-timelbl { position: absolute; top: 9px; font-size: 12px; font-weight: 700; color: var(--muted); transform: translateX(8px); }
.lt-nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--hot); z-index: 4; box-shadow: 0 0 8px rgba(255,77,109,0.8); }
.lt-epg-rows { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.lt-erow { display: flex; align-items: stretch; height: 62px; border-bottom: 1px solid rgba(38,43,56,0.6); }
.lt-erow.sel { background: rgba(108,92,255,0.10); }
.lt-echan {
  width: 168px; flex: 0 0 168px; display: flex; align-items: center; gap: 10px; padding: 0 12px; cursor: pointer;
  border-right: 1px solid var(--line); background: #10131a;
}
.lt-erow.sel .lt-echan { background: linear-gradient(90deg, rgba(108,92,255,0.3), rgba(108,92,255,0.05)); box-shadow: inset 3px 0 0 var(--accent); }
.lt-enum { font-weight: 800; font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-erow.sel .lt-enum { color: var(--accent-2); }
.lt-ename { font-size: 11.5px; font-weight: 800; letter-spacing: 0.5px; color: #c7ccda; line-height: 1.15; }
.lt-etrack { position: relative; flex: 1; }
.lt-block {
  position: absolute; top: 6px; bottom: 6px; overflow: hidden; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 7px;
  display: flex; align-items: center; padding: 0 12px; margin-right: 3px; transition: background 0.12s ease, border-color 0.12s ease;
}
.lt-block:hover { background: var(--panel-2); border-color: var(--accent); }
.lt-block.live { background: linear-gradient(120deg, #232a44, #1a1f30); border-color: rgba(108,92,255,0.5); }
.lt-erow.sel .lt-block.live { border-color: var(--accent); box-shadow: 0 0 16px rgba(108,92,255,0.4); }
.lt-block-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-hint { padding: 9px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #0d0f15; }
@media (max-width: 820px) {
  .lt-epg-title, .lt-echan { width: 96px; flex-basis: 96px; }
}

/* ---------- Detail (full page) ---------- */
.detail { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); }
.detail-close {
  position: fixed; top: 22px; right: 26px; z-index: 72; width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; background: rgba(10, 12, 18, 0.7); color: #fff; font-size: 18px; backdrop-filter: blur(6px);
}
.detail-close:hover { background: rgba(34, 38, 50, 0.95); }

.dp-splash { position: relative; height: 82vh; min-height: 560px; max-height: 900px; background-size: cover; background-position: center 14%; }
.dp-splash::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,12,16,0.95) 0%, rgba(11,12,16,0.6) 30%, rgba(11,12,16,0) 66%),
    linear-gradient(0deg, var(--bg) 2%, rgba(11,12,16,0.45) 32%, rgba(11,12,16,0) 72%);
}
.dp-splash video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; z-index: 3;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.dp-splash.playing video { opacity: 1; pointer-events: auto; }
.dp-hero { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: flex-end; gap: 30px; padding: 0 var(--edge) 6vh; }
.dp-splash.playing .dp-hero { opacity: 0; pointer-events: none; }
.dp-poster { width: 190px; flex: 0 0 auto; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-pop); border: 1px solid rgba(255, 255, 255, 0.1); }
.dp-poster img { width: 100%; height: 100%; object-fit: cover; }
.dp-info { max-width: 640px; }
.dp-title { font-size: clamp(30px, 4.6vw, 54px); font-weight: 800; line-height: 1.05; margin: 0 0 14px; text-shadow: 0 2px 18px rgba(0,0,0,0.5); }
.dp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dp-genres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.dp-genre { font-size: 12.5px; color: #cfd4e2; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 3px 11px; }
.dp-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dp-version { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.dp-version > span { color: var(--muted); font-size: 12.5px; }
.dp-select { background: rgba(20, 22, 30, 0.85); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 600; cursor: pointer; outline: none; }
.dp-select:focus { border-color: var(--accent); }

.dp-body { max-width: 1180px; margin: 0 auto; padding: 6px var(--edge) 70px; }
.dp-body .overview { font-size: 16px; color: #d7dbe6; max-width: 80ch; margin: 0 0 6px; }
.dp-tagline { color: var(--muted); font-style: italic; margin: 0 0 14px; }
.dp-section { margin-top: 36px; }
.dp-section h3 { font-size: 19px; margin: 0 0 14px; }
/* padding + negative margin give scaled (hover/tv-focus) tiles room to grow
   inside the horizontal scroll container without the tops clipping */
.dp-hscroll { display: flex; gap: 14px; overflow-x: auto; padding: 18px 12px; margin: -18px -12px -10px; scrollbar-width: none; }
.dp-hscroll::-webkit-scrollbar { display: none; }

.person { flex: 0 0 auto; width: 118px; }
.person .pfp { width: 118px; height: 118px; border-radius: 12px; object-fit: cover; background: var(--panel-2); }
.person .pfp.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 30px; }
.person .pname { font-size: 13px; font-weight: 600; margin-top: 8px; line-height: 1.25; }
.person .prole { font-size: 12px; color: var(--muted); }

.rec { flex: 0 0 auto; width: 152px; cursor: pointer; transition: transform 0.15s ease; }
.rec:hover { transform: scale(1.05); }
.rec .poster { aspect-ratio: 2/3; }
.rec .rec-title { font-size: 12.5px; margin-top: 7px; color: #d3d7e3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec.owned .rec-title::after { content: ' ▸ in library'; color: var(--accent-2); font-size: 11px; }
.rec:not(.owned) { opacity: 0.66; }

.trailer-card { flex: 0 0 auto; width: 320px; cursor: pointer; }
.trailer-thumb { aspect-ratio: 16/9; border-radius: 10px; background-size: cover; background-position: center; position: relative; box-shadow: var(--shadow-card); }
.trailer-thumb::after { content: '▶'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; background: rgba(0,0,0,0.3); border-radius: 10px; }
.trailer-name { font-size: 12.5px; color: #d3d7e3; margin-top: 7px; }
.filename { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* version picker used inside the TV show player */
.versions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.vlabel { color: var(--muted); font-size: 13px; }
.qbtn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.qbtn.active { background: var(--grad); border-color: transparent; color: #fff; }

/* Seasons + episodes */
.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 12px; }
.season-tab {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.season-tab.active { background: var(--grad); border-color: transparent; color: #fff; }
.seasons-h { font-size: 17px; margin: 26px 0 12px; }
.season-cards { display: flex; gap: 14px; overflow-x: auto; padding: 16px 10px; scrollbar-width: none; margin: -16px -10px 2px; }
.season-cards::-webkit-scrollbar { display: none; }
.season-card { flex: 0 0 auto; width: 128px; cursor: pointer; }
.season-card .sc-poster { aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg,#232838,#14161d); border: 2px solid transparent; box-shadow: var(--shadow-card); transition: border-color 0.12s ease; }
.season-card.active .sc-poster { border-color: var(--accent); }
.season-card .sc-poster img { width: 100%; height: 100%; object-fit: cover; }
.season-card .sc-poster .ph { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-weight: 600; font-size: 13px; }
.season-card .sc-label { font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.season-card.active .sc-label { color: var(--accent-2); }
.season-card .sc-count { font-size: 12px; color: var(--muted); }

.episode-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.episode-tools .et-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.episode-list { display: flex; flex-direction: column; gap: 8px; }
.episode {
  display: flex; align-items: center; gap: 14px; position: relative; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.episode:hover { border-color: var(--accent); }
.episode.playing { border-color: var(--accent); background: #1b2130; }
.episode .ethumb { width: 132px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: #0d0f15; }
.episode .enum { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; }
.episode .ebody { flex: 1; min-width: 0; }
.episode .etitle { font-weight: 600; font-size: 14.5px; }
.episode .eover { color: var(--muted); font-size: 12.5px; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode .eprog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); border-radius: 0 0 0 10px; }
.wtoggle {
  background: none; border: 1.5px solid var(--line); color: var(--muted); flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px;
}
.wtoggle:hover { border-color: var(--accent); color: var(--text); }
.wtoggle.on { background: #2e9d63; border-color: #2e9d63; color: #fff; }

/* ---------- Generic modals (settings / picker / subtitles) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(6, 7, 10, 0.72); backdrop-filter: blur(8px);
}
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--shadow-pop);
}
.sheet h2 { margin: 0 0 4px; }
.sheet h3 { margin: 0 0 6px; font-size: 15px; }
.close {
  position: absolute; top: 16px; right: 18px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); cursor: pointer; font-size: 15px;
}
.muted { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.btn.primary { background: var(--grad); border: none; color: #fff; }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item { display: flex; align-items: center; gap: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lib-item .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.lib-item .tag.movie { background: #24408f; color: #cfe0ff; }
.lib-item .tag.tv { background: #7a3d17; color: #ffd9be; }
.lib-item .path { flex: 1; font-size: 13px; word-break: break-all; }
.lib-item .rm { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.lib-item .rm:hover { color: var(--hot); }
.lib-empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.picker-path { font-size: 13px; color: var(--accent-2); margin-bottom: 10px; word-break: break-all; min-height: 18px; }
.picker-list { border: 1px solid var(--line); border-radius: 10px; max-height: 46vh; overflow-y: auto; margin-bottom: 16px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.frow:last-child { border-bottom: none; }
.frow:hover { background: var(--panel-2); }
.picker-actions { display: flex; align-items: center; gap: 10px; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sub-account { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sa-input { display: block; width: 100%; margin: 8px 0; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 9px 12px; border-radius: 8px; outline: none; }
.sa-input:focus { border-color: var(--accent); }

/* ---------- Update overlay ---------- */
.update-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 7, 10, 0.92); backdrop-filter: blur(10px); }
.update-card { text-align: center; max-width: 420px; padding: 34px 30px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.update-card h2 { margin: 18px 0 6px; }
.spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.update-steps { text-align: left; margin: 22px auto 0; max-width: 260px; padding-left: 0; list-style: none; counter-reset: step; }
.update-steps li { position: relative; padding: 7px 0 7px 34px; color: var(--muted); font-size: 14px; counter-increment: step; }
.update-steps li::before { content: counter(step); position: absolute; left: 0; top: 6px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; }
.update-steps li.active { color: var(--text); }
.update-steps li.active::before { background: var(--accent); border-color: var(--accent); color: #fff; }
.update-steps li.done::before { content: '✓'; background: #2e9d63; border-color: #2e9d63; color: #fff; }

/* ---------- Theater video player ---------- */
.vp { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; cursor: default; }
.vp.hide-ui { cursor: none; }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.vp ::cue { background: rgba(0,0,0,0.55); color: #fff; font-size: 1.05em; line-height: 1.35; }
.vp-fade { transition: opacity 0.25s ease; }
.vp.hide-ui .vp-top, .vp.hide-ui .vp-bottom { opacity: 0; pointer-events: none; }
.vp-top {
  top: 0; padding: 22px 34px; display: flex; align-items: center; gap: 16px; z-index: 4;
  position: absolute; left: 0; right: 0; transition: opacity 0.25s ease;
  background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
}
.vp-back { background: none; border: none; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.vp-titles .vp-t { font-size: 18px; font-weight: 700; }
.vp-titles .vp-st { font-size: 13px; color: #c7ccda; }
/* paused badge — a single, calm center indicator instead of the old floating
   button cluster (the video itself and the bottom bar are the controls) */
.vp-pausedbadge {
  position: absolute; inset: 0; margin: auto; width: 110px; height: 110px; z-index: 3;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(8, 9, 13, 0.55); backdrop-filter: blur(4px); pointer-events: none;
  opacity: 0; transform: scale(0.85); transition: opacity 0.18s ease, transform 0.18s ease;
}
.vp.vp-ispaused .vp-pausedbadge { opacity: 1; transform: scale(1); }
.vp-pausedbadge svg { width: 52px; height: 52px; color: #fff; }

/* Live TV: a real broadcast — hide all time-travel controls, show a LIVE tag. */
.vp-liveind { display: none; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--hot); }
.vp-live .vp-liveind { display: inline-flex; }
.vp-live .vp-scrub, .vp-live .vp-skip, .vp-live .vp-play, .vp-live .vp-time,
.vp-live .vp-skipbtn, .vp-live .vp-pausedbadge { display: none !important; }
.vp-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 0 44px 24px; transition: opacity 0.25s ease;
  background: linear-gradient(0deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0) 100%);
}
.vp-scrub { position: relative; height: 30px; display: flex; align-items: center; margin-bottom: 8px; cursor: pointer; }
.vp-track { position: absolute; left: 0; right: 0; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.22); transition: height 0.12s ease, box-shadow 0.12s ease; }
.vp-buffered { position: absolute; left: 0; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.38); width: 0; transition: height 0.12s ease; }
.vp-played { position: absolute; left: 0; height: 6px; border-radius: 4px; background: var(--grad); width: 0; transition: height 0.12s ease; }
.vp-seek { position: absolute; left: 0; right: 0; width: 100%; margin: 0; height: 30px; opacity: 0; cursor: pointer; }
/* focused bar (remote mode): thicker, ringed, thumb glowing */
.vp-scrub.pfocus .vp-track { height: 9px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 18px rgba(108, 92, 255, 0.55); }
.vp-scrub.pfocus .vp-buffered, .vp-scrub.pfocus .vp-played { height: 9px; }
.vp-scrub.pfocus .vp-played::after { opacity: 1; width: 17px; height: 17px; box-shadow: 0 0 0 3px var(--accent), 0 0 16px rgba(108, 92, 255, 0.9); }
/* seek-preview bubble */
.vp-bubble {
  position: absolute; bottom: 30px; transform: translateX(-50%); z-index: 9;
  background: rgba(14, 16, 24, 0.96); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 8px;
  padding: 5px 12px; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-card);
}
.vp-ctrls { display: flex; align-items: center; gap: 10px; }
.vp-time { font-size: 14.5px; color: #eef1f8; font-variant-numeric: tabular-nums; margin: 0 6px; }
.vp-spacer { flex: 1; }
.vp-volbar { width: 84px; accent-color: var(--accent); }

.vp-menu {
  position: absolute; right: 44px; bottom: 100px; z-index: 6; width: 300px; max-height: 60vh; overflow-y: auto;
  background: rgba(16, 18, 26, 0.97); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-pop);
}
.vp-menu h4 { margin: 10px 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.vp-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text); text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}
.vp-opt:hover { background: var(--panel-2); }
.vp-opt.active { color: var(--accent-2); }
.vp-opt .tick { color: var(--accent-2); }
.vp-offset { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.vp-offset button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: #fff; cursor: pointer; font-size: 16px; }
.vp-offset .val { flex: 1; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
/* remote-focused menu option */
.vp-menu button.focused { background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--accent); }
.vp-genmsg { padding: 8px 10px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.vp-genbar { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.16); overflow: hidden; }
.vp-genbar > i { display: block; height: 100%; background: var(--grad); transition: width 0.4s ease; }

/* in-player playback error */
.vp-error {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center; padding: 0 8%;
  background: rgba(0, 0, 0, 0.78);
}
.vp-error b { font-size: 21px; }
.vp-error span { color: var(--muted); max-width: 54ch; font-size: 14.5px; }

.vp-skipbtn {
  position: absolute; right: 44px; bottom: 112px; z-index: 5;
  background: rgba(20, 22, 30, 0.9); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  padding: 11px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.vp-skipbtn:hover { background: #fff; color: #0b0c10; }

.vp-upnext {
  position: absolute; right: 44px; bottom: 112px; z-index: 6; width: 340px;
  background: rgba(16, 18, 26, 0.96); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-pop);
}
.vp-upnext .un-still { aspect-ratio: 16/9; background-size: cover; background-position: center; background-color: #0d0f15; }
.vp-upnext .un-body { padding: 12px 14px; }
.vp-upnext .un-label { color: var(--muted); font-size: 12px; }
.vp-upnext .un-title { font-weight: 700; margin: 3px 0 10px; }
.vp-upnext .un-actions { display: flex; gap: 8px; }

/* player buttons — big, round, 10-ft friendly, with a visible focus ring */
.vp-ctrls button {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  width: 46px; height: 46px; border-radius: 50%; border: none; background: none; color: #eef1f8;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.vp-ctrls button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.vp-ctrls button svg { width: 26px; height: 26px; display: block; }
.vp-play { background: rgba(255, 255, 255, 0.1); }
.vp-cc { font-weight: 800; font-size: 13.5px; letter-spacing: 0.5px; }
.vp-skip { position: relative; }
.vp-skip svg { width: 30px; height: 30px; }
.vp-skip b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; padding-top: 3px; }
/* the remote's focus ring on buttons — same language as the library cards */
.vp-ctrls button.pfocus {
  background: rgba(255, 255, 255, 0.18); color: #fff; transform: scale(1.12);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent), 0 0 24px rgba(108, 92, 255, 0.65);
}
.vp-played { position: relative; }
.vp-played::after { content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity 0.12s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.vp-scrub:hover .vp-played::after { opacity: 1; }
.vp-scrub:hover .vp-track, .vp-scrub:hover .vp-buffered, .vp-scrub:hover .vp-played { height: 6px; }
.vp-subs {
  position: absolute; left: 0; right: 0; bottom: 13%; z-index: 3; text-align: center; pointer-events: none; padding: 0 8%;
  font-size: clamp(18px, 2.5vw, 30px); font-weight: 600; line-height: 1.35; color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.95), 0 0 3px rgba(0,0,0,0.9);
}
.vp-subs:empty { display: none; }
.vp.hide-ui .vp-subs { bottom: 8%; }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, #171a22 25%, #20242f 50%, #171a22 75%); background-size: 200% 100%;
  animation: shimmer 1.3s infinite; border-radius: var(--r-card); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- tvOS focus engine (10-ft / remote nav) ---------- */
/* Hide the mouse cursor while driving by remote; the field dims so the one
   focused item reads as a spotlight from across the room. */
body.tv-nav { cursor: none; }
.tv-focus { outline: none; }

/* Cards: the focused poster scales up with a bright ring + accent glow, and
   its hover-info overlay reveals; siblings dim. Hover scaling is suppressed in
   remote mode so the two highlight systems never fight. */
body.tv-nav .card { transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.18s ease; }
body.tv-nav .card:not(.tv-focus) { filter: brightness(0.58) saturate(0.85); }
body.tv-nav .card:hover { transform: none; }
.card.tv-focus { transform: scale(1.16); z-index: 8; }
.card.tv-focus .poster {
  box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--accent), 0 22px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(108, 92, 255, 0.75);
}
.card.tv-focus .card-info { opacity: 1; transform: translateY(0); }

/* Artwork tiles that aren't posters (season/rec/trailer) pop + ring. */
.season-card.tv-focus, .rec.tv-focus, .trailer-card.tv-focus { transform: scale(1.1); z-index: 8; }
.season-card.tv-focus .sc-poster,
.rec.tv-focus .poster,
.trailer-card.tv-focus .trailer-thumb {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent), 0 0 32px rgba(108, 92, 255, 0.7);
}
.rec.tv-focus { opacity: 1 !important; }

/* Buttons, nav, chips, list rows: a clean accent glow-ring. */
.btn.tv-focus, .nav-link.tv-focus, .see-all.tv-focus, .tab.tv-focus,
.az.tv-focus, .close.tv-focus, .detail-close.tv-focus, .icon-btn.tv-focus,
.rm.tv-focus, .hero-dot.tv-focus, #update-pill.tv-focus,
.nav-search.tv-focus, .req-input.tv-focus, .dp-select.tv-focus, .req-qsel select.tv-focus {
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(108, 92, 255, 0.32), 0 0 22px rgba(108, 92, 255, 0.55);
}
.nav-link.tv-focus { color: var(--text); background: rgba(108, 92, 255, 0.16); }
.btn.tv-focus { transform: translateY(-1px); }
.hero-dot.tv-focus { transform: scale(1.5); }

.episode.tv-focus, .frow.tv-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 20px rgba(108, 92, 255, 0.5);
}
.episode.tv-focus { background: #1b2130; }

/* 10-ft breathing room: while driving by remote the top menu grows a touch so
   it reads as a proper tvOS menu bar. */
body.tv-nav .nav { padding-top: 20px; padding-bottom: 20px; }
body.tv-nav .nav-link { font-size: 17px; padding: 9px 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  :root { --edge: 18px; }
  .nav { gap: 12px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 8px 8px; font-size: 14px; }
  .nav-search { width: 130px; }
  .nav-search:focus { width: 150px; }
  .hero { height: 62vh; min-height: 420px; }
  .card { width: 130px; }
  .episode .ethumb { width: 92px; }
  .detail-body { padding: 20px 18px 28px; }
}

/* ---------- Login / create account ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 620px at 18% -12%, rgba(108, 92, 255, 0.28), transparent 60%),
    radial-gradient(1000px 520px at 100% 112%, rgba(55, 194, 255, 0.20), transparent 60%),
    var(--bg);
}
.auth-card {
  position: relative; width: min(400px, 92vw);
  background: rgba(23, 26, 34, 0.92); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 36px 30px 26px;
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.auth-brand { font-size: 36px; margin: 0 0 2px; }
.auth-sub { color: var(--muted); margin: 0 0 12px; }
.auth-input {
  width: 100%; padding: 13px 14px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 16px; outline: none;
  transition: border-color 0.15s ease;
}
.auth-input:focus { border-color: var(--accent); }
.auth-submit { width: 100%; padding: 13px; font-size: 16px; margin-top: 4px; }
.auth-toggle { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; margin-top: 6px; }
.auth-toggle:hover { color: var(--text); }
.auth-error { color: var(--hot); font-size: 14px; min-height: 18px; }

/* Focus ring for the remote/D-pad focus engine on the login card. */
.auth-input.tv-focus, .auth-submit.tv-focus, .auth-toggle.tv-focus {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* ---------- Account row + admin-only settings ---------- */
.acct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px;
}
.acct-role { color: var(--accent-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.acct-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }

/* Server-level settings are hidden unless the signed-in user is an admin. */
.admin-only { display: none; }
body.is-admin .admin-only { display: block; }

/* ---------- TV / app mode (Android TV WebView): drop browser-isms ---------- */
body.tv-mode { cursor: none; }
body.tv-mode .vp-fs { display: none; }

/* ---------- Update available splash ---------- */
.us-sheet { max-width: 460px; text-align: center; }
.us-badge {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; background: var(--grad);
  box-shadow: 0 8px 26px rgba(108, 92, 255, 0.5);
}
.us-notes-wrap { text-align: left; margin: 16px 0 20px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.us-notes-wrap h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.us-notes { margin: 0; padding-left: 18px; max-height: 240px; overflow-y: auto; }
.us-notes li { margin: 5px 0; font-size: 14px; line-height: 1.45; }
.us-actions { display: flex; gap: 10px; justify-content: center; }
.us-actions .btn { min-width: 130px; }
