/* ─── EPTV CAST: Transmissão Universal para Smart TVs (Chromecast, AirPlay & Web Caster) ─── */
.eptv-cast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(14, 12, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0;
  margin: 0;
  outline: none;
  z-index: 15;
}

.eptv-cast-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.eptv-cast-btn:hover {
  transform: scale(1.08);
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.eptv-cast-btn:active {
  transform: scale(0.94);
}

.eptv-cast-btn.is-active,
.eptv-cast-btn.is-casting {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.55);
}

/* Botão flutuante sobre o player desativado (usando botão nativo no dock de controles inferior) */
.eptv-player-floating-cast,
.ch-player-wrap .eptv-player-floating-cast,
.plyr .eptv-player-floating-cast {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 600px) {
  .eptv-player-floating-cast {
    display: none !important;
  }
}

/* Integração com barra do Plyr */
.plyr__control--cast {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0.9 !important;
  visibility: visible !important;
}
.plyr__control--cast:hover {
  opacity: 1 !important;
  color: #fbbf24 !important;
}
.plyr__control--cast svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* ─── MODAL UNIVERSAL DE TRANSMISSÃO (BOTTOM-SHEET NO MOBILE) ─── */
.eptv-cast-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(4, 3, 8, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.eptv-cast-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.eptv-cast-modal {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(145deg, rgba(24, 20, 34, 0.96) 0%, rgba(12, 10, 18, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 32px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 24px;
  box-sizing: border-box;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  font-family: inherit;
}

.eptv-cast-modal-backdrop.is-open .eptv-cast-modal {
  transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
  .eptv-cast-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .eptv-cast-modal {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 22px 18px 28px;
    transform: translateY(100%);
  }
  .eptv-cast-modal-backdrop.is-open .eptv-cast-modal {
    transform: translateY(0);
  }
}

.eptv-cast-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.eptv-cast-modal-head__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.eptv-cast-modal-head__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  flex-shrink: 0;
}

.eptv-cast-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #a0a6b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.18s ease;
}

.eptv-cast-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.eptv-cast-target-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  font-size: 13px;
  color: #cbd5e1;
}

.eptv-cast-target-info strong {
  color: #ffffff;
  display: block;
  font-size: 13.5px;
}

.eptv-cast-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eptv-cast-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.eptv-cast-option-card:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04));
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.eptv-cast-option-card__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.eptv-cast-option-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.eptv-cast-option-card:hover .eptv-cast-option-icon {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.eptv-cast-option-text {
  min-width: 0;
}

.eptv-cast-option-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.eptv-cast-option-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.eptv-cast-option-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.eptv-cast-option-arrow {
  font-size: 16px;
  color: #94a3b8;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.eptv-cast-option-card:hover .eptv-cast-option-arrow {
  transform: translateX(3px);
  color: #fbbf24;
}

.eptv-cast-copied-toast {
  display: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #dcfce7;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  margin-top: 14px;
}

.eptv-cast-copied-toast.is-visible {
  display: block;
  animation: eptvFadeIn 0.2s ease;
}

@keyframes eptvFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
