/* === SPORTS HD - Vidaa TV ===
   Design base: 1280x720 (HD Ready)
   CSS-scaled to 1080p/4K via resolution.js
*/
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Smooth scrolling for all scrollable containers */
.cm-row-scroll, .dtl-card-row, .dtl-cast-row, .cm-season-strip,
.cm-genre-strip, .row-scroll, .rows, .content-screen, .cm-detail,
.featured, .fb-featured, .football-screen, .fb-league-cards,
.player-channels, .player-channels-list, .ep-picker-list,
.fbp-channels-list {
  scroll-behavior: smooth;
}

:root {
  --bg: #000;
  --surface: #1c1c1e;
  --text: #f5f5f7;
  --text2: rgba(255,255,255,0.55);
  --text3: rgba(255,255,255,0.25);
  --accent: #ff2d55;
  --green: #30d158;
  --radius: 10px;
  --pad: 64px; /* TV action-safe zone: 5% of 1280px */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  width: 1280px; height: 720px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transform-origin: 0 0;
}
/* Belt-and-braces mobile body sizing. The TV/desktop layout is built
   for a fixed 1280×720 canvas, but on phones we want the body to track
   the actual viewport. device.js does this in JS once it boots; this
   media query covers the brief window before that runs (and the case
   where the inline early-viewport script in <head> is blocked). */
@media (max-width: 900px) {
  body {
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
  }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  /* Safe-area-aware padding so notches and home-bars don't crash into
     the form, and a small horizontal gutter so on narrow phones the
     digit row never touches the screen edge. */
  padding: max(24px, env(safe-area-inset-top, 0px))
           16px
           max(24px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.auth-screen.hidden { display: none; }
.auth-inner {
  text-align: center;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  /* Scales with viewport instead of being a fixed 44px so phones don't
     get a header that's 12 % of total width while desktop barely sees it. */
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 800; letter-spacing: 4px; color: var(--text);
  margin-bottom: clamp(20px, 5vh, 36px);
}
/* Slim spacer so "SPORTS" and "HD" read as a unified mark instead of
   two unrelated words. Markup intentionally has no whitespace between
   them; this margin gives a one-character breath without the full
   space character's visual gap. */
.auth-logo span { color: var(--accent); margin-left: 0.18em; }
.auth-msg {
  font-size: clamp(14px, 4.5vw, 18px);
  color: var(--text2); font-weight: 500;
  margin-bottom: clamp(18px, 4vh, 28px);
}
.auth-code {
  display: flex;
  /* Gap auto-shrinks on narrow screens before any digit overflow can
     happen. clamp() is the only way to get this without a flurry of
     media queries. */
  gap: clamp(6px, 2vw, 14px);
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;   /* anchors the hidden input overlay below */
  width: 100%;
  max-width: 380px;
}
/* Hidden numeric input — covers the entire digit row so a tap anywhere
   in the area focuses it and pops the soft keypad. Opacity 0 keeps it
   invisible; pointer-events still fire because we don't disable them. */
.auth-code-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  border: none; outline: none; background: transparent;
  font-size: 16px;          /* iOS won't auto-zoom for >=16px inputs */
  caret-color: transparent;
  -webkit-appearance: none;
  cursor: pointer;
  /* Stay above the digit spans for hit testing. */
  z-index: 2;
}
.auth-digit {
  /* Each digit is 1/6 of the row width (minus gap budget). flex-basis
     handles the math so on a 280-px-wide screen we get ~38px boxes,
     on a 420-px-wide screen we cap at 52px. The aspect-ratio keeps
     them visually consistent. */
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
  aspect-ratio: 5 / 6;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 700; color: var(--text);
  transition: border-color 0.15s;
}
.auth-digit.active {
  border-color: var(--accent);
}
.auth-digit.filled {
  background: rgba(255,255,255,0.06);
}
.auth-error {
  font-size: 15px; color: #ff453a; font-weight: 500;
  min-height: 22px; margin-bottom: 16px;
  padding: 0 12px; max-width: 420px; line-height: 1.4;
  text-align: center; opacity: 0.95;
}
/* Pop the background + border when a real server reason is showing, so
   the multi-word explanation is readable at a glance on TV distance. */
.auth-error.auth-err-visible {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.35);
  border-radius: 8px;
  padding: 8px 14px;
}
.auth-hint {
  font-size: clamp(12px, 3.6vw, 14px);
  color: var(--text3);
}

/* ===== SPLASH ===== */
.splash {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 40%, #0e0e18 0%, var(--bg) 70%);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease);
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }

.splash-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--accent), #ff4060);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 900; color: #fff;
  margin: 0 auto 28px;
  box-shadow: 0 0 60px rgba(255,45,85,0.3);
  animation: splashPulse 2s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255,45,85,0.2); transform: scale(1); }
  50% { box-shadow: 0 0 80px rgba(255,45,85,0.4); transform: scale(1.04); }
}

.splash-logo {
  font-size: 48px; font-weight: 800; letter-spacing: 6px; color: var(--text);
  margin-bottom: 8px;
}
.splash-logo span { color: var(--accent); margin-left: 0.18em; }

.splash-tagline {
  font-size: 16px; font-weight: 500; color: var(--text3);
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 50px;
}

.splash-loader {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  margin-bottom: 18px;
}

.splash-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.splash-bar {
  width: 280px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px;
  overflow: hidden;
}
.splash-fill {
  width: 0%; height: 100%; background: var(--accent);
  border-radius: 2px; transition: width 0.4s var(--ease);
}

.splash-status { font-size: 14px; color: var(--text3); font-weight: 500; letter-spacing: 1px; }

/* ===== STATUS BAR ===== */
.statusbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 96px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px var(--pad) 8px;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 20px; }

.sb-logo {
  width: 56px; height: 56px;
  background: var(--accent); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-size: 24px; font-weight: 900; color: #fff;
}
.sb-brand { font-size: 32px; font-weight: 800; color: var(--text); letter-spacing: 3px; }
.sb-brand-hd { color: var(--accent); margin-left: 0.18em; }


/* Tabs — inside statusbar, next to brand */
.tab-strip {
  display: flex; align-items: center; gap: 6px;
  margin-left: 20px;
}
.tab {
  padding: 10px 24px; border-radius: 10px;
  font-size: 20px; font-weight: 600; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.tab.tab-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.tab.tab-focused {
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: 2px solid rgba(255,255,255,0.4);
}
.tab-count {
  font-size: 0.75em; font-weight: 700; color: var(--accent);
  margin-left: 3px;
}
.tab.tab-active .tab-count { color: var(--accent); }

.sb-net {
  display: flex; align-items: center;
  color: var(--text3);
}
.sb-wifi-icon { color: #ff453a; transition: color 0.3s; flex-shrink: 0; }
.sb-wifi-icon.online { color: var(--green); }
.sb-clock {
  font-size: 36px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sb-settings-btn, .sb-refresh-btn {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.sb-settings-btn svg, .sb-refresh-btn svg { width: 42px; height: 42px; }
.sb-settings-btn:hover, .sb-settings-btn.focused,
.sb-refresh-btn:hover, .sb-refresh-btn.focused {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.3);
  transform: scale(1.1);
}
.sb-refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }

/* ===== FEATURED (inside .rows, scrolls with content) ===== */
.featured {
  display: flex; gap: 20px;
  padding: 16px var(--pad) 16px;
  overflow-x: auto; overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.featured::-webkit-scrollbar { display: none; }
.featured:empty { display: none; }
.feat-card {
  flex: 0 0 420px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  transition: transform 0.3s ease, box-shadow 0.3s var(--ease);
  cursor: pointer; outline: none;
}
.feat-card::after {
  content: ''; position: absolute; top: -1px; right: -1px; bottom: -1px; left: -1px;
  border-radius: 13px;
  border: 2px solid transparent;
  transition: border-color 0.25s;
  pointer-events: none; z-index: 2;
}
.feat-card.focused {
  transform: scale(1.03) translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.8);
  z-index: 5;
}
.feat-card.focused::after { border-color: #fff; }
.feat-card.now-playing::after { border-color: var(--green); }

.feat-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  background: var(--surface);
  transition: transform 0.3s var(--ease);
}
.feat-card.focused .feat-img { transform: scale(1.03); }

.feat-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 20px 14px;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.7));
  z-index: 1;
}
.feat-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.7); letter-spacing: 1.5px;
  margin-bottom: 6px; text-transform: uppercase;
}
.feat-card.now-playing .feat-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 1.5s infinite;
}
.feat-name {
  font-size: 22px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.feat-cat { font-size: 14px; color: var(--text2); margin-top: 3px; font-weight: 500; }

/* ===== ROWS ===== */
.rows {
  position: fixed;
  top: 96px; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 0 300px;
  scrollbar-width: none;
  z-index: 20;
  -webkit-overflow-scrolling: touch;
}
.rows::-webkit-scrollbar { display: none; }

/* When the access code forbids the TV tab, force-hide the home content so
   the user can't see channel cards through other tabs' transitions. This
   wins over inline `style.display = ''` that Movies/Drama/etc. set on close. */
body.tv-tab-hidden #featured,
body.tv-tab-hidden #rows { display: none !important; }

.row {
  margin-bottom: 28px;
  position: relative;
  overflow: visible;
}

/* Subtle glow behind focused row */
.row.active-row::before {
  content: ''; position: absolute;
  left: 0; right: 0; top: -14px; bottom: -14px;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,45,85,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.row-title {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.75);
  padding: 8px var(--pad) 4px;
  display: flex; align-items: baseline; gap: 8px;
  transition: color 0.2s;
}
.row.active-row .row-title { color: #fff; }
.row-title .row-count { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.4); }

.row-scroll {
  display: flex; flex-wrap: nowrap; gap: 32px;
  padding: 24px var(--pad) 20px;
  overflow-x: auto; overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll::after {
  content: ''; flex-shrink: 0; width: var(--pad); min-width: var(--pad);
}

/* ===== CARD ===== */
.card {
  width: 220px;
  flex-shrink: 0;
  background: #141418;
  border-radius: var(--radius);
  overflow: hidden;
  outline: none;
  border: 2px solid rgba(255,255,255,0.06);
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.18s ease, border-color 0.15s;
  position: relative;
  will-change: transform;
}
.card.focused {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  border-color: #fff;
  z-index: 5;
  background: #1e1e22;
}
.card.now-playing {
  border-color: var(--green);
}

.card-poster {
  width: 100%; height: 0; padding-bottom: 56.25%;
  object-fit: contain;
  /* Light tint so transparent-PNG logos (Azam, BeIN, MBC…) stay legible.
     Card frame itself stays dark via the parent .card background. */
  background: rgba(255,255,255,0.92);
  display: block;
  position: relative;
}
.card-poster { height: auto; padding-bottom: 0; aspect-ratio: 16/9; } /* override if supported */
.card-info { padding: 12px 14px 14px; }
.card-name {
  font-size: 18px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: rgba(255,255,255,0.85);
  transition: color 0.2s;
}
.card.focused .card-name { color: #fff; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.card-cat { font-size: 14px; color: rgba(255,255,255,0.5); font-weight: 500; }

.badge {
  display: inline-block; font-size: 11px; padding: 3px 6px;
  border-radius: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-mpd { background: rgba(90,145,230,0.12); color: rgba(90,145,230,0.8); }
.badge-hls { background: rgba(48,209,88,0.1); color: rgba(48,209,88,0.7); }
.badge-drm { background: rgba(255,69,58,0.1); color: rgba(255,69,58,0.7); }
.badge-wv  { background: rgba(255,159,10,0.1); color: rgba(255,159,10,0.7); }
.badge-dead { background: rgba(142,142,147,0.15); color: rgba(255,69,58,0.85); }

/* Dead / unreachable channel cards — dim but still navigable so user sees them */
.card.card-dead .card-poster { filter: grayscale(0.75) brightness(0.6); }
.card.card-dead .card-name { color: rgba(255,255,255,0.5); }

/* Now playing */
.card.now-playing .card-name::before,
.feat-card.now-playing .feat-name::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; background: var(--green); border-radius: 50%;
  margin-right: 4px; animation: pulse 1.5s infinite; vertical-align: middle;
}

/* ===== PLAYER ===== */
.player-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000;
  z-index: 200; display: none;
  /* Clip <video>'s inline baseline gap and any sub-pixel rounding so the
     overlay never triggers a body/page scroll on mobile or desktop. */
  overflow: hidden;
  transition: opacity 0.3s var(--ease);
}
.player-overlay.active { display: block; animation: fadeIn 0.2s; }

.player-overlay.pip {
  top: 86px; right: var(--pad); bottom: auto; left: auto;
  width: 360px; height: 203px;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.95);
  z-index: 300; overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.08);
  animation: pipIn 0.35s ease;
}
/* PIP position variants */
.player-overlay.pip.pip-top-left { right: auto; left: var(--pad); }
.player-overlay.pip.pip-bottom-right { top: auto; bottom: 40px; }
.player-overlay.pip.pip-bottom-left { top: auto; bottom: 40px; right: auto; left: var(--pad); }
@keyframes pipIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.player-overlay.pip.pip-focused {
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.9), 0 0 0 2px rgba(255,255,255,0.15);
  transform: scale(1.03);
}
.player-overlay.pip .player-loading span { font-size: 10px; }
.player-overlay.pip .spinner { width: 16px; height: 16px; border-width: 2px; }
.player-overlay.pip .player-osd,
.player-overlay.pip .player-channels,
.player-overlay.pip .ch-splash { display: none !important; }

.pip-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.92));
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.65);
  display: none; z-index: 310;
}
.player-overlay.pip .pip-label { display: block; }

.player-overlay video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
  display: block; /* removes the default inline-baseline descender gap */
}

.player-loading {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; z-index: 210;
}
.player-loading.active { display: flex; }
.player-loading span { color: var(--text2); font-size: 13px; font-weight: 500; }

.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* Channel splash */
.ch-splash {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, #0a0a12 60%, #000 100%);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; z-index: 215;
}
.ch-splash.visible { display: flex; }
.ch-splash-img {
  width: 140px; height: 80px; object-fit: contain;
  border-radius: 12px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.ch-splash-name {
  font-size: 28px; font-weight: 700; color: #fff;
  text-align: center; max-width: 80%;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.ch-splash-cat {
  font-size: 16px; color: var(--text2); font-weight: 500;
  text-transform: uppercase; letter-spacing: 1px;
}
.ch-splash-loading {
  display: flex; align-items: center; gap: 10px;
  color: var(--accent); font-size: 12px; font-weight: 600;
}
.ch-splash-bar {
  width: 200px; height: 3px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.ch-splash-fill {
  width: 30%; height: 100%; background: var(--accent);
  border-radius: 2px;
  animation: splashProgress 2s ease-in-out infinite;
}
@keyframes splashProgress {
  0% { width: 10%; margin-left: 0; }
  50% { width: 40%; margin-left: 30%; }
  100% { width: 10%; margin-left: 90%; }
}
.ch-splash-loading .spinner { width: 14px; height: 14px; border-width: 2px; }

/* OSD */
.player-osd {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none;
  flex-direction: column; justify-content: space-between;
  padding: 24px 36px; pointer-events: none; z-index: 205;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 10%, transparent 90%, rgba(0,0,0,0.55) 100%);
}
.player-osd.visible { display: flex; animation: fadeIn 0.15s; }
.osd-top { display: flex; align-items: center; gap: 8px; }
.osd-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.85); letter-spacing: 1.5px;
}
.osd-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.5s infinite;
}
.osd-title { font-size: 22px; font-weight: 600; color: var(--text); text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.osd-bottom { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.osd-hint {
  font-size: 14px; color: var(--text3); font-weight: 500;
  background: rgba(28,28,30,0.65); padding: 8px 18px; border-radius: 16px;
}

/* OSD action buttons (Quality / Audio / Subtitles) */
.p-osd-btns {
  display: flex; justify-content: center; gap: 12px;
  pointer-events: auto;
}
.p-osd-btns:empty { display: none; }
.p-osd-btn {
  padding: 12px 26px; border-radius: 10px;
  background: rgba(28,28,30,0.85); color: #fff;
  border: 2px solid transparent;
  font-size: 18px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.p-osd-btn .p-osd-sub { font-size: 12px; font-weight: 500; opacity: 0.65; }
.p-osd-btn:hover { background: rgba(255,255,255,0.15); }
.p-osd-btn.focused {
  background: var(--accent); border-color: #fff;
  box-shadow: 0 0 18px rgba(255,45,85,0.55);
  transform: scale(1.05);
}

/* Shared picker modal for Quality / Audio / Subtitles */
.player-picker {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  min-width: 320px; max-width: 420px; max-height: 70vh;
  background: rgba(12, 12, 16, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 20px 0 10px;
  display: none; flex-direction: column;
  z-index: 220;
  box-shadow: 0 24px 48px rgba(0,0,0,0.7);
}
.player-picker.visible { display: flex; animation: fadeIn 0.15s; }
.player-picker-title {
  padding: 0 24px 14px; font-size: 20px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.player-picker-list {
  flex: 1; overflow-y: auto; padding: 10px;
  scrollbar-width: none; scroll-behavior: smooth;
}
.player-picker-list::-webkit-scrollbar { display: none; }
.player-picker-section {
  padding: 14px 16px 4px; margin: 8px 6px 2px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.player-picker-section:first-child { margin-top: 0; padding-top: 4px; }
.player-picker-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin: 2px 6px; border-radius: 10px;
  color: #fff; font-size: 18px; cursor: pointer;
  border: 2px solid transparent;
}
.player-picker-item.active::after {
  content: '✓'; color: var(--accent); font-weight: 700;
}
.player-picker-item.focused {
  background: rgba(255,255,255,0.14);
  border-left: 3px solid var(--accent);
}
.player-picker-item .pp-badge {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 6px; margin-left: 8px;
}
/* One-tap recovery entry at the top of the Audio / Subtitles pickers.
   Visually separated from the track list so the user reads it as an
   action, not a selectable track. The ::after checkmark on .active never
   applies here because reload items have no "selected" state. */
.player-picker-item.pp-reload {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
}
.player-picker-item.pp-reload.focused {
  background: rgba(255,45,85,0.18);
  border-left: 3px solid var(--accent);
}

/* Player channel list */
.player-channels {
  position: absolute; left: 0; top: 0;
  width: 520px; height: 100%;
  background: rgba(6,6,10,0.88);
  /* backdrop-filter disabled for TV performance — use solid bg instead */
  display: none; flex-direction: column; z-index: 220;
}
.player-channels.visible { display: flex; animation: slideIn 0.2s var(--ease); }
.player-channels-header {
  padding: 32px 28px 20px; font-size: 28px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.pchan-header-title { font-size: 28px; font-weight: 700; color: #fff; }
.pchan-options-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
  font-size: 18px; font-weight: 600; cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.pchan-options-btn:hover { background: rgba(255,255,255,0.12); }
.pchan-options-btn.focused {
  background: var(--accent); color: #fff;
  border-color: #fff;
  box-shadow: 0 0 18px rgba(255,45,85,0.55);
}
.pchan-options-icon { font-size: 22px; }
.player-channels-list {
  flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: none;
}
.player-channels-list::-webkit-scrollbar { display: none; }

.pchan-category {
  font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 1.5px; padding: 24px 16px 10px;
}
.pchan-item {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 16px; border-radius: 12px;
  transition: background 0.15s;
}
.pchan-item.focused { background: rgba(255,255,255,0.14); }
.pchan-item.now-playing { background: rgba(48,209,88,0.12); }
.pchan-thumb {
  width: 90px; height: 52px; object-fit: contain;
  background: rgba(255,255,255,0.92); border-radius: 8px; flex-shrink: 0;
}
.pchan-name {
  font-size: 28px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.15s;
}
.pchan-item.focused .pchan-name { color: #fff; font-weight: 700; }
.pchan-item.now-playing .pchan-name::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  background: var(--green); border-radius: 50%; margin-right: 8px;
  animation: pulse 1.5s infinite; vertical-align: middle;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28,28,30,0.88);

  color: var(--text2); padding: 10px 22px; border-radius: 16px;
  font-size: 16px; font-weight: 500; z-index: 9000; opacity: 0;
  transition: all 0.3s ease; pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { color: var(--green); }
.toast.error { color: #ff453a; }
.toast.info { color: var(--text); }

/* ===== QUALITY PICKER ===== */
.quality-panel {
  position: absolute; right: 0; top: 0;
  width: 320px; height: 100%;
  background: rgba(10,10,14,0.95);
  display: none; flex-direction: column; z-index: 225;
}
.quality-panel.visible { display: flex; animation: slideIn 0.2s var(--ease); }
.quality-header {
  padding: 24px 20px 16px; font-size: 20px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.quality-list {
  flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: none;
}
.quality-list::-webkit-scrollbar { display: none; }
.quality-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s;
  color: var(--text2); font-size: 16px; font-weight: 500;
}
.quality-item.focused { background: rgba(255,255,255,0.1); }
.quality-item.active { color: #fff; font-weight: 700; }
.quality-item.active::after {
  content: ''; width: 8px; height: 8px;
  background: var(--green); border-radius: 50%;
}
.quality-item .q-res { color: var(--text3); font-size: 13px; margin-left: 8px; }
.quality-item .q-badge {
  font-size: 10px; background: rgba(255,255,255,0.08);
  padding: 2px 6px; border-radius: 3px; color: var(--text3);
}

/* ===== SETTINGS ===== */
.sb-settings {
  font-size: 14px; color: var(--text2); cursor: pointer;
  transition: color 0.15s;
}

.settings-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.85);

  z-index: 500; display: none;
  align-items: center; justify-content: center;
}
.settings-overlay.visible { display: flex; animation: fadeIn 0.2s; }

.settings-panel {
  width: 70%;
  max-width: 900px;
  max-height: 85%;
  background: rgba(20,20,24,0.97);
  border-radius: 18px;
  padding: 32px 0;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
}

.settings-title {
  font-size: 28px; font-weight: 700; color: var(--text);
  padding: 0 36px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.settings-list {
  padding: 6px 0;
  overflow-y: auto;
  scrollbar-width: none;
  flex: 1;
}
.settings-list::-webkit-scrollbar { display: none; }

.setting-section {
  font-size: 15px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 20px 36px 8px;
}

.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 36px;
  cursor: pointer;
  transition: background 0.12s;
}
.setting-item.focused {
  background: rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
}
.setting-label { font-size: 22px; font-weight: 600; color: var(--text); }
.setting-value { font-size: 18px; color: var(--text3); font-weight: 500; }
.setting-desc {
  font-size: 10px; color: var(--text3); font-weight: 400;
  margin-top: 2px;
}

/* ===== MULTI-VIEW ===== */
.multiview {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: #000; z-index: 400;
  display: none;
}
.multiview.visible { display: block; animation: fadeIn 0.2s; }

.mv-grid {
  display: grid;
  width: 100%; height: 100%;
  gap: 2px;
  padding: 2px;
  background: #0a0a0e;
  transition: grid-template-columns 0.3s, grid-template-rows 0.3s;
}
.mv-grid[data-layout="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mv-grid[data-layout="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.mv-grid[data-layout="3"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-grid[data-layout="3"] .mv-slot[data-slot="0"] { grid-row: 1 / 3; }
.mv-grid[data-layout="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.mv-slot { display: none; }
.mv-slot.active { display: block; }

.mv-slot.mv-add-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 2px dashed rgba(255,255,255,0.08);
  cursor: pointer;
}
.mv-slot.mv-add-slot video { display: none; }
.mv-slot.mv-add-slot .mv-audio { display: none; }
.mv-slot.mv-add-slot .mv-label {
  position: static;
  background: none;
  font-size: 12px;
  color: var(--text3);
  padding: 0;
}
.mv-slot.mv-add-slot.focused {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.mv-grid[data-layout="1"] .mv-slot.mv-add-slot {
  position: absolute;
  bottom: 40px; right: 14px;
  width: 120px; height: 32px;
  border-radius: 16px;
  background: rgba(28,28,30,0.7);

  border: 1px solid rgba(255,255,255,0.1);
  z-index: 5;
}
.mv-grid[data-layout="1"] .mv-slot.mv-add-slot .mv-label {
  font-size: 11px;
}
.mv-grid[data-layout="1"] .mv-slot.mv-add-slot.focused {
  background: rgba(28,28,30,0.9);
  border-color: rgba(255,255,255,0.25);
}

.mv-slot {
  position: relative;
  background: #0a0a0e;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.04);
  transition: border-color 0.2s;
}
.mv-slot.focused { border-color: rgba(255,255,255,0.3); }
.mv-slot.has-audio { border-color: rgba(255,255,255,0.04); }

.mv-slot video {
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}

.mv-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.7);
}

.mv-audio {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  animation: pulse 1.5s infinite;
  font-size: 0;
}
.mv-slot.has-audio .mv-audio { display: block; }

.mv-close {
  display: none;
  position: absolute; top: 8px; left: 8px;
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.7); color: #fff;
  border-radius: 50%; font-size: 18px; line-height: 28px;
  text-align: center; cursor: pointer; z-index: 5;
}
.device-mobile .mv-close,
.device-browser .mv-close { display: block; }
.device-tv .mv-close { display: none; }
.mv-slot.mv-add-slot .mv-close { display: none; }

.mv-hint {
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.8);

  color: var(--text3); font-size: 11px; font-weight: 500;
  padding: 6px 14px; border-radius: 14px;
  white-space: nowrap;
}

/* ===== PERF ===== */
.card, .feat-card, .player-overlay, .toast, .ch-splash { will-change: transform; }
.card, .feat-card { transform: translateZ(0); }
.rows, .row-scroll, .player-channels-list { -webkit-overflow-scrolling: touch; }

@keyframes shake { 0%,100% { transform:translateX(0); } 20%,60% { transform:translateX(-8px); } 40%,80% { transform:translateX(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideIn { from { transform:translateX(-14px); opacity:0; } to { transform:translateX(0); opacity:1; } }

/* ===== MOUSE/TOUCH INTERACTION (browser & mobile) ===== */
.has-mouse .card:hover,
.has-touch .card:active {
  transform: scale(1.04) translateY(-3px);
  border-color: rgba(255,255,255,0.2);
  cursor: pointer;
}
.has-mouse .feat-card:hover,
.has-touch .feat-card:active { cursor: pointer; }
.has-mouse .setting-item:hover {
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.has-mouse .pchan-item:hover {
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.has-mouse .sb-refresh-btn:hover,
.has-mouse .sb-settings-btn:hover { cursor: pointer; }
.has-mouse .player-overlay.pip:hover { cursor: pointer; }

/* Hide keyboard-only hints on non-TV */
.device-mobile .osd-hint,
.device-browser .osd-hint { display: none; }
.device-mobile .mv-hint,
.device-browser .mv-hint { display: none; }

/* TV-only settings items */
.device-tv-only { display: none; }
.device-tv .device-tv-only { display: flex; }

/* ===== MOBILE RESPONSIVE ===== */
/* ===== TV / VIDAA — Remote-only focus ===== */
.device-tv .card.focused {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
  border-color: #fff;
  z-index: 10;
}
.device-tv .card { cursor: default; }
.device-tv .cm-btn { cursor: default; }
.device-tv .dtl-cast-item { cursor: default; }
.device-tv .cm-genre { cursor: default; }

/* ===== MOBILE ===== */
.device-mobile {
  width: 100% !important;
  height: auto !important;
  min-height: 100vh;
  transform: none !important;
  overflow-x: hidden;
  overflow-y: auto !important;
}
.device-mobile .statusbar {
  height: auto; min-height: 44px;
  padding: 8px 12px;
  position: sticky; top: 0;
  z-index: 100;
  flex-wrap: wrap; gap: 6px;
}
.device-mobile .sb-left { gap: 5px; flex-shrink: 0; }
.device-mobile .sb-logo { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.device-mobile .sb-brand { font-size: 12px; letter-spacing: 0.3px; white-space: nowrap; }
.device-mobile .sb-clock { font-size: 12px; display: none; }
.device-mobile .sb-center { display: none; }
.device-mobile .sb-right { gap: 4px; }
.device-mobile .sb-settings-btn,
.device-mobile .sb-refresh-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.device-mobile .sb-settings-btn svg,
.device-mobile .sb-refresh-btn svg { width: 18px; height: 18px; }
.device-mobile .tab-strip {
  padding: 0; width: 100%; order: 10;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start; gap: 0;
}
.device-mobile .tab-strip::-webkit-scrollbar { display: none; }
.device-mobile .tab {
  font-size: 12px; padding: 6px 12px; white-space: nowrap;
  flex-shrink: 0;
}

.device-mobile .featured {
  position: relative !important; top: auto !important;
  height: auto !important; min-height: 0;
  padding: 12px 16px;
  gap: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.device-mobile .feat-card {
  flex: 0 0 280px; min-width: 0; max-width: 85vw;
  border-radius: 10px;
  height: 140px;
}
.device-mobile .feat-name { font-size: 16px; }
.device-mobile .feat-cat { font-size: 10px; }
.device-mobile .feat-overlay { padding: 24px 14px 12px; }
.device-mobile .feat-live { font-size: 8px; margin-bottom: 3px; }

.device-mobile .rows {
  position: relative !important; top: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  padding: 0 0 80px;
}
.device-mobile .row { margin-bottom: 4px; }
.device-mobile .row-title { font-size: 14px; padding: 10px 16px 4px; }
.device-mobile .row-scroll {
  flex-wrap: wrap;
  overflow-x: hidden;
  padding: 8px 16px 12px;
  gap: 10px;
}
.device-mobile .card {
  width: calc(33.33% - 8px); min-width: 0; flex-shrink: 0;
}
@media (max-width: 480px) {
  .device-mobile .card { width: calc(50% - 6px); }
  .device-mobile .feat-card { min-width: 0; max-width: 85vw; height: 120px; }
}
@media (max-width: 360px) {
  .device-mobile .card { width: calc(50% - 6px); }
}
.device-mobile .card-name { font-size: 10px; }
.device-mobile .card-info { padding: 4px 5px 5px; }
.device-mobile .card-meta { gap: 2px; margin-top: 2px; }
.device-mobile .card-cat { font-size: 8px; }
.device-mobile .badge { font-size: 6px; padding: 1px 3px; }
.device-mobile .card-poster { border-radius: 6px 6px 0 0; }
.device-mobile .card {
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.device-mobile .card:active {
  transform: scale(0.96);
  opacity: 0.8;
}
.device-mobile .feat-card {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.device-mobile .feat-card:active {
  transform: scale(0.98);
  opacity: 0.85;
}

/* Mobile player */
.device-mobile .player-overlay.pip {
  width: 180px; height: 101px;
  top: 56px; right: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.device-mobile .player-overlay.active:not(.pip) {
  cursor: pointer;
}
.device-mobile .player-channels {
  width: 100%;
}
.device-mobile .player-channels-header {
  padding: 16px 16px 12px;
  font-size: 16px;
}
.device-mobile .pchan-item {
  padding: 12px 12px;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.device-mobile .pchan-item:active {
  background: rgba(255,255,255,0.12);
}
.device-mobile .pchan-name { font-size: 14px; }
.device-mobile .pchan-thumb { width: 52px; height: 30px; }

/* Mobile settings */
.device-mobile .settings-overlay { align-items: flex-end; }
.device-mobile .settings-panel {
  width: 100vw; max-width: 100%;
  border-radius: 16px 16px 0 0;
  max-height: 85vh;
  padding: 20px 0 env(safe-area-inset-bottom, 16px);
}
.device-mobile .settings-title {
  font-size: 18px;
  padding: 0 20px 14px;
}
.device-mobile .setting-section {
  font-size: 11px;
  padding: 14px 20px 4px;
}
.device-mobile .setting-item {
  padding: 16px 20px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.device-mobile .setting-item:active {
  background: rgba(255,255,255,0.1);
}
.device-mobile .setting-label { font-size: 16px; }
.device-mobile .setting-value { font-size: 14px; }

/* Mobile channel splash */
.device-mobile .ch-splash-img { width: 100px; height: 56px; }
.device-mobile .ch-splash-name { font-size: 18px; }
.device-mobile .ch-splash-bar { width: 60vw; }
.device-mobile .toast {
  bottom: env(safe-area-inset-bottom, 16px);
  font-size: 13px;
  max-width: 90vw;
}

/* Mobile auth */
/* The auth-digit / auth-logo / auth-msg sizing now uses viewport-aware
   clamp() rules (see "AUTH SCREEN" block above) so they reflow on any
   width whether or not Device.detect tagged the body. The only mobile-
   specific bit left is killing the tap highlight that flashes blue
   when the user taps a digit box on Android Chrome. */
.device-mobile .auth-digit { -webkit-tap-highlight-color: transparent; }

/* ===== MOBILE — Content Screens (Movies, Drama, IPTV) ===== */
.device-mobile .content-screen {
  position: relative !important; top: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  padding: 0 0 80px;
}
.device-mobile .cm-genre-strip {
  padding: 12px 16px;
  gap: 8px;
}
.device-mobile .cm-genre {
  padding: 6px 16px; font-size: 13px; border-radius: 16px;
}
.device-mobile .cm-search-input {
  width: 100%; min-width: 0; font-size: 14px;
  padding: 10px 14px; border-radius: 16px;
}
.device-mobile .cm-search-input:focus {
  width: 100%; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,45,85,0.2);
}
.device-mobile .cm-row-title { font-size: 15px; padding: 10px 16px 2px; }
.device-mobile .cm-row-scroll {
  padding: 12px 16px 18px; gap: 10px;
}
.device-mobile .cm-card.card { width: 120px; }
.device-mobile .cm-card .card-name { font-size: 11px; }
.device-mobile .cm-card .card-info { padding: 5px 7px 7px; }
.device-mobile .cm-card-overlay { padding: 4px 6px; }
.device-mobile .cm-card-overlay .card-cat { font-size: 10px; }
.device-mobile .cm-card-overlay .badge-rating { font-size: 8px; }
@media (max-width: 480px) {
  .device-mobile .cm-card.card { width: 100px; }
}

/* Mobile — Detail page */
.device-mobile .cm-detail {
  position: fixed; inset: 0; z-index: 200;
  overflow-y: auto; background: var(--bg);
}
.device-mobile .dtl-hero { height: 280px; }
.device-mobile .dtl-back {
  top: 10px; left: 16px;
  padding: 6px 14px 6px 10px; font-size: 12px;
}
.device-mobile .dtl-hero-info { left: 16px; max-width: 70%; bottom: 20px; }
.device-mobile .dtl-logo { max-width: 180px; max-height: 60px; }
.device-mobile .dtl-title { font-size: 22px; }
.device-mobile .dtl-genres { font-size: 11px; }
.device-mobile .dtl-meta-row { font-size: 12px; gap: 10px; margin-bottom: 10px; }
.device-mobile .cm-btn { padding: 8px 20px; font-size: 13px; border-radius: 8px; }
.device-mobile .dtl-body { padding: 0 0 60px; }
.device-mobile .dtl-overview { padding: 12px 16px 0; font-size: 13px; }
.device-mobile .dtl-section-title { font-size: 16px; padding: 0 16px 8px; }
.device-mobile .dtl-cast-row { padding: 6px 16px 10px; gap: 12px; }
.device-mobile .dtl-cast-item { width: 80px; padding: 4px; }
.device-mobile .dtl-cast-photo { width: 60px; height: 60px; }
.device-mobile .dtl-cast-name { font-size: 10px; }
.device-mobile .dtl-cast-role { font-size: 9px; }
.device-mobile .dtl-card-row { padding: 6px 16px 12px; gap: 10px; }
.device-mobile .dtl-rec-card.card { width: 140px; }
@media (max-width: 480px) {
  .device-mobile .dtl-hero { height: 220px; }
  .device-mobile .dtl-rec-card.card { width: 120px; }
}
.device-mobile .cm-season-strip { padding: 8px 16px; }
.device-mobile .cm-season-btn { padding: 6px 14px; font-size: 12px; }
.device-mobile .cm-ep-card { width: 160px; }

/* Mobile — Actor page */
.device-mobile .dtl-actor-photo { width: 80px; height: 80px; }
.device-mobile .dtl-hero-actor { height: 260px; }

/* Mobile — Football/Events */
.device-mobile .football-screen {
  position: relative !important; top: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  padding: 0 0 80px !important;
}
.device-mobile .fb-featured {
  padding: 10px 16px;
}
.device-mobile .fb-filters {
  display: flex !important;
  overflow-x: auto !important; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap !important; padding: 8px 16px !important;
  gap: 8px;
}
.device-mobile .fb-filters::-webkit-scrollbar { display: none; }
.device-mobile .fb-filter {
  flex-shrink: 0 !important; padding: 6px 14px; font-size: 12px;
  white-space: nowrap;
}
.device-mobile .fb-filter-sep { font-size: 14px; flex-shrink: 0; }
.device-mobile .fb-match-list { padding: 0 16px; }
.device-mobile .fb-match-card { width: 200px; }
.device-mobile .fb-league-title { font-size: 14px; padding: 8px 0 4px; }
@media (max-width: 480px) {
  .device-mobile .fb-match-card { width: 180px; }
}

/* Mobile — IPTV */
.device-mobile .iptv-card { width: 130px; }
@media (max-width: 480px) {
  .device-mobile .iptv-card { width: 110px; }
}

/* Mobile — Focus styles (lighter than TV but still visible) */
.device-mobile .card.focused {
  border-color: var(--accent); z-index: 5;
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
}
.device-mobile .cm-genre.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
}
.device-mobile .cm-btn.focused {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.device-mobile .dtl-cast-item.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
}
.device-mobile .cm-season-btn.focused {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.device-mobile .dtl-back.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
}
.device-mobile .fb-filter.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
}
/* Touch tap feedback */
.device-mobile .card:active {
  transform: scale(0.96); opacity: 0.85;
  transition: transform 0.1s;
}
.device-mobile .cm-btn:active { transform: scale(0.95); opacity: 0.85; }
.device-mobile .dtl-back:active { transform: scale(0.95); opacity: 0.85; }
.device-mobile .dtl-cast-item:active { transform: scale(0.95); opacity: 0.85; }
.device-mobile .cm-genre:active { transform: scale(0.95); opacity: 0.85; }
.device-mobile .cm-season-btn:active { transform: scale(0.95); opacity: 0.85; }
.device-mobile .fb-filter:active { transform: scale(0.95); opacity: 0.85; }

/* ===== BROWSER RESPONSIVE ===== */
.device-browser {
  width: 100% !important;
  height: auto !important;
  min-height: 100vh;
  transform: none !important;
  overflow-x: hidden;
  overflow-y: auto !important;
}
.device-browser .statusbar { position: sticky; top: 0; z-index: 100; }
.device-browser .tab-strip {
  padding: 0;
}
.device-browser .featured {
  position: relative !important; top: auto !important;
  height: auto !important; min-height: 0;
  flex-wrap: wrap;
}
.device-browser .rows {
  position: relative !important; top: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  padding-bottom: 80px;
}

/* Browser — Content screens */
.device-browser .content-screen {
  position: relative !important; top: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  padding: 0 0 80px;
}

/* Browser — Mouse hover states */
.device-browser .card:hover {
  transform: scale(1.03) translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.3);
  cursor: pointer;
}
.device-browser .cm-btn:hover { cursor: pointer; opacity: 0.85; }
.device-browser .dtl-cast-item:hover {
  background: rgba(255,255,255,0.08); cursor: pointer;
}
.device-browser .cm-genre:hover {
  background: rgba(255,255,255,0.12); cursor: pointer;
}
.device-browser .cm-season-btn:hover {
  background: rgba(255,255,255,0.15); cursor: pointer;
}
.device-browser .dtl-back:hover { cursor: pointer; }

/* Browser — Focus ring for keyboard nav, hover for mouse */
.device-browser .card.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,85,0.3);
  z-index: 5;
}

/* Browser — Detail page scrollable */
.device-browser .cm-detail {
  position: fixed; inset: 0; z-index: 200;
  overflow-y: auto; background: var(--bg);
}

/* ===== TABS (duplicate removed — styles at line 163) ===== */

/* ===== CONTENT SCREENS (Movies, Drama, IPTV) ===== */
/* Content screens — same scroll container pattern as TV .rows */
.content-screen {
  position: fixed; top: 96px; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 0 0 300px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.content-screen::-webkit-scrollbar { display: none; }

/* Sticky filter bar — stays below status bar on scroll */
.cm-filters-bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Genre/Category strip — positioned like .row-title with var(--pad) */
.cm-genre-strip {
  display: flex; gap: 10px; padding: 20px var(--pad) 12px;
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
  align-items: center;
}
.cm-genre-strip::-webkit-scrollbar { display: none; }
.cm-genre {
  padding: 8px 22px; border-radius: 20px;
  font-size: 16px; font-weight: 600; color: var(--text2);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.cm-genre.focused {
  border-color: #fff; color: #fff; transform: scale(1.03);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.cm-genre.cm-genre-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* Search input — inline at end of genre strip */
.cm-search-input {
  width: 200px; padding: 8px 16px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.1);
  border-radius: 20px; color: #fff; font-size: 14px; outline: none;
  transition: border-color 0.2s, width 0.2s, box-shadow 0.2s;
}
.cm-search-input:focus {
  border-color: var(--accent); width: 300px;
  box-shadow: 0 0 0 3px rgba(255,45,85,0.2);
}
.cm-search-input::placeholder { color: rgba(255,255,255,0.3); }

/* Content rows — mirrors TV .row / .row-title / .row-scroll */
.cm-rows { padding: 0 0 40px; }
.cm-row {
  margin-bottom: 28px;
  position: relative;
  overflow: visible;
}
.cm-row-title {
  font-size: 18px; font-weight: 700; color: rgba(255,255,255,0.85);
  padding: 12px var(--pad) 2px;
  display: flex; align-items: baseline; gap: 8px;
}
.cm-row-scroll {
  display: flex; flex-wrap: nowrap; gap: 28px;
  padding: 28px var(--pad) 30px;
  overflow-x: auto; overflow-y: clip;
  scrollbar-width: none;
}
.cm-row-scroll::-webkit-scrollbar { display: none; }
.cm-row-scroll::after {
  content: ''; flex-shrink: 0; width: var(--pad); min-width: var(--pad);
}
.cm-card.card { width: 220px; flex-shrink: 0; }
.cm-poster-wrap { position: relative; }
.cm-poster {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  background: var(--surface); display: block; border-radius: var(--radius) var(--radius) 0 0;
}
.cm-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  font-size: 11px;
}
.cm-card-overlay .card-cat { color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 500; }
.cm-card-overlay .badge-rating { font-size: 10px; }
.cm-card .card-info { padding: 8px 10px 10px; }
.cm-card .card-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-rating { background: rgba(245,197,24,0.2); color: #f5c518; }

/* Loading */
.cm-loading {
  display: none; align-items: center; justify-content: center;
  gap: 12px; padding: 60px var(--pad); color: rgba(255,255,255,0.6); font-size: 14px;
}
.cm-empty { padding: 60px var(--pad); text-align: center; color: rgba(255,255,255,0.4); font-size: 14px; }

/* ===== Detail Screen — Full hero backdrop ===== */
.dtl-hero {
  position: relative; width: 100%; height: 440px; overflow: hidden;
}
.dtl-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
}
.dtl-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%),
              linear-gradient(to right, rgba(0,0,0,0.6) 0%, transparent 70%);
}
.dtl-back {
  position: absolute; top: 14px; left: var(--pad); z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 18px 8px 14px; border-radius: 20px;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(8px); transition: all 0.15s;
  font-family: inherit; letter-spacing: 0.3px;
}
.dtl-back:hover, .dtl-back:focus, .dtl-back.focused {
  background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4);
  color: #fff; outline: none;
}
/* Actor detail page */
.dtl-hero-actor { height: 360px; }
.dtl-actor-info {
  display: flex; align-items: flex-end; gap: 20px;
  max-width: 80%;
}
.dtl-actor-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.2); flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}
.dtl-actor-details { min-width: 0; }

.dtl-hero-info {
  position: absolute; bottom: 30px; left: var(--pad); z-index: 1;
  max-width: 50%;
}
.dtl-logo {
  max-width: 280px; max-height: 80px; object-fit: contain;
  margin-bottom: 8px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}
.dtl-title {
  font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.dtl-genres {
  font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 6px;
}
.dtl-meta-row {
  display: flex; gap: 16px; font-size: 14px; color: rgba(255,255,255,0.75);
  margin-bottom: 14px;
}
.dtl-actions { display: flex; gap: 12px; }
.cm-btn {
  padding: 10px 28px; border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cm-btn-play { background: rgba(255,255,255,0.95); color: #000; }
.cm-btn-trailer { background: rgba(255,255,255,0.15); color: #fff; }
.cm-btn.focused { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.05); }

/* Detail body */
.dtl-body { padding: 0 0 100px; }
.dtl-overview {
  font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.7;
  padding: 16px var(--pad) 0; max-height: 80px; overflow: hidden;
  position: relative;
}
.dtl-more {
  color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600;
  margin-top: 4px; cursor: pointer;
}
.dtl-section {
  margin-top: 20px;
  overflow: visible;
}
.dtl-section-title {
  font-size: 18px; font-weight: 700; color: rgba(255,255,255,0.85);
  padding: 0 var(--pad) 10px;
}

/* Cast row — horizontal scroll */
.dtl-cast-row {
  display: flex; gap: 16px; overflow-x: auto; overflow-y: visible;
  scrollbar-width: none; padding: 8px var(--pad) 12px;
}
.dtl-cast-row::-webkit-scrollbar { display: none; }
.dtl-cast-row::after { content: ''; flex-shrink: 0; width: var(--pad); min-width: var(--pad); }
.dtl-cast-item {
  flex-shrink: 0; width: 110px; text-align: center;
  cursor: pointer; padding: 8px 6px; border-radius: 12px;
  transition: all 0.15s; border: 2px solid transparent;
}
.dtl-cast-item.focused {
  border-color: #fff; background: rgba(255,255,255,0.1);
  transform: scale(1.03);
}
.dtl-cast-photo {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  background: rgba(255,255,255,0.08);
}
.dtl-cast-name {
  font-size: 12px; color: #fff; margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dtl-cast-role {
  font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Recommendation / Similar card row — horizontal scroll */
.dtl-card-row {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: visible;
  scrollbar-width: none; padding: 8px var(--pad) 14px;
}
.dtl-card-row::-webkit-scrollbar { display: none; }
.dtl-card-row::after { content: ''; flex-shrink: 0; width: var(--pad); min-width: var(--pad); }
.dtl-rec-card.card {
  flex-shrink: 0; width: 220px; cursor: pointer;
}

/* Legacy detail compat */
.cm-detail-actions { display: flex; gap: 12px; margin-top: 8px; }
.cm-btn-back { background: rgba(255,255,255,0.1); color: #fff; }

/* Season/Episode picker */
.cm-season-strip {
  display: flex; gap: 8px; padding: 12px var(--pad) 12px; overflow-x: auto; scrollbar-width: none;
}
.cm-season-strip::-webkit-scrollbar { display: none; }
.cm-season-btn {
  padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.cm-season-btn.cm-season-active { background: var(--accent); color: #fff; }
.cm-season-btn.focused { outline: 2px solid #fff; outline-offset: 2px; }
.cm-episode-grid, .dtl-card-row .cm-ep-wrap {
  display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--pad);
}
.cm-episode-grid::-webkit-scrollbar { display: none; }
.cm-ep-card {
  width: 200px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.06); cursor: pointer; transition: all 0.15s;
}
.cm-ep-card.focused { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.03); }
.cm-ep-still { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.cm-ep-info { padding: 8px 10px; }
.cm-ep-num { font-size: 13px; color: rgba(255,255,255,0.9); font-weight: 600; }
.cm-ep-date { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* Videasy player overlay — must be outside .content-screen stacking context */
/* JS appends these to document.body so z-index works against statusbar */
.cm-player {
  position: fixed; inset: 0; z-index: 9999; background: #000;
}
/* Detail also needs root-level positioning */
.cm-detail {
  position: fixed; inset: 0; z-index: 9998; background: var(--bg);
  overflow-y: auto;
}
.cm-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; z-index: 1; }
.cm-player-trap { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.cm-player-osd {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,0.6), transparent);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.cm-player-osd.visible { opacity: 1; pointer-events: auto; }
.cm-player-back {
  background: rgba(255,255,255,0.12); color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.cm-player-back:hover { background: rgba(255,255,255,0.25); }
.cm-player-loading {
  position: absolute; inset: 0; z-index: 4;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  /* Solid black fallback — fully hides the iframe (and any Videasy chrome / ad
     flash) behind the spinner until real playback begins. openPlayer sets an
     inline background-image (the 16:9 movie/episode cover) over this, with a
     dark gradient scrim baked in so the spinner stays readable. */
  background: #000; gap: 8px;
  background-size: cover; background-position: center;
}
.cm-player-loading.visible { display: flex; }
.cm-player-ep-info { font-size: 14px; color: rgba(255,255,255,0.7); }
.cm-player-hint {
  position: absolute; bottom: 80px; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.cm-player-hint-text {
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 14px 32px; border-radius: 12px;
  font-size: 18px; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: hintPulse 2s ease-in-out infinite;
}
.cm-player-hint-text b { color: var(--accent, #ff2d55); font-weight: 700; }
@keyframes hintPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

/* Episode picker — overlaid on player for drama */
.ep-picker {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 10000;
  width: 520px; max-width: 90vw;
  background: rgba(6, 6, 10, 0.88);
  display: none; flex-direction: column;
  font-family: -apple-system, system-ui, sans-serif;
}
.ep-picker.visible { display: -webkit-flex; display: flex; animation: slideIn 0.2s var(--ease); }
.ep-picker-head {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  padding: 32px 28px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ep-picker-title { flex: 1; color: #fff; font-size: 28px; font-weight: 700; }
.ep-picker-season-nav {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 12px;
}
.ep-picker-season {
  color: rgba(255,255,255,0.5); font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,0.06); padding: 6px 14px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ep-picker-arrow {
  color: rgba(255,255,255,0.6); font-size: 14px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  background: rgba(255,255,255,0.08);
}
.ep-picker-arrow:hover { background: rgba(255,255,255,0.15); color: #fff; }
.ep-picker-list { flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: none; }
.ep-picker-list::-webkit-scrollbar { display: none; }
.ep-picker-item {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  padding: 18px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px; gap: 18px;
}
.ep-picker-item.focused {
  background: rgba(255,255,255,0.14);
  border-left: 3px solid var(--accent);
}
.ep-picker-item.current { background: rgba(255,255,255,0.04); }
.ep-picker-item.current::after {
  content: 'NOW'; font-size: 12px; font-weight: 700; color: var(--accent);
  margin-left: auto; flex-shrink: 0;
}
.ep-picker-thumb {
  width: 100px; height: 58px; border-radius: 8px; object-fit: cover;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
}
.ep-picker-info { flex: 1; min-width: 0; }
.ep-picker-ep { color: #fff; font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-picker-item.focused .ep-picker-ep { font-weight: 700; }
.ep-picker-date { color: rgba(255,255,255,0.35); font-size: 14px; margin-top: 4px; }

/* IPTV specific */
/* IPTV Home bar — search + title */
.iptv-home-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px var(--pad) 8px;
  position: sticky; top: 0; z-index: 10; background: var(--bg);
}
.iptv-search-wrap {
  position: relative; flex: 0 0 280px;
}
.iptv-home-search {
  width: 100%; height: 40px;
  background: rgba(255,255,255,0.08); border: 2px solid transparent;
  border-radius: 10px; color: #fff; font-size: 15px;
  padding: 0 36px 0 14px; outline: none; box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.iptv-home-search:focus, .iptv-home-search.focused {
  border-color: var(--accent, #ff2d55);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(255,45,85,0.2);
}
.iptv-home-search::placeholder { color: rgba(255,255,255,0.35); }
.iptv-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: none;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border-radius: 50%;
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  line-height: 1;
}
.iptv-home-title {
  font-size: 22px; font-weight: 800; color: #fff;
}
.iptv-home-count {
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.4); margin-left: 8px;
}

/* IPTV back button in header bar */
.iptv-cat-back-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border-radius: 8px;
  color: rgba(255,255,255,0.6); font-size: 18px; font-weight: 700;
  cursor: pointer;
}
.iptv-cat-grid {
  display: flex; flex-wrap: wrap; gap: 20px;
  padding: 20px var(--pad) 300px;
}

/* Category card — large visual tile */
.iptv-cat-card { width: 220px; }
.iptv-cat-icon {
  width: 100%; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.iptv-cat-initial {
  font-size: 36px; font-weight: 800; color: rgba(255,255,255,0.3);
  text-transform: uppercase;
}

/* Channel card — visual card matching TV channel cards */
.iptv-card { width: 220px; }
.iptv-card-poster {
  width: 100%; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  background: #111;
}
.iptv-card-logo {
  width: 100%; height: 100%;
  object-fit: contain; padding: 16px;
}
.iptv-card-placeholder {
  font-size: 36px; font-weight: 800; color: rgba(255,255,255,0.15);
}
.iptv-flag {
  width: 56px; height: auto; border-radius: 4px;
  object-fit: contain; display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.iptv-flag-sm {
  width: 16px; height: 12px; border-radius: 2px;
  object-fit: cover; vertical-align: middle;
}

/* IPTV Player — reuses TV player CSS classes directly:
   .ch-splash, .player-osd, .player-channels, .pchan-item etc. */
.iptv-player-overlay {
  position: fixed; inset: 0; z-index: 9999; background: #000; display: none;
}
.iptv-player-overlay video { width: 100%; height: 100%; object-fit: contain; }

/* ===== FOOTBALL SCREEN ===== */
.football-screen {
  position: fixed;
  top: 96px; left: 0; right: 0; bottom: 0;
  padding: 0 var(--pad) 300px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 18;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.football-screen::-webkit-scrollbar { display: none; }

/* Filters */
/* Featured matches banner (Events tab — same layout as TV .featured) */
.fb-featured {
  display: flex; gap: 20px;
  margin: 0 calc(-1 * var(--pad));
  padding: 16px var(--pad) 16px;
  overflow-x: auto; overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.fb-featured:empty { display: none; }
.fb-featured::-webkit-scrollbar { display: none; }

/* Highlights screen — matches .football-screen layout */
.highlights-screen {
  position: fixed;
  top: 96px; left: 0; right: 0; bottom: 0;
  padding: 0 var(--pad) 100px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.highlights-screen::-webkit-scrollbar { display: none; }
/* Section block — mirrors the Live Channels .row rhythm so Highlights
   feels visually consistent across tabs. */
.fb-highlights-section { padding: 0; margin-bottom: 28px; overflow: visible; }
.fb-section-title {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.85);
  padding: 8px 0 4px;
  display: flex; align-items: baseline; gap: 8px;
}
/* Grid wraps like before but uses the same gap + padding as .row-scroll,
   and now holds 16:9 cards (same shape as TV channel cards) so more fit
   per row and the ultra-wide 3:1 look is gone. */
.fb-highlights-grid {
  display: flex; flex-wrap: wrap; gap: 32px;
  padding: 24px 0 30px;
  overflow: visible;
}
.fb-hl-card.card { width: 220px; }                         /* match .card width */
.fb-hl-card .fbc-poster { aspect-ratio: 16/9; position: relative; }
.fb-hl-card .fbc-logos { gap: 6px; }
.fb-hl-card .fbc-team-logo { width: 42px; height: 42px; min-width: 42px; }
.fb-hl-card .fbc-team-logo img { width: 34px; height: 34px; }
.fb-hl-card .fbc-score { font-size: 16px; }
.fb-hl-play-icon {
  position: absolute; bottom: 8px; right: 8px;
  opacity: 0.5; transition: opacity 0.2s;
  pointer-events: none;
}
.fb-hl-card:hover .fb-hl-play-icon,
.fb-hl-card.focused .fb-hl-play-icon { opacity: 1; }
.fb-hl-card .card-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 16px; color: #fff;
}
.fb-hl-card .card-meta { flex-wrap: nowrap; font-size: 13px; }
.fb-hl-card .card-meta .card-cat { color: rgba(255,255,255,0.7); }
.fb-hl-card .card-meta .badge-ft { color: #fff; background: rgba(255,255,255,0.2); }
.fb-hl-detail { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 3px; }

/* Highlight Player Overlay */
.hl-player-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: #000;
}
#hlYtContainer, .hl-player-overlay iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none; z-index: 1;
}
.hl-player-trap {
  position: absolute; inset: 0; z-index: 2; cursor: pointer;
}
.hl-player-loading {
  position: absolute; inset: 0; z-index: 4;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); gap: 12px;
}
.hl-player-loading.visible { display: flex; }
.hl-loading-text { font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 500; }
.hl-player-osd {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.hl-player-osd.visible { opacity: 1; pointer-events: auto; }
.hl-osd-top {
  padding: 16px 20px;
  background: linear-gradient(rgba(0,0,0,0.6), transparent);
}
.hl-osd-bottom {
  padding: 16px 20px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
.hl-player-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.4);
  padding: 10px 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.hl-player-back:hover { background: rgba(255,255,255,0.25); color: #fff; }
.hl-player-back.hl-ctrl-focused { color: #fff; background: rgba(229,9,20,0.8); border-color: #e50914; outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }
.hl-player-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.hl-progress-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; overflow: hidden; cursor: pointer;
}
.hl-progress-fill {
  height: 100%; background: var(--accent); border-radius: 3px; width: 0%; transition: width 0.3s;
}
.hl-progress-time { font-size: 15px; color: rgba(255,255,255,0.7); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hl-player-controls {
  display: flex; align-items: center; justify-content: center; gap: 22px;
}
.hl-ctrl {
  color: rgba(255,255,255,0.7); font-size: 16px; cursor: pointer; padding: 12px 18px;
  border-radius: 8px; transition: all 0.2s; user-select: none;
}
.hl-ctrl:hover, .hl-ctrl.hl-ctrl-focused { color: #fff; background: rgba(255,255,255,0.15); }
.hl-ctrl.hl-ctrl-focused { outline: 2px solid #e50914; outline-offset: 2px; box-shadow: 0 0 10px rgba(229,9,20,0.6); }
.hl-ctrl-play {
  font-size: 28px; color: #fff; width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
}
.hl-ctrl-play:hover, .hl-ctrl-play.hl-ctrl-focused { background: var(--accent); border-color: var(--accent); outline: none; }
.hl-ctrl-sm {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  font-size: 15px; padding: 10px 16px; border-radius: 8px;
}
.hl-ctrl-sm:hover { background: rgba(255,255,255,0.2); }
#hlCtrlSubs { margin-left: auto; }

/* Highlight player modal (quality/subs picker) */
.hl-modal-overlay { position:fixed; inset:0; z-index:100001; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; }
.hl-modal { background:#1a1a1a; border-radius:12px; padding:24px; min-width:280px; max-width:380px; max-height:70vh; overflow-y:auto; border:1px solid rgba(255,255,255,0.1); }
.hl-modal-title { color:#fff; font-size:20px; font-weight:700; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid rgba(255,255,255,0.1); }
.hl-modal-item { color:rgba(255,255,255,0.7); font-size:17px; padding:14px 16px; border-radius:8px; cursor:pointer; transition:all 0.15s; margin-bottom:4px; display:flex; align-items:center; gap:10px; }
.hl-modal-item:hover { background:rgba(255,255,255,0.1); color:#fff; }
.hl-modal-item.hl-modal-active { color:#e50914; font-weight:700; }
.hl-modal-item.hl-modal-active::before { content:'\2713'; font-weight:700; font-size:16px; }
.hl-modal-item.hl-modal-focused { background:rgba(229,9,20,0.2); color:#fff; outline:2px solid #e50914; outline-offset:-2px; }

.fb-filters {
  display: flex; gap: 10px; margin-bottom: 12px; padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.fb-filter {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 16px; font-weight: 600;
  color: var(--text2);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.15s;
}
.fb-filter.filter-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fb-filter.focused {
  border-color: #fff;
  transform: scale(1.03);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.fb-filter-sep {
  color: #444; font-size: 18px; display: flex; align-items: center; padding: 0 2px; user-select: none;
}
.fb-sport-filter.sport-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Date headers */
.fb-date-header {
  font-size: 18px; font-weight: 700; color: var(--text);
  padding: 8px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}

/* League groups — same vertical rhythm as the Live Channels .row on the
   TV tab (margin-bottom: 28px) so Events doesn't feel visually cramped
   compared to the home grid. */
.fb-league { margin-bottom: 28px; overflow: visible; }
.fb-league-header {
  display: flex; align-items: center; gap: 8px;
  /* 0 horizontal padding — the parent .football-screen already applies
     --pad on both sides, so anything extra here would double-indent the
     league row relative to the "Today" date header. */
  padding: 8px 0 4px;
}
.fb-league-logo { width: 22px; height: 22px; object-fit: contain; }
.fb-league-name { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.85); }
.fb-league-country {
  font-size: 14px; color: rgba(255,255,255,0.7); font-weight: 400;
}
.fb-league-country::before {
  content: '·'; margin-right: 8px; color: var(--text3);
}
.fb-league-cards {
  display: flex; gap: 32px;
  overflow-x: auto; overflow-y: visible;
  flex-wrap: nowrap;
  /* 6px left padding with matching negative margin — keeps the first
     card visually aligned with the league title while giving the focus
     border breathing room so scale(1.03) + 2px border isn't clipped by
     the parent's overflow-x: hidden. */
  padding: 24px 0 20px 6px;
  margin-left: -6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.fb-league-cards::-webkit-scrollbar { display: none; }
.fb-league-cards::after {
  content: ''; flex-shrink: 0; width: var(--pad); min-width: var(--pad);
}

/* Match cards — uses standard .card sizing, custom poster area */
.fb-match-card { flex-shrink: 0; }
.fb-match-card .card-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.fb-match-card .card-meta { flex-wrap: wrap; }
.fb-match-card.fb-disabled {
  opacity: 0.9;
}
.fb-match-card.fb-disabled .fbc-poster {
  filter: grayscale(0.4);
}
.fb-match-card.fb-disabled .fbc-play { opacity: 0.3; }

/* Unavailable event modal */
.fb-unavailable-modal {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.75); align-items: center; justify-content: center;
}
.fb-unavailable-modal.visible { display: flex; }
.fb-unavail-box {
  background: var(--surface); border-radius: 20px; padding: 40px 48px;
  text-align: center; max-width: 460px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}
.fb-unavail-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,45,85,0.25); color: var(--accent);
  font-size: 28px; font-weight: 800; line-height: 56px;
  margin: 0 auto 20px;
}
.fb-unavail-title {
  font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px;
}
.fb-unavail-reason {
  font-size: 17px; color: var(--text2); margin-bottom: 24px;
}
.fb-unavail-btn {
  display: inline-block; padding: 12px 40px;
  background: var(--accent); color: #fff; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s;
}
.fb-unavail-btn:hover { opacity: 0.85; }

.fb-match-card .card-cat { color: rgba(255,255,255,0.75); }
.fb-match-card.now-playing {
  border-color: var(--green);
}
.fb-match-card.now-playing .card-name::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; background: var(--green); border-radius: 50%;
  margin-right: 5px; animation: pulse 1.5s infinite; vertical-align: middle;
}

.fbc-poster {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a2a4e 0%, #3c1d4e 50%, #8a2040 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.fbc-live-tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--green); color: #000;
  font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px;
  z-index: 1;
}
.fbc-logos {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 0 12px;
  width: 100%; overflow: hidden;
}
.fbc-team-logo {
  width: 56px; height: 56px; min-width: 56px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  position: relative;
}
.fbc-team-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: transparent;
}
.fbc-team-logo img[src=''] {
  display: none;
}
/* Fallback for broken images - show a default icon */
.fbc-team-logo::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../assets/posters/logo.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: 0;
}
.fbc-team-logo img {
  position: relative;
  z-index: 1;
}
.fbc-play { flex-shrink: 0; }

.fbc-score {
  font-size: 18px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 2px;
  flex-shrink: 1; min-width: 0;
}
.fbc-score.fbc-ft { opacity: 0.7; }

.badge-live {
  background: var(--green); color: #fff;
}
.badge-ft {
  background: rgba(255,255,255,0.12); color: var(--text3);
}
.badge-bball {
  background: #f97316; color: #fff;
}
.badge-other {
  background: #8b5cf6; color: #fff;
}

.fb-empty {
  text-align: center; padding: 60px 20px;
  font-size: 14px; color: var(--text3);
}

/* ===== FOOTBALL PLAYER OVERLAY (fullscreen like TV player) ===== */
.fb-player-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9000;
  background: #000;
}
.fb-player-overlay > video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 0;
}

/* Football player loading */
.fbp-loading {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, #0a0a12 60%, #000 100%);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 100;
}
.fbp-loading.visible { display: flex; }
.fbp-loading-text { font-size: 16px; color: var(--accent); font-weight: 600; }
.fbp-loading-match { font-size: 22px; color: #fff; font-weight: 700; text-align: center; max-width: 80%; }

/* Football player error */
.fbp-error {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.95);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 101;
}
.fbp-error.visible { display: flex; }
.fbp-error-icon {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,59,48,0.15); color: #ff453a;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
}
.fbp-error-msg { font-size: 18px; color: var(--text2); text-align: center; max-width: 80%; }
.fbp-error-actions { display: flex; gap: 12px; margin-top: 8px; }
.fbp-error-btn {
  padding: 10px 28px; border-radius: 8px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff;
}
.fbp-error-btn.fbp-error-close { background: rgba(255,255,255,0.1); color: var(--text2); }
.fbp-error-btn.focused { outline: 2px solid #fff; }

/* OSD - top/bottom bars, auto-hide */
.fbp-osd {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}
.fbp-osd.hidden { opacity: 0; }

.fbp-osd-top {
  display: flex; align-items: center; gap: 12px;
  padding: 16px var(--pad);
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}
.fbp-osd-live {
  background: #ff3b30; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 4px;
}
.fbp-osd-match {
  display: flex; align-items: center; gap: 10px;
}
.fbp-osd-match img { width: 24px; height: 24px; object-fit: contain; }
.fbp-osd-match .fbp-osd-name { font-size: 15px; font-weight: 700; }
.fbp-osd-match .fbp-osd-score { font-size: 18px; font-weight: 800; color: var(--accent); }
.fbp-osd-match .fbp-osd-state { font-size: 12px; color: var(--text2); margin-left: 6px; }

.fbp-osd-bottom {
  padding: 16px var(--pad);
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}
.fbp-osd-hint {
  font-size: 13px; color: var(--text3); font-weight: 500;
}

/* Channel list panel (right side slide-in) */
.fbp-channels {
  position: absolute; top: 0; left: 0; bottom: 0; width: 520px;
  background: rgba(6,6,10,0.88);
  /* backdrop-filter disabled for TV performance — use solid bg instead */
  z-index: 20;
  display: none; /* shown via JS */
  flex-direction: column;
  overflow: hidden;
}
.fbp-channels.open { display: flex; animation: slideIn 0.2s var(--ease); }

.fbp-channels-header {
  padding: 32px 28px 20px;
  font-size: 28px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
.fbp-channels-list {
  flex: 1; overflow-y: auto; padding: 10px;
  scrollbar-width: none;
}
.fbp-channels-list::-webkit-scrollbar { display: none; }

.fbp-chan-item {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 16px; border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.fbp-chan-item:hover,
.fbp-chan-item.focused {
  background: rgba(255,255,255,0.14);
}
.fbp-chan-item.focused {
  border-left: 3px solid var(--accent);
}
.fbp-chan-item.chan-active .fbp-chan-name {
  color: var(--accent);
}
.fbp-chan-name { font-size: 24px; font-weight: 600; color: #fff; }
.fbp-chan-item.focused .fbp-chan-name { color: #fff; font-weight: 700; }
.fbp-chan-label { font-size: 14px; color: rgba(255,255,255,0.7); }
.fbp-chan-playing {
  font-size: 12px; font-weight: 700; color: var(--accent);
  margin-left: auto;
}
.fbp-chan-section {
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 20px 16px 10px;
}
.fbp-chan-divider {
  margin-top: 12px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.fbp-chan-live {
  font-size: 11px; font-weight: 700; color: #000;
  background: var(--green); padding: 3px 10px; border-radius: 4px;
  margin-left: auto; flex-shrink: 0;
}
.fbp-chan-event { padding: 16px; }
.fbp-chan-event .fbp-chan-name { font-size: 22px; color: #fff; }
.fbp-chan-event .fbp-chan-label { font-size: 15px; color: rgba(255,255,255,0.8); }
.fbp-chan-item.chan-active .fbp-chan-name::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  background: var(--green); border-radius: 50%; margin-right: 8px;
  animation: pulse 1.5s infinite; vertical-align: middle;
}

/* === Football PiP (same position/size as TV PiP) === */
.fb-player-overlay.fbp-pip {
  top: 86px; right: var(--pad); bottom: auto; left: auto;
  width: 360px; height: 203px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 40px rgba(0,0,0,0.95);
  z-index: 300;
  overflow: hidden;
  animation: pipIn 0.3s var(--ease);
}
.fb-player-overlay.fbp-pip .fbp-osd,
.fb-player-overlay.fbp-pip .fbp-channels { display: none !important; }
.fb-player-overlay.fbp-pip.pip-focused {
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.9), 0 0 0 2px rgba(255,255,255,0.15);
  transform: scale(1.03);
}

.fbp-pip-label {
  display: none;
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  font-size: 10px; font-weight: 600; color: var(--text2);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 2;
}
.fb-player-overlay.fbp-pip .fbp-pip-label { display: block; }

/* === Football Multi-View === */
.fb-multiview {
  position: fixed; inset: 0; z-index: 9500;
  background: #000;
  display: flex; flex-direction: column;
}
.fbmv-grid {
  flex: 1; display: grid; gap: 2px; padding: 2px;
}
.fbmv-grid-2 { grid-template-columns: 1fr 1fr; }
.fbmv-grid-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.fbmv-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.fbmv-slot {
  position: relative; background: #111; border-radius: 4px; overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.fbmv-slot.mv-focused { border-color: var(--accent); }
.fbmv-slot iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}
.fbmv-label {
  position: absolute; top: 8px; left: 10px;
  font-size: 11px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 1;
}
.fbmv-score {
  position: absolute; top: 8px; right: 10px;
  font-size: 13px; font-weight: 800; color: var(--accent);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 1;
}
.fbmv-hint {
  padding: 8px; text-align: center;
  font-size: 12px; color: var(--text3); font-weight: 500;
  background: rgba(0,0,0,0.9);
}

/* MultiView loading indicator */
.fbmv-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-family: sans-serif;
  font-size: 14px;
  text-align: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 4px;
}



/* ===== CROSS-DEVICE INPUT POLISH =====
   - :focus-visible ring for keyboard users on desktop (browsers only emit
     :focus-visible when the focus came from a keyboard, so mouse clicks
     don't trigger it — zero visual regression for click users).
   - touch-action: manipulation removes the legacy 300 ms tap delay on
     mobile and disables double-tap-zoom on interactive elements. */

:where(.card, .cm-card, .feat-card, .btn, .cm-btn, .btn-icon,
       .tab, .setting-item, .pchan-item, .ep-picker-item,
       .player-picker-item, .p-osd-btn, .pchan-options-btn,
       .fb-match-card, .fb-league-card, .cm-genre, .cm-season-btn,
       .dtl-back, .dtl-cast-item, .quality-item,
       button, [role="button"]) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Visible keyboard-focus ring — only on devices with a mouse (desktop),
   since TVs drive focus via their own .focused class and mobile users
   use touch. */
.device-browser :where(button, a, [tabindex],
       .card, .cm-card, .feat-card,
       .tab, .setting-item, .pchan-item, .ep-picker-item,
       .player-picker-item, .fb-match-card, .cm-genre):focus-visible {
  outline: 3px solid var(--accent, #ff2d55);
  outline-offset: 2px;
  border-radius: 8px;
}
.device-browser :focus:not(:focus-visible) { outline: none; }

/* Keyboard-shortcuts modal (triggered by ? on desktop) */
.kbd-shortcuts-backdrop {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.kbd-shortcuts-backdrop.visible { display: flex; animation: fadeIn 0.15s; }
.kbd-shortcuts {
  background: #14141a; color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  width: 100%; max-width: 520px; max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.kbd-shortcuts h3 {
  padding: 18px 22px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.kbd-shortcuts .kbd-close {
  background: transparent; border: none; color: rgba(255,255,255,0.6);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.kbd-shortcuts .kbd-close:hover { color: #fff; }
.kbd-shortcuts-body { padding: 14px 22px 22px; overflow-y: auto; }
.kbd-section {
  font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1.4px;
  margin: 16px 0 8px;
}
.kbd-section:first-child { margin-top: 0; }
.kbd-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13.5px;
}
.kbd-row:last-child { border-bottom: none; }
.kbd-row span:first-child { color: rgba(255,255,255,0.85); }
.kbd-key {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Consolas, monospace;
  font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 8px;
  color: rgba(255,255,255,0.9);
}

/* Hide shortcut modal on touch-only devices — it's a keyboard feature */
body:not(.device-browser) .kbd-shortcuts-backdrop { display: none !important; }


/* ===== TIER 3 POLISH ===================================================
   :hover affordances for desktop · prefers-reduced-motion · safe-area-inset
   ======================================================================== */

/* --- Desktop hover states ---------------------------------------------
   Limited to .device-browser + .has-mouse so touch devices don't get
   sticky :hover on the last-tapped element. */
.device-browser.has-mouse .card:hover,
.device-browser.has-mouse .cm-card:hover,
.device-browser.has-mouse .feat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 8px 18px rgba(0,0,0,0.5);
}
.device-browser.has-mouse .fb-match-card:hover,
.device-browser.has-mouse .fb-league-card:hover {
  background: rgba(255,255,255,0.05);
}
.device-browser.has-mouse .cm-genre:hover,
.device-browser.has-mouse .cm-season-btn:hover,
.device-browser.has-mouse .tab:hover {
  background: rgba(255,255,255,0.08);
}
.device-browser.has-mouse .pchan-item:hover,
.device-browser.has-mouse .setting-item:hover,
.device-browser.has-mouse .player-picker-item:hover,
.device-browser.has-mouse .ep-picker-item:hover {
  background: rgba(255,255,255,0.06);
}
.device-browser.has-mouse .p-osd-btn:hover,
.device-browser.has-mouse .pchan-options-btn:hover {
  background: rgba(255,255,255,0.12);
}
.device-browser.has-mouse .btn-icon:hover,
.device-browser.has-mouse .cm-btn:hover,
.device-browser.has-mouse .btn:hover {
  filter: brightness(1.1);
}
.device-browser.has-mouse .dtl-cast-item:hover {
  transform: translateY(-2px);
}
.device-browser.has-mouse .sb-settings-btn:hover,
.device-browser.has-mouse .sb-refresh-btn:hover {
  background: rgba(255,255,255,0.08);
}

/* --- Respect reduced-motion preference --------------------------------
   Users with OS-level "reduce motion" settings don't want card scales,
   pulses, or slide transitions. Strip them all. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card.focused,
  .cm-card.focused,
  .feat-card.focused,
  .pchan-options-btn.focused,
  .p-osd-btn.focused { transform: none !important; }
}

/* --- iPhone notch / home indicator safe areas -------------------------
   Only matters on real mobile devices; Vidaa TVs don't report insets. */
.device-mobile .statusbar {
  padding-top: env(safe-area-inset-top, 0);
  padding-left: calc(var(--pad, 16px) + env(safe-area-inset-left, 0));
  padding-right: calc(var(--pad, 16px) + env(safe-area-inset-right, 0));
}
.device-mobile .rows,
.device-mobile .content-screen,
.device-mobile #moviesScreen,
.device-mobile #dramaScreen,
.device-mobile .football-screen {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.device-mobile .player-overlay {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* For iOS fullscreen web apps: let the viewport fill the cutout */
@supports (padding: env(safe-area-inset-top)) {
  body.device-mobile {
    padding-top: env(safe-area-inset-top, 0);
  }
}


/* ===== D-PAD / RENDER PERFORMANCE =====================================
   These rules are pure hints to the compositor + layout engine; none of
   them change pixels, so visual output is identical. They let the browser:
     - Skip layout for one row when another row's card gains focus
     - Promote scrollable containers to their own GPU layer
     - Avoid invalidating the page when a child's poster loads
   Biggest wins on Vidaa TV's older Chromium, where layout is slow. */

/* Row-level isolation — focusing a card in row 5 shouldn't force a layout
   recalculation of rows 1-4. `contain: layout paint` scopes both. */
.row,
.cm-row,
.fb-league-card {
  contain: layout paint;
}

/* Promote horizontally-scrollable strips to their own compositor layer.
   Cheap transform trick — zero visual change, huge scroll improvement. */
.row-scroll,
.cm-row-scroll,
.dtl-card-row,
.dtl-cast-row,
.cm-genre-strip,
.cm-season-strip,
.fb-league-cards {
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Large containers benefit from `content-visibility` — rows that scroll off
   screen are skipped entirely until they come back. Supported in Chromium
   85+; older browsers just ignore it. */
.row,
.cm-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;  /* fallback size to avoid scroll jumps */
}

/* Restore transform cost: .card.focused already animates transform, so the
   card already lives on its own layer while focused. Just need the idle
   state to hint the compositor once. */
.card,
.cm-card,
.feat-card {
  /* backface-visibility forces a compositor layer on WebKit/older Chromium */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}



/* ===== Global scrollbar hiding =========================================
   Hides native scrollbars on every scrollable surface in the app while
   keeping scroll functional (scrollbar-width: none on FF, ::-webkit-
   scrollbar on Chromium/WebKit, -ms-overflow-style: none on Edge Legacy).
   Belt-and-suspenders across html/body + every tab surface — stops leaks
   on desktop where the default browser scrollbar would otherwise show. */
html, body,
.rows, .content-screen, .football-screen, .highlights-screen,
#moviesScreen, #dramaScreen, #iptvScreen,
.row-scroll, .cm-row-scroll, .dtl-card-row, .dtl-cast-row,
.cm-genre-strip, .cm-season-strip, .fb-featured, .fb-league-cards,
.player-channels-list, .ep-picker-list, .player-picker-list,
.settings-list, .quality-list, .fbp-channels-list,
.tab-strip, .fb-filters, .cm-episode-grid {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
html::-webkit-scrollbar, body::-webkit-scrollbar,
.rows::-webkit-scrollbar, .content-screen::-webkit-scrollbar,
.football-screen::-webkit-scrollbar, .highlights-screen::-webkit-scrollbar,
#moviesScreen::-webkit-scrollbar, #dramaScreen::-webkit-scrollbar,
#iptvScreen::-webkit-scrollbar,
.row-scroll::-webkit-scrollbar, .cm-row-scroll::-webkit-scrollbar,
.dtl-card-row::-webkit-scrollbar, .dtl-cast-row::-webkit-scrollbar,
.cm-genre-strip::-webkit-scrollbar, .cm-season-strip::-webkit-scrollbar,
.fb-featured::-webkit-scrollbar, .fb-league-cards::-webkit-scrollbar,
.player-channels-list::-webkit-scrollbar, .ep-picker-list::-webkit-scrollbar,
.player-picker-list::-webkit-scrollbar, .settings-list::-webkit-scrollbar,
.quality-list::-webkit-scrollbar, .fbp-channels-list::-webkit-scrollbar,
.tab-strip::-webkit-scrollbar, .fb-filters::-webkit-scrollbar,
.cm-episode-grid::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}


/* ===== Admin — Code Detail page (hash-routed view) ====================
   Shown when location.hash matches #code/<id>. While visible, the default
   admin content (stats + panels) is hidden, so this feels like a distinct
   "page" instead of a modal. No URL change, no SPA router needed. */
.code-page { display: none; }
body.on-code-page .code-page { display: block; }
body.on-code-page .stats,
body.on-code-page > .content > .panel { display: none; }
body.on-code-page .tabs { display: none; }

.code-page-header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.code-page-title {
  font-size: 22px; font-weight: 800; color: var(--fg); letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.code-page-title .mono {
  font-family: 'SF Mono', Consolas, monospace;
  background: var(--surf); border: 1px solid var(--bd);
  padding: 3px 10px; border-radius: 6px; font-size: 18px;
}
.code-page-actions { margin-left: auto; display: flex; gap: 8px; }

.code-page .ins-kpis { margin-bottom: 18px; border: 1px solid var(--bd); border-radius: 12px; }
.code-page #codePageDevicesPanel,
.code-page #codePageLogsPanel { margin-bottom: 16px; }

/* ============================================================
   Ghost / skeleton loaders — per-tab card shapes.
   Base shimmer is a gradient swept across the block via bg-pos.
   Tab variants share the shimmer bg but differ in aspect + layout
   so each tab's loading state mirrors the real cards that replace it.
   ============================================================ */
@keyframes shd-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shd-skel {
  position: relative;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 400px 100%;
  animation: shd-shimmer 1.2s linear infinite;
  border-radius: var(--radius);
}
.shd-skel-grid {
  display: flex; flex-wrap: wrap; gap: 32px;
  padding: 24px 0 30px;
}
.shd-skel-row {
  display: flex; flex-wrap: nowrap; gap: 32px;
  padding: 24px 0 20px;
  overflow: hidden;
}
.shd-skel-title {
  width: 180px; height: 20px; margin: 8px 0 4px;
  border-radius: 6px;
}
/* Highlights + TV card — 16:9 poster + 2 text lines */
.shd-skel-card {
  width: 220px; flex-shrink: 0;
  background: #141418;
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  animation: none;
}
.shd-skel-card .shd-skel-poster {
  width: 100%; aspect-ratio: 16/9;
  border-radius: 0;
}
.shd-skel-card .shd-skel-lines { padding: 10px 12px 12px; }
.shd-skel-card .shd-skel-line {
  height: 10px; border-radius: 4px; margin-bottom: 6px;
}
.shd-skel-card .shd-skel-line:nth-child(1) { width: 85%; }
.shd-skel-card .shd-skel-line:nth-child(2) { width: 55%; }
/* Movies / Drama — 2:3 portrait poster */
.shd-skel-card.poster .shd-skel-poster { aspect-ratio: 2/3; }
/* Events — match card uses same 220px width but shorter poster */
.shd-skel-card.match .shd-skel-poster { aspect-ratio: 16/10; }
/* Section chip row (genre strip / filters) */
.shd-skel-chips {
  display: flex; gap: 10px;
  padding: 8px 0 12px;
}
/* Match the real .cm-genre chip (padding 8px 22px, radius 20px, font 16px). */
.shd-skel-chip {
  width: 70px; height: 37px; border-radius: 20px; flex-shrink: 0;
}
.shd-skel-chip:nth-child(2) { width: 90px; }
.shd-skel-chip:nth-child(3) { width: 60px; }
.shd-skel-chip:nth-child(4) { width: 80px; }
.shd-skel-chip:nth-child(5) { width: 100px; }
.shd-skel-chip:nth-child(6) { width: 76px; }
.shd-skel-chip:nth-child(7) { width: 64px; }

/* Posters ghost (Movies/Drama) — these fill the REAL .cm-* layout classes,
   so only the shimmer shapes are defined here; sizing/gaps come from .cm-*. */
.shd-skel-searchbox { width: 200px; height: 37px; border-radius: 20px; flex-shrink: 0; }
.shd-skel-posterimg { width: 100%; aspect-ratio: 2/3; display: block; border-radius: var(--radius) var(--radius) 0 0; }
.shd-skel-cardname { height: 14px; width: 78%; border-radius: 4px; }
/* Base head bar (row title) — height tuned to the real 18px .cm-row-title
   line box so cards below land at the same Y. .shd-skel-league overrides it. */
.shd-skel-head { width: 200px; height: 23px; border-radius: 6px; }
/* Events league block — header + horizontal card strip */
.shd-skel-league {
  margin-bottom: 28px;
}
.shd-skel-league .shd-skel-head {
  width: 240px; height: 22px; border-radius: 6px; margin: 16px 0 8px;
}
/* Outer wrap — adds the --pad gutter for screens whose container has
   no horizontal padding (moviesScreen / dramaScreen .content-screen,
   full-bleed detail pages). Keeps ghost content aligned with the real
   titles which already apply `padding: 0 var(--pad)`. */
.shd-skel-wrap { padding: 0 var(--pad); }
/* Detail page — hero backdrop + side info + body rows */
.shd-skel-hero {
  position: relative; width: 100%; height: 440px;
  background: linear-gradient(to top,
    var(--bg) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.1) 100%),
    rgba(255,255,255,0.04);
  overflow: hidden;
}
.shd-skel-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.02) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.02) 100%);
  background-size: 600px 100%;
  animation: shd-shimmer 1.4s linear infinite;
}
.shd-skel-hero-info {
  position: absolute; left: var(--pad); bottom: 30px;
  width: 50%; display: flex; flex-direction: column; gap: 10px; z-index: 2;
}
.shd-skel-hero-title { width: 320px; height: 34px; border-radius: 6px; }
.shd-skel-hero-sub   { width: 220px; height: 14px; border-radius: 5px; }
.shd-skel-hero-meta  { width: 160px; height: 14px; border-radius: 5px; }
.shd-skel-hero-btns  { display: flex; gap: 12px; margin-top: 8px; }
.shd-skel-btn        { width: 150px; height: 40px; border-radius: 10px; }
.shd-skel-btn.small  { width: 110px; }
/* Actor hero — circular photo + side text block */
.shd-skel-hero.actor { height: 360px; }
.shd-skel-hero.actor .shd-skel-hero-info { flex-direction: row; align-items: flex-end; gap: 20px; }
.shd-skel-avatar {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
}
.shd-skel-hero-side { display: flex; flex-direction: column; gap: 10px; }
/* Overview paragraph (3 lines) */
.shd-skel-para { margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.shd-skel-para .shd-skel-text {
  height: 12px; border-radius: 4px;
}
.shd-skel-para .shd-skel-text:nth-child(1) { width: 95%; }
.shd-skel-para .shd-skel-text:nth-child(2) { width: 88%; }
.shd-skel-para .shd-skel-text:nth-child(3) { width: 60%; }
/* Cast circles (actor avatars, 80px) */
.shd-skel-cast-row { display: flex; gap: 16px; overflow: hidden; padding: 8px 0 12px; }
.shd-skel-cast-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; width: 96px; }
.shd-skel-cast-item .shd-skel-avatar { width: 80px; height: 80px; }
.shd-skel-cast-item .shd-skel-text { width: 70px; height: 10px; border-radius: 4px; }
