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

html {
    background: linear-gradient(135deg, #0b0f14 0%, #0e1420 100%);
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #0b0f14 0%, #0e1420 100%);
    color: white;
}


/* Mensaje de orientación */
.orientation-message {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -50px;
    margin-left: -100px;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    display: none;
}

.orientation-message.show {
    display: block;
}

/* iOS Safari específico - Feedback de orientación landscape-primary */
.ios-orientation-feedback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0b0f14 0%, #0e1420 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    color: white;
    font-family: Arial, sans-serif;
}

.ios-orientation-feedback.show {
    display: flex;
}

.ios-orientation-content {
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

.ios-orientation-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: rotate-hint 2s ease-in-out infinite;
}

.ios-orientation-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #bae6fd;
}

.ios-orientation-desc {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #e5e7eb;
    line-height: 1.4;
}

.ios-orientation-waiting {
    font-size: 1em;
    color: #94a3b8;
    margin-top: 20px;
    font-style: italic;
}

.ios-orientation-timeout {
    font-size: 1em;
    color: #fca5a5;
    margin-top: 20px;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
}

.ios-orientation-retry {
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(2,132,199,0.25), rgba(2,132,199,0.15));
    color: white;
    border: 1px solid rgba(2,132,199,0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}

.ios-orientation-retry:hover {
    background: linear-gradient(135deg, rgba(2,132,199,0.35), rgba(2,132,199,0.25));
    transform: translateY(-1px);
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}


/* Botón de inicio */
.start-button-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0b0f14 0%, #0e1420 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: none;
}

.start-button-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-button {
    background: linear-gradient(135deg, rgba(2,132,199,0.25), rgba(2,132,199,0.15));
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: none;
    box-shadow: 0 8px 22px rgba(2,132,199,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.start-button:hover { box-shadow: 0 16px 28px rgba(2,132,199,0.35); }

.start-button:active { box-shadow: 0 4px 8px rgba(0,0,0,0.3); }

.button-icon {
    font-size: 2em;
}

.button-text {
    font-size: 1.2em;
}

.button-description {
    margin-top: 20px;
    color: #ccc;
}

.channels-info {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .channels-info {
        padding: 24px 16px;
        margin-bottom: 12px;
    }
}

.channels-info h3 {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .channels-info h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
}

.channels-info p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 0.95em;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .channels-info p {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
}

.channels-benefits {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 768px) {
    .channels-benefits {
        margin: 20px 0;
        gap: 2px;
    }
}

.channels-benefits li {
    color: #e2e8f0;
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    line-height: 1.4;
    text-align: left;
}

@media (max-width: 768px) {
    .channels-benefits li {
        padding: 6px 0;
        gap: 12px;
        font-size: 0.9em;
        line-height: 1.3;
    }
}

.channels-benefits li:hover {
    color: #fff;
    transform: translateX(4px);
}

.channels-benefits li::before {
    content: "✨";
    font-size: 1.2em;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
}

@media (max-width: 768px) {
    .channels-benefits li::before {
        font-size: 1.1em;
        margin-top: 1px;
    }
}

.channels-upgrade-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    align-self: center;
    min-width: 200px;
}

@media (max-width: 768px) {
    .channels-upgrade-btn {
        padding: 12px 24px;
        font-size: 14px;
        margin-top: 16px;
        min-width: 180px;
    }
}

.channels-upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.channels-upgrade-btn:hover::before {
    left: 100%;
}

.channels-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* Channel Management for Premium Users */
.channels-management {
    display: none;
}

.channels-management.active {
    display: block;
}

.channels-add-form {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .channels-add-form {
        padding: 16px;
        margin-bottom: 16px;
    }
}

.channels-add-form h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channels-add-form h3::before {
    content: "➕";
    font-size: 1.1em;
    filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.5));
}

.channels-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: stretch;
}

@media (max-width: 768px) {
    .channels-input-group {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }
}

.channels-input-group input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .channels-input-group input {
        padding: 12px 14px;
        font-size: 13px;
    }
}

.channels-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.channels-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.channels-add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .channels-add-btn {
        padding: 12px 18px;
        font-size: 13px;
        width: 100%;
    }
}

.channels-add-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.channels-add-btn:hover::before {
    left: 100%;
}

.channels-add-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.channels-list {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.channels-list h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channels-list h3::before {
    content: "📋";
    font-size: 1.1em;
    filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.5));
}

.channels-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.channels-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.channels-item:last-child {
    margin-bottom: 0;
}

.channels-item-info {
    flex: 1;
    min-width: 0;
}

.channels-item-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channels-item-title::before {
    content: "📺";
    font-size: 0.9em;
    opacity: 0.8;
}

.channels-item-url {
    color: #a1a1aa;
    font-size: 13px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.channels-item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.channels-edit-btn,
.channels-delete-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.channels-edit-btn::before,
.channels-delete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.3s ease;
}

.channels-edit-btn:hover::before,
.channels-delete-btn:hover::before {
    left: 100%;
}

.channels-edit-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.channels-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.channels-empty {
    text-align: center;
    color: #a1a1aa;
    padding: 50px 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.channels-empty p {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.channels-empty::before {
    content: "📺";
    font-size: 3em;
    display: block;
    margin-bottom: 20px;
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3));
}

.channels-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 12px;
}

.channels-error::before {
    content: "⚠️";
    font-size: 1.2em;
    flex-shrink: 0;
}

.channels-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 12px;
}

.channels-success::before {
    content: "✅";
    font-size: 1.2em;
    flex-shrink: 0;
}
    text-align: center;
    font-size: 0.9em;
    max-width: 300px;
}



/* Indicador de progreso */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.loading-indicator.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* HUD Time Display - Esquina Superior Izquierda */
.hud-time-container {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9999;
    pointer-events: none;
    background: transparent;
    border: none;
    padding: 0;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hud-time-container:hover {
    background: transparent;
    border: none;
}

.hud-time-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    text-shadow: 
        0 0 4px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.7));
}

.hud-weather-text {
    display: none; /* Oculto porque se integra en el texto principal */
}

.hud-date-text {
    display: none;
}

/* ===== SOLUCIÓN PARA CONFLICTOS DE ANIMACIONES CSS3D ===== */
/* Deshabilitar animaciones CSS para objetos CSS3D para evitar conflictos con transformaciones 3D */
/* Excepción: app-selector mantiene su animación porque funciona correctamente */

/* Deshabilitar animaciones en contenedores CSS3D */
#css3d-root * { animation: none; transition: none; }

/* Excepción específica para app-selector - mantener su animación */
.app-selector-view {
    animation: view-enter 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards  ;
}

/* Crear la animación view-enter que faltaba para app-selector */
@keyframes view-enter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Deshabilitar animaciones para vistas CSS3D (raíz y descendientes) */
.youtube-home-view,
.youtube-home-view *,
.twitch-home-view,
.twitch-home-view *,
.tv-channels-view,
.tv-channels-view *,
.tv-player-view,
.tv-player-view *,
.twitch-player-view,
.twitch-player-view *,
.twitch-search-results-view,
.twitch-search-results-view *,
.youtube-player-view,
.youtube-player-view *,
.youtube-search-results-view,
.youtube-search-results-view * {
    animation: none; transition: none;
}