/* ============================================
   CANAL INFANTIL 24/7 - NETFLIX KIDS STYLE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --b-radius: 24px;
  --b-radius-sm: 16px;
  --b-radius-xs: 12px;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-bg-hover: rgba(255, 255, 255, 0.13);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --rainbow-1: #ff6b9d;
  --rainbow-2: #ff9a56;
  --rainbow-3: #fbbf24;
  --rainbow-4: #4ade80;
  --rainbow-5: #22d3ee;
  --rainbow-6: #818cf8;
  --rainbow-7: #c084fc;
}

body {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  background: #0a0a1a;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========== ANIMATED SKY BACKGROUND ========== */
.sky-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky-gradient {
  position: absolute;
  inset: 0;
  transition: background 2s ease-in-out;
}

.sky-gradient.morning {
  background: linear-gradient(180deg, #ff9a56 0%, #ff6b9d 30%, #fbbf24 60%, #a8d8ea 100%);
}

.sky-gradient.afternoon {
  background: linear-gradient(180deg, #4facfe 0%, #00f2fe 30%, #a8d8ea 60%, #c3e8ff 100%);
}

.sky-gradient.evening {
  background: linear-gradient(180deg, #ff6b9d 0%, #c084fc 30%, #ff9a56 60%, #2d1b69 100%);
}

.sky-gradient.night {
  background: linear-gradient(180deg, #0a0a2e 0%, #1a1040 30%, #0d1b3e 60%, #0a0a1a 100%);
}

.stars-container {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.stars-container.visible {
  opacity: 1;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--star-duration) ease-in-out infinite;
  animation-delay: var(--star-delay);
  box-shadow: 0 0 var(--star-glow) rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

.clouds-container {
  position: absolute;
  inset: 0;
  opacity: 0.6;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  animation: cloudFloat var(--cloud-speed) linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.cloud::before {
  width: 60px;
  height: 60px;
  top: -30px;
  left: 20px;
}

.cloud::after {
  width: 80px;
  height: 80px;
  top: -40px;
  left: 60px;
}

@keyframes cloudFloat {
  0% { transform: translateX(-200px); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

.sun-moon {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  right: 15%;
  transition: all 2s ease-in-out;
  box-shadow: 0 0 80px rgba(255, 183, 77, 0.6), 0 0 160px rgba(255, 183, 77, 0.3);
}

.sun-moon.morning {
  top: 35%;
  background: radial-gradient(circle, #fff7ad, #ffb74d);
}

.sun-moon.afternoon {
  top: 8%;
  background: radial-gradient(circle, #ffffff, #ffcc02);
}

.sun-moon.evening {
  top: 65%;
  background: radial-gradient(circle, #ff9966, #ff6b6b);
  box-shadow: 0 0 80px rgba(255, 107, 107, 0.6), 0 0 160px rgba(255, 107, 107, 0.3);
}

.sun-moon.night {
  top: 20%;
  background: radial-gradient(circle, #f0f0f0, #c0c0c0);
  box-shadow: 0 0 40px rgba(200, 200, 255, 0.4), 0 0 80px rgba(200, 200, 255, 0.2);
}

/* ========== HEADER ========== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  background: rgba(10, 10, 26, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
}

.logo-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-7));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(255, 107, 157, 0.5),
    0 0 60px rgba(192, 132, 252, 0.3);
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 107, 157, 0.5), 0 0 60px rgba(192, 132, 252, 0.3); }
  50% { box-shadow: 0 0 50px rgba(255, 107, 157, 0.8), 0 0 100px rgba(192, 132, 252, 0.5); }
}

.logo-icon {
  font-size: 28px;
  animation: bounceIcon 2s ease-in-out infinite;
}

@keyframes bounceIcon {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-6px) scale(1.1); }
  50% { transform: translateY(0) scale(1); }
  70% { transform: translateY(-3px) scale(1.05); }
}

.channel-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-3), var(--rainbow-5), var(--rainbow-7));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbowText 4s ease-in-out infinite;
}

@keyframes rainbowText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.live-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ff4444;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: liveGlow 1.5s ease-in-out infinite;
}

@keyframes liveGlow {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(255, 68, 68, 0.6); }
  50% { opacity: 0.6; text-shadow: 0 0 20px rgba(255, 68, 68, 1); }
}

.live-dot {
  width: 9px;
  height: 9px;
  background: #ff4444;
  border-radius: 50%;
  display: inline-block;
  animation: dotPulse 1s ease-in-out infinite;
  box-shadow: 0 0 10px #ff4444;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.4; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Viewer counter */
.viewer-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.1);
}

.viewer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fe0b6;
  box-shadow: 0 0 8px #4fe0b6;
  animation: dotPulse 2s ease-in-out infinite;
}

.clock {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--rainbow-5), var(--rainbow-7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.confetti-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.confetti-btn:hover {
  background: var(--glass-bg-hover);
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 0 30px rgba(255, 251, 36, 0.4);
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
  position: relative;
  z-index: 1;
  padding: 20px 28px 32px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

/* ========== HERO SECTION (Player + Info | EPG) ========== */
.hero-section {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.hero-left {
  flex: 0 0 58%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  animation: confettiFall var(--confetti-duration) var(--confetti-delay) ease-out forwards;
  opacity: 0;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  50% { opacity: 1; transform: translateY(50vh) rotate(360deg) scale(1.5); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.3); }
}

/* ========== TV FRAME ========== */
.tv-frame {
  position: relative;
  flex-shrink: 0;
}

.tv-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--b-radius);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 40px rgba(255, 107, 157, 0.2),
    0 0 80px rgba(192, 132, 252, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease;
}

.tv-screen:hover {
  transform: perspective(800px) rotateY(-2deg) rotateX(2deg);
  box-shadow:
    0 0 60px rgba(255, 107, 157, 0.35),
    0 0 120px rgba(192, 132, 252, 0.25),
    0 30px 80px rgba(0, 0, 0, 0.6);
}

.tv-screen video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.tv-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  pointer-events: none;
  border-radius: var(--b-radius);
}

.tv-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.03) 100%);
  pointer-events: none;
  border-radius: var(--b-radius);
}

/* ========== PLAYER CONTROLS BAR (YouTube style) ========== */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 36px 14px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: all;
}

/* Boton central de play/pausa estilo YouTube */
.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.big-play-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.big-play-btn:active {
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.8);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  width: 70px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.controls-spacer {
  flex: 1;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.cast-btn.connected {
  color: var(--rainbow-1) !important;
  background: rgba(255, 107, 157, 0.3) !important;
  border-color: rgba(255, 107, 157, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 107, 157, 0.4);
}

/* ========== QUALITY SELECTOR ========== */
.quality-selector {
  position: relative;
  z-index: 7;
}

.quality-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.quality-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.quality-menu {
  position: absolute;
  bottom: 44px;
  right: 0;
  background: rgba(10, 10, 30, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--b-radius-xs);
  overflow: hidden;
  display: none;
  flex-direction: column;
  min-width: 90px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.quality-menu.open {
  display: flex;
}

.quality-option {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.quality-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.quality-option.active {
  color: var(--rainbow-1);
  background: rgba(255, 107, 157, 0.15);
}

.tv-glow-bottom {
  position: absolute;
  bottom: -30px;
  left: 5%;
  width: 90%;
  height: 50px;
  background: linear-gradient(90deg, transparent, var(--rainbow-1), var(--rainbow-4), var(--rainbow-7), transparent);
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.35;
  pointer-events: none;
}

.tv-corners {
  position: absolute;
  inset: -8px;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 4px;
}

.corner.tl { top: 0; left: 0; border-top: 3px solid rgba(255,255,255,0.15); border-left: 3px solid rgba(255,255,255,0.15); }
.corner.tr { top: 0; right: 0; border-top: 3px solid rgba(255,255,255,0.15); border-right: 3px solid rgba(255,255,255,0.15); }
.corner.bl { bottom: 0; left: 0; border-bottom: 3px solid rgba(255,255,255,0.15); border-left: 3px solid rgba(255,255,255,0.15); }
.corner.br { bottom: 0; right: 0; border-bottom: 3px solid rgba(255,255,255,0.15); border-right: 3px solid rgba(255,255,255,0.15); }

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: radial-gradient(ellipse at center, rgba(192, 132, 252, 0.15) 0%, transparent 70%);
}

.placeholder-icon {
  font-size: 80px;
  animation: floatPlaceholder 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.4));
}

@keyframes floatPlaceholder {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.08); }
}

.placeholder-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

/* ========== HERO INFO ========== */
.hero-info {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--b-radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.now-playing-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #ff4444, #ff6b6b);
  color: #fff;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  width: fit-content;
  animation: badgePulse 2s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.hero-show-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.5px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero-category {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
}

/* ========== PROGRESS BAR ========== */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  overflow: hidden;
}

.progress-rainbow {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--rainbow-1), var(--rainbow-2), var(--rainbow-3), var(--rainbow-4), var(--rainbow-5), var(--rainbow-6), var(--rainbow-7));
  background-size: 200% 100%;
  animation: rainbowShift 3s linear infinite;
  transition: width 1s ease-in-out;
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

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

.progress-info {
  display: flex;
  justify-content: space-between;
}

.progress-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ========== HERO ACTIONS ========== */
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-glass {
  padding: 10px 22px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
}

.btn-glass:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-glass:active {
  transform: translateY(1px) scale(0.97);
}

.btn-play {
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-7));
  border: none;
  box-shadow: 0 4px 24px rgba(255, 107, 157, 0.4);
}

.btn-play:hover {
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-7));
  box-shadow: 0 8px 36px rgba(255, 107, 157, 0.6);
}

/* ========== EPG PANEL (Right Sidebar) ========== */
.epg-panel {
  width: 340px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--b-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.epg-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
}

.epg-panel-icon {
  font-size: 18px;
}

.epg-live-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff4444;
  animation: liveGlow 1.5s ease-in-out infinite;
}

.epg-live-indicator .live-dot {
  width: 7px;
  height: 7px;
}

/* Current show card */
.epg-now-card {
  margin: 14px 14px 0;
  padding: 16px;
  background: rgba(255, 107, 157, 0.15);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: var(--b-radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.epg-now-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--rainbow-1);
}

.epg-now-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.epg-now-time {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.epg-mini-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  overflow: hidden;
  margin-top: 2px;
}

.epg-mini-bar {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--rainbow-1), var(--rainbow-3));
  transition: width 1s ease-in-out;
}

/* Up next */
.epg-upnext {
  padding: 14px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.epg-upnext-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
}

.epg-upnext-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--b-radius-xs);
  transition: all 0.25s ease;
}

.epg-upnext-emoji {
  font-size: 28px;
  flex-shrink: 0;
}

.epg-upnext-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.epg-upnext-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.85);
}

.epg-upnext-time {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

/* Scrollable show list */
.epg-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  min-height: 0;
  max-height: 500px;
}

.epg-scroll-list::-webkit-scrollbar {
  width: 4px;
}

.epg-scroll-list::-webkit-scrollbar-track {
  background: transparent;
}

.epg-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.epg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--b-radius-xs);
  transition: all 0.2s ease;
}

.epg-row.active {
  background: rgba(255, 107, 157, 0.1);
  border-left: 3px solid var(--rainbow-1);
  padding-left: 9px;
}

.epg-row.past {
  opacity: 0.35;
}

.epg-row-time {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
}

.epg-row.active .epg-row-time {
  color: var(--rainbow-1);
}

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

.epg-row-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.85);
}

.epg-row.active .epg-row-title {
  color: var(--rainbow-1);
}

.epg-row-duration {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.epg-row-progress {
  font-size: 10px;
  font-weight: 600;
  color: var(--rainbow-3);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(20, 20, 40, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: 5000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ========== FOOTER ========== */
.bottom-bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: 'Fredoka', sans-serif;
}

.facebook-btn {
  background: linear-gradient(135deg, #1877F2, #0d6efd);
  color: #fff;
  box-shadow: 0 4px 16px rgba(24, 119, 242, 0.35);
}
.facebook-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(24, 119, 242, 0.5);
}

.social-divider {
  color: rgba(255,255,255,0.2);
  font-size: 16px;
}

.social-text {
  color: var(--text-tertiary);
}

.footer-status {
  color: var(--rainbow-4);
  font-weight: 600;
}

/* ========== WHATSAPP FLOATING BUTTON ========== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: wspSlideUp 0.6s ease-out;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.6);
}

.wsp-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: wspPulse 2s ease-out infinite;
}

.footer-status {
  color: var(--rainbow-4);
  font-weight: 600;
}

/* ========== DONATION MARQUEE ========== */
.donation-marquee {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.15), rgba(255, 107, 157, 0.15), rgba(192, 132, 252, 0.15));
  border-bottom: 1px solid rgba(255, 107, 157, 0.15);
  padding: 10px 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 22s linear infinite;
  gap: 60px;
}

.marquee-track span {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
}

.marquee-track strong {
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 107, 157, 0.3);
  padding: 2px 10px;
  border-radius: 50px;
}

.marquee-download {
  font-weight: 800 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #25D366, #128C7E) !important;
  padding: 4px 16px !important;
  border-radius: 50px !important;
  text-decoration: none !important;
  letter-spacing: 1px;
  animation: marqueeGlow 2s ease-in-out infinite;
}

@keyframes marqueeGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(37, 211, 102, 0.3); }
  50% { box-shadow: 0 0 20px rgba(37, 211, 102, 0.7); }
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes wspPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ========== DOWNLOAD CARD ========== */
.download-card {
  margin: 0 14px 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(18, 140, 126, 0.12));
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.download-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.download-card-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.download-card-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border-radius: 50px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.download-card-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

/* Fake fullscreen (fallback para WebView/APK) */
.tv-screen.fake-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  margin: 0 !important;
}

.tv-screen.rotate-landscape {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  z-index: 9999 !important;
}

.tv-screen.rotate-landscape video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.tv-screen.fake-fullscreen video {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
}

.tv-screen.fake-fullscreen .tv-glare,
.tv-screen.fake-fullscreen .tv-scanlines,
.tv-screen.fake-fullscreen .tv-corners,
.tv-screen.fake-fullscreen .tv-glow-bottom {
  display: none !important;
}

.tv-screen.fake-fullscreen .player-controls {
  opacity: 1 !important;
  pointer-events: all !important;
}

body.is-fullscreen {
  overflow: hidden !important;
  background: #000 !important;
}

body.is-fullscreen .top-bar,
body.is-fullscreen .hero-info,
body.is-fullscreen .hero-actions,
body.is-fullscreen .epg-panel,
body.is-fullscreen .donation-marquee,
body.is-fullscreen .bottom-bar,
body.is-fullscreen .whatsapp-float {
  display: none !important;
}

body.is-fullscreen .main-wrapper {
  padding: 0 !important;
  max-width: none !important;
}

body.is-fullscreen .hero-section {
  display: block !important;
}

body.is-fullscreen .hero-left {
  flex: 1 !important;
}

body.is-fullscreen .tv-frame {
  position: static !important;
}

/* ========== FULLSCREEN ========== */
.tv-screen:fullscreen {
  border-radius: 0;
  background: #000;
  box-shadow: none;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  position: fixed;
  inset: 0;
}

.tv-screen:fullscreen video {
  object-fit: contain;
  width: 100% !important;
  height: 100% !important;
}

.tv-screen:fullscreen .player-placeholder {
  display: none;
}

.tv-screen:fullscreen .player-controls {
  opacity: 1;
  pointer-events: all;
}

.tv-screen:fullscreen .tv-glare,
.tv-screen:fullscreen .tv-scanlines,
.tv-screen:fullscreen .tv-corners {
  display: none;
}

/* Ocultar elementos al hacer fullscreen */
.tv-screen:fullscreen ~ .hero-info,
.tv-screen:fullscreen ~ * {
  display: none;
}

body:has(.tv-screen:fullscreen) .top-bar,
body:has(.tv-screen:fullscreen) .hero-section > *:not(.hero-left),
body:has(.tv-screen:fullscreen) .epg-panel,
body:has(.tv-screen:fullscreen) .bottom-bar,
body:has(.tv-screen:fullscreen) .donation-marquee {
  display: none !important;
}

/* Pantalla completa: video ocupa todo */
body:has(.tv-screen:fullscreen) {
  background: #000 !important;
  overflow: hidden;
}

body:has(.tv-screen:fullscreen) .main-wrapper {
  padding: 0;
  max-width: none;
}

body:has(.tv-screen:fullscreen) .hero-left {
  flex: 1;
}

body:has(.tv-screen:fullscreen) .tv-frame {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* WebKit fullscreen */
.tv-screen:-webkit-full-screen {
  border-radius: 0;
  background: #000;
  box-shadow: none;
}
.tv-screen:-webkit-full-screen video {
  object-fit: contain;
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 1200px) {
  .hero-left {
    flex: 0 0 55%;
  }
  .epg-panel {
    width: 300px;
  }
}

@media (max-width: 1000px) {
  .hero-section {
    flex-direction: column;
  }
  .hero-left {
    flex: 1;
  }
  .epg-panel {
    width: 100%;
    max-height: 380px;
  }
  .epg-scroll-list {
    max-height: 180px;
  }
  .hero-show-title {
    font-size: 22px;
  }
}

@media (max-width: 700px) {
  .top-bar {
    padding: 10px 16px;
  }

  .channel-name {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .clock {
    font-size: 20px;
  }

  .main-wrapper {
    padding: 12px 10px 20px;
  }

  .hero-info {
    padding: 18px;
  }

  .hero-show-title {
    font-size: 20px;
  }

  .btn-glass {
    padding: 8px 16px;
    font-size: 13px;
  }

  .bottom-bar {
    padding: 10px 16px;
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .hero-actions {
    flex-direction: column;
  }

    .btn-glass {
      width: 100%;
      text-align: center;
    }
}
