/* ==========================================================================
   THEUZINHOTV - ESTILOS DO MODAL PLAYER STREAMING PREMIUM (MODAL-PLAYER.CSS)
   ==========================================================================
   Componente visual global de reprodução de vídeo para o TheuzinhoTV.
   - Glassmorphism escuro de alta definição
   - Cabeçalho inteligente (Canal, Filme, Série)
   - Seletor de fontes, canais e temporadas/episódios (<optgroup>)
   - Controles de tela cheia, proporção 16:9 e responsividade mobile
   ========================================================================== */

/* Bloqueio de rolagem da página em segundo plano com o modal aberto */
html.player-modal-open,
body.player-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Overlay de Fundo Translúcido com Desfoque Profundo */
.player-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  overscroll-behavior: contain;
  animation: playerFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-modal-overlay.open {
  display: flex;
}

/* Container do Modal adaptado dinamicamente à altura da tela */
.player-modal-container {
  box-sizing: border-box;
  --player-chrome-height: 112px;
  width: min(100%, calc((100dvh - var(--player-chrome-height)) * 16 / 9), 1040px);
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  margin: auto;
  background: linear-gradient(180deg, #0d1527 0%, #080d1a 100%);
  border: 1px solid rgba(var(--accent-rgb, 0, 132, 255), 0.3);
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(var(--accent-rgb, 0, 132, 255), 0.15);
  overflow: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  animation: playerScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: width 0.25s ease, box-shadow 0.3s ease;
}

.player-modal-container.is-series-mode {
  --player-chrome-height: 166px;
}

.player-modal-container.has-epg {
  --player-chrome-height: 168px;
}

.player-modal-container.has-epg-expanded {
  overflow-y: auto;
}

.player-modal-container *,
.player-modal-container *::before,
.player-modal-container *::after {
  box-sizing: border-box;
}

/* Header Premium do Modal */
.player-modal-header {
  background: rgba(15, 22, 36, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.player-header-main {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  width: 100%;
}

.player-header-center[hidden] {
  display: none;
}

/* Barra de Controles Exclusiva para Séries (Linha 2) */
.player-series-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 14, 26, 0.72);
}

.player-series-controls[hidden] {
  display: none;
}

.player-series-servers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 0 1 auto;
}

.player-series-servers::-webkit-scrollbar {
  display: none;
}

.btn-series-server {
  background: rgba(6, 11, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary, #94a3b8);
  padding: 6px 13px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-series-server:hover {
  color: #ffffff;
  border-color: rgba(var(--accent-rgb, 0, 132, 255), 0.55);
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.14);
}

.btn-series-server.is-active {
  color: #ffffff;
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.22);
  border-color: var(--accent-cyan, #38bdf8);
  box-shadow: 0 0 14px rgba(var(--accent-rgb, 0, 132, 255), 0.35), inset 0 0 8px rgba(var(--accent-cyan-rgb, 0, 210, 255), 0.15);
}

.player-series-selectors {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.player-series-select-pill {
  min-width: 0;
}

.player-season-select {
  max-width: 150px;
}

.player-episode-select {
  max-width: 260px;
}

/* Esquerda: Tipo Inteligente + Título */
.player-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.player-type-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.player-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-type-icon svg {
  width: 18px;
  height: 18px;
}

.player-type-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.player-type-badge:empty {
  display: none;
}

/* Cores inteligentes dos tipos */
.player-type-badge.badge-live {
  color: #f87171;
}
.player-type-indicator:has(.badge-live) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.player-type-badge.badge-series {
  color: #c084fc;
}
.player-type-indicator:has(.badge-series) {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
  color: #a855f7;
}

.player-type-badge.badge-movie {
  color: var(--accent-cyan, #38bdf8);
}
.player-type-indicator:has(.badge-movie) {
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.12);
  border-color: rgba(var(--accent-rgb, 0, 132, 255), 0.35);
  color: var(--accent-blue, #0084ff);
}

.player-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.player-video-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

/* Centro: Seletor de Fontes, Canais e Episódios */
.player-header-center {
  flex-shrink: 0;
}

.player-source-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 11, 22, 0.95);
  border: 1px solid rgba(var(--accent-rgb, 0, 132, 255), 0.4);
  padding: 5px 12px 5px 10px;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-source-pill:hover,
.player-source-pill:focus-within {
  border-color: var(--accent-blue, #0084ff);
  box-shadow: 0 0 16px rgba(var(--accent-rgb, 0, 132, 255), 0.35);
}

.source-icon-svg {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan, #38bdf8);
  flex-shrink: 0;
}

.source-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.player-source-select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding-right: 26px;
  outline: none;
  max-width: 260px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Estilização dos grupos de opções */
.player-source-select optgroup {
  background: #090e18;
  color: var(--accent-cyan, #38bdf8);
  font-weight: 800;
  font-style: normal;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb, 0, 132, 255), 0.2);
}

.player-source-select option {
  background: #0f1624;
  color: #ffffff;
  padding: 8px 12px;
  font-weight: 500;
}

.source-arrow-svg {
  position: absolute;
  right: 10px;
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

/* Direita: Controles (Fullscreen + Close) */
.player-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-player-favorite,
.btn-player-fullscreen,
.btn-close-player {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #cbd5e1);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.btn-player-favorite:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}

.btn-player-favorite.is-favorite {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.5);
}

.btn-player-favorite.is-favorite svg {
  fill: currentColor;
}

.btn-player-fullscreen:hover {
  color: #ffffff;
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.2);
  border-color: rgba(var(--accent-rgb, 0, 132, 255), 0.4);
  transform: translateY(-1px);
}

.btn-close-player:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  transform: translateY(-1px);
}

.btn-player-favorite svg,
.btn-player-fullscreen svg,
.btn-close-player svg {
  width: 18px;
  height: 18px;
}

/* Tela de Reprodução (16:9) */
.player-screen-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020408;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.player-screen-box iframe,
.player-screen-box video.player-native-video {
  width: 100%;
  height: 100%;
  border: none;
  background: #000000;
}

.btn-player-retry {
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb, 0, 132, 255), 0.45);
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.2);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.btn-player-retry:hover {
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.35);
  transform: translateY(-1px);
}

/* Mock Stream / Loading */
.player-mock-stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px;
  text-align: center;
}

.player-buffering-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(var(--accent-rgb, 0, 132, 255), 0.2);
  border-top-color: var(--accent-blue, #0084ff);
  border-right-color: var(--accent-cyan, #38bdf8);
  border-radius: 50%;
  animation: playerSpin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(var(--accent-rgb, 0, 132, 255), 0.3);
}

.player-loading-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-status-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.player-status-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  max-width: 480px;
  line-height: 1.45;
}

/* Tela de Aviso: Título Não Disponível com Sugestões Semelhantes */
.player-notice-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  max-width: 620px;
  width: 90%;
  background: rgba(10, 16, 30, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.12);
  animation: playerFadeIn 0.22s ease;
}

.player-notice-icon {
  width: 44px;
  height: 44px;
  color: #f59e0b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.14);
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.player-notice-icon svg {
  width: 24px;
  height: 24px;
}

.player-maintenance-box {
  max-width: 520px;
  padding: 30px 26px;
  gap: 10px;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.72);
}

.player-maintenance-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.22);
}

.player-maintenance-icon svg {
  width: 26px;
  height: 26px;
}

.player-maintenance-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: #fcd34d;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
}

.player-maintenance-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
  max-width: 440px;
}

.player-maintenance-eta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.14);
}

.player-maintenance-eta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.player-maintenance-eta strong {
  color: #fef3c7;
  font-weight: 800;
}

.player-notice-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.player-notice-subtitle {
  font-size: 0.86rem;
  color: #94a3b8;
  margin-bottom: 16px;
  line-height: 1.45;
  max-width: 520px;
}

.player-notice-subtitle strong {
  color: #f8fafc;
}

.player-notice-candidates-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.player-notice-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.btn-candidate-play {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.btn-candidate-play:hover {
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.2);
  border-color: var(--accent-blue, #0084ff);
  color: var(--accent-cyan, #38bdf8);
  transform: translateX(3px);
}

.candidate-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.candidate-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  text-transform: uppercase;
  flex-shrink: 0;
}

.candidate-action svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* Animações */
@keyframes playerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes playerScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes playerSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   PAINEL DE GUIA DE PROGRAMAÇÃO (EPG) INTEGRADO AO MODAL DE CANAL
   ========================================================================== */
.player-epg-panel {
  background: rgba(9, 14, 26, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.player-epg-panel.is-collapsed {
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 0;
}

.player-epg-panel[hidden] {
  display: none;
}

.player-fs-hotspot {
  display: none;
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) .player-epg-panel {
  display: none;
}

.player-modal-overlay.is-pseudo-fullscreen {
  padding: 0 !important;
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  position: relative !important;
  overflow: hidden !important;
  animation: none !important;
  transform: none !important;
  transition: none !important;
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) .player-fs-hotspot {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  z-index: 25;
  background: transparent;
}

@media (hover: none), (pointer: coarse) {
  #player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) .player-fs-hotspot {
    height: 30px;
  }
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) .player-modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(180deg, rgba(6, 9, 15, 0.92) 0%, rgba(6, 9, 15, 0.65) 75%, transparent 100%);
  border-bottom: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen).is-fs-ui-hidden .player-modal-header {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

#player-modal-container:is(:fullscreen, .is-pseudo-fullscreen) .player-screen-box {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  flex: 1;
  min-height: 0;
}

.player-epg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  cursor: pointer;
  user-select: none;
}

.player-epg-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap;
}

.player-epg-now-preview {
  font-size: 0.78rem;
  font-weight: 500;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.player-epg-panel:not(.is-collapsed) .player-epg-now-preview {
  display: none;
}

.player-epg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.14);
  border: 1px solid rgba(var(--accent-rgb, 0, 132, 255), 0.35);
  color: var(--accent-cyan, #38bdf8);
  flex-shrink: 0;
}

.player-epg-icon svg {
  width: 14px;
  height: 14px;
}

.player-epg-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-epg-channel-pill {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-cyan, #38bdf8);
  background: rgba(var(--accent-cyan-rgb, 0, 210, 255), 0.1);
  border: 1px solid rgba(var(--accent-cyan-rgb, 0, 210, 255), 0.25);
  padding: 3px 9px;
  border-radius: 9999px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.player-epg-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-epg-action,
.btn-epg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-epg-toggle {
  padding: 5px 7px;
}

.btn-epg-action svg,
.btn-epg-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.btn-epg-action:hover,
.btn-epg-toggle:hover {
  color: #ffffff;
  background: rgba(var(--accent-rgb, 0, 132, 255), 0.18);
  border-color: rgba(var(--accent-rgb, 0, 132, 255), 0.4);
}

.player-epg-panel.is-collapsed .player-epg-body {
  display: none;
}

.player-epg-panel.is-collapsed .btn-epg-toggle svg {
  transform: rotate(180deg);
}

.player-epg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.epg-slot-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.epg-slot-card.is-current {
  background: linear-gradient(155deg, rgba(var(--accent-rgb, 0, 132, 255), 0.14) 0%, rgba(15, 23, 42, 0.92) 70%);
  border-color: rgba(var(--accent-rgb, 0, 132, 255), 0.42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.epg-slot-card.is-empty {
  justify-content: center;
  opacity: 0.7;
}

.epg-slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.epg-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2.5px 8px;
  border-radius: 9999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.epg-slot-badge.is-live {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}

.epg-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: epgPulse 1.4s infinite;
}

.epg-slot-time {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  white-space: nowrap;
}

.epg-slot-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.epg-slot-thumb-wrap {
  width: 84px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.epg-slot-card:not(.is-current) .epg-slot-thumb-wrap {
  width: 68px;
  height: 44px;
}

.epg-slot-thumb {
  width: 100%;
  height: 100%;
  aspect-ratio: 84 / 52;
  object-fit: cover;
  display: block;
}

.epg-slot-card:not(.is-current) .epg-slot-thumb {
  aspect-ratio: 68 / 44;
}

.epg-slot-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.epg-slot-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-slot-card:not(.is-current) .epg-slot-title {
  font-size: 0.84rem;
}

.epg-slot-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-slot-card.is-expanded .epg-slot-desc {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.btn-epg-expand {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-cyan, #38bdf8);
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-epg-expand:hover {
  text-decoration: underline;
}

.epg-slot-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 2px;
}

.epg-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
}

.epg-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.epg-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent-blue, #0084ff), var(--accent-cyan, #00d2ff));
  transition: width 0.4s ease;
}

.epg-slot-empty-text {
  font-size: 0.78rem;
  color: #64748b;
}

.epg-slot-skeleton {
  height: 112px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: epgSkeletonShimmer 1.35s infinite;
}

.player-epg-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
  font-size: 0.8rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.player-epg-empty-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-epg-empty-left svg {
  width: 16px;
  height: 16px;
  color: #64748b;
  flex-shrink: 0;
}

@keyframes epgPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@keyframes epgSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 880px) {
  .player-epg-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   RESPONSIVIDADE DO MODAL PLAYER (MOBILE & TABLETS)
   ========================================================================== */
@media (max-width: 900px) {
  .player-modal-container.is-series-mode {
    --player-chrome-height: 204px;
  }
  .player-series-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px;
  }
  .player-series-servers {
    width: 100%;
  }
  .player-series-selectors {
    width: 100%;
    gap: 8px;
  }
  .player-season-pill {
    flex: 0 0 38%;
    max-width: 38%;
  }
  .player-episode-pill {
    flex: 1 1 0%;
    min-width: 0;
  }
  .player-series-select-pill .player-source-select {
    width: 0;
    flex: 1 1 0%;
    max-width: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 768px) {
  .player-modal-overlay {
    padding: 10px;
  }
  .player-modal-container {
    --player-chrome-height: 158px;
    width: 100%;
    border-radius: 14px;
    max-height: calc(100dvh - 20px);
    touch-action: pan-y;
  }
  .player-modal-container.is-series-mode {
    --player-chrome-height: 212px;
  }
  .player-modal-container.has-epg {
    --player-chrome-height: 204px;
  }
  .player-modal-container:has(.player-notice-box) {
    overflow-y: auto;
  }
  .player-epg-panel {
    padding: 10px 12px 12px;
    gap: 10px;
  }
  .player-epg-panel.is-collapsed {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .player-epg-panel.is-collapsed .player-epg-title {
    display: none;
  }
  .player-epg-title {
    font-size: 0.78rem;
  }
  .player-epg-channel-pill {
    max-width: 118px;
    font-size: 0.7rem;
    padding: 2.5px 8px;
  }
  .player-epg-now-preview {
    font-size: 0.74rem;
  }
  .btn-epg-toggle {
    min-width: 34px;
    min-height: 34px;
    justify-content: center;
  }
  .player-epg-grid {
    gap: 10px;
  }
  .epg-slot-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .btn-epg-expand {
    padding: 4px 0;
  }
  .player-header-main {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .player-series-controls {
    padding: 8px 12px 10px;
    gap: 8px;
  }
  .player-header-left {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
  }
  .player-type-indicator {
    padding: 4px 8px;
  }
  .player-video-title {
    font-size: 0.94rem;
  }
  .player-header-right {
    order: 2;
    flex-shrink: 0;
    gap: 6px;
  }
  .player-header-center {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
  }
  .player-source-pill {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: space-between;
    padding: 6px 10px;
  }
  .player-source-select {
    max-width: none;
    width: 0;
    flex: 1 1 0%;
    min-width: 0;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .player-screen-box:has(.player-notice-box) {
    aspect-ratio: auto;
    min-height: 240px;
    padding: 14px 0;
  }
  .player-notice-box {
    max-height: 75vh;
    overflow-y: auto;
  }
  .player-maintenance-box {
    padding: 22px 18px;
  }
  .player-maintenance-title {
    font-size: 1.14rem;
  }
  .player-maintenance-desc {
    font-size: 0.86rem;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .player-modal-overlay {
    padding: 8px;
  }
  .player-modal-container {
    --player-chrome-height: 76px;
    width: min(100%, calc((100dvh - var(--player-chrome-height)) * 16 / 9));
    min-width: min(100%, 360px);
    max-height: calc(100dvh - 16px);
  }
  .player-modal-container.is-series-mode {
    --player-chrome-height: 118px;
  }
  .player-modal-container.has-epg {
    --player-chrome-height: 128px;
  }
  .player-header-main {
    padding: 8px 12px;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .player-series-controls {
    flex-direction: row;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
  }
  .player-series-servers {
    width: auto;
  }
  .player-series-selectors {
    width: auto;
  }
  .player-season-pill,
  .player-episode-pill {
    flex: 0 1 auto;
    max-width: none;
  }
  .player-header-left {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }
  .player-header-center {
    order: 2;
    flex: 0 1 auto;
    width: auto;
  }
  .player-header-right {
    order: 3;
    flex-shrink: 0;
  }
  .player-source-select {
    width: auto;
    flex: 0 1 auto;
    max-width: 170px;
  }
  .player-episode-select {
    max-width: 190px;
  }
}

@media (max-height: 440px) {
  .player-modal-container:not(:fullscreen):not(.is-pseudo-fullscreen) {
    overflow-y: auto;
  }
}

:is(
  .btn-player-fullscreen,
  .btn-close-player,
  .btn-series-server,
  .btn-candidate-play,
  .btn-epg-action,
  .btn-epg-toggle,
  .btn-epg-expand
):focus-visible {
  outline: 2px solid var(--accent-cyan, #00d2ff);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .player-modal-overlay,
  .player-modal-container,
  .player-notice-box {
    animation: none;
    transition: none;
  }

  .player-source-pill,
  .btn-series-server,
  .btn-player-fullscreen,
  .btn-close-player,
  .btn-candidate-play,
  .btn-epg-action,
  .btn-epg-toggle,
  .epg-progress-fill {
    transition: none;
  }

  .epg-live-dot,
  .epg-slot-skeleton {
    animation: none;
  }

  .player-buffering-spinner {
    animation-duration: 1.8s;
  }
}
