/* Ani TV - Universal Device & Browser Compatibility Layer
   Supports: LG WebOS (3.x, 4.x, 5.x, 6.x, 22, 23), Samsung Tizen,
   Android TV Boxes, Fire TV, Older Chrome (38-84+), Older Safari/WebKit, Modern Browsers
*/

/* 1. Global Viewport & Container Fallbacks */
html,
body {
  width: 100%;
  height: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000000 !important;
}

#app-root {
  width: 100%;
  height: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 2. Fullscreen & Position Fallbacks for Inset (All Old Browsers) */
.screen,
.hero-slide,
.hero-gradient-overlay,
.channel-card-box::after,
.iptv-card-box::after,
.video-wrapper,
.player-osd,
.player-connecting-overlay,
.connecting-bg-ambient,
.connecting-particles-wrap,
.audio-player-container,
.audio-player-vignette {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.audio-ambient-backdrop {
  top: -30px;
  right: -30px;
  bottom: -30px;
  left: -30px;
}

#splash-screen {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
}

#player-screen {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

#player-screen .video-wrapper {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.audio-player-container {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 55 !important;
  display: none !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  background: #080c14 !important;
  box-sizing: border-box !important;
}

.audio-player-container.active-audio,
.audio-player-container[style*="display: flex"] {
  display: flex !important;
}

.audio-player-container:not(.active-audio),
.audio-player-container[style*="display: none"] {
  display: none !important;
}

.audio-ambient-backdrop {
  position: absolute !important;
  top: -40px !important;
  right: -40px !important;
  bottom: -40px !important;
  left: -40px !important;
  width: calc(100% + 80px) !important;
  height: calc(100% + 80px) !important;
  background-size: cover !important;
  background-position: center !important;
  -webkit-filter: blur(70px) brightness(0.48) saturate(2) !important;
  filter: blur(70px) brightness(0.48) saturate(2) !important;
  -webkit-transform: scale(1.18) !important;
  transform: scale(1.18) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.audio-player-vignette {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: radial-gradient(circle at 50% 40%, rgba(10, 16, 28, 0.25) 0%, rgba(4, 7, 13, 0.94) 100%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

.audio-player-topbar {
  position: relative !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 28px 40px 12px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.audio-player-center {
  position: relative !important;
  z-index: 10 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: 10px 32px 36px !important;
  box-sizing: border-box !important;
}

.audio-artwork-card-wrap {
  position: relative !important;
  margin-bottom: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.audio-artwork-card {
  width: 260px !important;
  height: 260px !important;
  border-radius: 26px !important;
  overflow: hidden !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.75), 0 0 50px rgba(0, 229, 204, 0.3) !important;
  border: 2.5px solid rgba(255, 255, 255, 0.2) !important;
  background: #111827 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  -webkit-transition: -webkit-transform 0.35s ease, border-radius 0.4s ease !important;
  transition: transform 0.35s ease, border-radius 0.4s ease !important;
}

.audio-artwork-card.disc-mode {
  border-radius: 50% !important;
  border: 4px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 60px rgba(0, 229, 204, 0.4) !important;
}

.audio-artwork-card.disc-mode.playing {
  -webkit-animation: audioDiscRotate 20s linear infinite !important;
  animation: audioDiscRotate 20s linear infinite !important;
}

@-webkit-keyframes audioDiscRotate {
  from { -webkit-transform: rotate(0deg); }
  to { -webkit-transform: rotate(360deg); }
}

@keyframes audioDiscRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.audio-meta-wrap {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}

.audio-track-title {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85) !important;
  margin-bottom: 6px !important;
  max-width: 90% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.audio-track-subtitle {
  font-size: 15px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  max-width: 85% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.audio-progress-wrap {
  width: 100% !important;
  max-width: 600px !important;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 20px !important;
}

.audio-controls-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

/* 4. DEDICATED TV SCREEN PROPORTIONS (LG WebOS, Samsung Tizen, Android TV, Fire TV) */
body.is-tv .app-header,
body:not(.is-mobile) .app-header {
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  padding: 0 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.is-tv .brand-logo-glow,
body:not(.is-mobile) .brand-logo-glow {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
}

body.is-tv .brand-name,
body:not(.is-mobile) .brand-name {
  font-size: 30px !important;
  font-weight: 900 !important;
  letter-spacing: 1.8px !important;
  display: inline-block !important;
}

body.is-tv .header-left,
body:not(.is-mobile) .header-left {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

body.is-tv .header-right,
body:not(.is-mobile) .header-right {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

body.is-tv #header-orientation-btn,
body:not(.is-mobile) #header-orientation-btn,
body.is-tv #pwa-install-btn,
body:not(.is-mobile) #pwa-install-btn {
  display: none !important;
}

body.is-tv #header-fullscreen-btn,
body.is-tv #header-settings-btn,
body.is-tv #header-remote-btn,
body:not(.is-mobile) #header-fullscreen-btn,
body:not(.is-mobile) #header-settings-btn,
body:not(.is-mobile) #header-remote-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 10px !important;
}

/* TV Navigation Capsule Bar */
body.is-tv .nav-capsule-bar,
body:not(.is-mobile) .nav-capsule-bar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(18, 20, 32, 0.88) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 9999px !important;
  padding: 5px 10px !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  margin: 0 auto !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6) !important;
  max-width: 1350px !important;
}

body.is-tv .nav-tabs,
body:not(.is-mobile) .nav-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: none !important;
  padding: 2px 4px !important;
}

body.is-tv .nav-tab-btn,
body:not(.is-mobile) .nav-tab-btn {
  height: 36px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.82) !important;
  border-radius: 9999px !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap !important;
}

body.is-tv .nav-tab-btn.active,
body:not(.is-mobile) .nav-tab-btn.active {
  background: #ffffff !important;
  color: #111111 !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.45) !important;
}

body.is-tv .nav-tab-btn.active .nav-tab-label,
body:not(.is-mobile) .nav-tab-btn.active .nav-tab-label {
  color: #111111 !important;
}

body.is-tv .nav-tab-btn.active .nav-tab-icon svg,
body:not(.is-mobile) .nav-tab-btn.active .nav-tab-icon svg {
  stroke: #111111 !important;
}

/* TV Hero Slider Banner */
body.is-tv .hero-slider-wrap,
body:not(.is-mobile) .hero-slider-wrap {
  height: 360px !important;
  min-height: 320px !important;
  max-height: 400px !important;
  margin: 12px 36px 8px !important;
  border-radius: 20px !important;
}

body.is-tv .hero-content,
body:not(.is-mobile) .hero-content {
  left: 36px !important;
  bottom: 28px !important;
}

body.is-tv .hero-title,
body:not(.is-mobile) .hero-title {
  font-size: 42px !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
}

body.is-tv .hero-subtitle,
body:not(.is-mobile) .hero-subtitle {
  font-size: 17px !important;
}

body.is-tv .hero-tag,
body:not(.is-mobile) .hero-tag {
  font-size: 11px !important;
  padding: 3px 10px !important;
  border-radius: 5px !important;
}

/* TV Quick Shortcuts Row */
body.is-tv .shortcuts-row-container,
body:not(.is-mobile) .shortcuts-row-container {
  padding: 4px 36px 10px !important;
  gap: 12px !important;
}

body.is-tv .shortcut-card,
body:not(.is-mobile) .shortcut-card {
  height: 58px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
}

body.is-tv .shortcut-icon,
body:not(.is-mobile) .shortcut-icon {
  font-size: 22px !important;
}

/* TV Sections, Channel Cards & Movie Poster Cards */
body.is-tv .section-wrapper,
body:not(.is-mobile) .section-wrapper,
.section-wrapper {
  margin-top: 1px !important;
  margin-bottom: 2px !important;
}

body.is-tv .section-header-row,
body:not(.is-mobile) .section-header-row {
  padding: 0 36px !important;
  margin-bottom: 2px !important;
}

body.is-tv .section-title-text,
body:not(.is-mobile) .section-title-text {
  font-size: 22px !important;
  font-weight: 900 !important;
}

body.is-tv .section-accent-bar,
body:not(.is-mobile) .section-accent-bar {
  width: 5px !important;
  height: 24px !important;
}

body.is-tv .horizontal-scroll-row,
body:not(.is-mobile) .horizontal-scroll-row {
  padding: 2px 36px 4px !important;
  gap: 16px !important;
}

body.is-tv .horizontal-scroll-row .channel-card-item,
body:not(.is-mobile) .horizontal-scroll-row .channel-card-item {
  width: 235px !important;
}

body.is-tv .channel-card-box,
body:not(.is-mobile) .channel-card-box,
body.is-tv .iptv-card-box,
body:not(.is-mobile) .iptv-card-box {
  height: 138px !important;
  border-radius: 14px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  background: linear-gradient(145deg, rgba(20, 26, 42, 0.95) 0%, rgba(10, 14, 24, 0.98) 100%) !important;
}

body.is-tv .card-logo-img,
body:not(.is-mobile) .card-logo-img {
  object-fit: contain !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.is-tv .all-channels-grid,
body:not(.is-mobile) .all-channels-grid,
body.fullscreen-mode .all-channels-grid,
.all-channels-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
  gap: 16px !important;
  padding: 16px 28px 60px !important;
}

body.is-tv .all-channels-grid .channel-card-item,
body:not(.is-mobile) .all-channels-grid .channel-card-item,
body.mode-landscape .all-channels-grid .channel-card-item,
body.mode-mobile-landscape .all-channels-grid .channel-card-item,
body.is-mobile .all-channels-grid .channel-card-item,
body.fullscreen-mode .all-channels-grid .channel-card-item,
.all-channels-grid .channel-card-item {
  width: 100% !important;
  max-width: none !important;
}

body.is-tv .all-channels-grid .channel-card-box,
body:not(.is-mobile) .all-channels-grid .channel-card-box,
body.mode-landscape .all-channels-grid .channel-card-box,
body.mode-mobile-landscape .all-channels-grid .channel-card-box,
body.is-mobile .all-channels-grid .channel-card-box,
body.fullscreen-mode .all-channels-grid .channel-card-box,
.all-channels-grid .channel-card-box {
  height: 125px !important;
  border-radius: 14px !important;
}

body.is-tv .all-channels-grid .card-logo-img,
body:not(.is-mobile) .all-channels-grid .card-logo-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.is-tv .all-channels-grid .card-title-text,
body:not(.is-mobile) .all-channels-grid .card-title-text {
  font-size: 15px !important;
  font-weight: 700 !important;
  text-align: center !important;
  color: #ffffff !important;
  margin-top: 6px !important;
}

body.is-tv .poster-card-item,
body:not(.is-mobile) .poster-card-item {
  width: 185px !important;
}

body.is-tv .poster-card-box,
body:not(.is-mobile) .poster-card-box {
  height: 270px !important;
  border-radius: 14px !important;
}

body.is-tv .poster-card-item.is-show-card,
body:not(.is-mobile) .poster-card-item.is-show-card {
  width: 235px !important;
}

body.is-tv .poster-card-box.is-show-box,
body:not(.is-mobile) .poster-card-box.is-show-box {
  width: 100% !important;
  height: 138px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 14px !important;
}

body.is-tv .poster-card-img.is-show-img,
body:not(.is-mobile) .poster-card-img.is-show-img,
.poster-card-img.is-show-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

body.is-tv .card-title-text,
body:not(.is-mobile) .card-title-text {
  font-size: 15px !important;
  font-weight: 700 !important;
}

body.is-mobile:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card,
body.mode-portrait.is-mobile .poster-card-item.is-show-card {
  width: 144px !important;
  min-width: 144px !important;
  flex: 0 0 144px !important;
}

body.is-mobile:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-box.is-show-box,
body.mode-portrait.is-mobile .poster-card-box.is-show-box {
  width: 100% !important;
  height: 81px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

body.is-mobile:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card .card-title-text,
body.mode-portrait.is-mobile .poster-card-item.is-show-card .card-title-text {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #f0f0f5 !important;
  line-height: 1.25 !important;
  margin-top: 5px !important;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  height: 28px !important;
  letter-spacing: 0.2px !important;
}

body.is-mobile:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card .card-badge-ep,
body.mode-portrait.is-mobile .poster-card-item.is-show-card .card-badge-ep {
  font-size: 8px !important;
  padding: 2px 5px !important;
  border-radius: 4px !important;
  bottom: 4px !important;
  right: 4px !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(4px) !important;
  border: 0.5px solid rgba(0, 240, 255, 0.35) !important;
}

@media (max-width: 600px) and (orientation: portrait) {
  body:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card {
    width: 144px !important;
    min-width: 144px !important;
    flex: 0 0 144px !important;
  }

  body:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-box.is-show-box {
    width: 100% !important;
    height: 81px !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
  }

  body:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card .card-title-text {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #f0f0f5 !important;
    line-height: 1.25 !important;
    margin-top: 5px !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: 28px !important;
    letter-spacing: 0.2px !important;
  }

  body:not(.mode-landscape):not(.mode-mobile-landscape):not(.simulated-app-landscape) .poster-card-item.is-show-card .card-badge-ep {
    font-size: 8px !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    bottom: 4px !important;
    right: 4px !important;
    background: rgba(0, 0, 0, 0.78) !important;
    backdrop-filter: blur(4px) !important;
    border: 0.5px solid rgba(0, 240, 255, 0.35) !important;
  }
}

/* TV Music / Radio Player Screen Enhanced */
body.is-tv .audio-player-topbar,
body:not(.is-mobile) .audio-player-topbar {
  padding: 36px 56px 16px !important;
  max-width: 1280px !important;
}

body.is-tv .audio-player-center,
body:not(.is-mobile) .audio-player-center {
  max-width: 820px !important;
  padding: 16px 36px 40px !important;
}

body.is-tv .audio-artwork-card,
body:not(.is-mobile) .audio-artwork-card {
  width: 310px !important;
  height: 310px !important;
}

body.is-tv .audio-track-title,
body:not(.is-mobile) .audio-track-title {
  font-size: 30px !important;
}

body.is-tv .audio-track-subtitle,
body:not(.is-mobile) .audio-track-subtitle {
  font-size: 17px !important;
}

body.is-tv .audio-play-btn,
body:not(.is-mobile) .audio-play-btn {
  width: 74px !important;
  height: 74px !important;
}

body.is-tv .audio-ctrl-btn,
body:not(.is-mobile) .audio-ctrl-btn {
  width: 52px !important;
  height: 52px !important;
}

/* TV Radio Grid */
body.is-tv .radio-grid,
body:not(.is-mobile) .radio-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 18px !important;
  padding: 20px 36px 48px !important;
}

body.is-tv .radio-card,
body:not(.is-mobile) .radio-card {
  padding: 16px 18px !important;
  border-radius: 14px !important;
}

body.is-tv .radio-logo,
body:not(.is-mobile) .radio-logo {
  width: 56px !important;
  height: 56px !important;
  border-radius: 12px !important;
}

body.is-tv .radio-title,
body:not(.is-mobile) .radio-title {
  font-size: 16px !important;
}

/* 5. Flex Gap Fallbacks for Older Browsers (.no-flex-gap) */
.no-flex-gap .horizontal-scroll-row > *:not(:last-child) {
  margin-right: 14px !important;
}

.no-flex-gap .shortcuts-row-container > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .nav-tabs > *:not(:last-child) {
  margin-right: 6px !important;
}

.no-flex-gap .nav-capsule-bar > *:not(:last-child) {
  margin-right: 4px !important;
}

.no-flex-gap .header-left > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .header-right > *:not(:last-child) {
  margin-right: 6px !important;
}

.no-flex-gap .brand-badge > *:not(:last-child) {
  margin-right: 10px !important;
}

.no-flex-gap .radio-card > *:not(:last-child) {
  margin-right: 14px !important;
}

.no-flex-gap .radio-info > *:not(:last-child) {
  margin-bottom: 6px !important;
}

.no-flex-gap .radio-wave > *:not(:last-child) {
  margin-right: 3px !important;
}

.no-flex-gap .audio-player-topbar > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .audio-status-badge > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .audio-progress-wrap > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .audio-controls-row > *:not(:last-child) {
  margin-right: 20px !important;
}

.no-flex-gap .audio-bottom-actions > *:not(:last-child) {
  margin-right: 16px !important;
}

.no-flex-gap .audio-eq-wave > *:not(:last-child) {
  margin-right: 5px !important;
}

.no-flex-gap .osd-top-actions > *:not(:last-child) {
  margin-right: 10px !important;
}

.no-flex-gap .osd-controls-left > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .osd-bottom-controls-row > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .osd-channel-info > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .player-osd-bottom > *:not(:last-child) {
  margin-bottom: 12px !important;
}

.no-flex-gap .osd-progress-wrap > *:not(:last-child) {
  margin-right: 14px !important;
}

.no-flex-gap .login-btn-row > *:not(:last-child) {
  margin-right: 12px !important;
}

.no-flex-gap .exit-btn-row > *:not(:last-child) {
  margin-right: 14px !important;
}

.no-flex-gap .section-header-row > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .section-title-wrap > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .section-btn-group > *:not(:last-child) {
  margin-right: 8px !important;
}

.no-flex-gap .hero-content > *:not(:last-child) {
  margin-bottom: 6px !important;
}

.no-flex-gap .hero-dots-row > *:not(:last-child) {
  margin-right: 6px !important;
}

.no-flex-gap .connecting-text-row > *:not(:last-child) {
  margin-right: 6px !important;
}

.no-flex-gap .connecting-center-container > *:not(:last-child) {
  margin-bottom: 22px !important;
}

.no-flex-gap .splash-header-row > *:not(:last-child) {
  margin-right: 18px !important;
}

.no-flex-gap .splash-content-inner > *:not(:last-child) {
  margin-bottom: 16px !important;
}

.tv-focus:not(.channel-card-item):not(.poster-card-item):not(.iptv-card-item):not(.radio-card):not(.music-card):not(.all-channels-search-input):not(.iptv-subsearch-input),
button:focus,
input:not(.all-channels-search-input):not(.iptv-subsearch-input):focus,
[tabindex="0"]:not(.channel-card-item):not(.poster-card-item):not(.iptv-card-item):not(.radio-card):not(.music-card):not(.all-channels-search-input):not(.iptv-subsearch-input):focus {
  outline: none !important;
  box-shadow: 0 0 0 3.5px #00f0d6, 0 0 28px rgba(0, 240, 214, 0.9), 0 8px 24px rgba(0, 0, 0, 0.8) !important;
  border-color: #00f0d6 !important;
  z-index: 25 !important;
}

.all-channels-search-input,
.all-channels-search-input:focus,
.all-channels-search-input.tv-focus,
.iptv-subsearch-input,
.iptv-subsearch-input:focus,
.iptv-subsearch-input.tv-focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.channel-card-item.tv-focus,
.poster-card-item.tv-focus,
.iptv-card-item.tv-focus,
.channel-card-item:focus,
.poster-card-item:focus,
.iptv-card-item:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  transform: none !important;
}

.channel-card-item.tv-focus .channel-card-box,
.poster-card-item.tv-focus .poster-card-box,
.iptv-card-item.tv-focus .iptv-card-box,
.channel-card-item:focus .channel-card-box,
.poster-card-item:focus .poster-card-box,
.iptv-card-item:focus .iptv-card-box,
.radio-card.tv-focus,
.radio-card:focus,
.music-card.tv-focus,
.music-card:focus,
.shortcut-card.tv-focus {
  -webkit-transform: scale(1.05) translateY(-3px) !important;
  transform: scale(1.05) translateY(-3px) !important;
  border: 3px solid #ffe600 !important;
  box-shadow: 0 0 0 1.5px #ffd700, 0 0 28px rgba(255, 230, 0, 0.95), 0 0 45px rgba(255, 190, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.85) !important;
  border-radius: 14px !important;
  z-index: 20 !important;
}

.nav-tab-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2.5px #00f0d6, 0 0 18px rgba(0, 240, 214, 0.7) !important;
}

.nav-tab-btn.active,
.nav-tab-btn.active:focus {
  background: #ffffff !important;
  color: #111111 !important;
  font-weight: 800 !important;
  border-radius: 9999px !important;
  border: none !important;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.4) !important;
}

.nav-tab-btn.active .nav-tab-label {
  color: #111111 !important;
}

.nav-tab-btn.active .nav-tab-icon svg {
  stroke: #111111 !important;
}

input:not(.all-channels-search-input):not(.iptv-subsearch-input):focus,
input:not(.all-channels-search-input):not(.iptv-subsearch-input).tv-focus {
  -webkit-transform: none !important;
  transform: none !important;
  box-shadow: 0 0 0 2.5px #00f0d6, 0 0 16px rgba(0, 240, 214, 0.5) !important;
}

/* 7. Aspect Ratio Fallback for Music Thumbnails */
.music-thumb-wrap {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
  background: #17123d;
}

.music-thumb-wrap > img,
.music-thumb-wrap > .music-fallback-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.music-thumb-wrap > .card-fav-btn {
  position: absolute !important;
  top: auto !important;
  left: auto !important;
  bottom: 6px !important;
  right: 6px !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  z-index: 5 !important;
}

@supports (aspect-ratio: 1 / 1) {
  .music-thumb-wrap {
    height: auto;
    padding-bottom: 0;
    aspect-ratio: 1 / 1;
  }
}

body.is-tv,
body.is-tv * {
  -webkit-tap-highlight-color: transparent !important;
}

body.is-tv *,
body.is-tv *::before,
body.is-tv *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  scroll-behavior: auto !important;
}

body.is-tv .audio-ambient-backdrop {
  filter: none !important;
  -webkit-filter: none !important;
  display: none !important;
}

body.is-tv .channel-card-box,
body.is-tv .poster-card-box,
body.is-tv .shortcut-card,
body.is-tv .drawer-item {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

body.is-tv .horizontal-scroll-row,
body.is-tv .content-scroll-area,
body.is-tv .drawer-channel-list {
  -webkit-overflow-scrolling: auto !important;
  scroll-behavior: auto !important;
}

.quick-drawer-backdrop {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 9998 !important;
  background: rgba(4, 7, 14, 0.92) !important;
}

.quick-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100% !important;
  height: 100vh !important;
  z-index: 9999 !important;
  right: -500px !important;
  width: 440px !important;
  max-width: 86vw !important;
  background: rgba(10, 14, 22, 0.98) !important;
  border-left: 2px solid rgba(0, 229, 204, 0.4) !important;
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 229, 204, 0.25) !important;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  flex-direction: column !important;
}

.quick-drawer.open {
  right: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.quick-drawer .drawer-header {
  height: 72px !important;
  padding: 0 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(15, 22, 36, 0.95) !important;
}

.quick-drawer .drawer-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: 0.5px !important;
}

.quick-drawer .drawer-channel-list {
  padding: 16px !important;
  gap: 10px !important;
  overflow-y: auto !important;
}

.quick-drawer .drawer-item {
  padding: 12px 16px !important;
  border-radius: 12px !important;
  gap: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.06) !important;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
  cursor: pointer !important;
}

.quick-drawer .drawer-item.active {
  background: rgba(0, 229, 204, 0.18) !important;
  border-color: #00e5cc !important;
}

.quick-drawer .drawer-item:focus,
.quick-drawer .drawer-item.tv-focus {
  background: rgba(0, 229, 204, 0.28) !important;
  border-color: #00e5cc !important;
  box-shadow: 0 0 20px rgba(0, 229, 204, 0.45) !important;
  transform: scale(1.02) !important;
  outline: none !important;
}

.mobile-shows-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 8, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.mobile-shows-filter-bar::-webkit-scrollbar {
  display: none;
}

.mobile-filter-chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.mobile-filter-chip .chip-count {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.mobile-filter-chip.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(112, 0, 255, 0.35) 100%) !important;
  color: #00f0ff !important;
  border-color: rgba(0, 240, 255, 0.6) !important;
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.2) !important;
  font-weight: 800 !important;
}

.mobile-filter-chip.active .chip-count {
  background: rgba(0, 240, 255, 0.3);
  color: #ffffff;
}

.mobile-shows-vertical-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 10px 14px 40px;
  width: 100%;
  box-sizing: border-box;
}

.mobile-show-grid-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(20, 26, 44, 0.9) 0%, rgba(12, 16, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.mobile-show-grid-card:focus,
.mobile-show-grid-card.tv-focus {
  outline: none !important;
  border: 3px solid #ffe600 !important;
  box-shadow: 0 0 0 1.5px #ffd700, 0 0 24px rgba(255, 230, 0, 0.95), 0 0 40px rgba(255, 190, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.85) !important;
  transform: translateY(-3px) scale(1.03) !important;
  z-index: 25 !important;
}

.mobile-show-grid-card:active {
  transform: scale(0.97);
  border-color: #ffe600;
  box-shadow: 0 0 16px rgba(255, 230, 0, 0.7);
}

.mobile-grid-poster-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #0A0826;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-grid-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.mobile-grid-channel-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 8px;
  font-weight: 800;
  color: #00f0ff;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  border: 0.5px solid rgba(0, 240, 255, 0.35);
  letter-spacing: 0.3px;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-grid-ep-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 8px;
  font-weight: 700;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
}

.mobile-grid-info {
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
}

.mobile-grid-title {
  font-size: 11px;
  font-weight: 700;
  color: #f0f0f5;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 28px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.mobile-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

body.is-tv .mobile-shows-filter-bar,
body.mode-landscape .mobile-shows-filter-bar,
body.mode-mobile-landscape .mobile-shows-filter-bar,
body.simulated-app-landscape .mobile-shows-filter-bar {
  display: none !important;
}

body.is-tv .mobile-shows-vertical-grid,
body.mode-landscape .mobile-shows-vertical-grid,
body.mode-mobile-landscape .mobile-shows-vertical-grid,
body.simulated-app-landscape .mobile-shows-vertical-grid {
  display: none !important;
}

body.is-tv .horizontal-scroll-row.shows-expanded-grid,
body:not(.is-mobile) .horizontal-scroll-row.shows-expanded-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

body.is-tv .horizontal-scroll-row.shows-expanded-grid .poster-card-item,
body:not(.is-mobile) .horizontal-scroll-row.shows-expanded-grid .poster-card-item {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
}

body.is-tv .horizontal-scroll-row.shows-expanded-grid .poster-card-box.is-show-box,
body:not(.is-mobile) .horizontal-scroll-row.shows-expanded-grid .poster-card-box.is-show-box {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
}


