/* ============================================================================
 * VIPerClub Dedicated Android TV OS & Big Screen Stylesheet (tv-app.css v3.0)
 * Ultra-Lightweight 60fps 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 — 60FPS 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;
}

/* Dashboard return link in the /bigscreen header */
.tv-nav-dash-link {
  text-decoration: none;
  background: #171504;
  border: 2px solid var(--cyber-yellow);
  color: var(--cyber-yellow);
  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;
  padding: 3px 3px 6px;
  transition: transform 0.22s ease-out;
  will-change: transform;
}

.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(5,5,5,.92); border: 1px solid rgba(255,0,60,.55); border-top: 6px solid #ff003c; box-shadow: 0 0 40px rgba(255,0,60,.18); }
.tv-lock-card > i { font-size: 3.2rem; color: #ff003c; 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: .12em; text-transform: uppercase; margin: 0 0 1rem; }
.tv-lock-card p { color: #cbd5e1; 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: #000; color: #00f0ff; border: 2px solid rgba(0,240,255,.6); 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: #000; 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; }
#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 {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* ============================================================================
 * 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;
}
