/* =========================================
   ESTILO GLOBAL E RESET
   ========================================= */
body, html { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    font-family: 'Inter', -apple-system, sans-serif; 
    background: #0f172a; 
    color: white; 
    overflow: hidden; /* Impede a rolagem do corpo, as telas rolam sozinhas */
}

/* =========================================
   SISTEMA DE TELAS
   ========================================= */
.screen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    display: none; 
    flex-direction: column; 
}

.screen.active { 
    display: flex; 
}

/* Separação de Título e Conteúdo para permitir o Scroll */
.screen-header { 
    padding: 2rem 2.5rem 1rem 2.5rem; 
    flex-shrink: 0; 
    background: linear-gradient(to bottom, #0f172a 80%, transparent);
    z-index: 20;
}

.screen-content { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 0 2.5rem 150px 2.5rem; /* Espaço no fundo para não cobrir com o controle */
    scroll-behavior: smooth;
}

/* =========================================
   GRIDS E CARDS (CORREÇÃO DAS THUMBS)
   ========================================= */
.grid { 
    display: grid; 
    gap: 1.5rem; 
    align-items: start; /* Impede que os cards estiquem verticalmente */
}

/* Responsividade das colunas */
.grid-cols-tv { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .grid-cols-tv { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .grid-cols-tv { grid-template-columns: repeat(5, 1fr); } }

/* Itens Focáveis (Cards) */
.focusable { 
    border: 4px solid transparent; 
    transition: all 0.2s ease-out; 
    border-radius: 12px; 
    overflow: hidden; 
    background: #1e293b; 
    display: flex;
    flex-direction: column;
    outline: none;
    cursor: pointer;
}

/* Efeito de Foco (TV) */
.focusable.focused { 
    border-color: #3b82f6; 
    transform: scale(1.05); 
    z-index: 10; 
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); 
}

/* Ajuste da Imagem para Formato Paisagem (16:9) */
.focusable img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Força o formato deitado */
    object-fit: cover;   /* Garante que a imagem preencha sem distorcer */
    display: block;
    background: #000;
}

/* Título dentro do Card */
.card-title {
    padding: 10px;
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 500;
    color: #e2e8f0;
    /* Limita a 2 linhas de texto */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4rem; 
}

/* =========================================
   PLAYER DE VÍDEO (TELA CHEIA)
   ========================================= */
#player-container { 
    width: 100vw; 
    height: 100vh; 
    background: black; 
    position: relative; 
}

#main-player { 
    width: 100% !important; 
    height: 100% !important; 
    position: absolute; 
    top: 0; 
    left: 0; 
}

/* =========================================
   CONTROLES VIRTUAIS (D-PAD)
   ========================================= */
#on-screen-controls { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 9999; 
    display: flex; 
    align-items: flex-end; 
    gap: 20px; 
}

.control-btn { 
    width: 60px; 
    height: 60px; 
    background: rgba(30, 41, 59, 0.85); 
    border: 1px solid rgba(255,255,255,0.2); 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    color: white; 
    backdrop-filter: blur(8px); 
    transition: background 0.2s;
}

.control-btn:hover { background: #3b82f6; }

.d-pad { 
    display: grid; 
    grid-template-areas: ". up ." "left ok right" ". down ."; 
    gap: 8px; 
}

.d-up { grid-area: up; } 
.d-down { grid-area: down; } 
.d-left { grid-area: left; } 
.d-right { grid-area: right; } 
.d-ok { grid-area: ok; background: #3b82f6; border: none; }

/* =========================================
   LAUNCHER (MENU INICIAL)
   ========================================= */
.launcher-card { 
    width: 250px; 
    padding: 30px !important;
    text-align: center; 
}

.launcher-icon-box { 
    width: 120px; 
    height: 120px; 
    margin-bottom: 20px; 
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================================
   UTILITÁRIOS
   ========================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-8 { gap: 2rem; }
.p-3 { padding: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.bg-gray-800 { background-color: #1f2937; }
.rounded-full { border-radius: 9999px; }
.text-4xl { font-size: 2.2rem; }
.font-bold { font-weight: 700; }
.text-gray-400 { color: #94a3b8; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.pb-2 { padding-bottom: 0.5rem; }

/* Custom Scrollbar para TVs */
.screen-content::-webkit-scrollbar { width: 10px; }
.screen-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.screen-content::-webkit-scrollbar-thumb { background: #334155; border-radius: 5px; border: 2px solid #0f172a; }