/* ==========================================================================
   BioscopeBD Watch & Browse Theatre: Sticky Medium Player, 2:3 Posters & Glass
   ========================================================================== */

#github-watch-dock:not([hidden]) {
  position: relative;
  display: block;
  width: min(100% - 24px, 1440px);
  margin: 16px auto 32px;
  background: rgba(14, 16, 27, 0.72);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 20;
  animation: watchBlendIn .35s ease-out both;
}

@keyframes watchBlendIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#github-watch-dock #video-dialog[open] {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "header browse"
    "player browse"
    "toolbar browse" !important;
  gap: 12px 24px !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 auto !important;
  padding: 16px 20px 20px !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  background: transparent !important;
}

#github-watch-dock #video-dialog::backdrop {
  display: none !important;
}

/* Header */
#github-watch-dock .video-dialog__header,
.video-dialog__header {
  grid-area: header;
  width: 100% !important;
  max-width: 820px !important;
  min-height: 48px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 0 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px 12px !important;
}

#github-watch-dock .video-dialog__title-wrap,
#github-watch-dock .video-dialog__header-left,
.video-dialog__title-wrap,
.video-dialog__header-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

#github-watch-dock .video-dialog__live-dot,
.video-dialog__live-dot {
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 10px #10b981, 0 0 18px rgba(16, 185, 129, 0.5) !important;
  animation: pulse 1.4s ease-in-out infinite !important;
  flex-shrink: 0 !important;
}

#github-watch-dock .video-dialog__title,
.video-dialog__title {
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -0.01em !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
}

#github-watch-dock .video-dialog__header-actions,
.video-dialog__header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

#github-watch-dock .stream-source-toggle,
.stream-source-toggle {
  display: inline-flex !important;
  align-items: center !important;
  height: 36px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 999px !important;
  padding: 3px 4px !important;
  gap: 3px !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

#github-watch-dock .source-toggle-btn,
.source-toggle-btn {
  display: inline-flex !important;
  align-items: center !important;
  height: 30px !important;
  background: transparent !important;
  border: 0 !important;
  color: #a1a1aa !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
}

#github-watch-dock .source-toggle-btn:hover,
.source-toggle-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

#github-watch-dock .source-toggle-btn.is-active,
.source-toggle-btn.is-active {
  background: var(--color-accent, #f5c518) !important;
  color: #0b0c10 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(245, 197, 24, 0.45) !important;
}

#github-watch-dock .player-tv-controls,
.player-tv-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: relative !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

#github-watch-dock .player-tv-controls[hidden],
.player-tv-controls[hidden] {
  display: none !important;
}

#github-watch-dock .player-next-movie-btn,
.player-next-movie-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  height: 36px !important;
  padding: 0 14px !important;
  background: rgba(245, 197, 24, 0.16) !important;
  border: 1px solid rgba(245, 197, 24, 0.45) !important;
  border-radius: 999px !important;
  color: #f5c518 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#github-watch-dock .player-next-movie-btn:hover,
.player-next-movie-btn:hover {
  background: rgba(245, 197, 24, 0.3) !important;
  border-color: #f5c518 !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(245, 197, 24, 0.3) !important;
}

#github-watch-dock .player-next-movie-btn[hidden],
.player-next-movie-btn[hidden] {
  display: none !important;
}

#github-watch-dock .player-tv-pill,
.player-tv-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  height: 36px !important;
  background: rgba(245, 197, 24, 0.14) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(245, 197, 24, 0.38) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #ffd64c !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#github-watch-dock .player-tv-pill *,
.player-tv-pill * {
  white-space: nowrap !important;
}

#github-watch-dock .player-tv-pill:hover,
.player-tv-pill:hover {
  background: rgba(245, 197, 24, 0.28) !important;
  border-color: #f5c518 !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(245, 197, 24, 0.3) !important;
}

#github-watch-dock .player-tv-next-btn,
.player-tv-next-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#github-watch-dock .player-tv-next-btn *,
.player-tv-next-btn * {
  white-space: nowrap !important;
}

#github-watch-dock .player-tv-next-btn:hover,
.player-tv-next-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #ffd64c !important;
  transform: translateY(-1px) !important;
}

#github-watch-dock .video-dialog__header-right,
.video-dialog__header-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

#github-watch-dock .video-dialog__fullscreen-btn,
#github-watch-dock .video-dialog__close,
.video-dialog__fullscreen-btn,
.video-dialog__close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 10px !important;
  color: #e5e7eb !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#github-watch-dock .video-dialog__fullscreen-btn:hover,
.video-dialog__fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  transform: translateY(-1px) scale(1.05) !important;
}

#github-watch-dock .video-dialog__close:hover,
.video-dialog__close:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  color: #f43f5e !important;
  transform: translateY(-1px) scale(1.05) !important;
}

/* Medium Sticky Video Stage */
#github-watch-dock .video-dialog__stage {
  grid-area: player;
  justify-self: start;
  align-self: start;
  width: 100% !important;
  max-width: 820px !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 0 !important;
  max-height: clamp(340px, 52dvh, 470px) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #000 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65) !important;
  position: sticky !important;
  top: 80px !important;
  z-index: 10 !important;
}

/* Player Toolbar - ONLY Download button strictly */
#github-watch-dock .player-toolbar__group:first-child > :not(#btn-player-download),
#github-watch-dock .player-toolbar__group:not(:first-child),
#btn-family-mode,
#btn-xray-toggle,
#btn-dialogue-boost,
#quality-tool-wrap,
#btn-server-tool,
#btn-player-party,
.sub-sync-group {
  display: none !important;
}

#github-watch-dock .player-toolbar,
.player-toolbar {
  grid-area: toolbar;
  width: 100% !important;
  max-width: 820px !important;
  justify-self: start;
  align-self: start;
  margin-top: 10px !important;
  padding: 8px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  overflow: visible !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  max-height: none !important;
}

#btn-player-download {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 22px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.24), rgba(245, 197, 24, 0.08)) !important;
  border: 1px solid rgba(245, 197, 24, 0.45) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #ffd64c !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#btn-player-download:hover {
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.4), rgba(245, 197, 24, 0.18)) !important;
  border-color: #f5c518 !important;
  color: #fff !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(245, 197, 24, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

#btn-player-download .tool-icon {
  font-size: 0.95rem !important;
  line-height: 1 !important;
}

#btn-player-download .tool-label {
  font-family: inherit !important;
  letter-spacing: 0.02em !important;
}

#github-watch-dock .player-toolbar::-webkit-scrollbar,
#github-watch-browse::-webkit-scrollbar {
  display: none;
}

/* Browse Sidebar with Portrait Poster Cards */
#github-watch-browse {
  grid-area: browse;
  min-width: 0;
  max-height: clamp(480px, 75dvh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 0 4px 8px 0;
}

.github-watch-browse__heading {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(18, 20, 34, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: #f5c518;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.github-watch-reveal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background: #07070c;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.github-watch-reveal.is-visible {
  opacity: 1;
  visibility: visible;
}

.github-watch-reveal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px) brightness(0.35);
  transform: scale(1.06);
}

.github-watch-reveal__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 24px;
  background: rgba(5, 5, 10, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.github-watch-reveal__spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(245, 197, 24, 0.25);
  border-top-color: #f5c518;
  border-radius: 50%;
  animation: watchSpin 0.75s linear infinite;
}

@keyframes watchSpin {
  to { transform: rotate(360deg); }
}

/* Portrait (2:3 aspect ratio) Poster Cards in Sidebar */
.github-watch-browse__item {
  display: grid !important;
  grid-template-columns: 66px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 8px !important;
  padding: 8px 10px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  color: #fff !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.github-watch-browse__item:hover,
.github-watch-browse__item:focus-visible {
  border-color: rgba(255, 255, 255, 0.32) !important;
  border-top-color: rgba(255, 255, 255, 0.6) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  transform: translateY(-3px) scale(1.015) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(139, 92, 246, 0.22) !important;
}

.github-watch-browse__item img {
  width: 66px !important;
  height: 98px !important; /* 2:3 vertical aspect ratio! */
  object-fit: cover !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  background: #1d1d25 !important;
  flex-shrink: 0 !important;
}

.github-watch-browse__item-label {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0 !important;
}

.github-watch-browse__item strong {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #f4f3f0 !important;
}

.github-watch-browse__item small {
  display: block !important;
  color: #aaaab4 !important;
  font-size: 0.7rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.github-watch-browse__item-rating {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin-top: 2px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  color: #f5c518 !important;
}

@media (max-width: 900px) {
  #github-watch-dock:not([hidden]) {
    width: 100% !important;
    margin: 14px 0 24px !important;
    border-radius: 12px !important;
    padding: 16px 12px 18px !important;
  }
  #github-watch-dock #video-dialog[open] {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "header"
      "player"
      "toolbar"
      "browse" !important;
    gap: 8px !important;
    padding: 0 !important;
  }
  /* Responsive 2-tier header on mobile */
  #github-watch-dock .video-dialog__header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "title right"
      "actions actions" !important;
    gap: 12px 10px !important;
    padding: 0 0 8px !important;
    width: 100% !important;
  }
  #github-watch-dock .video-dialog__title-wrap,
  #github-watch-dock .video-dialog__header-left {
    grid-area: title !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  #github-watch-dock .video-dialog__header-right {
    grid-area: right !important;
    justify-self: end !important;
    margin-left: 0 !important;
  }
  #github-watch-dock .video-dialog__header-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  #github-watch-dock .video-dialog__stage {
    max-width: 100% !important;
    max-height: 38dvh !important;
    top: 56px !important;
  }
  #github-watch-dock .player-toolbar {
    max-width: 100% !important;
    margin-top: 6px !important;
  }
  #github-watch-browse {
    margin-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-top: 10px !important;
    max-height: 48dvh !important;
  }
}


/* --- Franchise & Sequel Badges in Browse List --- */
.github-watch-browse__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
  width: fit-content;
}
.github-watch-browse__badge--next {
  background: linear-gradient(135deg, #f5c518, #ff8c00);
  color: #0b0c10;
  box-shadow: 0 2px 8px rgba(245, 197, 24, 0.35);
  animation: pulseNextBadge 2s infinite ease-in-out;
}
@keyframes pulseNextBadge {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.04); opacity: 1; }
}
.github-watch-browse__badge--collection {
  background: rgba(245, 197, 24, 0.15);
  border: 1px solid rgba(245, 197, 24, 0.35);
  color: #f5c518;
}
.github-watch-browse__badge--genre {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}
