/* ============================================================================
   DONPLAYER NEO — FULL-BLEED CINEMA GLASS EDITION
   Radical Redesign: Full-Screen Live Video Background + Top Category Pills
   + Floating Left Channel Rail + Floating Cinema Control Island
   Zero-Lag 60 FPS Hardware Video Plane (Chrome & Samsung Tizen TV)
   ============================================================================ */

:root {
  --neo-bg: #040710;
  --neo-glass: rgba(8, 13, 26, 0.78);
  --neo-glass-solid: rgba(7, 11, 22, 0.90);
  --neo-border: rgba(255, 255, 255, 0.10);
  --neo-glow: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.55);
  --neo-pill: 999px;
}

/* 1. BASE ULTRA-LÉGÈRE (PAS DE background-attachment:fixed -> 60 FPS PUR) */
html, body {
  background: #040710 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

.ambient-glow-1,
.ambient-glow-2 {
  display: none !important;
}

/* Scrollbar ultra-fine néon */
::-webkit-scrollbar { width: 5px !important; height: 5px !important; }
::-webkit-scrollbar-track { background: transparent !important; }
::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.42) !important;
  border-radius: 999px !important;
}

/* 2. HEADER MINIMALISTE FLOTTANT (GARDE VOTRE LOGO POPCORN TV + THÈMES) */
.smarters-header {
  position: fixed !important;
  top: 12px !important;
  left: 18px !important;
  right: 18px !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 18px !important;
  border-radius: 16px !important;
  background: rgba(7, 11, 22, 0.84) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.25) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55) !important;
  z-index: 60 !important;
}

body.fullscreen-mode .smarters-header {
  display: none !important;
}

.smarters-header .icon-btn-header,
.smarters-header .btn-header-pill,
.smarters-header .header-action-btn,
.smarters-header .header-back-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: var(--neo-pill) !important;
  transition: background 0.12s ease, border-color 0.12s ease !important;
}

.smarters-header .icon-btn-header:hover,
.smarters-header .btn-header-pill:hover,
.smarters-header .header-action-btn:hover,
.smarters-header .header-back-btn:hover {
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.22) !important;
  border-color: var(--accent-cyan, #06b6d4) !important;
}

/* 3. ÉCRAN D'ACCUEIL ÉPURÉ & FUTURISTE (#homeScreen) */
#homeScreen {
  padding-top: 84px !important;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.16), transparent 50%),
    radial-gradient(ellipse at 80% 85%, rgba(244, 114, 182, 0.12), transparent 50%),
    #040710 !important;
}

#homeScreen .tile-card,
#homeScreen .smarters-tile,
#homeScreen .main-tile {
  background: linear-gradient(155deg, rgba(14, 21, 38, 0.88) 0%, rgba(7, 11, 22, 0.95) 100%) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.24) !important;
  border-radius: 24px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55) !important;
  transition: transform 0.15s ease, border-color 0.15s ease !important;
}

#homeScreen .tile-card:hover,
#homeScreen .smarters-tile:hover,
#homeScreen .main-tile:hover,
#homeScreen .focusable:focus {
  transform: translateY(-5px) !important;
  border-color: var(--accent-cyan, #06b6d4) !important;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.65), 0 0 24px rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.35) !important;
}

/* ============================================================================
   4. RÉVOLUTION LIVE TV : VIDÉO 100% PLEIN ÉCRAN EN FOND + OVERLAYS FLOTTANTS
   (Style Apple TV+ / Tivimate / Cyber-Cinema • Zéro écran noir sur Tizen TV !)
   ============================================================================ */
#liveTvScreen {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

#liveTvScreen .live-tv-container {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  background: transparent !important;
  overflow: hidden !important;
}

/* A. LA VIDÉO EN DIRECT REMPLIT 100% DE L'ÉCRAN (PLAN MATÉRIEL DIRECT PUR) */
#liveTvScreen .tv-preview-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1 !important;
  background: #000000 !important;
  display: block !important;
}

#liveTvScreen .stage-video-box,
#liveTvScreen .stage-live-active {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: visible !important;
}

#liveTvScreen #miniPreviewVideo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  background: #000000 !important;
}

/* Vignette Cinéma douce sur le côté gauche uniquement pour rendre les chaînes ultra-lisibles sans cacher l'image TV */
#liveTvScreen .stage-live-active::after {
  content: '' !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    90deg,
    rgba(4, 7, 16, 0.84) 0%,
    rgba(4, 7, 16, 0.45) 26%,
    rgba(4, 7, 16, 0.04) 52%,
    transparent 100%
  ) !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

body.fullscreen-mode #liveTvScreen .stage-live-active::after {
  display: none !important;
}

/* Badge Live compact en haut à droite sur la vidéo */
#liveTvScreen .mini-overlay-bar {
  position: fixed !important;
  top: 132px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  width: auto !important;
  max-width: 380px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  background: rgba(7, 11, 22, 0.78) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.30) !important;
  z-index: 25 !important;
}

#liveTvScreen .mini-top-actions {
  position: fixed !important;
  top: 132px !important;
  right: 20px !important;
  z-index: 26 !important;
  display: none !important;
}

body.fullscreen-mode #liveTvScreen .mini-overlay-bar,
body.fullscreen-mode #liveTvScreen .tv-categories-col,
body.fullscreen-mode #liveTvScreen .tv-channels-col,
body.fullscreen-mode #liveTvScreen .stage-bottom-bar {
  display: none !important;
}

/* B. BARRE HORIZONTALE DE PILULES CATÉGORIES EN HAUT (FINI LA GROSSE COLONNE GAUCHE !) */
#liveTvScreen .tv-categories-col {
  position: fixed !important;
  top: 74px !important;
  left: 18px !important;
  right: 18px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 0 10px !important;
  border-radius: 14px !important;
  background: rgba(7, 11, 22, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  z-index: 35 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  overflow: hidden !important;
}

#liveTvScreen .tv-categories-col .tv-col-header,
#liveTvScreen .tv-categories-col .tv-easy-scroll-bar,
#liveTvScreen .tv-channels-col .tv-easy-scroll-bar {
  display: none !important;
}

#liveTvScreen #categoriesList {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 2px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}
#liveTvScreen #categoriesList::-webkit-scrollbar { display: none !important; }

#liveTvScreen .tv-cat-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 12px 0 8px !important;
  border-radius: var(--neo-pill) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
  transition: background 0.1s ease, border-color 0.1s ease !important;
}

#liveTvScreen .tv-cat-btn .cat-badge-box {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  box-shadow: none !important;
}

#liveTvScreen .tv-cat-btn .cat-sub-label {
  display: none !important;
}

#liveTvScreen .tv-cat-btn .cat-text-wrap,
#liveTvScreen .tv-cat-btn .cat-title-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
}

#liveTvScreen .tv-cat-btn .cat-btn-label {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  max-width: none !important;
  overflow: visible !important;
}

#liveTvScreen .tv-cat-btn .cat-btn-count {
  font-size: 10.5px !important;
  padding: 1px 7px !important;
  border-radius: var(--neo-pill) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  color: #94a3b8 !important;
}

#liveTvScreen .tv-cat-btn.active {
  background: linear-gradient(135deg, rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.34), rgba(244, 114, 182, 0.24)) !important;
  border-color: var(--accent-cyan, #06b6d4) !important;
  box-shadow: 0 0 14px rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.35) !important;
}

#liveTvScreen .tv-cat-btn.active .cat-btn-label,
#liveTvScreen .tv-cat-btn.active .cat-btn-count {
  color: #ffffff !important;
}

#liveTvScreen .tv-cat-btn:focus {
  outline: none !important;
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.42) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px #38bdf8 !important;
  transform: none !important;
}

/* C. RAIL FLOTTANT ÉPURÉ DES CHAÎNES À GAUCHE (COMME AVANT — LAISSANT 74% DE L'ÉCRAN POUR LA TV LIVE !) */
#liveTvScreen .tv-channels-col {
  position: fixed !important;
  top: 132px !important;
  left: 18px !important;
  bottom: 18px !important;
  width: 345px !important;
  min-width: 345px !important;
  max-width: 345px !important;
  border-radius: 18px !important;
  background: rgba(7, 11, 22, 0.80) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55) !important;
  z-index: 30 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#liveTvScreen .search-input-wrap {
  padding: 10px 10px 8px 10px !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

#liveTvScreen .search-field {
  background: rgba(4, 7, 16, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--neo-pill) !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  color: #ffffff !important;
}

#liveTvScreen .search-field:focus {
  outline: none !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.65) !important;
}

#liveTvScreen #channelsListScroll {
  position: relative !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px !important;
}

#liveTvScreen #categoriesList {
  position: relative !important;
}

#liveTvScreen .channel-item-row {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid transparent !important;
  border-radius: 13px !important;
  margin: 0 0 5px 0 !important;
  padding: 9px 12px !important;
  transition: background 0.08s ease, border-color 0.08s ease !important;
}

#liveTvScreen .channel-item-row:hover {
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.16) !important;
  border-color: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.42) !important;
}

#liveTvScreen .channel-item-row.active {
  background: linear-gradient(95deg, rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.30) 0%, rgba(244, 114, 182, 0.16) 100%) !important;
  border-color: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.72) !important;
  box-shadow: inset 4px 0 0 var(--accent-cyan, #06b6d4) !important;
}

#liveTvScreen .channel-item-row:focus {
  outline: none !important;
  background: linear-gradient(95deg, rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.44) 0%, rgba(99, 102, 241, 0.30) 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: inset 5px 0 0 #38bdf8, 0 0 0 2px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.42) !important;
  transform: none !important;
}

#liveTvScreen .channel-item-row:focus .ch-name-text {
  color: #ffffff !important;
  font-weight: 800 !important;
}

#liveTvScreen .ch-program-text {
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  color: rgba(203, 213, 225, 0.88) !important;
}

#liveTvScreen .ch-prog-marquee-inner {
  display: inline-block !important;
  white-space: nowrap !important;
}

/* Programme défilant fluide sur la chaîne sélectionnée / survolée au curseur */
#liveTvScreen .channel-item-row:focus .ch-program-text,
#liveTvScreen .channel-item-row.active .ch-program-text,
#liveTvScreen .channel-item-row:hover .ch-program-text {
  text-overflow: clip !important;
  color: #e0f2fe !important;
  font-weight: 600 !important;
}

#liveTvScreen .channel-item-row:focus .ch-prog-marquee-inner,
#liveTvScreen .channel-item-row.active .ch-prog-marquee-inner,
#liveTvScreen .channel-item-row:hover .ch-prog-marquee-inner {
  padding-left: 10px !important;
  animation: donRowTicker 13s linear infinite !important;
}

@keyframes donRowTicker {
  0%, 14% { transform: translateX(0); }
  88%, 100% { transform: translateX(-55%); }
}

#liveTvScreen .ch-logo-box {
  background: rgba(4, 7, 16, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 9px !important;
  padding: 2px !important;
}

#liveTvScreen .ch-epg-progress {
  background: linear-gradient(90deg, var(--accent-cyan, #06b6d4), #f472b6) !important;
}

/* D. ÎLOT FLOTTANT DE CONTRÔLE EN BAS À DROITE (COMME AVANT) + TICKER PROGRAMME DÉFILANT LIVE */
#liveTvScreen .stage-bottom-bar {
  position: fixed !important;
  left: 380px !important;
  right: 20px !important;
  bottom: 18px !important;
  width: auto !important;
  border-radius: 18px !important;
  padding: 12px 18px !important;
  background: rgba(7, 11, 22, 0.84) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.30) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.62) !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

/* CENTRAGE PARFAIT DE LA CARTE "CONNEXION AU FLUX EN DIRECT..." AU MILIEU DE L'ÉCRAN (COMPATIBLE TIZEN 5.5) */
#fsStreamOverlay,
.fs-stream-overlay,
#miniStreamOverlay,
.mini-stream-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  z-index: 120 !important;
}

#liveTvScreen .stage-info-meta {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

#liveTvScreen #previewTitle {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.neo-now-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  background: rgba(16, 185, 129, 0.22) !important;
  border: 1px solid rgba(16, 185, 129, 0.65) !important;
  color: #6ee7b7 !important;
  flex-shrink: 0 !important;
}

.neo-browse-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  background: rgba(56, 189, 248, 0.22) !important;
  border: 1px solid rgba(56, 189, 248, 0.7) !important;
  color: #7dd3fc !important;
  flex-shrink: 0 !important;
}

/* TICKER PROGRAMME DÉFILANT CONTINU EN BAS */
#liveTvScreen #previewSub {
  margin-top: 5px !important;
  overflow: hidden !important;
  width: 100% !important;
}

.don-epg-ticker-track {
  position: relative !important;
  width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.08) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.22) !important;
  border-radius: 999px !important;
  padding: 4px 12px !important;
}

.don-epg-ticker-inner {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  animation: donEpgTicker 22s linear infinite !important;
}

.epg-ticker-seg {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding-right: 48px !important;
  font-size: 12.5px !important;
  color: #e2e8f0 !important;
}

.epg-ticker-badge {
  display: inline-block !important;
  padding: 1px 7px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.35), rgba(244, 114, 182, 0.28)) !important;
  color: #ffffff !important;
}

.epg-ticker-title {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.epg-ticker-time {
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.epg-ticker-sep {
  color: rgba(255, 255, 255, 0.35) !important;
}

.epg-ticker-pct {
  color: #f472b6 !important;
  font-weight: 700 !important;
}

.epg-ticker-next {
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

@keyframes donEpgTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.btn-mini-ctrl {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--neo-pill) !important;
  padding: 8px 13px !important;
  font-weight: 700 !important;
  transition: background 0.1s ease, border-color 0.1s ease !important;
}

.btn-mini-ctrl:hover,
.btn-mini-ctrl:focus {
  background: rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.28) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.7) !important;
  transform: none !important;
}

.btn-launch-fullscreen {
  background: linear-gradient(135deg, var(--accent-cyan, #06b6d4) 0%, #6366f1 55%, #ec4899 100%) !important;
  border: none !important;
  border-radius: var(--neo-pill) !important;
  padding: 9px 18px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.45) !important;
}

.btn-launch-fullscreen:focus {
  box-shadow: 0 0 0 3px #ffffff, 0 0 22px rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.85) !important;
  transform: none !important;
}

/* 5. PLEIN ÉCRAN CINÉMA — ÎLOT FLOTTANT EN BAS */
.player-top-bar {
  background: linear-gradient(180deg, rgba(4, 7, 16, 0.94) 0%, rgba(4, 7, 16, 0.62) 68%, transparent 100%) !important;
  padding: 18px 26px 34px 26px !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.player-top-bar .epg-next-line { margin-top: 5px !important; }
.player-top-right .ctrl-btn { height: 36px !important; display: inline-flex !important; align-items: center !important; }

#videoPlayerScreen:has(#playerOsdLayer:not(.hidden)) #fsPermanentTvCode {
  opacity: 0 !important;
  pointer-events: none !important;
}

.player-bottom-bar {
  margin: 0 auto 20px auto !important;
  width: min(1140px, calc(100% - 36px)) !important;
  border-radius: 22px !important;
  background: rgba(7, 11, 22, 0.88) !important;
  border: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.34) !important;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.72) !important;
  padding: 14px 22px !important;
}

.controls-buttons-row {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 12px !important;
}
.controls-group-left { justify-self: start !important; }
.controls-group-center { justify-self: center !important; }
.controls-group-right { justify-self: end !important; }

.player-osd-layer .ctrl-btn {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--neo-pill) !important;
}

.player-osd-layer .ctrl-btn-play-pause {
  background: linear-gradient(135deg, var(--accent-cyan, #06b6d4), #6366f1) !important;
}

.seek-progress-bar {
  background: linear-gradient(90deg, var(--accent-cyan, #06b6d4), #818cf8, #f472b6) !important;
}

.badge-live-tag {
  background: linear-gradient(135deg, #ef4444, #f43f5e) !important;
  border-radius: var(--neo-pill) !important;
  letter-spacing: 0.8px !important;
}

/* 6. PERFORMANCE PURE SUR SMART TV & DESKTOP (ZÉRO FLOU LOURD) */
body.smart-tv-mode * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.smart-tv-mode video,
body.smart-tv-mode #miniPreviewVideo,
body.smart-tv-mode #mainVideoPlayer {
  filter: none !important;
  -webkit-filter: none !important;
  border-radius: 0 !important;
}

/* ============================================================================
   7. EXPÉRIENCE SMARTPHONE WEB 100% PLEIN ÉCRAN (STYLE YOUTUBE / MOLOTOV TV)
   Uniquement sur écrans <= 899px hors Smart TV — Zéro impact PC & TV !
   - Occupe 100% de la hauteur d'écran (100dvh) sans bande noire vide
   - Header ultra-simple (logo + thème + paramètres uniquement, sans lien M3U)
   - Vidéo 16:9 bord à bord + contrôles & EPG défilant compacts
   - Pilules Catégories toujours visibles et glissables au pouce
   - Grande barre de recherche 100% largeur + liste chaînes jusqu'en bas
   - Barre du bas mobile inutile masquée
   ============================================================================ */
@media (max-width: 899px) {
  html, body:not(.smart-tv-mode) {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background: #040710 !important;
  }

  /* Masquer la barre de navigation du bas inutile sur smartphone */
  body:not(.smart-tv-mode) #mobileBottomNav,
  body:not(.smart-tv-mode) .mobile-bottom-nav {
    display: none !important;
  }

  /* A. En-tête mobile ultra-fin et élégant (40px) : Retour, Logo, Thème & Paramètres uniquement */
  body:not(.smart-tv-mode) .smarters-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 8px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.30) !important;
    background: linear-gradient(90deg, rgba(6, 10, 22, 0.98) 0%, rgba(12, 18, 36, 0.98) 100%) !important;
    box-shadow: none !important;
    z-index: 80 !important;
  }

  body:not(.smart-tv-mode) .smarters-header .icon-btn-header,
  body:not(.smart-tv-mode) .smarters-header .header-action-btn,
  body:not(.smart-tv-mode) .smarters-header .header-back-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    font-size: 13px !important;
  }

  body:not(.smart-tv-mode) .smarters-header img {
    width: 24px !important;
    height: 24px !important;
  }

  body:not(.smart-tv-mode) .smarters-header .header-clock,
  body:not(.smart-tv-mode) .smarters-header #headerNowPlayingBtn,
  body:not(.smart-tv-mode) .smarters-header #screenPairingBadge,
  body:not(.smart-tv-mode) .smarters-header #btnHeaderPlaylist,
  body:not(.smart-tv-mode) .smarters-header #btnRefreshPlaylist,
  body:not(.smart-tv-mode) .smarters-header [title*="Actualiser"],
  body:not(.smart-tv-mode) .smarters-header [title*="Recharger"],
  body:not(.smart-tv-mode) .smarters-header .brand-sub,
  body:not(.smart-tv-mode) .smarters-header .logo-subtitle {
    display: none !important;
  }

  /* B. Accueil mobile plein écran scrollable */
  body:not(.smart-tv-mode) #homeScreen {
    padding: 50px 12px 24px 12px !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* C. Live TV Mobile : 100% de l'écran utilisé de haut en bas (Zéro espace mort) */
  body:not(.smart-tv-mode) #liveTvScreen {
    position: fixed !important;
    top: 40px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - 40px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .live-tv-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: #040710 !important;
  }

  /* 1. Lecteur Vidéo 16:9 bord à bord (zéro marge noire au-dessus) + barre contrôles compacte */
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .tv-preview-stage {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    flex: 0 0 auto !important;
    z-index: 30 !important;
    background: #000000 !important;
    display: flex !important;
    flex-direction: column !important;
    order: 1 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-video-box {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 56.25vw !important;
    max-height: 31dvh !important;
    min-height: 180px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000 !important;
    overflow: hidden !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-live-active {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #miniPreviewVideo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .stage-live-active::after {
    display: none !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .mini-overlay-bar {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    max-width: none !important;
    background: rgba(6, 10, 22, 0.52) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    opacity: 0.85 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .mini-overlay-bar .badge-live-tag {
    font-size: 9px !important;
    padding: 1px 6px !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #badgeMiniRes,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #miniChName,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .mini-overlay-program,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .mini-epg-progress-track {
    display: none !important;
  }

  /* Barre d'infos + Ticker EPG + Boutons tactiles ULTRA-COMPACTE (1 seule ligne de boutons = +100px pour la liste !) */
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-bottom-bar {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 5px 8px 6px 8px !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.25) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(7, 11, 22, 0.96) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 5px !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-info-meta {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #previewTitle {
    font-size: 12.5px !important;
    flex: 0 0 auto !important;
    max-width: 42% !important;
    margin: 0 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .neo-now-badge {
    display: none !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #previewSub {
    margin-top: 0 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .don-epg-ticker-track {
    padding: 2px 8px !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .epg-ticker-seg {
    font-size: 11px !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-actions-bar,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-controls-group,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .stage-bottom-bar > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 5px !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .btn-mini-ctrl {
    padding: 5px 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .btn-launch-fullscreen {
    padding: 5px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }

  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen .mini-vol-slider-wrap,
  body:not(.smart-tv-mode):not(.fullscreen-mode) #liveTvScreen #miniVolumeSlider {
    display: none !important;
  }

  /* 2. CATÉGORIES TOUJOURS VISIBLES (barre compacte 38px glissable au pouce) */
  body:not(.smart-tv-mode) #liveTvScreen .tv-categories-col {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    flex: 0 0 38px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(6, 10, 22, 0.94) !important;
    box-shadow: none !important;
    z-index: 20 !important;
    order: 2 !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen #categoriesList {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
    width: 100% !important;
    height: 100% !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .tv-cat-btn {
    height: 28px !important;
    padding: 0 10px 0 6px !important;
    flex-shrink: 0 !important;
  }

  /* 3. GRANDE BARRE DE RECHERCHE 100% LARGEUR + LISTE CHAÎNES (4-5 CHAÎNES VISIBLES) */
  body:not(.smart-tv-mode) #liveTvScreen .tv-channels-col {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #040710 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 10 !important;
    order: 3 !important;
  }

  /* Masquer le gros bouton "+ Lien M3U" qui écrasait la recherche ! */
  body:not(.smart-tv-mode) #liveTvScreen #btnLiveAddM3u {
    display: none !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .search-input-wrap {
    padding: 6px 10px !important;
    flex: 0 0 auto !important;
    background: rgba(7, 11, 22, 0.92) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .search-field,
  body:not(.smart-tv-mode) #liveTvScreen #channelSearchInput {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1.5px solid rgba(var(--accent-cyan-rgb, 6, 182, 212), 0.42) !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen #channelsListScroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 8px 18px 8px !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .channel-item-row {
    padding: 7px 10px !important;
    margin-bottom: 5px !important;
    border-radius: 12px !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .ch-name-text {
    font-size: 13.5px !important;
  }

  body:not(.smart-tv-mode) #liveTvScreen .ch-program-text {
    font-size: 11px !important;
  }

  /* 4. Plein écran mobile propre (portrait & paysage) */
  body:not(.smart-tv-mode).fullscreen-mode #liveTvScreen {
    top: 0 !important;
    height: 100dvh !important;
  }

  body:not(.smart-tv-mode).fullscreen-mode #liveTvScreen .tv-preview-stage {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 90 !important;
  }

  body:not(.smart-tv-mode).fullscreen-mode .player-top-bar {
    padding: 12px 14px 20px 14px !important;
  }

  body:not(.smart-tv-mode).fullscreen-mode .player-bottom-bar {
    width: calc(100% - 16px) !important;
    margin: 0 auto 12px auto !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
  }

  body:not(.smart-tv-mode).fullscreen-mode .controls-buttons-row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
}
