/* ==================== MULTICAM RETRO 2006-2012 - ESTILO WINDOWS VISTA/MAC OS X ==================== */

/* ==================== Variables Retro ==================== */
:root {
  /* Colores Retro */
  --retro-blue: #2196F3;
  --retro-blue-light: #64B5F6;
  --retro-blue-dark: #1976D2;
  --retro-green: #4CAF50;
  --retro-orange: #FF9800;
  --retro-purple: #9C27B0;
  
  /* Espaciados */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  
  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  /* Sombras */
  --retro-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  --retro-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.4);
  
  /* Transiciones */
  --retro-transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', 'Lucida Grande', Tahoma, Geneva, Verdana, sans-serif;
  
  /* Fondo azul Windows XP Luna */
  background: 
    radial-gradient(ellipse at top right, #5A8FD4 0%, #2865C7 50%, #0D4FA3 100%),
    linear-gradient(180deg, #3D6FB8 0%, #1C4F9C 100%);
  background-size: cover;
  background-attachment: fixed;
}

/* Patrón de cuadrícula */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* ==================== OPTIONS BAR TIPO BARRA DE WINDOWS ==================== */
.options-bar {
  padding: var(--space-sm) clamp(1%, 1.5vw, 2%);
  
  /* Vidrio translúcido tipo Vista */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(245, 248, 255, 0.9) 50%,
    rgba(235, 242, 255, 0.95) 100%);
  
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  
  border-bottom: 1px solid rgba(200, 220, 255, 0.8);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-sm);
  z-index: 10;
  position: relative;
  min-height: 56px;
}

/* Brillo superior */
.options-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  pointer-events: none;
}

.options-bar label {
  font-weight: 600;
  color: #2C3E50;
  font-size: 0.9rem;
  margin-right: var(--space-xs);
  flex-shrink: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ==================== BOTONES TIPO GEL ==================== */
.btn,
.layout-dropdown-btn,
.dropdown-btn,
.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: 18px;
  
  /* Botón tipo gel */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 250, 255, 0.9) 45%,
    rgba(240, 245, 255, 0.92) 55%,
    rgba(235, 242, 255, 0.95) 100%);
  
  border: 1px solid rgba(200, 220, 255, 0.8);
  color: #2C3E50;
  font-weight: 600;
  cursor: pointer;
  transition: var(--retro-transition);
  font-size: 0.9rem;
  min-height: 40px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.05);
  
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

/* Brillo superior en botones */
.btn::before,
.layout-dropdown-btn::before,
.dropdown-btn::before,
.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}


.btn:active,
.layout-dropdown-btn:active,
.dropdown-btn:active,
.filter-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg,
    rgba(33, 150, 243, 0.95) 0%,
    rgba(25, 118, 210, 0.9) 50%,
    rgba(66, 165, 245, 0.95) 100%);
}

/* ==================== LAYOUT SELECTOR ==================== */
.layout-dropdown-btn {
  position: relative;
  min-width: 160px;
  justify-content: space-between;
}

.layout-dropdown-btn::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform var(--transition-normal);
}

.layout-dropdown-btn.active::after {
  transform: rotate(180deg);
}

.layout-dropdown-content {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  
  /* Panel tipo Windows */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(245, 248, 255, 0.95) 100%);
  
  backdrop-filter: blur(20px);
  border: 1px solid rgba(200, 220, 255, 0.8);
  border-radius: var(--radius-md);
  z-index: 1001;
  display: none;
  min-width: 160px;
  
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.layout-dropdown-content.show {
  display: block;
  animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.layout-option {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: var(--retro-transition);
  border-bottom: 1px solid rgba(200, 220, 255, 0.3);
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #2C3E50;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.layout-option:hover {
  background: linear-gradient(90deg,
    rgba(100, 181, 246, 0.2) 0%,
    rgba(100, 181, 246, 0.3) 100%);
  padding-left: 24px;
  color: var(--retro-blue-dark);
}

.layout-option:last-child {
  border-bottom: none;
}

/* ==================== FILTER BUTTONS ==================== */
.filter-btn {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(240, 245, 255, 0.85) 50%,
    rgba(230, 238, 255, 0.9) 100%);
  border-color: rgba(150, 180, 220, 0.6);
}

.filter-btn.active {
  background: linear-gradient(180deg,
    rgba(100, 181, 246, 0.95) 0%,
    rgba(64, 169, 255, 0.9) 50%,
    rgba(33, 150, 243, 0.95) 100%);
  border-color: var(--retro-blue);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 3px 10px rgba(33, 150, 243, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
}

/* ==================== FULLSCREEN BUTTON DESTACADO ==================== */
.fullscreen-btn {
  margin-left: auto;
  background: linear-gradient(180deg, #FFD54F 0%, #FFC107 50%, #FFA000 100%);
  border-color: rgba(255, 193, 7, 0.8);
  color: #5D4037;
  font-weight: 700;
  border: none;
  
  box-shadow: 
    0 3px 8px rgba(255, 152, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  
  animation: goldGlow 2s ease-in-out infinite;
}

@keyframes goldGlow {
  0%, 100% { 
    box-shadow: 
      0 3px 8px rgba(255, 152, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.7); 
  }
  50% { 
    box-shadow: 
      0 4px 12px rgba(255, 152, 0, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 0 20px rgba(255, 193, 7, 0.5);
  }
}

.fullscreen-btn:hover {
  background: linear-gradient(180deg, #FFECB3 0%, #FFD54F 50%, #FFC107 100%);
  transform: translateY(-3px);
}

.icon-fullscreen {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ==================== STREAM SELECTORS ==================== */
.stream-selectors {
  padding: var(--space-sm) clamp(1%, 1.5vw, 2%);
  
  background: linear-gradient(180deg,
    rgba(245, 248, 255, 0.9) 0%,
    rgba(235, 242, 255, 0.85) 100%);
  
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(200, 220, 255, 0.6);
  
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-sm);
  z-index: 9;
  position: relative;
}

.stream-dropdown {
  position: relative;
}

.dropdown-btn {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-btn::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform var(--transition-normal);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.dropdown-btn.active::after {
  transform: rotate(180deg);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  right: 0;
  
  /* Panel tipo lista de Windows */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(245, 248, 255, 0.95) 100%);
  
  backdrop-filter: blur(20px);
  border: 1px solid rgba(200, 220, 255, 0.8);
  border-radius: var(--radius-md);
  max-height: min(400px, 70vh);
  overflow-y: auto;
  z-index: 1001;
  display: none;
  
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  
  -webkit-overflow-scrolling: touch;
}

.dropdown-content.show {
  display: block;
  animation: dropdownSlide 0.2s ease;
}

/* Scrollbar estilo Windows 7 */
.dropdown-content::-webkit-scrollbar {
  width: 12px;
}

.dropdown-content::-webkit-scrollbar-track {
  background: rgba(230, 235, 245, 0.8);
  border-radius: 6px;
}

.dropdown-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
    rgba(150, 180, 220, 0.9) 0%,
    rgba(120, 160, 210, 0.85) 50%,
    rgba(150, 180, 220, 0.9) 100%);
  border-radius: 6px;
  border: 1px solid rgba(100, 140, 200, 0.6);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,
    rgba(100, 181, 246, 0.95) 0%,
    rgba(64, 169, 255, 0.9) 50%,
    rgba(100, 181, 246, 0.95) 100%);
}

/* ==================== STREAM OPTIONS ==================== */
.stream-option {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: var(--retro-transition);
  border-bottom: 1px solid rgba(200, 220, 255, 0.3);
  min-height: 44px;
  touch-action: manipulation;
  color: #2C3E50;
}

.stream-option:hover {
  background: linear-gradient(90deg,
    rgba(100, 181, 246, 0.2) 0%,
    rgba(100, 181, 246, 0.3) 100%);
  padding-left: 24px;
}

.stream-option:last-child {
  border-bottom: none;
}

.stream-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stream-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #2C3E50;
  line-height: 1.3;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stream-meta {
  font-size: 0.8rem;
  color: #5D4037;
  opacity: 0.9;
}

/* ==================== CONTAINER ==================== */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: var(--space-sm);
  position: relative;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.streams-grid {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  position: relative;
  z-index: 5;
}

/* ==================== GRID LAYOUTS ==================== */
.layout-1 { 
  grid-template-columns: 1fr;
  grid-template-rows: minmax(600px, 1fr);
}

.layout-2 { 
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: minmax(500px, 1fr);
}

.layout-3 { 
  grid-template-columns: repeat(2, 1fr); 
  grid-template-rows: minmax(400px, 1fr) minmax(400px, 1fr);
}

.layout-3 .stream-item:nth-child(1) { 
  grid-column: 1 / -1; 
}

.layout-4 { 
  grid-template-columns: repeat(2, 1fr); 
  grid-template-rows: minmax(450px, 1fr) minmax(450px, 1fr);
}

/* ==================== STREAM ITEMS TIPO VENTANA ==================== */
.stream-item {
  /* Vidrio translúcido tipo Vista */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(245, 248, 255, 0.9) 50%,
    rgba(235, 242, 255, 0.95) 100%);
  
  backdrop-filter: blur(15px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  
  border: 2px solid rgba(200, 220, 255, 0.8);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.05);
  
  transition: var(--retro-transition);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 450px;
  height: 100%;
}

/* Brillo superior en items */
.stream-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
  z-index: 1;
}

/* Reflejo inferior */
.stream-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(0deg,
    rgba(0, 0, 0, 0.05) 0%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.stream-item.active {
  border-color: var(--retro-blue);
  box-shadow: 
    0 6px 18px rgba(33, 150, 243, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 30px rgba(33, 150, 243, 0.3);
}



/* ==================== STREAM HEADER ==================== */
.stream-header {
  background: linear-gradient(180deg,
    rgba(230, 240, 255, 0.95) 0%,
    rgba(220, 235, 255, 0.9) 100%);
  
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(200, 220, 255, 0.6);
  flex-shrink: 0;
  min-height: 48px;
  position: relative;
  z-index: 2;
  
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stream-title-bar {
  flex: 1;
  font-size: 0.9rem;
  color: #2C3E50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stream-title-bar strong {
  color: var(--retro-blue-dark);
  font-weight: 700;
}

/* ==================== STREAM CONTENT ==================== */
.stream-content {
  flex: 1;
  display: flex;
  position: relative;
  background: #000;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  z-index: 2;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stream-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #7F8C8D;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.1rem;
  padding: var(--space-xl);
  background: linear-gradient(135deg,
    rgba(240, 245, 255, 0.5) 0%,
    rgba(230, 238, 255, 0.5) 100%);
}

.placeholder-icon {
  font-size: 3rem;
  animation: gentlePulse 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.placeholder-text {
  text-align: center;
  opacity: 0.9;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

@keyframes gentlePulse {
  0%, 100% { 
    opacity: 0.7;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ==================== STREAM IFRAME ==================== */
.stream-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.stream-iframe::-webkit-scrollbar {
  display: none !important;
}

.stream-iframe:not([src]) {
  opacity: 0;
}

.stream-iframe[src]:not([src=""]) {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ==================== EXIT FULLSCREEN BUTTON ==================== */
.exit-fullscreen-btn {
  position: fixed;
  top: var(--space-xl);
  right: var(--space-xl);
  
  /* Botón tipo Vista */
  background: linear-gradient(180deg,
    rgba(244, 67, 54, 0.95) 0%,
    rgba(229, 57, 53, 0.9) 50%,
    rgba(211, 47, 47, 0.95) 100%);
  
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  z-index: 10000;
  display: none;
  align-items: center;
  gap: var(--space-sm);
  transition: var(--retro-transition);
  min-height: 48px;
  font-size: 1.1rem;
  
  box-shadow: 
    0 4px 12px rgba(244, 67, 54, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 30px rgba(244, 67, 54, 0.4);
  
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.exit-fullscreen-btn:hover {
  background: linear-gradient(180deg,
    rgba(255, 82, 82, 0.95) 0%,
    rgba(244, 67, 54, 0.9) 50%,
    rgba(229, 57, 53, 0.95) 100%);
  transform: scale(1.05);
  box-shadow: 
    0 6px 18px rgba(244, 67, 54, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 40px rgba(255, 82, 82, 0.6);
}

/* ==================== FULLSCREEN MODE ==================== */
body.fullscreen-mode {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

body.fullscreen-mode .site-header,
body.fullscreen-mode .options-bar,
body.fullscreen-mode .stream-selectors,
body.fullscreen-mode .site-footer {
  display: none !important;
}

body.fullscreen-mode .container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: 
    radial-gradient(ellipse at center, #3D6FB8 0%, #2865C7 50%, #1C4F9C 100%);
  margin: 0;
  padding: var(--space-sm);
  height: 100vh;
  overflow: hidden !important;
}

body.fullscreen-mode .streams-grid {
  height: 100%;
  width: 100%;
  gap: var(--space-sm);
}

body.fullscreen-mode .layout-1 { grid-template-rows: 1fr; }
body.fullscreen-mode .layout-2 { grid-template-rows: 1fr; }
body.fullscreen-mode .layout-3 { grid-template-rows: 1fr 1fr; }
body.fullscreen-mode .layout-4 { grid-template-rows: 1fr 1fr; }

body.fullscreen-mode .stream-item {
  min-height: 0;
  height: 100%;
}

body.fullscreen-mode .exit-fullscreen-btn {
  display: flex;
}

body.fullscreen-mode .stream-iframe {
  height: 100%;
}

/* ==================== LOADING ==================== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@keyframes smoothSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  animation: smoothSpin 1.2s linear infinite;
  transform-origin: center;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .options-bar,
  .stream-selectors {
    padding: var(--space-sm) 2%;
  }
  
  .layout-2 { grid-template-rows: minmax(400px, 1fr); }
  .layout-3 { grid-template-rows: minmax(350px, 1fr) minmax(350px, 1fr); }
  .layout-4 { grid-template-rows: minmax(350px, 1fr) minmax(350px, 1fr); }
  
  .stream-item { min-height: 350px; }
}

@media (max-width: 768px) {
  .container { padding: var(--space-sm); }
  
  .layout-2,
  .layout-3,
  .layout-4 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(auto-fill, minmax(400px, auto));
  }
  
  .layout-3 .stream-item:nth-child(1) { grid-column: 1; }
  
  .options-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  .card-header {
    width: 100%;
    justify-content: space-between;
  }
  
  .fullscreen-btn {
    margin-left: 0;
    width: 100%;
  }
  
  .stream-selectors { grid-template-columns: 1fr; }
  .stream-item { min-height: 400px; }
  
  body.fullscreen-mode .container { padding: var(--space-xs); }
}

@media (max-width: 600px) {
  .options-bar,
  .stream-selectors {
    padding: var(--space-xs) 3%;
    gap: var(--space-xs);
  }
  
  .layout-1 { grid-template-rows: minmax(350px, 1fr); }
  
  .layout-2,
  .layout-3,
  .layout-4 {
    grid-template-rows: repeat(auto-fill, minmax(350px, auto));
  }
  
  .btn,
  .layout-dropdown-btn,
  .dropdown-btn,
  .filter-btn {
    font-size: 0.85rem;
    padding: 7px 12px;
    min-height: 38px;
  }
  
  .stream-header {
    padding: var(--space-sm) var(--space-md);
    min-height: 44px;
  }
  
  .stream-item { min-height: 350px; }
  
  .exit-fullscreen-btn {
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .container { padding: var(--space-xs); }
  .streams-grid { gap: var(--space-xs); }
  
  .layout-1,
  .layout-2,
  .layout-3,
  .layout-4 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(auto-fill, minmax(300px, auto));
  }
  
  .stream-item { min-height: 300px; }
  .dropdown-content { max-height: min(350px, 60vh); }
}

@media (max-width: 375px) {
  .options-bar,
  .stream-selectors {
    padding: var(--space-xs) 2%;
  }
  
  .btn,
  .layout-dropdown-btn,
  .dropdown-btn,
  .filter-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
    min-height: 36px;
  }
  
  .stream-header {
    padding: 6px 10px;
    min-height: 40px;
  }
  
  .layout-1,
  .layout-2,
  .layout-3,
  .layout-4 {
    grid-template-rows: repeat(auto-fill, minmax(280px, auto));
  }
  
  .stream-item { min-height: 280px; }
}

/* ==================== ACCESIBILIDAD ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (pointer: coarse) {
  .btn,
  .layout-dropdown-btn,
  .dropdown-btn,
  .filter-btn,
  .layout-option,
  .stream-option {
    min-height: 44px;
    min-width: 44px;
  }
  
  .stream-option:active {
    background: rgba(100, 181, 246, 0.3);
    transition-duration: 0.1s;
  }
}

/* ==================== FIX SAFARI iOS ==================== */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
}

/* ==================== PREVENIR OVERSCROLL ==================== */
body {
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
}

/* ==================== FIN DEL ARCHIVO ==================== */