/* =============================================================
   Let's Watch — Desktop app theme
   TiviMate-inspired: dark, cinematic, focus-forward.
   Shares design tokens with the letswatchmedia.com site.
   ============================================================= */

:root {
  --bg: #08090d;
  --bg-2: #0b0d14;
  --surface: #12141d;
  --surface-2: #171a25;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f6fb;
  --muted: #a6abbe;
  --faint: #71768a;
  --accent: #57a9e8;
  --accent-soft: rgba(87, 169, 232, 0.16);
  --green: #34d399;
  --red: #f87171;
  --r: 14px;
  --r-sm: 10px;
  --pill: 999px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* , *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 78% -8%, rgba(87, 169, 232, 0.10), transparent 60%),
    radial-gradient(50rem 40rem at 6% 4%, rgba(120, 133, 154, 0.10), transparent 55%),
    var(--bg);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 0.4em; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0 0 0.9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
kbd {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  font-family: inherit;
}
code {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-track { background: transparent; }

.screen { position: relative; z-index: 1; height: 100vh; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  border-radius: var(--pill);
  padding: 9px 22px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.btn:hover { background: var(--glass-strong); border-color: var(--faint); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #071018;
}
.btn-primary:hover { background: #74bbf0; border-color: #74bbf0; }
.btn-lg { padding: 13px 34px; font-size: 16px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--glass); border-color: transparent; }
.btn-danger { border-color: rgba(248, 113, 113, 0.4); color: var(--red); background: transparent; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--red); }

/* =============================================================
   SETUP WIZARD
   ============================================================= */
#setup {
  display: flex;
  align-items: center;
  justify-content: center;
}
.wizard {
  width: min(600px, 94vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 44px 48px;
  text-align: center;
}
.wizard-step { animation: rise 0.35s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.brand-mark { margin-bottom: 18px; display: flex; justify-content: center; }
.accent { color: var(--accent); }
.lead { color: var(--muted); margin-bottom: 26px; }
.wizard .btn { margin: 4px 6px; }
.btn-back { margin-top: 18px; }

.method-cards { display: grid; gap: 12px; margin-bottom: 8px; }
.method-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas: "icon name" "icon desc";
  text-align: left;
  gap: 2px 12px;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.method-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.method-icon { grid-area: icon; font-size: 26px; }
.method-name { grid-area: name; font-weight: 700; }
.method-desc { grid-area: desc; color: var(--muted); font-size: 13px; }

/* Branded provider monogram badge (fills the 44px icon column) */
.provider-mono {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

/* "Connecting to <provider>" banner on the login step */
.provider-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(87, 169, 232, 0.4);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.provider-banner strong { color: var(--text); }
.provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

/* ---------- Provider grid (compact two-column chooser) ---------- */
.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}
.provider-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}
.provider-tile:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.provider-tile .provider-mono {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 14px;
  flex: none;
}
.provider-tile-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.method-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
  margin: 18px 2px 12px;
}
.method-divider::before,
.method-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.method-alt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.alt-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.alt-card:hover { color: var(--text); border-color: var(--faint); background: var(--glass); }
.alt-icon { font-size: 15px; }

.wizard-form { display: grid; gap: 14px; text-align: left; margin-bottom: 6px; }
.wizard-form label { font-size: 13px; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
.wizard-form input {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.wizard-form input:focus { border-color: var(--accent); }
.wizard-form .btn { justify-self: center; margin-top: 8px; }
.form-error { color: var(--red); font-size: 14px; margin: 0; text-align: center; }

.spinner {
  width: 46px; height: 46px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-ring {
  width: 62px; height: 62px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--green);
  border: 2px solid var(--green);
  background: rgba(52, 211, 153, 0.1);
}

/* =============================================================
   MAIN APP SHELL
   ============================================================= */
#app { display: flex; }

.rail {
  width: 78px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.rail-logo { margin-bottom: 14px; }
.rail-btn {
  width: 62px;
  border: none;
  background: transparent;
  color: var(--faint);
  font: inherit;
  border-radius: var(--r-sm);
  padding: 9px 0 7px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 2px;
  transition: all 0.15s var(--ease);
}
.rail-btn:hover { color: var(--text); background: var(--glass); }
.rail-btn.active { color: var(--accent); background: var(--accent-soft); }
.rail-icon { font-size: 20px; }
.rail-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.rail-spacer { flex: 1; }
.rail-status { color: var(--green); font-size: 12px; }
.rail-status.offline { color: var(--red); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 54px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.topbar h2 { margin: 0; font-size: 17px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ---------- Account switcher ---------- */
.acct-switch { position: relative; }
.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--pill);
  padding: 6px 12px 6px 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.acct-btn:hover { border-color: var(--faint); background: var(--surface-2); }
.acct-dot {
  width: 20px; height: 20px;
  flex: none;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: hsl(210, 45%, 22%); color: hsl(210, 72%, 74%);
}
.acct-dot.all { background: var(--glass-strong); color: var(--text); }
.acct-name { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-caret { color: var(--faint); font-size: 11px; }

.acct-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 248px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 6px;
  animation: rise 0.16s var(--ease);
}
.acct-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.acct-menu-item:hover { background: var(--glass); }
.acct-menu-item.active { background: var(--accent-soft); }
.acct-menu-item.active .acct-mi-check { color: var(--accent); }
.acct-mi-dot {
  width: 24px; height: 24px; flex: none;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.acct-mi-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.acct-mi-check { color: transparent; font-size: 13px; }
.acct-menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.acct-menu-add { color: var(--accent); font-weight: 700; }

/* ---------- Wizard close (add-account mode) ---------- */
.wizard-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--glass);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  z-index: 1;
}
.wizard-close:hover { background: var(--glass-strong); color: var(--text); }

/* ---------- Accounts manager (Settings) ---------- */
.acct-manage { display: grid; gap: 8px; margin-bottom: 14px; }
.acct-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.acct-row.active { border-color: var(--accent); background: var(--accent-soft); }
.acct-row-dot {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.acct-row-meta { flex: 1; min-width: 0; }
.acct-row-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-row-sub { font-size: 12px; color: var(--faint); }
.acct-row-badge { font-size: 11px; font-weight: 700; color: var(--accent); }
.acct-row-signout {
  flex: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--pill);
  padding: 5px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.acct-row-signout:hover {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
}

/* Sign-out entry in the account switcher menu */
.acct-menu-signout { color: var(--muted); }
.acct-menu-signout:hover { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.acct-menu-signout .acct-mi-dot { background: rgba(248, 113, 113, 0.14); color: var(--red); }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-pad { padding: 22px; overflow-y: auto; display: block; }

/* =============================================================
   LIVE TV
   ============================================================= */
.live-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 205px 305px 1fr;
}
.col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.col-preview { border-right: none; padding: 18px; overflow-y: auto; }
.col-head {
  flex: none;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.col-head input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 6px 13px;
  outline: none;
}
.col-head input:focus { border-color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0 8px 14px; overflow-y: auto; flex: 1; }
.list li {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s;
}
.list li:hover { background: var(--glass); color: var(--text); }
.list li.active { background: var(--accent-soft); color: var(--text); }
.list li.active .chan-name { color: var(--accent); }
.chan-logo {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 6px;
  object-fit: contain;
  background: var(--surface-2);
}
.chan-logo-ph {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--faint);
}
.chan-meta { min-width: 0; flex: 1; }
.chan-star {
  flex: none;
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.list li:hover .chan-star { opacity: 0.7; }
.chan-star:hover { opacity: 1; color: #f5c451; }
.chan-star.on { opacity: 1; color: #f5c451; }
.chan-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-num { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.list-empty { color: var(--faint); padding: 14px; text-align: center; }

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
}
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-empty, .video-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-2) 100%);
  text-align: center;
  padding: 20px;
}
.video-error { color: var(--muted); background: rgba(8, 9, 13, 0.92); }
.video-reconnecting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 9, 13, 0.82);
  color: var(--muted);
  font-size: 14px;
}
.spinner-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
/* Video control bar — volume on the left, fullscreen on the right.
   Lives inside .video-wrap so it shows in the small preview AND fullscreen. */
.video-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 14px 12px;
  background: linear-gradient(transparent, rgba(4, 5, 8, 0.72));
  opacity: 0;
  transition: opacity 0.18s;
}
.video-wrap:hover .video-bar,
.video-wrap:focus-within .video-bar,
.video-wrap:fullscreen .video-bar { opacity: 1; }
.vc-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 8px;
  cursor: pointer;
}
.vc-btn:hover { background: rgba(255, 255, 255, 0.14); }
.vc-spacer { flex: 1; }
.vc-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}
.vc-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.vc-vol:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* In fullscreen the bar sits a little higher off the screen edge */
.video-wrap:fullscreen .video-bar { padding: 40px 26px 22px; }
.video-wrap:fullscreen .vc-vol { width: 140px; }

.now-panel { margin-top: 16px; }
.now-chan { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: 0.03em; }
.now-title { font-size: 19px; font-weight: 700; margin-top: 2px; }
.now-time { color: var(--faint); font-size: 13px; margin-top: 2px; }
.now-desc { color: var(--muted); font-size: 13.5px; margin-top: 10px; max-height: 108px; overflow-y: auto; }
.next-line { color: var(--faint); font-size: 13px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.next-line strong { color: var(--muted); }

/* =============================================================
   TV GUIDE (EPG)
   ============================================================= */
.guide-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.guide-toolbar select {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  outline: none;
}
.guide-hint { color: var(--faint); font-size: 13px; }

.guide-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.guide-grid { position: relative; min-width: max-content; }

.g-timebar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  margin-left: 210px;
}
.g-tick {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  padding: 8px 0 8px 8px;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.g-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); height: 58px; }
.g-chan {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 210px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  cursor: pointer;
}
.g-chan:hover .chan-name { color: var(--accent); }
.g-progs { position: relative; flex: none; }
.g-prog {
  position: absolute;
  top: 7px;
  bottom: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.3;
}
.g-prog .g-prog-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.g-prog .g-prog-time { color: var(--faint); font-size: 11px; }
.g-prog.now { background: var(--accent-soft); border-color: rgba(87, 169, 232, 0.5); }
.g-nowline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 1;
  box-shadow: 0 0 10px rgba(87, 169, 232, 0.8);
}
.g-loading { color: var(--faint); font-size: 12px; padding: 8px 12px; align-self: center; }
.guide-empty { color: var(--faint); text-align: center; padding: 60px 20px; }

/* =============================================================
   MOVIES + SERIES (VOD)
   ============================================================= */
.toolbar-search {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 7px 14px;
  outline: none;
  width: 240px;
}
.toolbar-search:focus { border-color: var(--accent); }

.vod-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; }

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 18px 16px;
}
.poster-card { cursor: pointer; }
.poster-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
}
.poster-card:hover .poster-img {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.8);
}
.poster-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: var(--faint);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
}
.rating-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(8, 9, 13, 0.8);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fbbf24;
}
.poster-fav {
  position: absolute;
  top: 8px;
  left: 8px;
  border: none;
  background: rgba(8, 9, 13, 0.6);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.poster-card:hover .poster-fav { opacity: 1; }
.poster-fav:hover { color: #ff6b81; }
.poster-fav.on { opacity: 1; color: #ff6b81; background: rgba(8, 9, 13, 0.8); }
.btn.fav-on { color: #ff6b81; border-color: rgba(255, 107, 129, 0.5); }

.poster-name {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-sub { font-size: 11.5px; color: var(--faint); }
.vod-status { color: var(--faint); text-align: center; padding: 46px 20px; }
.grid-sentinel { height: 2px; }

/* Continue watching strip */
.continue-strip { margin-bottom: 22px; }
.strip-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.strip-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.strip-card { flex: none; width: 210px; cursor: pointer; }
.strip-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.strip-card:hover .strip-thumb { border-color: var(--accent); }
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.strip-thumb .poster-ph { font-size: 24px; }
.strip-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: rgba(8, 9, 13, 0.35);
  opacity: 0;
  transition: opacity 0.15s;
}
.strip-card:hover .strip-play { opacity: 1; }
.strip-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
}
.strip-progress > div { height: 100%; background: var(--accent); }
.strip-name {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-sub { font-size: 11px; color: var(--faint); }

/* ---------- Title details modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.modal-card {
  position: relative;
  width: min(780px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 30px;
  animation: rise 0.28s var(--ease);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  border: none;
  background: var(--glass);
  color: var(--muted);
  font-size: 15px;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { background: var(--glass-strong); color: var(--text); }

.detail-layout { display: grid; grid-template-columns: 205px 1fr; gap: 24px; }
.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  align-self: start;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-poster .poster-ph { font-size: 44px; }
.detail-title { font-size: 24px; margin-bottom: 8px; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.chip-rating { color: #fbbf24; }
.detail-plot { color: var(--muted); font-size: 14px; max-height: 170px; overflow-y: auto; user-select: text; }
.detail-credits { font-size: 12.5px; color: var(--faint); margin-top: 10px; }
.detail-credits strong { color: var(--muted); font-weight: 600; }
.detail-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.detail-loading { text-align: center; color: var(--faint); padding: 60px 0; }

/* Series seasons + episodes */
.season-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 10px; }
.season-tab {
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--pill);
  padding: 5px 15px;
  cursor: pointer;
}
.season-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ep-list { display: grid; gap: 4px; }
.ep-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.12s;
}
.ep-row:hover { background: var(--glass); }
.ep-num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--faint);
}
.ep-row:hover .ep-num { color: var(--accent); }
.ep-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-dur { flex: none; color: var(--faint); font-size: 12.5px; }
.ep-play { flex: none; color: var(--faint); }
.ep-row:hover .ep-play { color: var(--accent); }

/* ---------- VOD player overlay ---------- */
.vod-player {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
}
.vod-player video { width: 100%; height: 100%; object-fit: contain; }
.vod-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 34px;
  background: linear-gradient(rgba(4, 5, 8, 0.85), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.vod-player:hover .vod-topbar { opacity: 1; }
.vod-title { font-weight: 700; font-size: 15.5px; }
.vod-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: var(--muted);
  background: rgba(8, 9, 13, 0.9);
}

/* =============================================================
   HELP + SETTINGS
   ============================================================= */
.help-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 1050px;
}
.help-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
}
.help-card h3 { margin-bottom: 10px; }
.help-card ol, .help-card ul { margin: 0; padding-left: 20px; color: var(--muted); }
.help-card li { margin-bottom: 6px; }
.help-card p { color: var(--muted); }
.help-card-wide { grid-column: 1 / -1; }
.help-note { font-size: 13.5px; color: var(--faint); }
.help-card .btn { margin-top: 4px; }
.settings-grid .btn { margin: 6px 8px 0 0; }

.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text); font-weight: 600; }

/* =============================================================
   UPDATE TOAST (over-the-air update ready)
   ============================================================= */
.update-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  animation: rise 0.3s var(--ease);
}
.update-toast-icon { font-size: 22px; flex: none; }
.update-toast-body { min-width: 0; }
.update-toast-title { font-weight: 700; font-size: 14px; }
.update-toast-sub { font-size: 12.5px; color: var(--muted); }
.update-toast .btn { flex: none; }
.update-toast-close {
  flex: none;
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.update-toast-close:hover { color: var(--text); background: var(--glass); }

/* =============================================================
   FULLSCREEN VIDEO
   ============================================================= */
.video-wrap:fullscreen { border-radius: 0; border: none; aspect-ratio: auto; }
.video-wrap:fullscreen video { height: 100vh; object-fit: contain; }

/* =============================================================
   CLOUD SYNC (Settings card)
   ============================================================= */
.cloud-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.cloud-form input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.cloud-form input:focus { border-color: var(--accent); }
.cloud-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#cs-status { text-align: left; margin-top: 10px; }

/* =============================================================
   D-PAD / REMOTE FOCUS (Android TV — body.tv-nav)
   A remote gives no pointer, so the focused element must be obvious
   from across a room.
   ============================================================= */
.tv-nav *:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.tv-nav .list li:focus,
.tv-nav .poster-grid > *:focus {
  background: rgba(87, 169, 232, 0.16);
  outline-offset: -3px;
}
.tv-nav .rail-btn:focus { background: rgba(87, 169, 232, 0.2); }
/* The pointer-only hover affordances shouldn't linger on TV */
.tv-nav .video-bar { opacity: 1; }
