/* SpaceGate Nova Live V7 — unified Nova layout and resilient player presentation */
:root {
  --sgn-live-bg: #05020b;
  --sgn-live-panel: rgba(15, 10, 24, .94);
  --sgn-live-panel-2: rgba(9, 6, 15, .98);
  --sgn-live-line: rgba(255, 255, 255, .09);
  --sgn-live-purple: #7b2cff;
  --sgn-live-purple-2: #b974ff;
  --sgn-live-text: #fff;
  --sgn-live-muted: #aaa4b7;
  --sgn-live-radius: 22px;
  --sgn-live-shadow: 0 28px 90px rgba(0, 0, 0, .48);
}

body.sg-nova-live {
  color: var(--sgn-live-text) !important;
  background:
    radial-gradient(circle at 86% -4%, rgba(123, 44, 255, .23), transparent 32%),
    radial-gradient(circle at 2% 28%, rgba(69, 107, 255, .09), transparent 30%),
    linear-gradient(180deg, #08030f 0, #030106 44%, #05020b 100%) !important;
}

body.sg-nova-live .bein-header {
  height: 68px !important;
  background: rgba(5, 2, 11, .78) !important;
  border-bottom: 1px solid var(--sgn-live-line) !important;
  backdrop-filter: blur(24px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(155%) !important;
}

body.sg-nova-live .bein-header-inner {
  width: min(1480px, calc(100% - 40px)) !important;
  min-height: 68px !important;
  margin-inline: auto !important;
}

body.sg-nova-live .connect-logo {
  gap: 10px !important;
  font-weight: 800 !important;
  letter-spacing: -.02em !important;
}

body.sg-nova-live .connect-logo img {
  width: 36px !important;
  height: 36px !important;
  filter: drop-shadow(0 10px 24px rgba(123, 44, 255, .42)) !important;
}

body.sg-nova-live .bein-page {
  width: min(1480px, calc(100% - 40px)) !important;
  max-width: 1480px !important;
  margin-inline: auto !important;
  padding: 94px 0 112px !important;
}

/* The live experience follows Nova's full-width content-rail model. */
body.sg-nova-live .bein-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 22px !important;
  align-items: start !important;
}

body.sg-nova-live .player-column {
  grid-column: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
  padding-top: 0 !important;
}

body.sg-nova-live .guide-panel {
  grid-column: 1 !important;
  position: static !important;
  top: auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
}

body.sg-nova-live .player-hero-shell {
  position: relative !important;
  overflow: clip !important;
  border: 1px solid var(--sgn-live-line) !important;
  border-radius: var(--sgn-live-radius) !important;
  background: linear-gradient(180deg, rgba(17, 10, 28, .96), rgba(6, 4, 10, .99)) !important;
  box-shadow: var(--sgn-live-shadow) !important;
}

body.sg-nova-live .player-hero-shell::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  background:
    radial-gradient(circle at 82% 0, rgba(123, 44, 255, .21), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 32%) !important;
}

body.sg-nova-live .player-container {
  position: relative !important;
  z-index: 1 !important;
  padding: 14px 14px 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.sg-nova-live .player-shell {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(76vh, 820px) !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  border-radius: 16px !important;
  background: #000 !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .52) !important;
  isolation: isolate !important;
}

body.sg-nova-live .player-shell::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, .52), transparent 22%, transparent 62%, rgba(0, 0, 0, .84)) !important;
}

body.sg-nova-live .player-shell video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000 !important;
}

body.sg-nova-live .big-play {
  width: 76px !important;
  height: 76px !important;
  border: 1px solid rgba(255, 255, 255, .2) !important;
  background: linear-gradient(145deg, var(--sgn-live-purple), #9c4cff) !important;
  box-shadow: 0 20px 54px rgba(123, 44, 255, .42) !important;
}

body.sg-nova-live .player-controls {
  padding: 44px 18px 14px !important;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78)) !important;
}

body.sg-nova-live .progress {
  height: 4px !important;
  accent-color: var(--sgn-live-purple-2) !important;
}

body.sg-nova-live .control-btn,
body.sg-nova-live .quality-select,
body.sg-nova-live .network-mode-select {
  border-color: rgba(255, 255, 255, .12) !important;
  background: rgba(10, 7, 16, .72) !important;
  backdrop-filter: blur(12px) !important;
}

body.sg-nova-live .control-btn:hover,
body.sg-nova-live .quality-select:hover,
body.sg-nova-live .network-mode-select:hover {
  border-color: rgba(185, 116, 255, .55) !important;
  background: rgba(123, 44, 255, .18) !important;
}

body.sg-nova-live .player-status-line {
  min-height: 38px !important;
  padding: 0 18px !important;
  color: var(--sgn-live-muted) !important;
  border: 0 !important;
  background: transparent !important;
}

body.sg-nova-live .now-playing {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 18px 20px 20px !important;
  border: 0 !important;
  border-top: 1px solid var(--sgn-live-line) !important;
  background: rgba(8, 5, 13, .72) !important;
}

body.sg-nova-live .now-title {
  margin: 0 0 8px !important;
  font-size: clamp(20px, 2vw, 30px) !important;
  line-height: 1.25 !important;
}

body.sg-nova-live .live-tags span {
  border: 1px solid rgba(185, 116, 255, .22) !important;
  color: #ded2ea !important;
  background: rgba(123, 44, 255, .1) !important;
}

body.sg-nova-live .guide-panel {
  padding: 20px !important;
  border: 1px solid var(--sgn-live-line) !important;
  border-radius: var(--sgn-live-radius) !important;
  background: linear-gradient(180deg, var(--sgn-live-panel), var(--sgn-live-panel-2)) !important;
  box-shadow: 0 20px 65px rgba(0, 0, 0, .32) !important;
}

body.sg-nova-live .sh-section-header {
  min-height: 44px !important;
  margin-bottom: 16px !important;
}

body.sg-nova-live .sh-section-title {
  font-size: clamp(19px, 2vw, 25px) !important;
  letter-spacing: -.02em !important;
}

body.sg-nova-live .guide-tools {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

body.sg-nova-live .chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.sg-nova-live .chip,
body.sg-nova-live .channel-view-btn {
  min-height: 38px !important;
  border: 1px solid rgba(255, 255, 255, .1) !important;
  border-radius: 999px !important;
  color: #c6bfce !important;
  background: rgba(255, 255, 255, .035) !important;
}

body.sg-nova-live .chip.active,
body.sg-nova-live .channel-view-btn.active {
  color: #fff !important;
  border-color: rgba(185, 116, 255, .54) !important;
  background: linear-gradient(135deg, rgba(123, 44, 255, .34), rgba(123, 44, 255, .14)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025) !important;
}

body.sg-nova-live #channelSearch {
  min-height: 42px !important;
  border: 1px solid rgba(255, 255, 255, .11) !important;
  border-radius: 13px !important;
  color: #fff !important;
  background: rgba(255, 255, 255, .045) !important;
}

body.sg-nova-live #channelSearch:focus {
  outline: 0 !important;
  border-color: rgba(185, 116, 255, .62) !important;
  box-shadow: 0 0 0 4px rgba(123, 44, 255, .13) !important;
}

body.sg-nova-live .channels-carousel-wrap {
  margin-inline: -4px !important;
}

body.sg-nova-live #channelsList {
  gap: 12px !important;
  padding: 4px 4px 12px !important;
  scroll-padding-inline: 4px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(185, 116, 255, .4) transparent !important;
}

body.sg-nova-live #channelsCarouselWrap:not(.is-vertical) #channelsList {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.sg-nova-live #channelsCarouselWrap:not(.is-vertical) #channelsList .channel-btn {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  width: auto !important;
  flex: 0 0 clamp(228px, 21vw, 292px) !important;
}

body.sg-nova-live #channelsCarouselWrap:not(.is-vertical) #channelsList .channel-logo {
  width: 100% !important;
}

body.sg-nova-live .channel-btn,
body.sg-nova-live .channel-card {
  flex: 0 0 clamp(228px, 21vw, 292px) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, .085) !important;
  border-radius: 16px !important;
  color: #fff !important;
  background: linear-gradient(180deg, rgba(21, 15, 31, .96), rgba(9, 6, 15, .99)) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .24) !important;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease !important;
}

body.sg-nova-live .channel-btn:hover,
body.sg-nova-live .channel-btn:focus-visible,
body.sg-nova-live .channel-btn.active-channel {
  transform: translateY(-3px) !important;
  border-color: rgba(185, 116, 255, .58) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(123, 44, 255, .16) !important;
  outline: 0 !important;
}

body.sg-nova-live .channel-btn.active-channel {
  background: linear-gradient(180deg, rgba(50, 26, 78, .94), rgba(13, 8, 21, .99)) !important;
}

body.sg-nova-live .channel-logo {
  min-height: 136px !important;
  background:
    radial-gradient(circle at 50% 28%, rgba(123, 44, 255, .18), transparent 48%),
    #08050d !important;
}

body.sg-nova-live .channel-logo img {
  max-width: 72% !important;
  max-height: 76px !important;
  object-fit: contain !important;
}

body.sg-nova-live .channel-copy {
  padding: 14px !important;
}

body.sg-nova-live .channel-title {
  font-size: 15px !important;
  font-weight: 800 !important;
}

body.sg-nova-live .qbtn {
  border-color: rgba(255, 255, 255, .1) !important;
  background: rgba(255, 255, 255, .04) !important;
}

body.sg-nova-live .qbtn.active {
  color: #fff !important;
  border-color: rgba(185, 116, 255, .6) !important;
  background: rgba(123, 44, 255, .25) !important;
}

body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  overflow: visible !important;
}

body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList .channel-btn {
  width: 100% !important;
  flex-basis: auto !important;
}

body.sg-nova-live .player-loading {
  background: rgba(0, 0, 0, .35) !important;
  backdrop-filter: blur(3px) !important;
}

body.sg-nova-live .spinner {
  border-color: rgba(255, 255, 255, .16) !important;
  border-top-color: var(--sgn-live-purple-2) !important;
  box-shadow: 0 0 24px rgba(123, 44, 255, .22) !important;
}

@media (max-width: 1100px) {
  body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  body.sg-nova-live .bein-page {
    width: 100% !important;
    padding: 68px 0 92px !important;
  }

  body.sg-nova-live .bein-header-inner {
    width: calc(100% - 24px) !important;
  }

  body.sg-nova-live .player-hero-shell,
  body.sg-nova-live .guide-panel {
    border-inline: 0 !important;
    border-radius: 0 !important;
  }

  body.sg-nova-live .player-container {
    padding: 0 !important;
  }

  body.sg-nova-live .player-shell {
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body.sg-nova-live .now-playing {
    align-items: flex-start !important;
    flex-direction: column !important;
    padding: 15px 16px 17px !important;
  }

  body.sg-nova-live .network-mode-wrap {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  body.sg-nova-live .guide-panel {
    padding: 17px 14px !important;
  }

  body.sg-nova-live .guide-tools {
    grid-template-columns: 1fr !important;
  }

  body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.sg-nova-live .channel-btn,
  body.sg-nova-live .channel-card {
    flex-basis: min(78vw, 274px) !important;
  }
}

@media (max-width: 520px) {
  body.sg-nova-live .connect-logo span {
    font-size: 14px !important;
  }

  body.sg-nova-live .player-controls {
    padding: 34px 10px 8px !important;
  }

  body.sg-nova-live .volume-range,
  body.sg-nova-live .time-label,
  body.sg-nova-live #pipBtn {
    display: none !important;
  }

  body.sg-nova-live .quality-select {
    max-width: 116px !important;
  }

  body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList {
    grid-template-columns: 1fr !important;
  }

  body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList .channel-btn {
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
  }

  body.sg-nova-live #channelsCarouselWrap.is-vertical #channelsList .channel-logo {
    min-height: 112px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sg-nova-live *,
  body.sg-nova-live *::before,
  body.sg-nova-live *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
