/* public/modules/puzzle/style.css */

/* =========================================
   ESTRUTURA E FUNDO
   ========================================= */
   body {
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Mobile real height */
    /* Fundo estático limpo (sem animação) */
    background: radial-gradient(circle at center, #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-green));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.icon-float {
    font-size: 5rem; color: var(--neon-green); 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-green), #00cc6a);
    border: none; color: #000; padding: 18px 30px; border-radius: 50px;
    font-size: 1.2rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 255, 136, 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(0, 255, 136, 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; 
    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-green); 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(0, 255, 136, 0.15); border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 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; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 10px; box-sizing: border-box;
}

/* PUZZLE BOARD */
.puzzle-board {
    width: 320px; height: 320px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    user-select: none;
    transition: all 0.5s;
    touch-action: none; /* Importante para drag no mobile */
}

.puzzle-piece {
    width: 100%; height: 100%;
    background-repeat: no-repeat; background-size: cover;
    cursor: grab; transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.2);
}

.puzzle-piece:active {
    cursor: grabbing; transform: scale(1.05); z-index: 100;
    box-shadow: 0 0 15px rgba(255,255,255,0.5); border: 1px solid white;
}

/* Efeito quando está na posição correta (opcional, só visualmente sutil) */
.puzzle-piece.correct {
    filter: brightness(1.1);
    box-shadow: inset 0 0 0 1px var(--neon-green);
    z-index: 1;
}

/* =========================================
   MOBILE (AJUSTES)
   ========================================= */
@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%; }
    
    .themes-wrapper { 
        width: 100%; border-radius: 20px 20px 0 0; padding: 20px 10px;
    }
    .themes-grid { 
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px; padding-bottom: 50px;
    }
    .theme-card { padding: 15px 5px; }
    .theme-icon { font-size: 1.5rem; margin-bottom: 5px; }
    .theme-name { font-size: 0.8rem; }
    
    .puzzle-board { width: 90vw !important; height: 90vw !important; max-width: 350px; max-height: 350px; }
}

/* 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;
}