/* ============================================================
   PORTAL DE MINI GAMES - MACLOJA (SEM SCROLL)
   ============================================================ */

:root {
    --bg-portal: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    
    --status-ok-bg: #dcfce7;
    --status-ok-text: #166534;
    --status-breve-bg: #f1f5f9;
    --status-breve-text: #94a3b8;
}

body.dark {
    --bg-portal: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0284c7;
    --card-bg: #1e293b;
    --border-color: #334155;
    
    --status-ok-bg: #166534;
    --status-ok-text: #dcfce7;
    --status-breve-bg: #334155;
    --status-breve-text: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-portal);
    color: var(--text-main);
    height: 100vh; /* Trava altura */
    height: 100dvh;
    overflow: hidden; /* EVITA O SCROLL DA PÁGINA */
    transition: background-color 0.3s ease, color 0.3s ease;
    background-image: url('../assets/Bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    padding-bottom: 45px; /* Espaço pro rodapé fixo */
}
body.dark { background-image: none; }

/* Container Principal */
.main-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

/* ESTRUTURA PRINCIPAL (GRID) */
.portal-wrapper {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 15px 20px 0 20px;
    align-items: start;
    justify-content: center;
}

.portal-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Colunas de Ads */
.ads-lateral {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 15px;
    align-self: flex-start;
    height: 100%;
}

.ads-lateral a, .ads-topo a {
    text-decoration: none;
    display: block;
}

.ad-pc {
    width: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}
.ad-pc:hover { transform: scale(1.02); }

.ads-topo {
    display: none;
    padding: 10px;
    text-align: center;
}

.ad-mobile {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* CABEÇALHO COMPACTO */
.portal-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding-bottom: 5px;
}

.header-acoes {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.btn-macloja {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--card-bg);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.btn-macloja:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-macloja .icon { font-size: 16px; font-weight: bold; }

.topo-acoes { display: flex; align-items: center; gap: 8px; }
.tema-label { font-size: 12px; font-weight: 600; color: var(--text-muted); user-select: none; }
.tema { background: none; border: 1px solid var(--border-color); padding: 6px; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--text-main); }

.logo-portal { 
    max-width: 140px; 
    height: auto; 
    margin: 0 auto 5px auto; 
}

.portal-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.portal-header p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 500px;
}

/* GRID DE PROJETOS (Ajustado para caber sem scroll) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    flex: 1;
    align-content: start;
    margin-top: 15px;
    padding-bottom: 10px;
    overflow: hidden; /* Evita que o conteúdo do grid vaze */
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.project-card.active {
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.project-card.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.project-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card.active:hover::before { opacity: 1; }

.card-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0f2fe;
    color: var(--primary);
    border-radius: 8px;
}

body.dark .card-icon { background-color: #0c4a6e; }

.card-content h2 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.card-content p { font-size: 12px; color: var(--text-muted); line-height: 1.3; }

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.status-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
}

.status-ok { background-color: var(--status-ok-bg); color: var(--status-ok-text); }

.arrow {
    font-size: 16px;
    color: var(--primary);
    font-weight: bold;
    transition: transform 0.3s ease;
}

.project-card.active:hover .arrow { transform: translateX(4px); }

/* RODAPÉ FIXO */
.portal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-portal);
    text-align: center;
    padding: 8px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
}

.footer-sub { font-size: 10px; opacity: 0.8; }

/* RESPONSIVIDADE */
@media (max-width: 1100px) {
    .portal-wrapper {
        grid-template-columns: 1fr;
        padding-top: 10px;
    }
    .ads-lateral { display: none; }
    .ads-topo { display: block; }
    
    /* No celular, volta a permitir scroll para não cortar os cards */
    body { height: auto; overflow: auto; }
    .main-wrapper { overflow: visible; }
    .portal-container { overflow: visible; }
}

@media (max-width: 768px) {
    .projects-grid { 
        grid-template-columns: 1fr; 
        margin-top: 10px; 
    }
    .header-acoes { flex-direction: column; gap: 10px; }
    .portal-header h1 { font-size: 22px; }
}