/* ============================================================================
 * VIPerClub Dedicated Android TV OS & Big Screen Stylesheet (tv-app.css v3.0)
 * Ultra-Lightweight GPU-Optimized Build:
 *   - ZERO CSS filter:blur(), ZERO mask-image, ZERO full-screen scanline overdraw
 *   - ZERO clip-path software rasterization, ZERO heavy box-shadow blurs
 *   - Windowed shelf virtualization on TV (or full vertical/horizontal touch scroll on Mobile/Tablet/BigScreen)
 *   - Fullscreen Top Server Bar & D-Pad Pointer when pressing UP in the Player
 * ============================================================================ */

:root {
  --cyber-yellow: #fcee0a;
  --cyber-cyan: #00f0ff;
  --cyber-red: #ff003c;
  --cyber-dark: #050505;
  --safe-x: 3.2vw;
  --safe-y: 2.6vh;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  background: #05070b;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.brand-font {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.1em;
}

.mono-font {
  font-family: ui-monospace, 'Courier New', monospace;
}

/* Screen Containers (State Machine: Login | Vault | Player) */
.tv-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
  display: none;
  background: linear-gradient(160deg, #070b12 0%, #050505 65%, #080d16 100%);
}

.tv-screen.active {
  display: flex;
}

/* Crisp Zero-Lag TV Focus Ring (No expensive multi-pass blur shadows) */
.tv-focusable {
  outline: none !important;
}

.tv-focusable.tv-focused {
  border-color: var(--cyber-yellow) !important;
  outline: 3px solid var(--cyber-yellow) !important;
  outline-offset: 1px;
  z-index: 30;
}

/* ============================================================================
 * SCREEN 1: NEURAL INTERFACE (LOGIN) — Compact Fixed Height (Never Clips)
 * ============================================================================ */
#tvScreenLogin {
  align-items: center;
  justify-content: center;
  padding: var(--safe-y) var(--safe-x);
  overflow-y: auto;
}

.tv-login-card {
  width: 100%;
  max-width: 440px;
  background: #090d14;
  border: 2px solid rgba(0, 240, 255, 0.5);
  border-top: 5px solid var(--cyber-cyan);
  padding: 20px 26px;
  position: relative;
  text-align: center;
}

.tv-login-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 2px;
}

.tv-login-title span {
  color: var(--cyber-cyan);
}

.tv-login-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 14px;
}

.tv-login-tabs {
  display: flex;
  border: 1px solid rgba(0, 240, 255, 0.45);
  margin-bottom: 14px;
  background: #04060a;
}

.tv-login-tab {
  flex: 1;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
}

.tv-login-tab.active {
  background: var(--cyber-cyan);
  color: #000;
}

.tv-login-body {
  min-height: 192px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tv-pair-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 6px 0 12px;
}

.tv-pair-qr-wrap {
  width: 108px;
  height: 108px;
  flex-shrink: 0;
  background: #000;
  border: 1px solid var(--cyber-cyan);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-pair-qr-wrap img {
  width: 96px;
  height: 96px;
  display: block;
}

.tv-pair-code-wrap {
  flex: 1;
  background: #000;
  border: 2px solid var(--cyber-yellow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tv-pair-code-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 4px;
}

.tv-pair-code-val {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--cyber-yellow);
  line-height: 1.1;
}

.tv-pair-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyber-cyan);
  margin-top: 6px;
}

.tv-input {
  width: 100%;
  background: #020406;
  border: 2px solid rgba(0, 240, 255, 0.55);
  color: #fff;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
}

.tv-input-code {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 26px;
  letter-spacing: 0.42em;
  text-align: center;
  color: var(--cyber-yellow);
}

.tv-btn-primary {
  width: 100%;
  background: var(--cyber-yellow);
  color: #000;
  border: 2px solid var(--cyber-yellow);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.tv-btn-primary.tv-focused {
  background: #fff !important;
  color: #000 !important;
  border-color: var(--cyber-cyan) !important;
  outline: 3px solid var(--cyber-cyan) !important;
}

.tv-login-msg {
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 16px;
}

/* ============================================================================
 * SCREEN 2: THE VAULT (10-FOOT LEANBACK MEDIA ARCHIVE — VIRTUALIZED)
 * ============================================================================ */
#tvScreenVault {
  flex-direction: column;
  padding: 2vh var(--safe-x) 0;
}

/* Zone A: Top TV Navbar */
.tv-navbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 8vh;
  min-height: 42px;
  max-height: 58px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding-bottom: 0.8vh;
  flex-shrink: 0;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tv-brand img {
  width: 30px;
  height: 30px;
  border-radius: 4px;
}

.tv-brand-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  text-transform: uppercase;
}

.tv-brand-text .vip {
  color: var(--cyber-yellow);
}

.tv-brand-badge {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  background: #071922;
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  padding: 2px 6px;
  letter-spacing: 0.14em;
}

.tv-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-nav-pill {
  background: #0c121b;
  border: 2px solid rgba(0, 240, 255, 0.3);
  color: #d1d5db;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tv-nav-pill.active {
  background: #082630;
  border-color: var(--cyber-cyan);
  color: var(--cyber-cyan);
}

.tv-nav-pill.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
}


/* Search tab first: portrait/narrow = icon-only magnifier (Jake Nov 2026) */
.tv-nav-pill.tv-nav-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tv-nav-pill.tv-nav-search .vi-search {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}
@media (orientation: portrait), (max-width: 700px) {
  .tv-nav-pill.tv-nav-search .tv-nav-pill-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .tv-nav-pill.tv-nav-search {
    padding-left: 10px;
    padding-right: 10px;
    min-width: 40px;
    min-height: 32px;
  }
}

/* Dashboard return link in the /bigscreen header */
.tv-nav-dash-link,
body.anime-mode-purple .tv-nav-dash-link,
body.movies-mode-theme .tv-nav-dash-link,
body.tvseries-mode-theme .tv-nav-dash-link,
#tvScreenVault.anime-hub-active .tv-nav-dash-link,
#tvScreenVault.movies-hub-active .tv-nav-dash-link,
#tvScreenVault.tvseries-hub-active .tv-nav-dash-link {
  text-decoration: none;
  background: #171504 !important;
  border: 2px solid var(--cyber-yellow) !important;
  color: var(--cyber-yellow) !important;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tv-nav-dash-link:hover,
.tv-nav-dash-link.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
}

.tv-nav-logout {
  background: #220710;
  border: 2px solid var(--cyber-red);
  color: #fff;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Search Bar Drawer */
.tv-search-bar {
  position: relative;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 1vh;
  flex-shrink: 0;
}

.tv-search-bar.active {
  display: flex;
}

.tv-search-input {
  flex: 1;
  max-width: 440px;
  background: #04070b;
  border: 2px solid var(--cyber-cyan);
  color: #fff;
  padding: 7px 12px;
  font-size: 15px;
  font-weight: 600;
}

.tv-search-clear {
  background: #0c131d;
  border: 2px solid rgba(0, 240, 255, 0.45);
  color: var(--cyber-cyan);
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

/* On-Screen D-Pad Quick Keyboard for TV Search */
.tv-osk-bar {
  position: relative;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(6, 12, 20, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.35);
  flex-shrink: 0;
}

.tv-osk-bar.active {
  display: grid;
}

.tv-osk-key {
  background: #0b1420;
  border: 1px solid rgba(0, 240, 255, 0.32);
  color: #e5e7eb;
  padding: 5px 2px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.tv-osk-key.wide {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--cyber-cyan);
  border-color: rgba(0, 240, 255, 0.55);
}

.tv-osk-key:hover,
.tv-osk-key.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
}

#tvScreenVault.search-mode .tv-spotlight {
  height: auto;
  min-height: 44px;
  max-height: 60px;
  padding: 0.4vh 0;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}

#tvScreenVault.search-mode .tv-spotlight-desc {
  display: none;
}

#tvScreenVault.search-mode .tv-spotlight-title {
  font-size: 17px;
  margin-bottom: 0;
}

/* Zone B: Live Cyberpunk Spotlight Stage */
.tv-spotlight {
  position: relative;
  z-index: 15;
  height: 27vh;
  min-height: 120px;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1vh 0;
  flex-shrink: 0;
  max-width: 78vw;
}

.tv-spotlight-kicker {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyber-yellow);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-spotlight-title {
  font-size: clamp(20px, 3.5vh, 32px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 5px;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.tv-badge {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  background: #071922;
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: var(--cyber-cyan);
  text-transform: uppercase;
}

.tv-badge.rating {
  background: #211f05;
  border-color: var(--cyber-yellow);
  color: var(--cyber-yellow);
}

.tv-badge.resume {
  background: #290711;
  border-color: var(--cyber-red);
  color: #fff;
}

.tv-spotlight-desc {
  font-size: clamp(12px, 2.1vh, 15px);
  color: #cbd5e1;
  line-height: 1.32;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 68vw;
}

/* Zone C: Virtualized Shelves Viewport (Only active shelf + next shelf visible on TV) */
.tv-shelves-viewport {
  position: relative;
  z-index: 15;
  flex: 1;
  width: 100%;
  overflow: hidden;
  padding-top: 0.4vh;
}

.tv-shelves-stack {
  width: 100%;
}

.tv-shelf {
  margin-bottom: 1.8vh;
  display: none;
}

.tv-shelf.visible-shelf {
  display: block;
}

.tv-shelf-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8vh;
}

.tv-shelf-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0;
  padding-left: 8px;
  border-left: 3px solid var(--cyber-cyan);
}

.tv-shelf.active-shelf .tv-shelf-title {
  color: var(--cyber-yellow);
  border-left-color: var(--cyber-yellow);
}

.tv-shelf-count {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #64748b;
}

.tv-shelf-seemore-btn {
  margin-left: auto;
  background: #0b1622;
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.tv-shelf-seemore-btn:hover {
  background: var(--cyber-yellow);
  border-color: var(--cyber-yellow);
  color: #000;
}

.tv-rail-viewport {
  width: 100%;
  overflow: hidden;
}

.tv-rail-track {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 4px 4px 8px;
}

/* Poster Card inside TV Rail (Lightweight GPU layer) */
.tv-card {
  width: 116px;
  flex-shrink: 0;
  background: #0a0f16;
  border: 2px solid rgba(0, 240, 255, 0.22);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
}

@media (min-height: 720px) {
  .tv-card {
    width: 144px;
  }
}

.tv-card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #05070b;
  position: relative;
  overflow: hidden;
}

.tv-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tv-card-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #050505;
  border: 1px solid var(--cyber-yellow);
  color: var(--cyber-yellow);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
}

.tv-card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: #000;
}

.tv-card-progress > span {
  display: block;
  height: 100%;
  background: var(--cyber-yellow);
}

.tv-card-foot {
  padding: 5px 6px;
  background: #070a0f;
}

.tv-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-card-sub {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-card.tv-focused {
  border-color: var(--cyber-yellow) !important;
  outline: 3px solid var(--cyber-yellow) !important;
  background: #141c28;
}

.tv-card.tv-focused .tv-card-title {
  color: var(--cyber-yellow);
}

/* "See More" Tile at the end of every Shelf Rail */
.tv-card.tv-card-seemore {
  background: linear-gradient(160deg, #091924 0%, #05080e 100%);
  border: 2px dashed var(--cyber-cyan);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tv-card.tv-card-seemore .tv-card-poster {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(0, 240, 255, 0.14) 0%, transparent 75%);
}

.tv-seemore-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--cyber-yellow);
  background: #171504;
  color: var(--cyber-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tv-seemore-label {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

.tv-seemore-sub {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--cyber-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tv-card.tv-card-seemore.tv-focused {
  border-style: solid !important;
  border-color: var(--cyber-yellow) !important;
  background: #1b1905 !important;
}

.tv-card.tv-card-seemore.tv-focused .tv-seemore-icon {
  background: var(--cyber-yellow);
  color: #000;
}

/* Genre Library Active Banner & Full-Screen Library Mode */
.tv-library-banner {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #08131d;
  border: 1px solid var(--cyber-cyan);
  border-left: 4px solid var(--cyber-yellow);
  padding: 8px 14px;
  margin-top: 0.8vh;
  margin-bottom: 0.8vh;
  flex-shrink: 0;
  z-index: 20;
}

.tv-library-banner.active {
  display: flex;
}

.tv-library-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-library-banner-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyber-yellow);
}

.tv-library-genres {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tv-library-genres::-webkit-scrollbar {
  display: none;
}

.tv-lib-genre-pill {
  background: #0b1420;
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  color: #cbd5e1;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.tv-lib-genre-pill.active {
  background: var(--cyber-cyan);
  border-color: var(--cyber-cyan);
  color: #000;
}

.tv-lib-genre-pill.tv-focused,
.tv-library-back-btn.tv-focused {
  background: var(--cyber-yellow) !important;
  border-color: var(--cyber-yellow) !important;
  color: #000 !important;
  outline: 2px solid #fff !important;
}

.tv-library-back-btn {
  background: #0c1622;
  border: 1.5px solid var(--cyber-cyan);
  color: #fff;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

/* When Full Genre Library Mode is active, compact the spotlight and show all rows in a scrollable full-screen archive */
#tvScreenVault.library-mode .tv-spotlight {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0.6vh 0 !important;
  max-width: 100% !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
}

#tvScreenVault.library-mode .tv-spotlight-kicker,
#tvScreenVault.library-mode .tv-spotlight-desc {
  display: none !important;
}

#tvScreenVault.library-mode .tv-spotlight-title {
  font-size: 16px !important;
  margin: 0 !important;
}

#tvScreenVault.library-mode .tv-spotlight-meta {
  margin: 0 !important;
}

#tvScreenVault.library-mode .tv-shelves-viewport {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6vh;
}

#tvScreenVault.library-mode .tv-shelf {
  display: block !important;
  margin-bottom: 1.4vh;
}

/* ============================================================================
 * SCREEN 3: THE PLAYER (TITLE OVERVIEW HUD + TOP SERVER SELECTOR)
 * ============================================================================ */
#tvScreenPlayer {
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2vh var(--safe-x);
}

.tv-detail-shell {
  position: relative;
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 1.5vh;
}

/* Top Bar on Player Overview Screen (Reached by pressing UP from Play button!) */
.tv-player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding-bottom: 1vh;
  flex-shrink: 0;
}

.tv-player-top-servers {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-srv-pill {
  background: #0b111a;
  border: 2px solid rgba(0, 240, 255, 0.35);
  color: #cbd5e1;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tv-srv-pill.active {
  background: #082630;
  border-color: var(--cyber-cyan);
  color: var(--cyber-cyan);
}

.tv-srv-pill.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
}

.tv-detail-top {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
}

.tv-detail-poster {
  width: clamp(110px, 20vh, 180px);
  aspect-ratio: 2 / 3;
  flex-shrink: 0;
  border: 2px solid var(--cyber-cyan);
  background: #05080c;
  overflow: hidden;
}

.tv-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tv-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tv-detail-kicker {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--cyber-cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.tv-detail-title {
  font-size: clamp(22px, 4vh, 36px);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  line-height: 1.1;
}

.tv-detail-synopsis {
  font-size: clamp(13px, 2.2vh, 15px);
  color: #dbeafe;
  line-height: 1.38;
  margin: 4px 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 68vw;
}

.tv-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tv-action-btn {
  background: #0c121c;
  border: 2px solid rgba(0, 240, 255, 0.45);
  color: #f8fafc;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tv-action-btn.play-primary {
  background: var(--cyber-yellow);
  border-color: var(--cyber-yellow);
  color: #000;
  padding: 10px 24px;
  font-size: 14px;
}

.tv-action-btn.tv-focused {
  background: #fff !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
}

/* Season & Episode Horizontal Rails for TV Series */
.tv-series-panel {
  position: relative;
  z-index: 15;
  border-top: 1px solid rgba(0, 240, 255, 0.25);
  padding-top: 1.2vh;
  flex-shrink: 0;
}

.tv-seasons-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1vh;
  overflow: hidden;
}

.tv-season-pill {
  background: #0a0f18;
  border: 2px solid rgba(0, 240, 255, 0.35);
  color: #cbd5e1;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  cursor: pointer;
}

.tv-season-pill.active {
  background: #082630;
  border-color: var(--cyber-cyan);
  color: var(--cyber-cyan);
}

.tv-season-pill.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
}

.tv-episodes-viewport {
  width: 100%;
  overflow: hidden;
}

.tv-episodes-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 3px 3px 6px;
}

.tv-ep-card {
  width: 170px;
  flex-shrink: 0;
  background: #090e16;
  border: 2px solid rgba(0, 240, 255, 0.25);
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.tv-ep-card.current {
  border-color: var(--cyber-cyan);
  background: #07222b;
}

.tv-ep-card.tv-focused {
  border-color: var(--cyber-yellow) !important;
  background: #211f06 !important;
}

.tv-ep-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyber-yellow);
}

.tv-ep-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
 * FULLSCREEN CINEMA PLAYER OVERLAY + TOP SERVER BAR (REACHED BY PRESSING UP!)
 * ============================================================================ */
#tvFullscreenStage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  display: none;
}

#tvFullscreenStage.active {
  display: block;
}

#tvPlayerFrame {
  width: 100vw;
  height: 100vh;
  border: 0;
  display: block;
  background: #000;
}

/* Floating Touch/Mouse Toggle Pill for Fullscreen Player (Mobile / Tablet / BigScreen) */
.tv-fs-touch-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  background: rgba(5, 8, 14, 0.85);
  border: 1.5px solid var(--cyber-cyan);
  color: #fff;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
}

html.touch-scroll-mode .tv-fs-touch-toggle,
html.bigscreen-mode .tv-fs-touch-toggle {
  display: inline-flex;
}

/* Top Server & Exit Bar inside Fullscreen Player (Shown when user presses UP on D-Pad or taps toggle) */
#tvFsTopBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: rgba(5, 8, 14, 0.94);
  border-bottom: 2px solid var(--cyber-cyan);
  padding: 12px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#tvFsTopBar.active {
  display: flex;
}

.tv-fs-server-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tv-fs-btn {
  background: #0c131f;
  border: 2px solid rgba(0, 240, 255, 0.45);
  color: #fff;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.tv-fs-btn.active {
  background: #082834;
  border-color: var(--cyber-cyan);
  color: var(--cyber-cyan);
}

.tv-fs-btn.exit-btn {
  background: #280711;
  border-color: var(--cyber-red);
}

.tv-fs-btn.embed-srv-btn {
  background: #1c1904;
  border-color: var(--cyber-yellow);
  color: var(--cyber-yellow);
}

.tv-fs-btn.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: #fff !important;
  outline: 3px solid var(--cyber-yellow) !important;
}

/* On-Screen D-Pad Pointer Reticle for clicking inside framextv's internal Server Menu */
#tvFsPointer {
  position: fixed;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border: 3px solid var(--cyber-yellow);
  background: rgba(252, 238, 10, 0.28);
  border-radius: 50%;
  z-index: 10002;
  pointer-events: none;
  display: none;
}

#tvFsPointer.active {
  display: block;
}

#tvToast {
  position: fixed;
  bottom: 4vh;
  right: 4vw;
  z-index: 10005;
  background: #060a10;
  border: 1px solid var(--cyber-cyan);
  border-left: 4px solid var(--cyber-yellow);
  color: #fff;
  padding: 9px 16px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}

#tvToast.show {
  display: block;
}

/* ============================================================================
 * TOUCH & BIGSCREEN SCROLL MODE (Mobile APK, Tablet APK, PWA, & /bigscreen)
 * Enables smooth vertical shelf scrolling and horizontal swipe rails
 * ============================================================================ */
html.touch-scroll-mode .tv-shelves-viewport,
html.bigscreen-mode .tv-shelves-viewport {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6vh;
}

html.touch-scroll-mode .tv-shelf,
html.bigscreen-mode .tv-shelf {
  display: block !important;
}

html.touch-scroll-mode .tv-rail-viewport,
html.bigscreen-mode .tv-rail-viewport,
html.touch-scroll-mode .tv-seasons-rail,
html.bigscreen-mode .tv-seasons-rail,
html.touch-scroll-mode .tv-episodes-viewport,
html.bigscreen-mode .tv-episodes-viewport,
html.touch-scroll-mode .tv-nav-pills,
html.bigscreen-mode .tv-nav-pills,
html.touch-scroll-mode .tv-player-top-servers,
html.bigscreen-mode .tv-player-top-servers {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

html.touch-scroll-mode .tv-rail-viewport::-webkit-scrollbar,
html.bigscreen-mode .tv-rail-viewport::-webkit-scrollbar,
html.touch-scroll-mode .tv-seasons-rail::-webkit-scrollbar,
html.bigscreen-mode .tv-seasons-rail::-webkit-scrollbar,
html.touch-scroll-mode .tv-episodes-viewport::-webkit-scrollbar,
html.bigscreen-mode .tv-episodes-viewport::-webkit-scrollbar,
html.touch-scroll-mode .tv-nav-pills::-webkit-scrollbar,
html.bigscreen-mode .tv-nav-pills::-webkit-scrollbar,
html.touch-scroll-mode .tv-player-top-servers::-webkit-scrollbar,
html.bigscreen-mode .tv-player-top-servers::-webkit-scrollbar {
  display: none;
}

html.touch-scroll-mode #tvScreenPlayer,
html.bigscreen-mode #tvScreenPlayer {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .tv-navbar {
    height: auto;
    min-height: 44px;
    max-height: none;
    flex-wrap: wrap;
    padding: 6px 0;
  }
  .tv-nav-pills {
    width: 100%;
    order: 3;
    padding-bottom: 4px;
  }
  .tv-spotlight {
    height: auto;
    min-height: 105px;
    max-height: 165px;
    max-width: 100%;
  }
  .tv-spotlight-desc,
  .tv-detail-synopsis {
    max-width: 100%;
  }
  .tv-detail-top {
    flex-direction: row;
    gap: 14px;
  }
  .tv-detail-poster {
    width: 96px;
  }
  .tv-player-topbar {
    flex-wrap: wrap;
  }
  .tv-player-top-servers {
    width: 100%;
    padding-bottom: 4px;
  }
}

/* ============================================================================
 * FEATURES ADDED AFTER JAKE'S b6dfe09 (everything above this line is b6dfe09 verbatim).
 * Only rules for elements that are hidden unless in use: the on-screen keyboard (Search tab, opened by its
 * button), the offline / locked screen (a .tv-screen, display:none unless active) and the boot skeleton
 * (position:fixed overlay, hidden as soon as the app shows a screen). Nothing here touches the page layout.
 * ============================================================================ */
/* Keyboard toggle next to the search field */
.tv-search-kbd { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; justify-content: center; }
.tv-search-kbd i { font-size: 15px; }
.tv-search-kbd.on { background: var(--cyber-cyan); color: #000; border-color: var(--cyber-cyan); }
.tv-search-kbd.tv-focused, .tv-search-kbd:hover { background: var(--cyber-yellow) !important; color: #000 !important; border-color: var(--cyber-yellow) !important; }

/* On-screen keyboard for TV search (hidden until toggled) */
.tv-osk-bar {
  position: relative;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 5px;
  max-width: 760px;
  margin-top: 6px;
  padding: 8px;
  background: rgba(6, 12, 20, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.35);
  flex-shrink: 0;
}
.tv-osk-bar.active { display: flex; }
.tv-osk-bar[hidden] { display: none !important; }
.tv-osk-row { display: flex; gap: 5px; }
.tv-osk-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  background: #0b1420;
  border: 1px solid rgba(0, 240, 255, 0.32);
  color: #e5e7eb;
  padding: 4px 2px;
  font-family: ui-monospace, monospace;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tv-osk-key.special { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cyber-cyan); border-color: rgba(0, 240, 255, 0.55); }
.tv-osk-key.k-space { flex-grow: 4; }
.tv-osk-key.k-search { flex-grow: 2.2; background: #062028; }
.tv-osk-key.k-clear, .tv-osk-key.k-sym, .tv-osk-key.k-abc { flex-grow: 1.5; }
.tv-osk-key.k-shift.on { background: var(--cyber-cyan); color: #000; }
.tv-osk-bar[data-shift="caps"] .k-shift { box-shadow: inset 0 -3px 0 #000; }
.tv-osk-key:hover,
.tv-osk-key.tv-focused {
  background: var(--cyber-yellow) !important;
  color: #000 !important;
  border-color: var(--cyber-yellow) !important;
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.tv-osk-bar .sr-only, .tv-search-kbd .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 768px) {
  .tv-osk-bar { max-width: none; padding: 5px; gap: 4px; }
  .tv-osk-row { gap: 3px; }
  .tv-osk-key { font-size: 15px; padding: 2px 0; }
  .tv-osk-key.special { font-size: 10px; letter-spacing: 0; }
  .tv-search-kbd .tv-kbd-label { display: none; }
  /* phone: field on its own row (16px, no iOS zoom), keyboard / search / clear share the row below */
  .tv-search-bar.active { flex-wrap: wrap; gap: 6px; }
  .tv-search-bar .tv-search-input { flex: 1 1 100%; max-width: none; font-size: 16px; min-height: 44px; }
  .tv-search-bar .tv-search-clear { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
}
.tv-osk-key { text-transform: none; } /* the new keyboard has lower case + shift (b6dfe09's was upper case only) */

/* ---- Vault offline / locked (applyAccess in tv-app.js) ---- */
.tv-lock-screen { align-items: center; justify-content: center; padding: 4vh 5vw; }
.tv-lock-card {
  max-width: 46rem; width: 100%; text-align: center; padding: 3rem 2.5rem;
  background: rgba(8, 17, 31, 0.96); border: 1px solid rgba(75, 99, 133, 0.55);
  border-top: 4px solid #fcee0a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(8, 223, 236, 0.08);
}
.tv-lock-card > i { font-size: 3.2rem; color: #ff005f; margin-bottom: 1.2rem; display: block; }
.tv-lock-card h1 { color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.6rem); font-weight: 900; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 1rem; }
.tv-lock-card p { color: #7a8eaa; font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.55; margin: 0 0 2rem; }
.tv-lock-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.tv-lock-btn { min-height: 48px; min-width: 10rem; padding: .8rem 1.6rem; background: transparent; color: #c9d6e8; border: 1px solid rgba(75, 99, 133, 0.55); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: .95rem; cursor: pointer; }
.tv-lock-btn i { margin-right: .5rem; }
.tv-lock-btn:hover, .tv-lock-btn.tv-focused { background: #fcee0a; color: #05070c; border-color: #fcee0a; }

.tv-admin-offline { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; background: #ff003c; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; padding: 6px 14px; pointer-events: none; }
.tv-admin-offline[hidden] { display: none; }


/* ---- Boot shell (skeleton painted before any script; hidden by tv-app.js showScreen) ---- */
.tv-boot {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 2.4vh;
  padding: 2vh var(--safe-x) 0; background: var(--cyber-dark, #050505); overflow: hidden;
  font-family: system-ui, sans-serif;
}
.tv-boot[hidden] { display: none; }
.tv-boot-nav { display: flex; align-items: center; gap: 12px; height: 46px; border-bottom: 1px solid rgba(0, 240, 255, 0.25); flex-shrink: 0; }
.tv-boot-brand { font-weight: 900; font-size: 18px; letter-spacing: 0.12em; color: #fff; margin-right: auto; }
.tv-boot-brand .vip { color: var(--cyber-yellow); }
.tv-boot-pill { width: 92px; height: 28px; border: 1px solid rgba(0, 240, 255, 0.22); }
.tv-boot-hero, .tv-boot-row { display: flex; flex-direction: column; gap: 10px; }
.tv-boot-line { display: block; height: 14px; background: rgba(148, 163, 184, 0.14); }
.tv-boot-line.w40 { width: 40%; height: 26px; } .tv-boot-line.w25 { width: 25%; } .tv-boot-line.w15 { width: 15%; min-width: 110px; }
.tv-boot-cards { display: flex; gap: 14px; overflow: hidden; }
.tv-boot-cards i { flex-shrink: 0; width: 116px; aspect-ratio: 2 / 3; background: #0a0f16; border: 2px solid rgba(0, 240, 255, 0.12); }
@media (min-height: 720px) { .tv-boot-cards i { width: 144px; } }
.tv-boot-line, .tv-boot-cards i { animation: tvBootPulse 1.4s ease-in-out infinite; }
@keyframes tvBootPulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .tv-boot-line, .tv-boot-cards i { animation: none; } }
.tv-boot-status { position: absolute; left: 0; right: 0; bottom: 6vh; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #94a3b8; font-size: 16px; text-align: center; padding: 0 var(--safe-x); }
.tv-boot.slow .tv-boot-line, .tv-boot.slow .tv-boot-cards i { animation: none; opacity: 0.4; }
/* v3.6.5 2077 skeleton: chamfered blocks, yellow edge, one cyan sweep (background-position only; static on lite/reduced-motion/slow) */
.tv-boot-line, .tv-boot-cards i, .tv-boot-pill {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  background-color: #0c131f; border-left: 2px solid rgba(252, 238, 10, 0.55);
  background-image: linear-gradient(100deg, transparent 30%, rgba(0, 240, 255, 0.14) 50%, transparent 70%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 130% 0;
}
.tv-boot-cards i { border: 1px solid rgba(0, 240, 255, 0.14); border-left: 2px solid rgba(252, 238, 10, 0.5); }
.tv-boot-line, .tv-boot-cards i { animation: tvBootSweep 1.5s linear infinite; }
@keyframes tvBootSweep { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .tv-boot-line, .tv-boot-cards i { animation: none; } }
html.tv-lite-mode .tv-boot-line, html.tv-lite-mode .tv-boot-cards i, .tv-boot.slow .tv-boot-line, .tv-boot.slow .tv-boot-cards i { animation: none; background-image: none; }
.tv-boot-status #tvBootMsg { font-family: ui-monospace, 'JetBrains Mono', monospace; letter-spacing: 0.18em; text-transform: uppercase; font-size: 13px; color: rgba(0, 240, 255, 0.8); }
#tvBootRetry { min-height: 44px; min-width: 140px; padding: 10px 28px; font: 800 16px/1 system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #000; background: var(--cyber-yellow); border: 0; cursor: pointer; }
#tvBootRetry[hidden] { display: none; }
#tvBootRetry:focus-visible, #tvBootRetry:focus { outline: 3px solid var(--cyber-cyan); outline-offset: 3px; }

/* ============================================================================
 * EDGE TO EDGE on phones, tablets, the Mobile APK and /bigscreen (Jake, 22 Oct 2026)
 * J inset the whole Vault by the TV overscan margin (--safe-x = 3.2vw each side), so every rail was clipped
 * 3.2vw short of both screen edges and the dark page showed through as side bars on every touch device; and
 * 100vh (the LARGEST viewport) pushed the bottom under the browser toolbar. On touch / Big Screen:
 *  - page, screens and player are 100% wide and 100dvh tall (100vh fallback);
 *  - the Vault itself has no side padding: text rows sit on a small fixed gutter (--safe-x, 16px), rails run
 *    to both edges (first card still lines up with the text).
 * Update (Jake, 22 Oct 20:29): the 3.2vw overscan margin is gone EVERYWHERE, including real-TV D-pad mode;
 * --safe-x is now a fixed 16px gutter and the Vault rules below apply in every mode.
 * No safe-area / notch inset handling (Jake's preference).
 * ============================================================================ */
html.touch-scroll-mode, html.touch-scroll-mode body,
html.bigscreen-mode, html.bigscreen-mode body {
  width: 100% !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
}
html.touch-scroll-mode .tv-screen, html.bigscreen-mode .tv-screen,
html.touch-scroll-mode #tvFullscreenStage, html.bigscreen-mode #tvFullscreenStage,
html.touch-scroll-mode #tvPlayerFrame, html.bigscreen-mode #tvPlayerFrame {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}
/* Jake 22 Oct 20:29: no 3.2vw overscan margin anywhere (TV D-pad too): a fixed 16px text gutter instead. */
:root { --safe-x: 16px; }
html:root #tvScreenVault {
  padding-left: 0;
  padding-right: 0;
}
html:root #tvScreenVault > :not(.tv-shelves-viewport) {
  margin-left: var(--safe-x);
  margin-right: var(--safe-x);
}
html:root #tvScreenVault .tv-shelf-header {
  padding-left: var(--safe-x);
  padding-right: var(--safe-x);
}
html:root #tvScreenVault .tv-rail-viewport {
  scroll-padding-left: var(--safe-x);
  scroll-padding-right: var(--safe-x);
}
html:root #tvScreenVault .tv-rail-track {
  padding-left: calc(var(--safe-x) + 4px);
  padding-right: calc(var(--safe-x) + 4px);
}
html:root #tvScreenVault .tv-rail-track::after {
  content: "";
  flex: 0 0 1px;
  margin-left: calc(var(--safe-x) - 9px);
}

/* ============================================================================
 * PORTRAIT ONLY (Jake, 23 Oct 12:38): landscape is fixed and must render exactly as before, so every rule
 * below sits inside @media (orientation: portrait).
 * viewport-fit=cover (needed for edge-to-edge landscape) also lets the page draw under the iPhone status bar
 * in portrait, so the header slid under the clock/battery. And the explicit 100dvh/100vh heights don't always
 * match the real screen on iOS (Home Screen app / after rotation), which left an unpainted black band
 * at the bottom. In portrait:
 *  - page, screens and the player stage are sized by position:fixed + inset:0 only (height:auto), so they
 *    always cover the whole screen, under the status bar and the home indicator too;
 *  - the dark screen background still paints behind the status bar, and only the content is pushed down by
 *    the status-bar inset (top), with the last shelf row clearing the home indicator (bottom).
 * ============================================================================ */
@media (orientation: portrait) {
  html.touch-scroll-mode, html.touch-scroll-mode body,
  html.bigscreen-mode, html.bigscreen-mode body,
  html.touch-scroll-mode .tv-screen, html.bigscreen-mode .tv-screen,
  html.touch-scroll-mode #tvFullscreenStage, html.bigscreen-mode #tvFullscreenStage {
    height: auto !important;
    max-height: none !important;
  }
  html.touch-scroll-mode #tvPlayerFrame, html.bigscreen-mode #tvPlayerFrame {
    height: 100%;
  }
  html.touch-scroll-mode #tvScreenVault, html.bigscreen-mode #tvScreenVault {
    padding-top: calc(2vh + env(safe-area-inset-top, 0px));
  }
  html.touch-scroll-mode #tvScreenLogin, html.bigscreen-mode #tvScreenLogin {
    padding-top: calc(var(--safe-y) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--safe-y) + env(safe-area-inset-bottom, 0px));
  }
  html.touch-scroll-mode #tvScreenPlayer, html.bigscreen-mode #tvScreenPlayer {
    padding-top: calc(2.2vh + env(safe-area-inset-top, 0px));
    padding-bottom: calc(2.2vh + env(safe-area-inset-bottom, 0px));
  }
  html.touch-scroll-mode .tv-boot, html.bigscreen-mode .tv-boot {
    padding-top: calc(2vh + env(safe-area-inset-top, 0px));
  }
  html.touch-scroll-mode .tv-shelves-viewport, html.bigscreen-mode .tv-shelves-viewport {
    padding-bottom: calc(6vh + env(safe-area-inset-bottom, 0px));
  }
  /* iOS Home Screen app (html.ios-app, set by tv-app.js), portrait (Jake, 23 Oct 15:31: had to tap above
   * Movies / TV Series). iOS 26 can make the app's layout viewport taller than what is on screen
   * (WebKit 316008), so a vertical drag on the header or past the end of the shelves pans the whole view by
   * up to a status bar. Then iOS keeps drawing the fixed screens where they were while taps are matched
   * against the panned position (WebKit 297779), so every tap lands below the finger.
   * So in the app: the page is exactly the visible height (--ios-app-h = visualViewport.height, measured
   * by tv-app.js), nothing can start or chain a page pan, and tv-app.js resets any pan that still happens. */
  html.ios-app, html.ios-app body {
    overscroll-behavior: none;
  }
  html.ios-app.touch-scroll-mode, html.ios-app.touch-scroll-mode body,
  html.ios-app.bigscreen-mode, html.ios-app.bigscreen-mode body,
  html.ios-app .tv-screen, html.ios-app #tvFullscreenStage {
    bottom: auto !important;
    height: var(--ios-app-h, 100%) !important;
  }
  html.ios-app .tv-screen, html.ios-app .tv-shelves-viewport, html.ios-app .tv-rail-viewport,
  html.ios-app .tv-nav-pills, html.ios-app .tv-seasons-rail, html.ios-app .tv-episodes-viewport,
  html.ios-app .tv-detail-actions, html.ios-app .tv-player-top-servers {
    overscroll-behavior: contain;
  }
  html.ios-app .tv-navbar, html.ios-app .tv-player-topbar, html.ios-app #tvFsTopBar {
    touch-action: pan-x;
  }
  /* Title detail / player screen (#tvScreenPlayer): eliminate the empty middle void by placing the
   * Seasons & Episodes panel right below the hero info / action buttons, and enlarge the season pills and
   * episode cards into a 2-row horizontal grid with full multi-line titles and episode descriptions. */
  html.touch-scroll-mode #tvScreenPlayer,
  html.bigscreen-mode #tvScreenPlayer,
  #tvScreenPlayer {
    justify-content: flex-start;
  }
  #tvScreenPlayer .tv-detail-shell {
    justify-content: flex-start;
    height: auto;
    min-height: 100%;
    gap: 16px;
  }
  #tvScreenPlayer .tv-detail-top {
    flex: 0 0 auto;
    gap: 16px;
  }
  #tvScreenPlayer .tv-detail-poster {
    width: clamp(104px, 26vw, 126px);
  }
  #tvScreenPlayer .tv-detail-synopsis {
    -webkit-line-clamp: 4;
    font-size: 13.5px;
    line-height: 1.4;
  }
  #tvScreenPlayer .tv-series-panel {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 240, 255, 0.38);
    flex: 1 1 auto;
  }
  #tvScreenPlayer .tv-seasons-rail {
    gap: 10px;
    margin-bottom: 14px;
    padding: 2px 0 4px;
  }
  #tvScreenPlayer .tv-season-pill {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
    letter-spacing: 0.08em;
    border-width: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #tvScreenPlayer .tv-episodes-track {
    display: grid;
    grid-template-rows: repeat(2, minmax(112px, auto));
    grid-auto-flow: column;
    grid-auto-columns: minmax(226px, 60vw);
    gap: 12px;
    padding: 4px 2px 10px;
  }
  #tvScreenPlayer .tv-ep-card {
    width: 100%;
    min-height: 112px;
    padding: 12px 14px;
    gap: 6px;
    border-width: 2px;
    justify-content: flex-start;
  }
  #tvScreenPlayer .tv-ep-num {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
  }
  #tvScreenPlayer .tv-ep-meta {
    display: inline !important;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  #tvScreenPlayer .tv-ep-title {
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.28;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #tvScreenPlayer .tv-ep-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.38;
    color: #94a3b8;
    white-space: normal;
  }
  #tvScreenPlayer .tv-action-btn,
  #tvScreenPlayer .tv-back-btn,
  #tvScreenPlayer .tv-srv-pill {
    min-height: 48px;
    padding: 10px 16px;
    font-size: 13.5px;
  }
  #tvScreenPlayer .tv-action-btn i,
  #tvScreenPlayer .tv-back-btn i {
    font-size: 17px;
  }
  #tvFullscreenStage .tv-fs-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 10px 16px;
    font-size: 13px;
  }
  #tvFullscreenStage .tv-fs-btn i {
    font-size: 18px;
  }
  #tvFullscreenStage #tvFsTouchToggle {
    top: calc(env(safe-area-inset-top, 0px) + 68px);
    left: 12px;
    width: auto !important;
    min-width: 48px;
    height: 38px !important;
    min-height: 38px;
    padding: 0 12px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    border-radius: 6px;
    overflow: hidden;
  }
}

/* ============================================================================
 * VIPERCLUB TV LITE MODE (Low-tier TV Hardware Optimizations)
 * ============================================================================ */
html.tv-lite-mode * {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.tv-lite-mode .tv-card-poster img {
  image-rendering: auto;
}
html.tv-lite-mode .tv-screen {
  background: #050505 !important;
}
html.tv-lite-mode #tvFullscreenStage {
  background: #000 !important;
}

/* ==========================================================================
   ANIME NETWORK HUB (Anime Discovery + Anime Stream Configurator & Player)
   ========================================================================== */
.anime-network-hub {
  margin-top: 1.15rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 12, 28, 0.92) 0%, rgba(8, 10, 18, 0.96) 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.anime-net-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(12, 9, 22, 0.92);
  border-bottom: 1px solid rgba(168, 85, 247, 0.28);
}

.anime-net-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.anime-net-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.24) 0%, rgba(236, 72, 153, 0.2) 100%);
  border: 1px solid rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.28);
}

.anime-net-sub {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.74rem;
  color: #9ca3af;
}

.anime-net-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.anime-net-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.anime-net-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.anime-net-tab.active {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  border-color: rgba(216, 180, 254, 0.65);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.45);
}

.anime-net-body {
  padding: 1.25rem;
}

/* Featured Anime Hero Card */
.anime-hero-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: #090812;
  min-height: 290px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

.anime-hero-backdrop,
.anime-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  opacity: 0.42;
  filter: saturate(1.18) contrast(1.05);
  transition: background-image 0.35s ease;
}

.anime-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 7, 16, 0.96) 0%, rgba(8, 7, 16, 0.82) 52%, rgba(8, 7, 16, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 7, 16, 0.2) 0%, rgba(8, 7, 16, 0.96) 100%);
}

.anime-hero-inner,
.anime-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.anime-hero-copy {
  max-width: 680px;
  flex: 1 1 320px;
}

.anime-hero-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.anime-hero-pill,
.anime-hero-feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(168, 85, 247, 0.24);
  border: 1px solid rgba(192, 132, 252, 0.65);
  color: #f3e8ff;
}

.anime-hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde047;
}

.anime-hero-title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.12;
  margin: 0 0 0.45rem 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

.anime-hero-meta,
.anime-hero-meta-pill {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.65rem;
}

.anime-hero-synopsis {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d1d5db;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.anime-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.anime-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.anime-hero-btn--primary {
  background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
  border: 1px solid rgba(244, 114, 182, 0.75);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.48);
}

.anime-hero-btn--primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 24px rgba(236, 72, 153, 0.65);
}

.anime-hero-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.anime-hero-btn--secondary:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
  color: #f3e8ff;
}

.anime-hero-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.anime-hero-dot {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anime-hero-dot.active,
.anime-hero-dot:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #c084fc;
  color: #ffffff;
}

/* Discovery Search & Genre Pills */
.anime-discovery-search-row,
.anime-search-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.anime-discovery-input-wrap {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.anime-discovery-input-wrap i {
  position: absolute;
  left: 0.9rem;
  color: #a855f7;
  pointer-events: none;
}

.anime-discovery-input,
.anime-search-input {
  flex: 1 1 200px;
  width: auto;
  min-width: 0;
  padding: 0.68rem 2.4rem 0.68rem 2.5rem;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.38);
  background: rgba(10, 12, 22, 0.9);
  color: #ffffff;
  font-size: max(16px, 1rem) !important;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.anime-discovery-input:focus,
.anime-search-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.anime-discovery-submit,
.anime-search-btn {
  padding: 0.68rem 1.35rem;
  border-radius: 8px;
  border: 1px solid rgba(192, 132, 252, 0.65);
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: #ffffff;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.anime-genre-bar,
.anime-genre-rail {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.anime-genre-pill {
  flex: 0 0 auto;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.anime-genre-pill:hover {
  border-color: rgba(192, 132, 252, 0.55);
  color: #ffffff;
}

.anime-genre-pill.active {
  background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
  border-color: rgba(244, 114, 182, 0.8);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* Stream Configurator + Live Player Grid */
.anime-configurator-layout,
.anime-cfg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1023px) {
  .anime-configurator-layout,
  .anime-cfg-grid {
    grid-template-columns: 1fr;
  }
}

.anime-cfg-card {
  background: rgba(13, 12, 24, 0.92);
  border: 1px solid rgba(168, 85, 247, 0.32);
  border-radius: 10px;
  padding: 1.1rem;
}

.anime-cfg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.anime-cfg-title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9d5ff;
}

.anime-cfg-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.66rem;
  padding: 0.15rem 0.48rem;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #d8b4fe;
}

.anime-cfg-section-label {
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.45rem;
}

.anime-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}

.anime-preset-btn {
  padding: 0.34rem 0.68rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anime-preset-btn:hover {
  border-color: rgba(192, 132, 252, 0.6);
  color: #ffffff;
  background: rgba(168, 85, 247, 0.16);
}

.anime-preset-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(236, 72, 153, 0.28) 100%);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

.anime-cfg-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.anime-cfg-toggle-btn {
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.anime-cfg-toggle-btn.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.34) 0%, rgba(79, 70, 229, 0.3) 100%);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.35);
}

.anime-cfg-toggle-btn[data-cfg-sub="dub"].active,
.anime-cfg-toggle-btn[data-p-cfg-sub="dub"].active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.32) 0%, rgba(168, 85, 247, 0.32) 100%);
  border-color: #f472b6;
  color: #ffffff;
}

.anime-cfg-inputs-row {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.anime-cfg-field label {
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.3rem;
}

.anime-cfg-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 9, 16, 0.92);
  color: #ffffff;
  font-family: "Share Tech Mono", monospace;
  font-size: max(16px, 1rem) !important;
  outline: none;
}

.anime-cfg-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.anime-cfg-resolved {
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(192, 132, 252, 0.48);
  color: #e9d5ff;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.anime-cfg-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.anime-player-preview-card,
.anime-player-stage {
  background: rgba(10, 10, 20, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.32);
  border-radius: 10px;
  overflow: hidden;
}

.anime-player-preview-bar,
.anime-player-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 12, 28, 0.95);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  flex-wrap: wrap;
}

.anime-player-preview-stage,
.anime-player-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #04050a;
}

.anime-player-preview-stage iframe,
.anime-player-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* Big Screen / TV adjustments for Anime Network Hub */
#tvScreenVault.anime-hub-active .tv-spotlight {
  display: none !important;
}
#tvScreenVault.anime-hub-active .tv-shelves-viewport {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-top: 10px !important;
  padding-bottom: 32px !important;
}
#tvSettingsPanel #tvAnimeConfiguratorPanel {
  margin-top: 18px;
}
#tvScreenVault.anime-hub-active .tv-shelf {
  display: block !important;
}
#tvAnimeNetworkHub {
  margin: 8px 0 18px;
}
#tvAnimeNetworkHub.hidden,
#tvAnimeNetworkHub .hidden {
  display: none !important;
}
@media (max-width: 767px) {
  #tvAnimeNetworkHub {
    margin: 8px 12px 12px;
  }
}


.tv-seasons-rail {
  overflow: visible;
  padding: 3px 3px 6px;
  transition: transform 0.22s ease-out;
  will-change: transform;
}

/* Hide horizontal scrollbars on genre strips so no white scrollbar track renders */
.anime-genre-bar,
.anime-genre-rail {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.anime-genre-bar::-webkit-scrollbar,
.anime-genre-rail::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Big Screen / TV Anime Mode Purple Theme Overrides */
html.anime-mode-purple,
body.anime-mode-purple {
  --cyber-cyan: #c084fc;
  --bg-dark: #070510;
  background-color: #070510 !important;
  color-scheme: dark !important;
}

html.anime-mode-purple body,
body.anime-mode-purple,
#tvScreenVault.anime-hub-active {
  background-color: #070510 !important;
  background-image: radial-gradient(ellipse at 50% 0%, #160c2e 0%, #090614 55%, #05030a 100%) !important;
}

body.anime-mode-purple .tv-nav,
#tvScreenVault.anime-hub-active .tv-nav {
  background: rgba(12, 8, 24, 0.92) !important;
  border-bottom-color: rgba(168, 85, 247, 0.38) !important;
}

body.anime-mode-purple .tv-nav-pill:not(.tv-nav-dash-link),
#tvScreenVault.anime-hub-active .tv-nav-pill:not(.tv-nav-dash-link) {
  background: #100b1e !important;
  border-color: rgba(168, 85, 247, 0.38) !important;
  color: #e9d5ff !important;
}

body.anime-mode-purple .tv-nav-pill.active,
#tvScreenVault.anime-hub-active .tv-nav-pill.active {
  background: linear-gradient(135deg, #9333ea 0%, #db2777 100%) !important;
  border-color: #f472b6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45) !important;
}

body.anime-mode-purple .tv-card,
#tvScreenVault.anime-hub-active .tv-card {
  background: #0d091a !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
}

body.anime-mode-purple .tv-brand-badge,
#tvScreenVault.anime-hub-active .tv-brand-badge {
  background: rgba(147, 51, 234, 0.2) !important;
  border-color: #c084fc !important;
  color: #e9d5ff !important;
}

/* Big Screen / TV Movies Mode Cyberpunk Cyan Theme Overrides */
html.movies-mode-theme,
body.movies-mode-theme {
  --cyber-cyan: #00f0ff;
  --bg-dark: #03090d;
  background-color: #03090d !important;
  color-scheme: dark !important;
}

html.movies-mode-theme body,
body.movies-mode-theme,
#tvScreenVault.movies-hub-active {
  background-color: #03090d !important;
  background-image: radial-gradient(ellipse at 50% 0%, #05222e 0%, #031118 55%, #02070a 100%) !important;
}

body.movies-mode-theme .tv-nav,
#tvScreenVault.movies-hub-active .tv-nav {
  background: rgba(4, 16, 22, 0.92) !important;
  border-bottom-color: rgba(0, 240, 255, 0.38) !important;
}

body.movies-mode-theme .tv-nav-pill:not(.tv-nav-dash-link),
#tvScreenVault.movies-hub-active .tv-nav-pill:not(.tv-nav-dash-link) {
  background: #061821 !important;
  border-color: rgba(0, 240, 255, 0.38) !important;
  color: #cffafe !important;
}

body.movies-mode-theme .tv-nav-pill.active,
#tvScreenVault.movies-hub-active .tv-nav-pill.active {
  background: linear-gradient(135deg, #0891b2 0%, #00f0ff 100%) !important;
  border-color: #00f0ff !important;
  color: #021017 !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.45) !important;
}

body.movies-mode-theme .tv-card,
#tvScreenVault.movies-hub-active .tv-card {
  background: #041017 !important;
  border-color: rgba(0, 240, 255, 0.35) !important;
}

body.movies-mode-theme .tv-brand-badge,
#tvScreenVault.movies-hub-active .tv-brand-badge {
  background: rgba(0, 240, 255, 0.16) !important;
  border-color: #00f0ff !important;
  color: #cffafe !important;
}

body.movies-mode-theme .tv-shelf-title,
#tvScreenVault.movies-hub-active .tv-shelf-title {
  color: #cffafe !important;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4) !important;
}

/* Big Screen / TV Series Mode Emerald Theme Overrides */
html.tvseries-mode-theme,
body.tvseries-mode-theme {
  --cyber-cyan: #34d399;
  --bg-dark: #030a07;
  background-color: #030a07 !important;
  color-scheme: dark !important;
}

html.tvseries-mode-theme body,
body.tvseries-mode-theme,
#tvScreenVault.tvseries-hub-active {
  background-color: #030a07 !important;
  background-image: radial-gradient(ellipse at 50% 0%, #05261c 0%, #03120d 55%, #020705 100%) !important;
}

body.tvseries-mode-theme .tv-nav,
#tvScreenVault.tvseries-hub-active .tv-nav {
  background: rgba(4, 18, 13, 0.92) !important;
  border-bottom-color: rgba(16, 185, 129, 0.38) !important;
}

body.tvseries-mode-theme .tv-nav-pill:not(.tv-nav-dash-link),
#tvScreenVault.tvseries-hub-active .tv-nav-pill:not(.tv-nav-dash-link) {
  background: #061c14 !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
  color: #d1fae5 !important;
}

body.tvseries-mode-theme .tv-nav-pill.active,
#tvScreenVault.tvseries-hub-active .tv-nav-pill.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  border-color: #6ee7b7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
}

body.tvseries-mode-theme .tv-card,
#tvScreenVault.tvseries-hub-active .tv-card {
  background: #04120d !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.tvseries-mode-theme .tv-brand-badge,
#tvScreenVault.tvseries-hub-active .tv-brand-badge {
  background: rgba(5, 150, 105, 0.2) !important;
  border-color: #34d399 !important;
  color: #d1fae5 !important;
}

body.tvseries-mode-theme .tv-shelf-title,
#tvScreenVault.tvseries-hub-active .tv-shelf-title {
  color: #d1fae5 !important;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}

.firebase-emulator-warning, #firebase-emulator-warning { display: none !important; }

/* Hide PWA install button whenever any player screen, configurator, or fullscreen stream is active (portrait & landscape) */
body.tv-player-active #pwaInstall,
body.tv-fs-active #pwaInstall,
body:has(#tvScreenPlayer.active) #pwaInstall,
body:has(#tvFullscreenStage.active) #pwaInstall,
body:has(#tvSettingsPanel:not(.hidden)) #pwaInstall,
#tvScreenPlayer.active ~ #pwaInstall,
#tvFullscreenStage.active ~ #pwaInstall {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#tvFullscreenStage:has(#tvFsTopBar.active) #tvFsTouchToggle {
  display: none !important;
}

/* ==========================================================================
   BIG SCREEN STREAM CONFIGURATOR & USER SETTINGS HUB
   ========================================================================== */
.anime-search-Wrap {
  margin-bottom: 0.75rem;
}

.anime-search-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.anime-search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.anime-search-input-box > i {
  position: absolute;
  left: 0.9rem;
  color: #a855f7;
  font-size: 0.88rem;
  pointer-events: none;
}

.anime-search-input {
  width: 100%;
  padding: 0.68rem 2.2rem 0.68rem 2.45rem;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(11, 9, 20, 0.92);
  color: #f8fafc;
  font-family: "Rajdhani", sans-serif;
  font-size: max(16px, 0.96rem) !important;
  font-weight: 600;
  outline: none;
}

.anime-search-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.anime-search-clear {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
}

.anime-search-btn {
  padding: 0 1.25rem;
  border-radius: 8px;
  border: 1px solid #c084fc;
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: #ffffff;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.anime-genre-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.anime-cfg-section {
  margin-bottom: 0.9rem;
}

.anime-cfg-label {
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 0.42rem;
}

.anime-cfg-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.anime-toggle-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.anime-toggle-btn {
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.anime-toggle-btn.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.38) 0%, rgba(79, 70, 229, 0.32) 100%);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.38);
}

.anime-toggle-btn[data-cfg-sub="dub"].active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.36) 0%, rgba(168, 85, 247, 0.36) 100%);
  border-color: #f472b6;
  color: #ffffff;
}

.anime-cfg-row-3col {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.anime-btn-primary {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #f472b6;
  background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
  color: #ffffff;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
  transition: all 0.16s ease;
}

.anime-btn-primary:hover,
.anime-btn-primary.tv-focused {
  background: var(--cyber-yellow) !important;
  border-color: var(--cyber-yellow) !important;
  color: #050505 !important;
  box-shadow: 0 0 20px rgba(252, 238, 9, 0.55) !important;
}

/* USER SETTINGS HUB (#tvSettingsPanel) */
.hidden,
.tv-settings-hub.hidden,
#tvSettingsPanel.hidden,
#tvSettingsPanel .hidden,
#tvShelvesStack.hidden {
  display: none !important;
}

#tvScreenVault.settings-hub-active .tv-spotlight {
  display: none !important;
}

#tvScreenVault.settings-hub-active .tv-shelves-viewport {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.tv-settings-hub {
  margin: 0.5rem 22px 1.75rem;
  padding: 1.35rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.94) 0%, rgba(6, 9, 15, 0.96) 100%);
  border: 1px solid rgba(0, 240, 255, 0.28);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tv-settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
  flex-wrap: wrap;
}

.tv-settings-kicker {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyber-yellow);
  margin-bottom: 0.25rem;
}

.tv-settings-title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.tv-settings-sub {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.92rem;
  color: #94a3b8;
  margin: 0;
}

.tv-settings-status-pill {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.tv-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tv-settings-card {
  background: rgba(13, 18, 28, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 10px;
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tv-settings-card-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(20, 12, 38, 0.92) 0%, rgba(12, 18, 30, 0.94) 100%);
  border-color: rgba(192, 132, 252, 0.42);
}

.tv-settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.tv-settings-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyber-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tv-settings-card-featured .tv-settings-card-icon {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
}

.tv-settings-card-head-text {
  flex: 1;
  min-width: 0;
}

.tv-settings-card-title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
  margin: 0 0 0.2rem;
}

.tv-settings-card-desc {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
}

.tv-settings-current-badge {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.58rem;
  border-radius: 6px;
  background: rgba(252, 238, 9, 0.14);
  border: 1px solid var(--cyber-yellow);
  color: var(--cyber-yellow);
  flex-shrink: 0;
}

.tv-settings-btn-row {
  display: grid;
  gap: 0.6rem;
}

.tv-settings-btn-row-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-settings-server-grid {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.tv-settings-btn {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  transition: all 0.15s ease;
}

.tv-settings-btn:hover {
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.08);
}

.tv-settings-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(8, 145, 178, 0.26) 100%);
  border-color: var(--cyber-cyan);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.tv-settings-card-featured .tv-settings-btn.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.36) 0%, rgba(219, 39, 119, 0.3) 100%);
  border-color: #e879f9;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.tv-settings-btn.tv-focused {
  background: var(--cyber-yellow) !important;
  border-color: var(--cyber-yellow) !important;
  color: #050505 !important;
  box-shadow: 0 0 18px rgba(252, 238, 9, 0.55) !important;
}

.tv-settings-btn.tv-focused .tv-settings-btn-main,
.tv-settings-btn.tv-focused .tv-settings-btn-hint {
  color: #050505 !important;
}

.tv-settings-btn-main {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tv-settings-btn-hint {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
  color: #94a3b8;
}

.tv-settings-btn-action {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
}

.tv-settings-btn-action:hover {
  border-color: #fb7185;
  background: rgba(244, 63, 94, 0.16);
}

.tv-settings-footer {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.tv-settings-reset-btn {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
}

html.tv-reduced-motion *,
body.tv-reduced-motion * {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}

@media (max-width: 900px) {
  .tv-settings-grid,
  .tv-settings-btn-row-2col,
  .anime-cfg-row-2col {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * TOUCH PLAYER CONTROLS (v101, Jake 29 Oct): phones / tablets only (html.tv-touch-osd, set by tv-app.js for touch
 * or <= 900px wide, never on Android TV). Big scrubber (7px track, 24px thumb, 48px hit strip) and 52-64px buttons
 * with 28px SVG icons, padded clear of the notch / home indicator. The embed's own small bottom bar is pushed
 * off screen (frame 64px taller than the stage) so only one set of controls shows. Desktop and TV unchanged.
 * ============================================================================ */
.tv-tosd { display: none; }
html.tv-touch-osd #tvFullscreenStage { overflow: hidden; }
html.tv-touch-osd #tvFullscreenStage:not(.backup-active) #tvPlayerFrame,
#tvFullscreenStage:not(.backup-active) #tvPlayerFrame,
#tvFullscreenStage #tvPlayerFrame {
  height: 100% !important;
  max-height: none !important;
  bottom: 0 !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

#tvFullscreenStage.backup-active #tvPlayerFrame {
  height: 100% !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  pointer-events: none !important;
}

.player-backup-shield {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 6 !important;
  background: transparent !important;
  cursor: pointer !important;
  display: none !important;
  pointer-events: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

#tvFullscreenStage.backup-active .player-backup-shield,
body.backup-active .player-backup-shield {
  display: block !important;
  pointer-events: auto !important;
}
html.tv-touch-osd #tvFullscreenStage #tvFsTouchToggle { display: none !important; }
html.tv-touch-osd .tv-tosd {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  color: #fff;
}
/* Tap layer: tap the picture to show / hide the controls. A 140px hole in the middle leaves the embed's own
   centre play button reachable (needed when a browser blocks autoplay). */
.tv-tosd-tap {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: transparent;
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    calc(50% - 70px) calc(50% - 70px), calc(50% + 70px) calc(50% - 70px),
    calc(50% + 70px) calc(50% + 70px), calc(50% - 70px) calc(50% + 70px), calc(50% - 70px) calc(50% - 70px));
}
.tv-tosd-panel {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.tv-tosd.show .tv-tosd-panel {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0s;
}
.tv-tosd.show .tv-tosd-panel .tv-tosd-btn,
.tv-tosd.show .tv-tosd-panel .tv-tosd-scrub { pointer-events: auto; }
.tv-tosd-top {
  top: 0;
  align-items: center;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 22px max(14px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}
.tv-tosd-bottom {
  bottom: 0;
  flex-direction: column;
  gap: 4px;
  padding: 26px max(16px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}
.tv-tosd-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 26px;
  background: rgb(5, 8, 15);
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  color: #fff;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tv-tosd-btn[hidden] { display: none !important; }
.tv-tosd-btn svg { width: 28px; height: 28px; flex: 0 0 28px; display: block; }
.tv-tosd-btn:active { background: rgb(0, 56, 64); border-color: var(--cyber-cyan, #00f0ff); }
.tv-tosd-pill { padding: 0 16px 0 12px; }
.tv-tosd-pill-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tv-tosd-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
}
.tv-tosd-scrub-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tv-tosd-time {
  flex: 0 0 auto;
  min-width: 46px;
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px #000;
}
.tv-tosd-scrub {
  position: relative;
  flex: 1 1 auto;
  height: 48px;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.tv-tosd-track {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
}
.tv-tosd-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 4px;
  background: var(--cyber-cyan, #00f0ff);
}
.tv-tosd-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cyber-cyan, #00f0ff);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35);
}
.tv-tosd-scrub.dragging .tv-tosd-thumb { width: 28px; height: 28px; }
.tv-tosd-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tv-tosd-side { flex: 1 1 0; display: flex; }
.tv-tosd-side-r { justify-content: flex-end; }
.tv-tosd-center { flex: 0 0 auto; display: flex; align-items: center; gap: 22px; }
.tv-tosd-btn.tv-tosd-play {
  min-width: 64px;
  height: 64px;
  border-radius: 32px;
  border: 2px solid var(--cyber-cyan, #00f0ff);
}
/* Wide enough (landscape phones, tablets): slightly roomier transport row. */
@media (min-width: 700px) {
  .tv-tosd-center { gap: 32px; }
}
/* Narrow portrait phones: icon-only EPISODES / SERVER so the title keeps some room. */
@media (max-width: 480px) {
  #tvTosdEpisodes .tv-tosd-pill-label,
  #tvTosdSettings .tv-tosd-pill-label { display: none; }
  #tvTosdEpisodes, #tvTosdSettings { padding: 0 12px; }
  .tv-tosd-top { gap: 10px; }
}
/* The server / audio bar opened from SERVER sits above the OSD and clears the notch. */
html.tv-touch-osd #tvFsTopBar {
  z-index: 10002;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
/* Toasts during touch playback float above the controls and never swallow a tap. */
html.tv-touch-osd body.tv-fs-active #tvToast {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 168px);
  pointer-events: none;
}

/* ============================================================================
 * PORTRAIT TOUCH OSD (Jake 3 Nov 18:20): on a 393px-wide phone the single control row did not fit (volume, CC,
 * cast and full screen were pushed off screen). Narrow screens now get two rows under the full-width scrubber:
 *   row 1  -10 / PLAY / +10 (centred)      row 2  VOLUME  CC  ........  CAST  FULLSCREEN
 * ============================================================================ */
@media (max-width: 600px) {
  .tv-tosd-ctrl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
    column-gap: 10px;
  }
  .tv-tosd-center { grid-column: 1 / -1; grid-row: 1; justify-self: center; gap: 28px; }
  .tv-tosd-side { grid-row: 2; gap: 10px; }
  .tv-tosd-side-r { justify-content: flex-end; }
  .tv-tosd-center .tv-tosd-btn:not(.tv-tosd-play) { min-width: 56px; height: 56px; border-radius: 28px; }
  .tv-tosd-bottom { padding-top: 34px; }
}

/* ============================================================================
 * MOBILE NATIVE FULL SCREEN (html.tv-fs-pass: iPhone / iPad / Android phones / mobile APK only, set by tv-app.js).
 * The embed keeps its own bar so its full-screen button can open the iOS native player / Android's full-screen
 * player. Its bars are never seen: while our controls are up their solid bands sit exactly over the embed's top and
 * bottom bars, and our FULLSCREEN key (#tvTosdFsPass, no pointer events) is drawn over a window in our tap layer that
 * lines up with the embed's button, so one tap lands on the embed's real button. Desktop / TV: none of this applies.
 * ============================================================================ */
.tv-tosd-fs-pass { display: none; }
html.tv-fs-pass #tvFullscreenStage:not(.backup-active) #tvPlayerFrame {
  position: absolute !important;
  top: env(safe-area-inset-top, 0px) !important;
  bottom: env(safe-area-inset-bottom, 0px) !important;
  left: env(safe-area-inset-left, 0px) !important;
  right: auto !important;
  width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  max-width: none !important;
}
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-fs-pass {
  display: flex;
  position: absolute;
  left: var(--fsh-l, -999px);
  top: var(--fsh-t, -999px);
  width: calc(var(--fsh-r, 0px) - var(--fsh-l, 0px));
  height: calc(var(--fsh-b, 0px) - var(--fsh-t, 0px));
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgb(5, 8, 15);
  border: 1.5px solid var(--cyber-cyan, #00f0ff);
  color: #fff;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
html.tv-fs-pass .tv-tosd.fs-pass.show .tv-tosd-fs-pass { opacity: 1; visibility: visible; transition: opacity 0.18s ease, visibility 0s; }
.tv-tosd-fs-pass svg { width: 26px; height: 26px; display: block; }
/* Tap layer: centre window (embed's big play button) plus, while the controls are up, the full-screen window. */
html.tv-fs-pass .tv-tosd.fs-pass.show .tv-tosd-tap {
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    calc(50% - 70px) calc(50% - 70px), calc(50% + 70px) calc(50% - 70px),
    calc(50% + 70px) calc(50% + 70px), calc(50% - 70px) calc(50% + 70px), calc(50% - 70px) calc(50% - 70px), 0 0,
    var(--fsh-l, 0px) var(--fsh-t, 0px), var(--fsh-r, 0px) var(--fsh-t, 0px),
    var(--fsh-r, 0px) var(--fsh-b, 0px), var(--fsh-l, 0px) var(--fsh-b, 0px), var(--fsh-l, 0px) var(--fsh-t, 0px), 0 0);
}
/* Solid bands over the embed's own bars (top ~52px / bottom ~66px on a phone, ~66 / ~79px from 640px wide). */
html.tv-fs-pass .tv-tosd.fs-pass {
  --cover-top: calc(env(safe-area-inset-top, 0px) + 60px);
  --cover-bot: calc(env(safe-area-inset-bottom, 0px) + 74px);
}
@media (min-width: 640px) {
  html.tv-fs-pass .tv-tosd.fs-pass {
    --cover-top: calc(env(safe-area-inset-top, 0px) + 72px);
    --cover-bot: calc(env(safe-area-inset-bottom, 0px) + 88px);
  }
}
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-top {
  min-height: var(--cover-top);
  box-sizing: border-box;
  background: linear-gradient(to bottom, #000 0, #000 var(--cover-top), rgba(0, 0, 0, 0) 100%);
}
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-bottom {
  /* Our second / transport row is centred on the embed's button row (frame bottom - safe area - 24 / 30px). */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 54px);
  background: linear-gradient(to top, #000 0, #000 var(--cover-bot), rgba(0, 0, 0, 0.82) calc(var(--cover-bot) + 1px), rgba(0, 0, 0, 0) 100%);
}
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-scrub-row { margin-right: -38px; }
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-side { gap: 10px; }
@media (max-width: 600px) {
  html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-bottom { padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-scrub-row { margin-right: 0; }
  html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-side-r { padding-right: 40px; }
  html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-side .tv-tosd-btn { height: 48px; min-width: 52px; border-radius: 24px; }
}


/* ==========================================================================
   VIPER-OS v3.6.4: COLLAPSIBLE ON-SCREEN KEYBOARD & RESPONSIVE SEARCH LAYOUT
   ========================================================================== */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.search-input-wrap .search-input-display {
  flex: 1 1 auto;
  min-width: 0;
}
.search-kb-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(10, 15, 28, 0.94);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 999px;
  color: #00f0ff;
  font-family: var(--font-hud, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: all 0.18s ease-in-out;
}
.search-kb-toggle-btn .ftv-svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.search-kb-toggle-btn:hover,
.search-kb-toggle-btn:focus,
.search-kb-toggle-btn.dpad-focused {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.22);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
  transform: scale(1.03);
}
.search-kb-toggle-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(168, 85, 247, 0.3));
  border-color: #00f0ff;
  color: #fff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}
.search-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
}
.search-layout .keyboard-box {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.search-layout.kb-open {
  display: grid !important;
  grid-template-columns: 440px 1fr !important;
  gap: 28px !important;
  align-items: start !important;
}
@media (max-width: 1180px) {
  .search-layout.kb-open {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ==========================================================================
   VIPER-OS v3.6.4: AIRPLAY & STREAM CAST TRANSMISSION MODAL
   ========================================================================== */
.cast-airplay-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.cast-airplay-modal.hidden {
  display: none !important;
}
.cast-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cast-modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  background: linear-gradient(165deg, rgba(14, 20, 36, 0.98), rgba(8, 11, 20, 0.99));
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}
.cast-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: rgba(0, 240, 255, 0.06);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}
.cast-modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00f0ff;
  flex: none;
}
.cast-modal-header-icon .ftv-svg { width: 22px; height: 22px; }
.cast-modal-kicker {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #00f0ff;
}
.cast-modal-title {
  font-family: var(--font-display, sans-serif);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
}
.cast-modal-close-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cast-modal-close-btn:hover,
.cast-modal-close-btn:focus,
.cast-modal-close-btn.dpad-focused {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}
.cast-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cast-target-card {
  background: rgba(18, 25, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cast-target-card.quick-sync {
  border-color: rgba(0, 240, 255, 0.25);
  background: rgba(8, 20, 36, 0.85);
}
.cast-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cast-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hud, sans-serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}
.cast-target-badge svg { width: 18px; height: 18px; flex: none; }
.cast-target-badge.airplay svg { color: #fff; }
.cast-target-badge.chromecast svg { color: #00f0ff; }
.cast-target-badge.qrcode svg { color: #a855f7; }
.cast-target-status {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  letter-spacing: 0.1em;
}
.cast-target-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #94a3b8;
  margin: 0;
}
.cast-target-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cast-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 17, 30, 0.9);
  color: #f1f5f9;
  font-family: var(--font-hud, sans-serif);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.cast-action-btn svg { width: 16px; height: 16px; flex: none; }
.cast-action-btn:hover,
.cast-action-btn:focus,
.cast-action-btn.dpad-focused {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.2);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transform: scale(1.02);
}
.cast-action-btn.primary {
  background: var(--accent-active, #00f0ff);
  color: #040711;
  border-color: #fff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}
.cast-action-btn.primary:hover,
.cast-action-btn.primary:focus,
.cast-action-btn.primary.dpad-focused {
  background: #38bdf8;
  color: #020617;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}
.cast-qr-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 240, 255, 0.3);
}
.cast-qr-img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
  flex: none;
}
.cast-qr-title {
  font-family: var(--font-display, sans-serif);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.cast-qr-sub {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}
.cast-modal-footer {
  padding: 14px 24px;
  background: rgba(5, 8, 16, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
}

/* OSD Bottom bar protective backdrop: spans full-bleed to bottom of screen with silky-smooth upward fade, eliminating any sharp border or video gap */
.player-osd-bottom,
.player-modal .player-osd-bottom,
.player-modal:not(.backup-server-active) .player-osd-bottom {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 56px 48px max(24px, env(safe-area-inset-bottom, 20px)) 48px !important;
  background: linear-gradient(
    180deg,
    rgba(2, 4, 8, 0) 0%,
    rgba(2, 4, 8, 0.28) 22%,
    rgba(2, 4, 8, 0.65) 48%,
    rgba(2, 4, 8, 0.92) 74%,
    rgba(2, 4, 8, 0.98) 90%,
    #020408 100%
  ) !important;
  pointer-events: auto !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 99999 !important;
}

/* When OSD is hidden, cleanly fade out bottom bar and disable pointer events */
.player-osd.hidden .player-osd-bottom,
.player-modal.osd-hidden .player-osd-bottom {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease !important;
}

/* ==========================================================================
   VIPER-OS v3.6.4: RESPONSIVE MOBILE PLAYER OSD (PORTRAIT & LANDSCAPE)
   Eliminates clipping, controls cut off screen, and horizontal overflow.
   ========================================================================== */
@media (max-width: 768px), (orientation: portrait) {
  body.edition-mobile .player-modal .player-osd-bottom,
  body.mobile-native-player .player-modal .player-osd-bottom,
  body.mobile-touch-mode .player-modal .player-osd-bottom,
  .player-modal .player-osd-bottom {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 36px 14px calc(env(safe-area-inset-bottom, 12px) + 8px) 14px !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    background: linear-gradient(
      180deg,
      rgba(2, 4, 8, 0) 0%,
      rgba(2, 4, 8, 0.32) 20%,
      rgba(2, 4, 8, 0.72) 48%,
      rgba(2, 4, 8, 0.94) 75%,
      #020408 100%
    ) !important;
  }
  body.edition-mobile .player-osd-bottom .player-timeline-row,
  body.mobile-native-player .player-osd-bottom .player-timeline-row,
  .player-osd-bottom .player-timeline-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 0 4px 0 !important;
  }
  body.edition-mobile .player-osd-bottom .player-timecode,
  body.mobile-native-player .player-osd-bottom .player-timecode,
  .player-osd-bottom .player-timecode {
    font-size: 11px !important;
    min-width: 36px !important;
    text-align: center !important;
    flex: none !important;
  }
  body.edition-mobile .player-osd-bottom .player-scrubber,
  body.mobile-native-player .player-osd-bottom .player-scrubber,
  .player-osd-bottom .player-scrubber {
    flex: 1 1 auto !important;
    height: 6px !important;
    min-width: 0 !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-row,
  body.mobile-native-player .player-osd-bottom .player-controls-row,
  .player-osd-bottom .player-controls-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  /* Row 1: Transport Controls (PREV, -10s, PLAY, +10s, NEXT) */
  body.edition-mobile .player-osd-bottom .player-controls-group:first-child,
  body.mobile-native-player .player-osd-bottom .player-controls-group:first-child,
  .player-osd-bottom .player-controls-group:first-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group:first-child .osd-btn,
  body.mobile-native-player .player-osd-bottom .player-controls-group:first-child .osd-btn,
  .player-osd-bottom .player-controls-group:first-child .osd-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 6px 4px !important;
    font-size: 11px !important;
    min-height: 36px !important;
    border-radius: 999px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group:first-child .osd-btn.primary,
  body.mobile-native-player .player-osd-bottom .player-controls-group:first-child .osd-btn.primary,
  .player-osd-bottom .player-controls-group:first-child .osd-btn.primary {
    flex: 1.35 1 0 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group:first-child .osd-btn svg,
  body.mobile-native-player .player-osd-bottom .player-controls-group:first-child .osd-btn svg,
  .player-osd-bottom .player-controls-group:first-child .osd-btn svg {
    width: 15px !important;
    height: 15px !important;
    flex: none !important;
  }
  /* Row 2: Secondary Controls (SUBS, AUDIO, SERVER, CAST, EPISODES) */
  body.edition-mobile .player-osd-bottom .player-controls-group:last-child,
  body.mobile-native-player .player-osd-bottom .player-controls-group:last-child,
  .player-osd-bottom .player-controls-group:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group:last-child .osd-btn,
  body.mobile-native-player .player-osd-bottom .player-controls-group:last-child .osd-btn,
  .player-osd-bottom .player-controls-group:last-child .osd-btn {
    flex: 0 1 auto !important;
    padding: 5px 9px !important;
    font-size: 10.5px !important;
    min-height: 30px !important;
    border-radius: 999px !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group:last-child .osd-btn svg,
  body.mobile-native-player .player-osd-bottom .player-controls-group:last-child .osd-btn svg,
  .player-osd-bottom .player-controls-group:last-child .osd-btn svg {
    width: 14px !important;
    height: 14px !important;
    flex: none !important;
  }
  /* Ensure CAST button is visible on mobile */
  .player-modal .player-osd-bottom #osd-cast-btn {
    display: inline-flex !important;
  }
}

/* Mobile Landscape optimizations: keep controls compact so nothing cuts off bottom */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  body.edition-mobile .player-modal .player-osd-bottom,
  body.mobile-native-player .player-modal .player-osd-bottom,
  body.mobile-touch-mode .player-modal .player-osd-bottom,
  .player-modal .player-osd-bottom {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 24px 14px calc(env(safe-area-inset-bottom, 6px) + 4px) 14px !important;
    gap: 4px !important;
    background: linear-gradient(
      180deg,
      rgba(2, 4, 8, 0) 0%,
      rgba(2, 4, 8, 0.3) 22%,
      rgba(2, 4, 8, 0.7) 50%,
      rgba(2, 4, 8, 0.93) 76%,
      #020408 100%
    ) !important;
  }
  body.edition-mobile .player-osd-bottom .player-timeline-row,
  body.mobile-native-player .player-osd-bottom .player-timeline-row,
  .player-osd-bottom .player-timeline-row {
    margin-bottom: 2px !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-row,
  body.mobile-native-player .player-osd-bottom .player-controls-row,
  .player-osd-bottom .player-controls-row {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
  }
  body.edition-mobile .player-osd-bottom .player-controls-group,
  body.mobile-native-player .player-osd-bottom .player-controls-group,
  .player-osd-bottom .player-controls-group {
    max-width: none !important;
    margin: 0 !important;
    gap: 4px !important;
  }
  body.edition-mobile .player-osd-bottom .osd-btn,
  body.mobile-native-player .player-osd-bottom .osd-btn,
  .player-osd-bottom .osd-btn {
    min-height: 28px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
}

/* ==========================================================================
   VIPER-OS: TV / BIGSCREEN PLAYER INTERACTION UNLOCK
   Ensures BACK, FULLSCREEN, EPISODES, and CAST buttons are 100% interactive
   in Portrait and Landscape on iOS, Android, and Web browsers.
   ========================================================================== */
.tv-tosd-top,
#tvTosdBack,
#tvTosdFs,
#tvTosdCast,
#tvFsCloseBtn {
  pointer-events: auto !important;
  z-index: 99999 !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
}

/* Continue Watching Individual Remove Controls (Big Screen Cards + Settings) */
.tv-card-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: rgba(5, 7, 11, 0.92);
  border: 1px solid rgba(255, 0, 85, 0.75);
  color: #ff4d88;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.tv-card-remove-btn:hover,
.tv-card-remove-btn:focus-visible {
  background: #ff0055;
  border-color: #ff0055;
  color: #fff;
}

.tv-settings-continue-items {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tv-settings-continue-pill {
  flex: 1 1 220px;
  max-width: 100%;
  border-color: rgba(255, 0, 85, 0.42) !important;
}

.tv-settings-continue-pill:hover,
.tv-settings-continue-pill.tv-focused {
  border-color: #ff0055 !important;
}

/* ==========================================================================
   BIG SCREEN 2077 SKIN (css v46). Same night-city look as the website and ViperOS:
   navy base, yellow striped primary buttons, skewed pills, chamfered panels, italic
   heavy titles with the red offset, mono labels, ViperIcons (inline SVG).
   Firestick rules: the APK page (/tv, html.tv-mode) and Lite get the same colours but
   no clip-path and no grain; nothing animates and no grain paints during playback;
   no backdrop blur anywhere. D-pad focus stays a bright 3px ring (clip-path is dropped
   on the focused element so the ring is never cut off).
   ========================================================================== */
:root {
  --v77-bg: #05070c;
  --v77-bg2: #07101d;
  --v77-panel: rgba(8, 17, 31, .94);
  --v77-card: #0a1626;
  --v77-line: rgba(75, 99, 133, .55);
  --v77-muted: #4b6385;
  --v77-text: #c9d6e8;
  --v77-yellow: #fcee0a;
  --v77-blue: #08dfec;
  --v77-red: #ff005f;
  --v77-head: 'Archivo', 'Rajdhani', system-ui, sans-serif;
  --v77-mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  --v77-stripe: repeating-linear-gradient(115deg, transparent 0 6px, #05070c 6px 9px) right 12px center / 28px 100% no-repeat;
  --v77-cut: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  --v77-skew: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  --v77-chamfer: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  --cyber-cyan: #08dfec;
  --cyber-red: #ff005f;
}
html, body { background: var(--v77-bg); color: var(--v77-text); }
.tv-screen {
  background:
    radial-gradient(1100px 560px at 92% -12%, rgba(255, 0, 95, .11), transparent 60%),
    radial-gradient(900px 520px at -4% -6%, rgba(8, 223, 236, .08), transparent 60%),
    linear-gradient(180deg, #05070c 0%, #06101c 100%);
}
/* Static film grain on the menus only (website parity). Never on the APK / Lite / reduced motion, never while playing. */
html:not(.tv-mode):not(.apk-mode):not(.tv-lite-mode):not(.tv-reduced-motion) body:not(.tv-fs-active):not(.tv-player-active)::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9990; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- ViperIcons ---- */
svg.vi { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; display: inline-block; overflow: visible; }
.vi.vi-on { fill: currentColor; fill-opacity: .25; }
.tv-search-kbd svg.vi { width: 17px; height: 17px; }
.tv-lock-icon { display: block; color: var(--v77-red); margin: 0 auto 1.2rem; line-height: 0; }
.tv-lock-icon svg.vi, .tv-lock-card > svg.vi { width: 3.2rem; height: 3.2rem; color: var(--v77-red); }
.tv-lock-btn svg.vi { margin-right: .5rem; }
.tv-seemore-icon svg.vi { width: 22px; height: 22px; }
#tvScreenPlayer .tv-action-btn svg.vi, #tvScreenPlayer .tv-back-btn svg.vi { width: 18px; height: 18px; }
#tvFullscreenStage .tv-fs-btn svg.vi { width: 18px; height: 18px; }
.tv-load-tick { display: inline-block; width: 10px; height: 10px; margin-right: 6px; background: var(--v77-yellow); transform: skewX(-20deg); animation: v77-tick 1s steps(2, end) infinite; }
@keyframes v77-tick { 50% { opacity: .2; } }

/* ---- Focus: bright, never clipped ---- */
.tv-focusable.tv-focused { outline: 3px solid var(--v77-blue) !important; outline-offset: 2px; border-color: #fff !important; }

/* ---- Type ---- */
.tv-brand-text { font-family: var(--v77-head); font-style: italic; font-weight: 900; letter-spacing: .04em; }
.tv-spotlight-title, .tv-detail-title, .tv-login-title, .tv-settings-title, .tv-lock-card h1 {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; letter-spacing: 0;
  color: #fff; text-shadow: 4px 0 0 var(--v77-red);
}
.tv-spotlight-title { line-height: 1.05; padding-right: 6px; }
.tv-detail-title { line-height: 1.02; padding-right: 6px; }
.tv-spotlight-kicker, .tv-detail-kicker, .tv-badge, .tv-card-sub, .tv-shelf-count, .tv-ep-num, .tv-login-sub,
.tv-settings-sub, .tv-settings-btn-hint, .tv-brand-badge, .tv-card-badge, .tv-seemore-sub, .tv-tosd {
  font-family: var(--v77-mono);
}
.tv-spotlight-kicker, .tv-detail-kicker { color: var(--v77-yellow); letter-spacing: .2em; font-weight: 700; }
.tv-spotlight-kicker svg.vi { color: var(--v77-yellow); }
.tv-spotlight-kicker::before { content: "//"; color: var(--v77-red); }
.tv-spotlight-desc, .tv-detail-synopsis { color: var(--v77-text); }

/* ---- Nav bar ---- */
.tv-navbar { border-bottom: 1px solid var(--v77-line); background: linear-gradient(180deg, rgba(5, 12, 22, .0), rgba(5, 12, 22, 0)); }
.tv-nav-pill, .tv-srv-pill, .tv-season-pill, .tv-lib-genre-pill, .tv-fs-btn, .tv-shelf-seemore-btn, .tv-library-back-btn {
  border-radius: 0; background: rgba(8, 17, 31, .9); border: 1px solid var(--v77-line); color: var(--v77-text);
  font-family: var(--v77-mono); font-weight: 700; letter-spacing: .12em;
  clip-path: var(--v77-skew); padding-left: 16px; padding-right: 16px;
}
.tv-nav-pill.active, .tv-srv-pill.active, .tv-season-pill.active, .tv-lib-genre-pill.active, .tv-fs-btn.active {
  background: var(--v77-yellow); border-color: var(--v77-yellow); color: #05070c;
}
.tv-nav-pill.tv-focused, .tv-srv-pill.tv-focused, .tv-season-pill.tv-focused, .tv-lib-genre-pill.tv-focused,
.tv-fs-btn.tv-focused, .tv-shelf-seemore-btn.tv-focused, .tv-library-back-btn.tv-focused {
  clip-path: none !important; background: #fff !important; color: #05070c !important; border-color: #fff !important;
  outline: 3px solid var(--v77-blue) !important; outline-offset: 2px;
}
.tv-nav-pill:hover, .tv-srv-pill:hover, .tv-season-pill:hover, .tv-fs-btn:hover { border-color: var(--v77-yellow); }
.tv-nav-dash-link, .tv-nav-logout { border-radius: 0; } .tv-nav-dash-link { clip-path: var(--v77-skew); border-radius: 0 !important; }
.tv-fs-btn.exit-btn, .tv-nav-logout {
  background: rgba(255, 0, 95, .12); border-color: var(--v77-red); color: #fff;
}
.tv-fs-btn.embed-srv-btn { background: rgba(252, 238, 10, .1); border-color: var(--v77-yellow); color: var(--v77-yellow); }

/* ---- Shelves + cards ---- */
.tv-shelf-title {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; letter-spacing: .03em; color: #fff;
  border-left: 0; padding-left: 30px; position: relative; font-size: 15px;
}
.tv-shelf-title::before { content: ""; position: absolute; left: 0; top: 50%; width: 20px; height: 6px; margin-top: -3px; background: var(--v77-blue); transform: skewX(-24deg); }
.tv-shelf.active-shelf .tv-shelf-title { color: #fff; }
.tv-shelf.active-shelf .tv-shelf-title::before { background: var(--v77-yellow); }
.tv-shelf-seemore-btn { color: var(--v77-yellow); border-color: rgba(252, 238, 10, .6); }
.tv-card { background: var(--v77-card); border: 1px solid var(--v77-line); border-radius: 0; }
.tv-card-foot { background: linear-gradient(180deg, #0a1626, #07101d); }
.tv-card-title { font-weight: 800; }
.tv-card-badge { background: var(--v77-yellow); color: #05070c; border-color: var(--v77-yellow); }
.tv-card-progress > span { background: var(--v77-red); }
.tv-card.tv-focused {
  border-color: var(--v77-yellow) !important; outline: 3px solid var(--v77-yellow) !important; outline-offset: 2px;
  background: #102036; box-shadow: 0 0 0 6px rgba(252, 238, 10, .18);
}
.tv-card.tv-focused .tv-card-title { color: var(--v77-yellow); }
.tv-card.tv-card-seemore { border: 1px dashed var(--v77-blue); background: linear-gradient(160deg, #0a1a2c, #05070c); }
.tv-seemore-icon { border-radius: 0; clip-path: var(--v77-skew); border: 0; background: var(--v77-yellow); color: #05070c; width: 52px; }
.tv-seemore-sub { color: var(--v77-blue); }
.tv-badge { background: rgba(8, 17, 31, .9); border: 1px solid var(--v77-line); color: var(--v77-blue); clip-path: var(--v77-skew); padding: 2px 10px; }
.tv-badge.rating { background: rgba(252, 238, 10, .1); border-color: var(--v77-yellow); color: var(--v77-yellow); }
.tv-badge.resume { background: var(--v77-red); border-color: var(--v77-red); color: #fff; }
.tv-library-banner { background: var(--v77-panel); border: 1px solid var(--v77-line); border-left: 4px solid var(--v77-yellow); }
.tv-library-banner-title { font-family: var(--v77-head); font-style: italic; }

/* ---- Buttons ---- */
.tv-action-btn, .tv-lock-btn, .tv-back-btn {
  border-radius: 0; background: rgba(5, 12, 22, .85); border: 1px solid var(--v77-line); color: #fff;
  font-family: var(--v77-mono); font-weight: 700; letter-spacing: .12em;
  clip-path: var(--v77-cut); padding-right: 30px;
}
.tv-action-btn.play-primary, .tv-btn-primary {
  background: var(--v77-stripe), var(--v77-yellow); border: 1px solid var(--v77-yellow); color: #05070c;
  font-family: var(--v77-head); font-style: italic; font-weight: 900; letter-spacing: .06em;
  clip-path: var(--v77-cut); padding-right: 56px; border-radius: 0;
}
.tv-action-btn.tv-focused, .tv-lock-btn.tv-focused, .tv-back-btn.tv-focused {
  clip-path: none !important; background: rgba(252, 238, 10, .16) !important; color: #fff !important; border-color: #fff !important;
  outline: 3px solid var(--v77-blue) !important; outline-offset: 3px;
}
.tv-action-btn.play-primary.tv-focused, .tv-btn-primary.tv-focused {
  background: var(--v77-stripe), #fff !important; color: #05070c !important; border-color: #fff !important;
  outline: 3px solid var(--v77-yellow) !important; outline-offset: 3px;
}
.tv-lock-btn:hover { background: rgba(252, 238, 10, .16); color: #fff; border-color: var(--v77-yellow); }

/* ---- Detail ---- */
.tv-player-topbar { border-bottom: 1px solid var(--v77-line); }
.tv-detail-poster { border: 1px solid var(--v77-line); box-shadow: 6px 6px 0 rgba(255, 0, 95, .55); }
.tv-series-panel { border-top: 1px solid var(--v77-line); }
.tv-ep-card { background: var(--v77-card); border: 1px solid var(--v77-line); border-radius: 0; position: relative; }
.tv-ep-card.current { border-color: var(--v77-yellow); background: #121c14; box-shadow: inset 4px 0 0 var(--v77-yellow); }
.tv-ep-card.tv-focused {
  border-color: var(--v77-yellow) !important; background: #102036 !important;
  outline: 3px solid var(--v77-yellow) !important; outline-offset: 2px;
}
.tv-ep-num { color: var(--v77-yellow); }
.tv-ep-title { font-family: var(--v77-head); font-style: italic; font-weight: 800; }

/* ---- Login / pairing / lock / settings / modals: chamfered panels ---- */
.tv-login-card, .tv-lock-card {
  background: var(--v77-panel); border: 1px solid var(--v77-line); border-top: 4px solid var(--v77-yellow);
  clip-path: var(--v77-chamfer); border-radius: 0; box-shadow: none;
}
.tv-lock-card { border-top-color: var(--v77-red); }
.tv-login-title span { color: var(--v77-yellow); }
.tv-input, .tv-login-card input { border-radius: 0 !important; background: #05070c !important; border: 1px solid var(--v77-line) !important; font-family: var(--v77-mono); }
.tv-input.tv-focused, .tv-login-card input.tv-focused { border-color: var(--v77-yellow) !important; outline: 3px solid var(--v77-yellow) !important; }
.tv-settings-card { background: var(--v77-panel); border: 1px solid var(--v77-line); border-radius: 0; clip-path: var(--v77-chamfer); }
.tv-settings-card-featured { border-color: rgba(255, 0, 95, .5); background: linear-gradient(135deg, rgba(40, 6, 26, .9), rgba(8, 17, 31, .94)); }
.tv-settings-card-icon { border-radius: 0; clip-path: var(--v77-skew); background: rgba(252, 238, 10, .12); border-color: rgba(252, 238, 10, .5); color: var(--v77-yellow); }
.tv-settings-card-title { font-family: var(--v77-head); font-style: italic; font-weight: 900; letter-spacing: .04em; }
.tv-settings-status-pill, .tv-settings-current-badge { border-radius: 0; clip-path: var(--v77-skew); }
.tv-settings-btn { border-radius: 0; background: rgba(5, 12, 22, .7); border: 1px solid var(--v77-line); }
.tv-settings-btn.active, .tv-settings-card-featured .tv-settings-btn.active {
  background: rgba(252, 238, 10, .12); border-color: var(--v77-yellow); box-shadow: inset 4px 0 0 var(--v77-yellow);
}
.tv-settings-btn.tv-focused {
  background: var(--v77-yellow) !important; border-color: #fff !important; color: #05070c !important; box-shadow: none !important;
  outline: 3px solid var(--v77-blue) !important; outline-offset: 2px;
}
.tv-settings-btn-main { font-family: var(--v77-head); font-style: italic; font-weight: 800; }

/* ---- Toast ---- */
#tvToast {
  background: var(--v77-panel); border: 1px solid var(--v77-line); border-left: 6px solid var(--v77-yellow);
  color: #fff; font-family: var(--v77-mono); font-weight: 700; letter-spacing: .14em; font-size: 13px;
  padding: 11px 22px 11px 16px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  box-shadow: none; max-width: min(92vw, 560px);
}
#tvToast::before { content: "SYS //"; color: var(--v77-yellow); margin-right: 10px; }

/* ---- Fullscreen player: top bar, server pills, touch toggle (no blur, solid paint) ---- */
#tvFsTopBar { background: linear-gradient(180deg, rgba(5, 12, 22, .97), rgba(5, 12, 22, .9)); border-bottom: 1px solid var(--v77-line); box-shadow: 0 2px 0 rgba(252, 238, 10, .5); }
.tv-fs-touch-toggle { border-radius: 0; background: rgba(5, 12, 22, .9); border: 1px solid var(--v77-yellow); color: #fff; font-family: var(--v77-mono); clip-path: var(--v77-cut); padding-right: 24px; }
.tv-fs-touch-toggle.tv-focused { clip-path: none !important; }
#tvFsPointer { border-radius: 0; transform: rotate(45deg); border-color: var(--v77-yellow); }

/* ---- Touch OSD (PR #72): same sizes, 2077 colours ---- */
.tv-tosd-top { background: linear-gradient(to bottom, rgba(5, 12, 22, .9), rgba(5, 12, 22, 0)); }
.tv-tosd-bottom { background: linear-gradient(to top, rgba(5, 12, 22, .92), rgba(5, 12, 22, 0)); }
.tv-tosd-btn { border-radius: 0; background: rgba(5, 12, 22, .94); border: 1px solid var(--v77-line); clip-path: var(--v77-cut); padding-right: 18px; }
.tv-tosd-btn:active { background: rgba(252, 238, 10, .18); border-color: var(--v77-yellow); }
.tv-tosd-btn.tv-tosd-play { border-radius: 0; background: var(--v77-yellow); color: #05070c; border-color: var(--v77-yellow); clip-path: var(--v77-skew); padding: 0 16px; min-width: 72px; }
.tv-tosd-pill-label { font-family: var(--v77-mono); }
.tv-tosd-title { font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 16px; }
.tv-tosd-track { border-radius: 0; background: rgba(75, 99, 133, .55); }
.tv-tosd-fill { border-radius: 0; background: var(--v77-yellow); }
.tv-tosd-thumb { border-radius: 0; background: var(--v77-yellow); border: 3px solid #05070c; box-shadow: 0 0 0 2px var(--v77-yellow); transform: translate(-50%, -50%) skewX(-14deg); width: 18px; height: 28px; }
.tv-tosd-scrub.dragging .tv-tosd-thumb { width: 22px; height: 32px; }

/* ---- APK (Fire TV / Android TV) + Lite: same colours, flat shapes (no clip-path rasterisation) ---- */
html.tv-mode .tv-nav-pill, html.tv-mode .tv-srv-pill, html.tv-mode .tv-season-pill, html.tv-mode .tv-lib-genre-pill,
html.tv-mode .tv-fs-btn, html.tv-mode .tv-shelf-seemore-btn, html.tv-mode .tv-library-back-btn, html.tv-mode .tv-nav-dash-link,
html.tv-mode .tv-action-btn, html.tv-mode .tv-lock-btn, html.tv-mode .tv-back-btn, html.tv-mode .tv-btn-primary,
html.tv-mode .tv-login-card, html.tv-mode .tv-lock-card, html.tv-mode .tv-settings-card, html.tv-mode .tv-settings-card-icon,
html.tv-mode .tv-settings-status-pill, html.tv-mode .tv-settings-current-badge, html.tv-mode .tv-badge, html.tv-mode .tv-seemore-icon,
html.tv-mode #tvToast, html.tv-mode .tv-fs-touch-toggle, html.tv-mode .tv-tosd-btn,
html.tv-lite-mode .tv-nav-pill, html.tv-lite-mode .tv-srv-pill, html.tv-lite-mode .tv-season-pill, html.tv-lite-mode .tv-lib-genre-pill,
html.tv-lite-mode .tv-fs-btn, html.tv-lite-mode .tv-shelf-seemore-btn, html.tv-lite-mode .tv-library-back-btn, html.tv-lite-mode .tv-nav-dash-link,
html.tv-lite-mode .tv-action-btn, html.tv-lite-mode .tv-lock-btn, html.tv-lite-mode .tv-back-btn, html.tv-lite-mode .tv-btn-primary,
html.tv-lite-mode .tv-login-card, html.tv-lite-mode .tv-lock-card, html.tv-lite-mode .tv-settings-card, html.tv-lite-mode .tv-settings-card-icon,
html.tv-lite-mode .tv-settings-status-pill, html.tv-lite-mode .tv-settings-current-badge, html.tv-lite-mode .tv-badge, html.tv-lite-mode .tv-seemore-icon,
html.tv-lite-mode #tvToast, html.tv-lite-mode .tv-fs-touch-toggle, html.tv-lite-mode .tv-tosd-btn { clip-path: none; }
html.tv-mode .tv-card.tv-focused, html.tv-lite-mode .tv-card.tv-focused { box-shadow: none; }
html.tv-lite-mode .tv-spotlight-title, html.tv-lite-mode .tv-detail-title { text-shadow: 3px 0 0 var(--v77-red); }
html.tv-lite-mode .tv-detail-poster { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .tv-load-tick { animation: none; } }
html.tv-reduced-motion .tv-load-tick { animation: none; }
/* Server bar open: hide the OSD title row under it (no doubled text behind the bar) */
#tvFsTopBar.active ~ .tv-tosd .tv-tosd-top { visibility: hidden; }
/* Keep the slanted tail / stripe clear of the label wherever the touch layouts resize the buttons */
#tvScreenPlayer .tv-action-btn { padding-right: 28px; }
#tvScreenPlayer .tv-action-btn.play-primary { padding-right: 54px; }
/* Detail top bar: Back + Audio stay on one line, the server pills scroll sideways (anime now lists Wizard / Grand Warden etc.) */
.tv-player-top-audio { flex-shrink: 0; white-space: nowrap; }
.tv-player-top-servers { min-width: 0; flex: 1 1 auto; flex-wrap: nowrap; }
#tvBtnTopBack { flex-shrink: 0; }
/* Short landscape phones: the detail block takes its natural height and the screen scrolls, so a wrapped
   action row never sits on top of the season rail. */
@media (max-height: 520px) {
  html.bigscreen-mode .tv-detail-top, html.touch-scroll-mode .tv-detail-top { flex: 0 0 auto; }
  html.bigscreen-mode .tv-detail-shell, html.touch-scroll-mode .tv-detail-shell { height: auto; min-height: 100%; }
}
/* Fullscreen server bar on phones: Close + Audio on the first line, the servers wrap underneath in even rows. */
@media (max-width: 700px) {
  #tvFsTopBar { flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px; }
  #tvFsTopBar #tvFsAudioGroup { margin-right: 0 !important; margin-left: auto; }
  #tvFsTopBar .tv-fs-server-group { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #tvFsTopBar .tv-fs-server-group > span { grid-column: 1 / -1; }
  #tvFsTopBar .tv-fs-server-group .tv-fs-btn { width: 100%; text-align: left; }
  #tvFsTopBar #tvFsEmbedMenuBtn { grid-column: 1 / -1; }
}
@media (max-height: 520px) and (min-width: 701px) {
  #tvFsTopBar { flex-wrap: nowrap; }
  #tvFsTopBar .tv-fs-server-group { flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1 1 auto; scrollbar-width: none; }
  #tvFsTopBar .tv-fs-server-group::-webkit-scrollbar { display: none; }
  #tvFsTopBar .tv-fs-server-group > * { flex-shrink: 0; }
  #tvFsTopBar #tvFsCloseBtn, #tvFsTopBar #tvFsAudioGroup { flex-shrink: 0; white-space: nowrap; }
}

/* ============================================================================
 * BIG SCREEN 2077: SEASON CARDS + EPISODE GRID (css v47)
 * The detail screen fills the screen: compact hero on top, then a full-width season card rail and a
 * vertically scrolling grid of big episode cards (still, number, title, runtime/air date, synopsis,
 * progress). Phones: the whole detail screen scrolls; portrait shows a thumb-left list.
 * ============================================================================ */
#tvScreenPlayer .tv-detail-shell { justify-content: flex-start; }
#tvScreenPlayer .tv-detail-top { flex: 0 0 auto; }
#tvSeriesPanel.v77-eps {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  margin-top: 0.6vh; padding-top: 1.6vh; border-top: 1px solid var(--v77-line);
}
#tvSeriesPanel.v77-eps[style*="display: none"], #tvSeriesPanel.v77-eps[style*="display:none"] { display: none !important; }

/* ---- Season cards ---- */
#tvSeriesPanel.v77-eps .tv-seasons-rail {
  display: flex; gap: 14px; flex: 0 0 auto; margin: 0 0 1.4vh;
  padding: 6px 6px 8px; overflow-x: auto !important; overflow-y: hidden; transform: none !important;
  scrollbar-width: none; transition: none; will-change: auto;
}
#tvSeriesPanel.v77-eps .tv-seasons-rail::-webkit-scrollbar { display: none; }
#tvSeriesPanel.v77-eps .tv-season-card {
  display: flex; align-items: stretch; gap: 14px; flex: 0 0 auto;
  width: clamp(250px, 17vw, 340px); min-height: 104px; padding: 8px 18px 8px 8px;
  text-align: left; text-transform: none; letter-spacing: 0; font-size: 16px; line-height: 1.2;
  background: var(--v77-card); border: 1px solid var(--v77-line); color: var(--v77-text);
  clip-path: var(--v77-chamfer); position: relative;
}
#tvSeriesPanel.v77-eps .tv-season-art {
  flex: 0 0 auto; width: 58px; aspect-ratio: 2 / 3; background: #05070c; overflow: hidden;
  border: 1px solid var(--v77-line); display: flex; align-items: center; justify-content: center;
}
#tvSeriesPanel.v77-eps .tv-season-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#tvSeriesPanel.v77-eps .tv-season-art-ph {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 26px; color: var(--v77-muted);
  background: repeating-linear-gradient(115deg, #0a1626 0 8px, #07101d 8px 14px);
}
#tvSeriesPanel.v77-eps .tv-season-txt { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
#tvSeriesPanel.v77-eps .tv-season-kicker { font-family: var(--v77-mono); font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--v77-blue); }
#tvSeriesPanel.v77-eps .tv-season-name {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 22px; text-transform: uppercase; color: #fff; white-space: nowrap;
}
#tvSeriesPanel.v77-eps .tv-season-arc {
  font-size: 13px; color: var(--v77-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
#tvSeriesPanel.v77-eps .tv-season-meta { font-family: var(--v77-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--v77-muted); }
#tvSeriesPanel.v77-eps .tv-season-card.active {
  background: linear-gradient(90deg, rgba(252, 238, 10, .16), rgba(252, 238, 10, .03) 70%), var(--v77-card);
  border-color: var(--v77-yellow); color: var(--v77-text); box-shadow: inset 5px 0 0 var(--v77-yellow);
}
#tvSeriesPanel.v77-eps .tv-season-card.active .tv-season-kicker,
#tvSeriesPanel.v77-eps .tv-season-card.active .tv-season-name { color: var(--v77-yellow); }
#tvSeriesPanel.v77-eps .tv-season-card.tv-focused {
  clip-path: none !important; background: #102036 !important; color: #fff !important;
  border-color: #fff !important; outline: 3px solid var(--v77-blue) !important; outline-offset: 2px;
}
#tvSeriesPanel.v77-eps .tv-season-card.tv-focused .tv-season-name { color: #fff; }
#tvSeriesPanel.v77-eps .tv-season-card:hover { border-color: var(--v77-yellow); }

/* ---- Episodes heading ---- */
#tvSeriesPanel.v77-eps .tv-eps-head {
  display: flex; align-items: baseline; gap: 16px; flex: 0 0 auto; margin: 0 6px 1.2vh; min-width: 0;
}
#tvSeriesPanel.v77-eps .tv-eps-head-title {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 26px; text-transform: uppercase; color: #fff;
  padding-left: 14px; position: relative;
}
#tvSeriesPanel.v77-eps .tv-eps-head-title::before {
  content: ""; position: absolute; left: 0; top: 15%; bottom: 15%; width: 6px; background: var(--v77-yellow); transform: skewX(-14deg);
}
#tvSeriesPanel.v77-eps .tv-eps-head-sub { font-family: var(--v77-mono); font-size: 13px; font-weight: 700; letter-spacing: .16em; color: var(--v77-blue); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#tvSeriesPanel.v77-eps .tv-eps-head-count { margin-left: auto; font-family: var(--v77-mono); font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--v77-muted); white-space: nowrap; }

/* ---- Episode grid ---- */
#tvSeriesPanel.v77-eps .tv-episodes-viewport {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden !important; overflow-y: auto !important;
  padding: 6px 6px 18px; scrollbar-width: none; overscroll-behavior: contain;
}
#tvSeriesPanel.v77-eps .tv-episodes-viewport::-webkit-scrollbar { display: none; }
#tvSeriesPanel.v77-eps .tv-episodes-track {
  display: grid !important; grid-auto-flow: row !important; grid-template-rows: none !important; grid-auto-columns: auto !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(300px, 21vw, 420px)), 1fr));
  gap: 22px 20px; padding: 0; transform: none !important; transition: none;
}
#tvSeriesPanel.v77-eps .tv-ep-card {
  width: auto; min-height: 0; padding: 0; gap: 0; display: flex; flex-direction: column; text-align: left;
  background: var(--v77-card); border: 1px solid var(--v77-line); box-shadow: none; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
#tvSeriesPanel.v77-eps .tv-ep-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #05070c; overflow: hidden; flex: 0 0 auto;
}
#tvSeriesPanel.v77-eps .tv-ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#tvSeriesPanel.v77-eps .tv-ep-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(115deg, #0b182a 0 10px, #07101d 10px 18px);
}
#tvSeriesPanel.v77-eps .tv-ep-ph span { font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 54px; color: rgba(201, 214, 232, .22); text-shadow: 3px 0 0 rgba(255, 0, 95, .35); }
#tvSeriesPanel.v77-eps .tv-ep-badge {
  position: absolute; left: 0; top: 0; padding: 5px 14px 5px 10px; background: #05070c; color: var(--v77-yellow);
  font-family: var(--v77-mono); font-weight: 700; font-size: 14px; letter-spacing: .12em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
#tvSeriesPanel.v77-eps .tv-ep-now {
  position: absolute; right: 0; top: 0; padding: 5px 10px 5px 16px; background: var(--v77-yellow); color: #05070c;
  font-family: var(--v77-mono); font-weight: 700; font-size: 12px; letter-spacing: .16em;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); display: inline-flex; align-items: center; gap: 6px;
}
#tvSeriesPanel.v77-eps .tv-ep-now.tv-ep-done { background: var(--v77-blue); }
#tvSeriesPanel.v77-eps .tv-ep-now svg.vi { width: 13px; height: 13px; }
#tvSeriesPanel.v77-eps .tv-ep-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: none; align-items: center; justify-content: center; background: var(--v77-yellow); color: #05070c;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
#tvSeriesPanel.v77-eps .tv-ep-play svg.vi { width: 30px; height: 30px; }
#tvSeriesPanel.v77-eps .tv-ep-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(5, 12, 22, .85); }
#tvSeriesPanel.v77-eps .tv-ep-progress span { display: block; height: 100%; background: var(--v77-red); }
#tvSeriesPanel.v77-eps .tv-ep-body { display: flex; flex-direction: column; gap: 7px; padding: 14px 18px 20px; min-width: 0; }
#tvSeriesPanel.v77-eps .tv-ep-num {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-family: var(--v77-mono); font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--v77-yellow);
}
#tvSeriesPanel.v77-eps .tv-ep-meta { display: inline !important; color: var(--v77-muted); font-size: 12px; letter-spacing: .1em; }
#tvSeriesPanel.v77-eps .tv-ep-title {
  font-family: var(--v77-head); font-style: italic; font-weight: 900; font-size: 22px; line-height: 1.15; color: #fff;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#tvSeriesPanel.v77-eps .tv-ep-desc {
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; line-height: 1.42; color: var(--v77-text); white-space: normal; font-weight: 400;
}
#tvSeriesPanel.v77-eps .tv-ep-card.current {
  border-color: var(--v77-yellow); background: linear-gradient(180deg, rgba(252, 238, 10, .08), transparent 60%), var(--v77-card);
  box-shadow: inset 0 -5px 0 var(--v77-yellow);
}
#tvSeriesPanel.v77-eps .tv-ep-card.watched .tv-ep-thumb img { opacity: .55; }
#tvSeriesPanel.v77-eps .tv-ep-card.tv-focused {
  clip-path: none !important; border-color: #fff !important; background: #102036 !important;
  outline: 3px solid var(--v77-blue) !important; outline-offset: 2px;
}
#tvSeriesPanel.v77-eps .tv-ep-card.tv-focused .tv-ep-play,
#tvSeriesPanel.v77-eps .tv-ep-card:hover .tv-ep-play { display: flex; }
#tvSeriesPanel.v77-eps .tv-ep-card:hover { border-color: var(--v77-yellow); }

/* Fire TV / Android TV APK + lite: flat shapes, no clip-path rasterisation, no hover */
html.tv-mode #tvSeriesPanel.v77-eps .tv-season-card, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-season-card,
html.tv-mode #tvSeriesPanel.v77-eps .tv-ep-card, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-card,
html.tv-mode #tvSeriesPanel.v77-eps .tv-ep-badge, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-badge,
html.tv-mode #tvSeriesPanel.v77-eps .tv-ep-now, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-now,
html.tv-mode #tvSeriesPanel.v77-eps .tv-ep-play, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-play { clip-path: none; }
html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-ph, html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-season-art-ph { background: #0a1626; }
html.tv-lite-mode #tvSeriesPanel.v77-eps .tv-ep-ph span { text-shadow: none; }

/* Short screens (phone landscape) and narrow screens (phone portrait): the detail screen scrolls as one page */
@media (max-height: 520px), (max-width: 700px) {
  #tvScreenPlayer .tv-detail-shell { height: auto; min-height: 100%; }
  #tvSeriesPanel.v77-eps { flex: 0 0 auto; padding-top: 14px; }
  #tvSeriesPanel.v77-eps .tv-episodes-viewport { overflow: visible !important; flex: 0 0 auto; padding: 4px 4px 14px; }
  #tvSeriesPanel.v77-eps .tv-seasons-rail { gap: 10px; margin-bottom: 12px; padding: 4px 4px 6px; }
  #tvSeriesPanel.v77-eps .tv-season-card { width: 214px; min-height: 80px; padding: 6px 14px 6px 6px; gap: 10px; }
  #tvSeriesPanel.v77-eps .tv-season-art { width: 44px; }
  #tvSeriesPanel.v77-eps .tv-season-name { font-size: 17px; }
  #tvSeriesPanel.v77-eps .tv-season-kicker, #tvSeriesPanel.v77-eps .tv-season-meta { font-size: 11px; letter-spacing: .12em; }
  #tvSeriesPanel.v77-eps .tv-season-arc { font-size: 12px; }
  #tvSeriesPanel.v77-eps .tv-eps-head { margin: 0 4px 10px; gap: 10px; }
  #tvSeriesPanel.v77-eps .tv-eps-head-title { font-size: 20px; }
  #tvSeriesPanel.v77-eps .tv-eps-head-sub, #tvSeriesPanel.v77-eps .tv-eps-head-count { font-size: 11px; letter-spacing: .12em; }
  #tvSeriesPanel.v77-eps .tv-episodes-track { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px 12px; }
  #tvSeriesPanel.v77-eps .tv-ep-body { padding: 10px 12px 14px; gap: 5px; }
  #tvSeriesPanel.v77-eps .tv-ep-title { font-size: 16px; }
  #tvSeriesPanel.v77-eps .tv-ep-desc { font-size: 12.5px; line-height: 1.38; }
  #tvSeriesPanel.v77-eps .tv-ep-num { font-size: 11.5px; letter-spacing: .1em; }
  #tvSeriesPanel.v77-eps .tv-ep-meta { font-size: 10.5px; letter-spacing: .06em; }
  #tvSeriesPanel.v77-eps .tv-ep-badge { font-size: 12px; padding: 4px 12px 4px 8px; }
  #tvSeriesPanel.v77-eps .tv-ep-now { font-size: 10.5px; padding: 4px 8px 4px 14px; }
  #tvSeriesPanel.v77-eps .tv-ep-ph span { font-size: 36px; }
  #tvSeriesPanel.v77-eps .tv-ep-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  #tvSeriesPanel.v77-eps .tv-ep-play svg.vi { width: 24px; height: 24px; }
}
/* Phone portrait: compact list (thumb left, text right) */
@media (max-width: 700px) and (orientation: portrait) {
  #tvSeriesPanel.v77-eps .tv-episodes-track { grid-template-columns: 1fr; gap: 10px; }
  #tvSeriesPanel.v77-eps .tv-ep-card { flex-direction: row; align-items: stretch; min-height: 96px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
  #tvSeriesPanel.v77-eps .tv-ep-thumb { width: 42%; max-width: 168px; aspect-ratio: 16 / 9; height: auto; min-height: 0; align-self: flex-start; flex: 0 0 auto; }
  #tvSeriesPanel.v77-eps .tv-ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  #tvSeriesPanel.v77-eps .tv-ep-body { flex: 1 1 auto; padding: 8px 12px 10px; gap: 4px; }
  #tvSeriesPanel.v77-eps .tv-ep-title { font-size: 15px; }
  #tvSeriesPanel.v77-eps .tv-ep-desc { font-size: 12px; -webkit-line-clamp: 2; }
  #tvSeriesPanel.v77-eps .tv-ep-num { font-size: 10.5px; }
  #tvSeriesPanel.v77-eps .tv-ep-meta { display: none !important; }
  #tvSeriesPanel.v77-eps .tv-ep-ph span { font-size: 28px; }
  #tvSeriesPanel.v77-eps .tv-ep-now { font-size: 9.5px; letter-spacing: .1em; padding: 3px 6px 3px 12px; left: 0; right: auto; top: auto; bottom: 0; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 0 100%); padding: 3px 14px 3px 8px; }
  #tvSeriesPanel.v77-eps .tv-ep-card.current .tv-ep-progress { bottom: 0; }
  #tvSeriesPanel.v77-eps .tv-ep-card.current { box-shadow: inset 4px 0 0 var(--v77-yellow); }
  #tvSeriesPanel.v77-eps .tv-season-card { width: 196px; }
}

/* ==========================================================================
   SKIP INTRO / SKIP RECAP (TheIntroDB) — Big Screen floating chip
   ========================================================================== */
.tv-skip-intro-btn {
  position: absolute;
  right: clamp(20px, 3vw, 56px);
  bottom: clamp(72px, 12vh, 140px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  background: linear-gradient(135deg, rgba(5, 12, 24, 0.94) 0%, rgba(0, 40, 55, 0.9) 100%);
  color: #e8fbff;
  font-family: var(--v77-mono, "JetBrains Mono", monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.12), 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 240, 255, 0.18);
  pointer-events: auto;
}
.tv-skip-intro-btn .vi { color: #00f0ff; }
.tv-skip-intro-btn:hover,
.tv-skip-intro-btn:focus,
.tv-skip-intro-btn.tv-focused,
.tv-skip-intro-btn:focus-visible {
  outline: none;
  border-color: #00f0ff;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 60, 80, 0.95) 0%, rgba(0, 120, 140, 0.9) 100%);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.45), 0 10px 32px rgba(0, 240, 255, 0.25);
}
.tv-skip-intro-btn.hidden { display: none !important; }

/* ==========================================================================
   BIG SCREEN LOGIN — open2077 restyle polish (STYLE ONLY)
   VIPER-OS mark, scanlines, corner ticks, stronger tab / pair chrome.
   Keeps existing v77 chamfer / stripe / focus. Lite/tv-mode: no clip-path.
   ========================================================================== */
#tvScreenLogin {
  position: relative;
  background:
    radial-gradient(1100px 560px at 92% -12%, rgba(255, 0, 95, 0.14), transparent 60%),
    radial-gradient(900px 520px at -4% -6%, rgba(8, 223, 236, 0.10), transparent 60%),
    linear-gradient(180deg, #05070c 0%, #040910 100%);
}
#tvScreenLogin::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(8, 223, 236, 0.07) 2px 3px
  );
}
#tvScreenLogin .tv-login-card {
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(8, 223, 236, 0.08);
}
#tvScreenLogin .tv-login-card::before,
#tvScreenLogin .tv-login-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border-color: var(--v77-blue);
  border-style: solid;
  z-index: 2;
}
#tvScreenLogin .tv-login-card::before {
  top: 8px; left: 8px;
  border-width: 2px 0 0 2px;
}
#tvScreenLogin .tv-login-card::after {
  bottom: 8px; right: 8px;
  border-width: 0 2px 2px 0;
  border-color: var(--v77-red);
}
/* Brand row → VIPER-OS mark (targets the first flex brand row inside the card) */
#tvScreenLogin .tv-login-card > div:first-child {
  position: relative;
  flex-wrap: wrap;
  gap: 10px;
}
#tvScreenLogin .tv-login-card > div:first-child::after {
  content: "BIG SCREEN";
  display: inline-flex;
  align-items: center;
  padding: 3px 10px 3px 12px;
  font-family: var(--v77-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #05070c;
  background: var(--v77-blue);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
#tvScreenLogin .tv-login-card > div:first-child img {
  border-radius: 0 !important;
  border: 1px solid var(--v77-line);
  box-shadow: 3px 0 0 var(--v77-red);
}
#tvScreenLogin .tv-login-sub::before {
  content: "// ";
  color: var(--v77-red);
}
#tvScreenLogin .tv-login-tabs {
  border: 1px solid var(--v77-line);
  background: #05070c;
}
#tvScreenLogin .tv-login-tab {
  font-family: var(--v77-mono);
  letter-spacing: 0.16em;
  color: #7a8eaa;
}
#tvScreenLogin .tv-login-tab.active {
  background: var(--v77-blue);
  color: #05070c;
  box-shadow: inset 0 -2px 0 var(--v77-yellow);
}
#tvScreenLogin .tv-pair-qr-wrap {
  border: 1px solid var(--v77-yellow);
  box-shadow: 4px 4px 0 rgba(255, 0, 95, 0.35);
}
#tvScreenLogin .tv-pair-code-wrap {
  border: 1px solid var(--v77-yellow);
  background: #05070c;
  position: relative;
}
#tvScreenLogin .tv-pair-code-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--v77-blue), var(--v77-yellow), var(--v77-red));
}
#tvScreenLogin .tv-pair-code-val {
  font-family: var(--v77-head);
  font-style: italic;
  text-shadow: 2px 0 0 var(--v77-red);
}
#tvScreenLogin .tv-pair-status {
  font-family: var(--v77-mono);
  color: var(--v77-blue);
}
html.tv-mode #tvScreenLogin .tv-login-card > div:first-child::after,
html.tv-lite-mode #tvScreenLogin .tv-login-card > div:first-child::after {
  clip-path: none;
}
html.tv-mode #tvScreenLogin::before,
html.tv-lite-mode #tvScreenLogin::before,
html.tv-mode #tvScreenLogin .tv-login-card::before,
html.tv-mode #tvScreenLogin .tv-login-card::after,
html.tv-lite-mode #tvScreenLogin .tv-login-card::before,
html.tv-lite-mode #tvScreenLogin .tv-login-card::after {
  display: none;
}
html.tv-mode #tvScreenLogin .tv-pair-qr-wrap,
html.tv-lite-mode #tvScreenLogin .tv-pair-qr-wrap {
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  #tvScreenLogin::before { opacity: 0.04; }
}

/* Overlay subtitles on Big Screen fullscreen stage (OSD-clock timed). The stage is already position:fixed (the
   containing block for .viper-sub-overlay); never override it with position:relative here, that dropped the
   player into the page flow (0px tall on phones) so PLAY looked dead on /bigscreen, /tv and the Big Screen APK. */

/* Overlay subtitles settings panel (Big Screen OSD Subtitles button) */
.tv-subs-panel {
  position: absolute;
  right: 18px;
  bottom: 120px;
  width: min(400px, calc(100% - 36px));
  z-index: 80;
  display: none;
  pointer-events: none;
}
.tv-subs-panel.open {
  display: block;
  pointer-events: auto;
}
.tv-subs-panel-inner {
  background: rgba(8, 12, 20, 0.94);
  border: 1px solid rgba(57, 230, 224, 0.28);
  border-radius: 16px;
  padding: 14px 16px 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  max-height: min(70vh, 560px);
  overflow: auto;
  color: #f3f5fa;
}
.tv-subs-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.tv-subs-panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #39e6e0;
}
.tv-subs-panel-desc {
  margin: 0 0 12px;
  color: rgba(243, 245, 250, 0.62);
  font-size: 12.5px;
  line-height: 1.4;
}
.tv-subs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}
.tv-subs-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.tv-subs-field select,
.tv-subs-field input[type="color"] {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(57, 230, 224, 0.28);
  background: rgba(0, 0, 0, 0.45);
  color: #f3f5fa;
  padding: 8px 10px;
  font-size: 15px;
}
.tv-subs-offset-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tv-subs-panel .tv-tosd-btn {
  min-height: 44px;
  min-width: 72px;
  padding: 8px 12px;
  font-size: 13px;
}
.tv-subs-primary,
#tv-subs-toggle.active,
#tvTosdSubs.active {
  background: rgba(0, 240, 255, 0.18) !important;
  border-color: #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}
.tv-subs-panel .tv-tosd-btn:focus,
.tv-subs-panel select:focus,
.tv-subs-panel input:focus {
  outline: 2px solid #39e6e0;
  outline-offset: 2px;
}

#tvFullscreenStage .viper-sub-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  padding: 0 8% 10%;
  box-sizing: border-box;
}
#tvFullscreenStage .viper-sub-cue {
  max-width: 88%;
  text-align: center;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  padding: 0.18em 0.55em;
  border-radius: 6px;
  color: #fff;
}

/* ==========================================================================
   BIG SCREEN / TV LOCK — open2077 / Blackwall parity (STYLE ONLY)
   Matches #tvScreenLogin pop-up: #05070c, Archivo italic, JetBrains Mono,
   chamfer, corner ticks, hazard-stripe primary, BIG SCREEN mark.
   ========================================================================== */
#tvScreenLock.tv-lock-screen,
.tv-lock-screen {
  position: relative;
  background:
    radial-gradient(1100px 560px at 92% -12%, rgba(255, 0, 95, 0.14), transparent 60%),
    radial-gradient(900px 520px at -4% -6%, rgba(8, 223, 236, 0.10), transparent 60%),
    linear-gradient(180deg, #05070c 0%, #040910 100%) !important;
  font-family: var(--v77-mono, 'JetBrains Mono', ui-monospace, monospace);
}
#tvScreenLock.tv-lock-screen::before,
.tv-lock-screen::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.07;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(8, 223, 236, 0.07) 2px 3px);
}
#tvScreenLock .tv-lock-card,
.tv-lock-screen .tv-lock-card {
  position: relative; z-index: 1;
  background: var(--v77-panel, rgba(8, 17, 31, 0.96)) !important;
  border: 1px solid var(--v77-line, rgba(75, 99, 133, 0.55)) !important;
  border-top: 4px solid var(--v77-yellow, #fcee0a) !important;
  clip-path: var(--v77-chamfer, polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(8, 223, 236, 0.08) !important;
}
#tvScreenLock .tv-lock-card::before,
#tvScreenLock .tv-lock-card::after,
.tv-lock-screen .tv-lock-card::before,
.tv-lock-screen .tv-lock-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--v77-blue, #08dfec); border-style: solid; z-index: 2;
}
#tvScreenLock .tv-lock-card::before,
.tv-lock-screen .tv-lock-card::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
#tvScreenLock .tv-lock-card::after,
.tv-lock-screen .tv-lock-card::after {
  bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-color: var(--v77-red, #ff005f);
}
#tvScreenLock .tv-lock-card h1,
.tv-lock-screen .tv-lock-card h1 {
  font-family: var(--v77-head, 'Archivo', system-ui, sans-serif) !important;
  font-style: italic; letter-spacing: 0.02em !important;
  text-shadow: 4px 0 0 var(--v77-red, #ff005f);
}
#tvScreenLock .tv-lock-card h1::after {
  content: "BIG SCREEN";
  display: block; width: fit-content; margin: 10px auto 0;
  padding: 3px 10px 3px 12px;
  font-family: var(--v77-mono, 'JetBrains Mono', monospace);
  font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: 0.2em;
  color: #05070c; background: var(--v77-blue, #08dfec); text-shadow: none;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
#tvScreenLock .tv-lock-card p,
.tv-lock-screen .tv-lock-card p {
  font-family: var(--v77-mono, 'JetBrains Mono', monospace);
  color: #7a8eaa !important;
}
#tvScreenLock .tv-lock-card p::before,
.tv-lock-screen .tv-lock-card p::before { content: "// "; color: var(--v77-red, #ff005f); }
#tvScreenLock .tv-lock-icon,
.tv-lock-screen .tv-lock-icon {
  width: 58px; height: 58px; margin: 0 auto 1.2rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--v77-red, #ff005f);
  border: 1px solid rgba(255, 0, 95, 0.55); background: rgba(255, 0, 95, 0.08);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
#tvScreenLock .tv-lock-icon svg.vi,
.tv-lock-screen .tv-lock-icon svg.vi { width: 52%; height: 52%; margin: 0; }
#tvScreenLock .tv-lock-btn,
.tv-lock-screen .tv-lock-btn {
  font-family: var(--v77-mono, 'JetBrains Mono', monospace);
  background: transparent; color: #c9d6e8;
  border: 1px solid var(--v77-line, rgba(75, 99, 133, 0.55));
  clip-path: var(--v77-cut, polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%));
  padding-right: 1.8rem;
}
#tvScreenLock .tv-lock-btn:first-child,
.tv-lock-screen .tv-lock-actions .tv-lock-btn:first-child {
  background: var(--v77-stripe), var(--v77-yellow, #fcee0a);
  border-color: var(--v77-yellow, #fcee0a); color: #05070c;
  font-family: var(--v77-head, 'Archivo', system-ui, sans-serif);
  font-style: italic; font-weight: 900;
}
#tvScreenLock .tv-lock-btn.tv-focused,
#tvScreenLock .tv-lock-btn:focus-visible,
.tv-lock-screen .tv-lock-btn.tv-focused {
  clip-path: none !important;
  outline: 3px solid var(--v77-yellow, #fcee0a) !important;
  outline-offset: 3px;
  background: var(--v77-stripe), #fff !important;
  color: #05070c !important; border-color: #fff !important;
}
html.tv-mode #tvScreenLock .tv-lock-card,
html.tv-mode #tvScreenLock .tv-lock-btn,
html.tv-lite-mode #tvScreenLock .tv-lock-card,
html.tv-lite-mode #tvScreenLock .tv-lock-btn {
  clip-path: none !important;
}


/* ============================================================================
 * BIG SCREEN v1.0.9: TOUCH OSD ALWAYS REACHABLE
 * Portrait phones: the bottom controls stay on screen (pinned above the home indicator) instead of hiding.
 * Landscape phones: the control rows scroll sideways by touch, so nothing is clipped.
 * ============================================================================ */
#tvTosdLang .vpl-ico { width: 22px; height: 22px; }
@media (orientation: portrait) and (max-width: 900px) {
  html.tv-touch-osd:not(.tv-fs-pass) .tv-tosd .tv-tosd-bottom {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    bottom: 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  }
  html.tv-touch-osd:not(.tv-fs-pass) .tv-tosd .tv-tosd-bottom .tv-tosd-btn,
  html.tv-touch-osd:not(.tv-fs-pass) .tv-tosd .tv-tosd-bottom .tv-tosd-scrub { pointer-events: auto !important; }
  .tv-tosd-top {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
    gap: 8px !important;
  }
  .tv-tosd-top::-webkit-scrollbar { display: none; }
  .tv-tosd-top > .tv-tosd-btn { flex-shrink: 0; }
}
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  .tv-tosd-ctrl-row,
  .tv-tosd-top {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .tv-tosd-ctrl-row::-webkit-scrollbar,
  .tv-tosd-top::-webkit-scrollbar { display: none; }
  .tv-tosd-ctrl-row > *,
  .tv-tosd-top > .tv-tosd-btn { flex-shrink: 0; }
}

/* ============================================================================
 * Player overlay fix (Jake, Nov 2026; same fix as ViperFlix): no dark band or blur over the top of the picture
 * for any movie, show or anime, on any server. The top row keeps its legibility with a text shadow only; the
 * bottom keeps one short fade behind the controls. In landscape the picture fills the screen edge to edge
 * (contain, no inset frame).
 * ============================================================================ */
.tv-tosd-top,
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-top {
  background: none !important;
}
.tv-tosd-top .tv-tosd-title,
.tv-tosd-top .tv-tosd-sub,
.tv-tosd-top .tv-tosd-pill-label {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6);
}
.tv-tosd-bottom,
html.tv-fs-pass .tv-tosd.fs-pass .tv-tosd-bottom {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0, rgba(0, 0, 0, 0) 100%) !important;
}
@media (orientation: landscape) {
  html.tv-fs-pass #tvFullscreenStage:not(.backup-active) #tvPlayerFrame {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
}
#tvFullscreenStage .viper-anime-video { object-fit: contain; background: #000; }
