/* public/modules/memory/style.css */

/* =========================================
   ESTRUTURA E FUNDO
   ========================================= */
   body {
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Altura real no mobile */
    background: radial-gradient(circle at top left, #1a1a2e 0%, #0f0f1a 100%);
    margin: 0;
}

.hub-container {
    flex: 1; display: flex; flex-direction: column;
    width: 100%; position: relative; overflow: hidden; align-items: center;
}

.nav-back {
    display:flex; align-items:center; text-decoration:none; color:inherit; padding-left: 20px; transition: 0.3s;
}
.app-header { z-index: 10; }

/* =========================================
   MENU DASHBOARD (Setup)
   ========================================= */
.menu-content {
    display: flex; width: 90%; max-width: 1200px; height: 100%;
    gap: 40px; align-items: center; padding-bottom: 20px;
}

.menu-info {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start; padding: 20px;
    min-width: 300px;
}

.game-logo-large h1 {
    font-family: var(--font-gamer); font-size: 3.5rem; line-height: 0.9; margin: 0;
    background: linear-gradient(to right, #fff, var(--neon-pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 0, 200, 0.3);
}

.icon-float {
    font-size: 5rem; color: var(--neon-pink); margin-bottom: 10px;
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Selector de Dificuldade */
.difficulty-selector {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 15px;
    width: 100%;
    max-width: 350px;
    margin: 30px 0;
}
.difficulty-selector label { display: block; color: rgba(255,255,255,0.6); margin-bottom: 8px; font-size: 0.9rem; }
.difficulty-selector select {
    width: 100%; background: #0f0f1a; color: white; border: 1px solid #333;
    padding: 10px; border-radius: 8px; font-family: var(--font-main);
}

.btn-neon {
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
    border: none; color: white; padding: 18px 30px; border-radius: 50px;
    font-size: 1.2rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 200, 0.4); transition: 0.4s;
    width: 100%; max-width: 350px; text-transform: uppercase;
}
.btn-neon:hover { transform: scale(1.05); box-shadow: 0 0 40px rgba(255, 0, 200, 0.6); }
.btn-neon.disabled {
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.3);
    box-shadow: none; cursor: not-allowed; transform: none;
}

/* Lista de Temas (Direita) */
.themes-wrapper {
    flex: 1.5; background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 30px;
    padding: 30px; height: 100%; display: flex; flex-direction: column;
    backdrop-filter: blur(10px); overflow: hidden;
}

.themes-grid {
    display: grid; 
    /* Desktop: Mínimo 130px */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px; overflow-y: auto; padding-right: 5px;
}
.themes-grid::-webkit-scrollbar { width: 6px; }
.themes-grid::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 10px; }

.theme-card {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; padding: 20px 10px; cursor: pointer; transition: 0.2s;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.theme-card:active { transform: scale(0.95); }
.theme-card.selected {
    background: rgba(255, 0, 200, 0.15); border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 200, 0.2);
}
.theme-icon { font-size: 2rem; margin-bottom: 10px; }
.theme-name { font-weight: 600; font-size: 0.9rem; color: white; margin-bottom: 5px; }
.theme-count { font-size: 0.7rem; color: rgba(255,255,255,0.5); background: rgba(0,0,0,0.3); padding: 3px 8px; border-radius: 8px; }

/* =========================================
   GAMEPLAY AREA
   ========================================= */
.screen { display: none; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
.screen.active { display: flex; opacity: 1; }

.hud-bar {
    width: 90%; max-width: 600px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    padding: 10px 20px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.1);
}
.hud-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.2rem; font-family: var(--font-gamer); color: white;
}

.game-container {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: flex-start;
    overflow-y: auto; padding: 10px; box-sizing: border-box;
}

.grid {
    display: grid; gap: 10px; 
    width: 100%; max-width: 600px;
    margin: auto; 
}

/* CARTAS 3D */
.card {
    background: transparent; cursor: pointer; perspective: 1000px;
    aspect-ratio: 1 / 1; position: relative;
    user-select: none; -webkit-tap-highlight-color: transparent;
}

.card-inner {
    position: relative; width: 100%; height: 100%;
    text-align: center; transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); border-radius: 12px;
}

.card.flipped .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute; width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
}

.card-front {
    background: linear-gradient(135deg, #2a2a3a, #1a1a2e);
    border: 2px solid rgba(255,255,255,0.05);
}
.card-front::after { 
    content: '?'; font-family: var(--font-gamer); font-size: 2rem; 
    color: var(--neon-pink); opacity: 0.5; 
}

.card-back {
    background: #eef; color: #1a1a2e; transform: rotateY(180deg);
    border: 2px solid white; font-weight: bold; padding: 5px;
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

.card.matched .card-back {
    background: var(--neon-green); color: #000;
    border-color: #fff;
    box-shadow: 0 0 20px var(--neon-green);
    animation: pulseMatch 0.5s;
}

@keyframes pulseMatch { 0%{transform: rotateY(180deg) scale(1);} 50%{transform: rotateY(180deg) scale(1.1);} 100%{transform: rotateY(180deg) scale(1);} }

/* =========================================
   MOBILE (AJUSTES DE TAMANHO)
   ========================================= */
@media (max-width: 900px) {
    .menu-content { flex-direction: column; gap: 15px; padding: 10px; }
    .menu-info { align-items: center; text-align: center; padding: 10px 0; width: 100%; }
    
    /* Área dos Cards no Mobile */
    .themes-wrapper { 
        width: 100%; 
        border-radius: 20px 20px 0 0; 
        padding: 20px 10px; /* Menos padding lateral */
    }

    /* GRID MAIS COMPACTO */
    .themes-grid { 
        /* Reduzimos o mínimo para 100px para caber 3 por linha em telas padrão */
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding-bottom: 50px; /* Espaço extra para scroll final */
    }

    /* CARD MENOR */
    .theme-card {
        padding: 15px 5px; /* Cards mais finos */
    }
    .theme-icon { 
        font-size: 1.5rem; /* Ícone menor */
        margin-bottom: 5px; 
    }
    .theme-name { 
        font-size: 0.8rem; /* Fonte menor */
    }

    .difficulty-selector { margin: 15px 0; }
    
    /* Gameplay */
    .grid { gap: 6px; max-width: 95vw; }
    .card-inner { border-radius: 8px; }
    .card-front, .card-back { border-radius: 8px; }
}

/* MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: none;
    justify-content: center; align-items: center; z-index: 5000;
}
.modal-content {
    background: #1a1a2e; border: 1px solid var(--neon-green);
    padding: 30px; border-radius: 20px; text-align: center;
    box-shadow: 0 0 50px rgba(0,255,136,0.15); width: 85%; max-width: 350px;
}