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

:root {
    --glass-bg: rgba(13, 17, 23, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-purple: #bd00ff;
    --neon-cyan: #00f3ff;
    --neon-pink: #ff0055;
    --bg-dark: #050510;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex; flex-direction: column;
    margin: 0;
    touch-action: manipulation; /* Melhora resposta ao toque */
}

.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(189, 0, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(189, 0, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1; pointer-events: none;
}

/* HEADER */
.app-header {
    height: 60px; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 15px; }
.btn-back {
    color: white; text-decoration: none; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: 0.2s;
}
.btn-back:hover { background: rgba(255,255,255,0.1); color: var(--neon-purple); }
.app-logo { font-weight: 700; font-size: 1.4rem; color: white; letter-spacing: 1px; }

.header-right { display: flex; gap: 15px; }
.score-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px; border-radius: 20px;
    color: white; font-weight: bold; font-size: 1.1rem;
    display: flex; align-items: center; gap: 6px;
}
.score-badge:first-child { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.score-badge:last-child { border-color: var(--neon-purple); color: var(--neon-purple); }

/* TELAS */
.screen { display: none; width: 100%; height: calc(100vh - 60px); position: relative; }
.screen.active { display: flex; flex-direction: column; }

/* MENU SETUP */
.setup-container {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 40px;
}
.hero-text { text-align: center; }
.hero-text h1 { font-size: 3rem; margin: 0; color: white; text-shadow: 0 0 20px var(--neon-purple); }
.hero-text p { color: #aaa; margin-top: 5px; font-size: 1.2rem; }

.mode-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.mode-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    padding: 25px; border-radius: 16px; width: 180px; cursor: pointer;
    transition: 0.3s; color: white; display: flex; flex-direction: column; align-items: center;
}
.mode-card:hover { transform: translateY(-5px); border-color: var(--neon-purple); box-shadow: 0 0 20px rgba(189, 0, 255, 0.3); }

/* Ícones de Grade CSS */
.grid-icon { display: grid; gap: 2px; margin-bottom: 15px; }
.grid-icon span { width: 10px; height: 10px; background: rgba(255,255,255,0.2); border-radius: 2px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mode-card:hover .grid-icon span { background: var(--neon-purple); box-shadow: 0 0 5px var(--neon-purple); }

.mode-card h3 { margin: 0; font-size: 1.2rem; }
.mode-card p { margin: 5px 0 0 0; color: #888; font-size: 0.9rem; }


/* ÁREA DE JOGO */
.game-layout {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px; gap: 30px;
}

.status-bar {
    font-size: 1.5rem; color: #fff; font-weight: bold;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    height: 30px; text-align: center;
}

.matrix-grid {
    display: grid; gap: 15px;
    padding: 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.matrix-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s;
    aspect-ratio: 1 / 1;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.matrix-btn:active { transform: scale(0.95); }

/* Estados do Botão */
.matrix-btn.lit {
    background: var(--btn-color);
    border-color: #fff;
    box-shadow: 0 0 30px var(--btn-color), inset 0 0 20px rgba(255,255,255,0.5);
    z-index: 10;
}

.matrix-btn.wrong {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 30px var(--neon-pink);
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 200;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-card {
    background: #0d0d12; border: 1px solid var(--neon-purple);
    padding: 40px; border-radius: 20px; text-align: center;
    width: 90%; max-width: 400px; position: relative;
    box-shadow: 0 0 60px rgba(189, 0, 255, 0.2);
}
.modal-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 200px; height: 200px; background: var(--neon-purple);
    filter: blur(100px); opacity: 0.2; pointer-events: none;
}
.btn-primary {
    background: var(--neon-purple); color: white; border: none;
    padding: 12px 30px; border-radius: 8px; font-weight: bold; cursor: pointer;
    font-family: 'Rajdhani'; font-size: 1.1rem; width: 100%; margin-bottom: 10px;
}
.btn-secondary {
    background: transparent; border: 1px solid #555; color: #ccc;
    padding: 10px; border-radius: 8px; cursor: pointer; width: 100%;
}