/* ===== RESET Y VARIABLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141c;
    --bg-card: #1c1c26;
    --bg-hover: #25252f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent: #e50914;
    --accent-hover: #f6121d;
    --gold: #fbbf24;
    --border: #2a2a35;
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
}

html, body { height: 100%; }

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================
   PANTALLA DE BIENVENIDA
   ============================================ */
.welcome-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: welcomeFadeIn 0.8s ease-out;
}

.welcome-screen.hiding {
    animation: welcomeFadeOut 0.7s ease-in forwards;
}

@keyframes welcomeFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcomeFadeOut { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

.welcome-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    animation: welcomeZoom 20s ease-in-out infinite alternate;
}

@keyframes welcomeZoom {
    from { transform: scale(1.05); }
    to { transform: scale(1.15); }
}

.welcome-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10, 10, 15, 0.92) 0%,
        rgba(10, 10, 15, 0.75) 50%,
        rgba(10, 10, 15, 0.92) 100%
    );
}

.welcome-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 640px;
    padding: 40px 24px;
    animation: welcomeContentUp 1s ease-out 0.2s backwards;
}

@keyframes welcomeContentUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-logo {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: logoBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 32px rgba(229, 9, 20, 0.5));
}

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.welcome-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #e50914 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6));
}

.welcome-tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
    font-weight: 400;
}

.welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 20px 48px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
    font-family: inherit;
    letter-spacing: 0.5px;
}

.welcome-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 32px rgba(229, 9, 20, 0.6);
}

.welcome-btn:active { transform: translateY(0) scale(1); }

.welcome-footer {
    margin-top: 48px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.7) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    gap: 20px;
    transition: background 0.3s, box-shadow 0.3s;
}

.header.scrolled {
    background: rgba(10,10,15,0.98);
    box-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
}

.logo:hover { transform: scale(1.05); }

.logo-icon { font-size: 1.6rem; }

.logo-text {
    background: linear-gradient(135deg, #ffffff 0%, #e50914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 560px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border: 1px solid var(--border);
    background-color: rgba(28, 28, 38, 0.9);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

.search-input::placeholder { color: var(--text-secondary); }

.header-right {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
}

.nav-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.nav-badge {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ✅ ESTILOS PREMIUM */
.nav-btn-gold {
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.15));
    border-color: rgba(251,191,36,0.4);
    color: var(--gold);
}

.nav-btn-gold:hover {
    background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.25));
    border-color: var(--gold);
    transform: translateY(-1px);
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 1.5px;
    animation: premiumPulse 2s infinite;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes premiumPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.8); }
}

/* ============================================
   HERO BANNER
   ============================================ */
.hero-banner {
    position: relative;
    height: 520px;
    margin-top: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(10,10,15,0.98) 0%,
        rgba(10,10,15,0.85) 40%,
        rgba(10,10,15,0.4) 70%,
        rgba(10,10,15,0.9) 100%
    );
    z-index: 1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 40px;
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    background: rgba(229, 9, 20, 0.2);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
    border: 1px solid rgba(229, 9, 20, 0.4);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #e50914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.8));
}

.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}

.hero-btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
}

.hero-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(229, 9, 20, 0.6);
}

.hero-btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* ============================================
   STATUS BAR & NAVEGACIÓN DE CATEGORÍAS
   ============================================ */
.status-bar {
    position: relative;
    height: 40px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: statusPulse 2s infinite;
    box-shadow: 0 0 8px #22c55e;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ✅ MENÚ STICKY DE CATEGORÍAS (Con Wrap para evitar cortes) */
.category-nav {
    position: sticky;
    top: 72px;
    z-index: 95;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(12px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.category-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-nav-btn:hover {
    background: rgba(229, 9, 20, 0.8);
    border-color: var(--accent);
    color: white;
    transform: translateY(-1px);
}

.filter-indicator {
    position: sticky;
    top: 72px;
    z-index: 90;
    background: linear-gradient(90deg, var(--accent), #b8070f);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.clear-filter {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: background 0.2s;
}

.clear-filter:hover { background: rgba(255,255,255,0.35); }

/* ============================================
   MAIN CONTAINER & CATEGORÍAS
   ============================================ */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px;
}

.category-section {
    margin-bottom: 48px;
    animation: sectionFadeUp 0.5s ease-out both;
    scroll-margin-top: 140px; 
}

@keyframes sectionFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-left: 4px;
}

.category-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    padding-left: 16px;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--accent), #b8070f);
    border-radius: 2px;
}

.category-count {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ============================================
   GRID DE CANALES
   ============================================ */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.channel-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    border: 1px solid transparent;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
}

.channel-card:hover {
    transform: scale(1.05) translateY(-4px);
    background: var(--bg-hover);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 16px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(229, 9, 20, 0.3);
    z-index: 10;
}

.channel-logo-container {
    width: 100%;
    flex: 1;
    background: linear-gradient(135deg, #1a1a24 0%, #0f0f16 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 16px;
}

.channel-logo {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    transition: transform 0.3s;
}

.channel-card:hover .channel-logo { transform: scale(1.1); }

.channel-fav-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s;
    z-index: 5;
    padding: 0;
    backdrop-filter: blur(4px);
}

.channel-fav-btn svg { width: 20px; height: 20px; }

.channel-fav-btn:hover {
    background: rgba(229, 9, 20, 0.9);
    border-color: rgba(229, 9, 20, 0.9);
    color: white;
    transform: scale(1.15);
}

.channel-fav-btn.active {
    background: rgba(229, 9, 20, 0.95);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
}

.channel-info {
    padding: 14px 14px 16px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}

.channel-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.channel-card::after {
    content: '▶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.channel-card:hover::after { opacity: 1; }

/* ============================================
   MODAL DEL REPRODUCTOR
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
    backdrop-filter: blur(8px);
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.player-wrapper {
    width: 100%;
    max-width: 1200px;
    position: relative;
    animation: modalZoomIn 0.3s ease-out;
    /* ✅ Ajuste para laptops: permite scroll si la pantalla es muy pequeña */
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.player-wrapper::-webkit-scrollbar { width: 8px; }
.player-wrapper::-webkit-scrollbar-track { background: transparent; }
.player-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

@keyframes modalZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.player-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.player-close:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

.player-video-container {
    background: black;
    overflow: hidden;
    aspect-ratio: 16/9;
    width: 100%;
}

#video-player {
    width: 100%;
    height: 100%;
    background: black;
    display: block;
}

/* ✅ BOTÓN EXTERNO: Pequeño, elegante y en la barra de controles */
.player-external-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--gold);
    padding: 0 14px;
    height: 44px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.player-external-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.player-info {
    background: var(--bg-secondary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--border);
    /* ✅ Ajuste para que no se corte en pantallas pequeñas */
    flex-wrap: wrap;
}

.player-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    padding: 8px;
}

.player-meta { flex: 1; min-width: 150px; }
.player-meta h2 { font-size: 1.2rem; margin-bottom: 4px; font-weight: 800; }
.player-meta p { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }

/* ===== CONTROLES DE NAVEGACIÓN ===== */
.player-controls {
    display: flex;
    gap: 8px;
    margin-left: auto; 
    margin-right: 16px;
    align-items: center;
}

.player-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.05);
}

.player-fav-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-fav-btn:hover {
    background: rgba(229, 9, 20, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.player-fav-btn.active {
    background: rgba(229, 9, 20, 0.3);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   BOTÓN VOLVER AL INICIO
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.6);
}

.back-to-top.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    font-size: 0.85rem;
}

.footer-sub { margin-top: 8px; opacity: 0.6; font-size: 0.8rem; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.empty-state h2 { font-size: 1.5rem; margin-bottom: 12px; color: var(--text-primary); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .header { padding: 0 20px; height: 64px; }
    .logo-text { display: none; }
    .nav-btn span:not(.nav-badge) { display: none; }
    .hero-banner { height: 400px; }
    .hero-content { padding: 0 24px; }
    .main-container { padding: 24px; }
    .category-nav { top: 64px; padding: 10px 24px; }
    .category-section { scroll-margin-top: 120px; }
    .channels-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .category-title { font-size: 1.3rem; }
    .back-to-top { bottom: 20px; right: 20px; width: 44px; height: 44px; }
}

@media (max-width: 600px) {
    .header-center { display: none; }
    .header { justify-content: space-between; }
    .hero-banner { height: 340px; }
    .hero-title { font-size: 2rem; }
    .welcome-title { font-size: 2.5rem; }
    .welcome-logo { font-size: 4rem; }
    .channels-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    
    /* Ajustes del reproductor en móvil */
    .player-info { 
        flex-direction: column; 
        text-align: center; 
        padding: 16px;
    }
    .player-meta { width: 100%; }
    .player-controls { margin: 0; width: 100%; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
    .player-external-btn { width: 100%; order: 3; margin-top: 8px; } /* En móvil se pone abajo y ancho completo */
    .player-fav-btn { width: 100%; max-width: 200px; margin: 0 auto; }
}

/* ============================================
   ✅ GATE SCREEN (PANTALLA DE BLOQUEO PREMIUM)
   ============================================ */
.gate-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
    animation: gateFadeIn 0.8s ease-out;
}

/* ✅ Fondo personalizado (Usando tu imagen dominitv.webp) */
.gate-bg {
    position: absolute;
    inset: 0;
    background-image: url('dominitv.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.8) saturate(1.1);
    z-index: -2;
}

.gate-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 15, 0.9) 0%,
        rgba(10, 10, 15, 0.1) 50%,
        rgba(10, 10, 15, 0.7) 100%
    );
    z-index: -1;
}

@keyframes gateFadeIn {
    from { opacity: 0; transform: scale(1.05); }
    to { opacity: 1; transform: scale(1); }
}

.gate-content {
    max-width: 460px;
    width: 100%;
    background: rgba(15, 15, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 48px 36px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: gateContentUp 0.8s ease-out 0.1s backwards;
}

@keyframes gateContentUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.gate-logo {
    font-size: 4.5rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 10px 24px rgba(229, 9, 20, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gate-title {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.gate-subtitle {
    color: #d1d1d6;
    margin-bottom: 36px;
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 500;
}

.gate-pay-btn {
    width: 100%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: inherit;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.gate-pay-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(251, 191, 36, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.gate-pay-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.gate-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #80808a;
    font-size: 0.75rem;
    margin: 32px 0 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.gate-divider::before,
.gate-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.gate-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.gate-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.gate-input::placeholder {
    color: #666;
}

.gate-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}

.gate-validate-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 28px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.gate-validate-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.gate-validate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gate-error {
    color: #ff4d4d;
    font-size: 0.85rem;
    min-height: 20px;
    margin-top: 12px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#premium-badge {
    cursor: pointer;
    border: none;
    font-family: inherit;
}