/* public/modules/math-defense/style.css */

:root {
    --glass-bg: rgba(13, 17, 23, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-blue: #00f3ff;
    --neon-red: #ff3b3b;
    --neon-green: #00ff88;
    --neon-yellow: #ffdd00;
}

body {
    background-color: #050510;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex; flex-direction: column;
    margin: 0;
}

.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 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.7);
    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-blue); }

.app-logo { font-weight: 700; font-size: 1.4rem; color: white; letter-spacing: 1px; }

.score-badge {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-blue);
    padding: 5px 15px; border-radius: 20px;
    color: var(--neon-blue); font-weight: bold; font-size: 1.2rem;
    display: flex; align-items: center; gap: 8px;
}

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

/* --- TELA SETUP (MENU) --- */
.setup-container {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 40px; text-align: center;
}

.hero-text h1 { font-size: 3rem; margin: 0; color: white; text-shadow: 0 0 20px var(--neon-blue); letter-spacing: 3px; }
.hero-text p { color: #aaa; margin-top: 10px; font-size: 1.2rem; }

.difficulty-grid {
    display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
}

.diff-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 30px; border-radius: 16px;
    width: 200px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: white;
}
.diff-card:hover { transform: translateY(-10px); }

.icon-box {
    font-size: 3rem; margin-bottom: 10px;
    transition: 0.3s;
}

/* Cores dos Cards */
.diff-card.easy:hover { border-color: var(--neon-green); box-shadow: 0 0 30px rgba(0, 255, 136, 0.3); }
.diff-card.easy:hover .icon-box { color: var(--neon-green); text-shadow: 0 0 15px var(--neon-green); }

.diff-card.medium:hover { border-color: var(--neon-yellow); box-shadow: 0 0 30px rgba(255, 221, 0, 0.3); }
.diff-card.medium:hover .icon-box { color: var(--neon-yellow); text-shadow: 0 0 15px var(--neon-yellow); }

.diff-card.hard:hover { border-color: var(--neon-red); box-shadow: 0 0 30px rgba(255, 59, 59, 0.3); }
.diff-card.hard:hover .icon-box { color: var(--neon-red); text-shadow: 0 0 15px var(--neon-red); }

.diff-card h3 { margin: 0; font-size: 1.5rem; }
.diff-card p { margin: 0; color: #888; font-size: 0.9rem; }


/* --- ÁREA DO JOGO --- */
.game-area {
    flex: 1; position: relative; overflow: hidden;
    background: radial-gradient(circle at center bottom, rgba(0, 100, 255, 0.1), transparent 60%);
}

.hud-overlay { position: absolute; top:0; left:0; width:100%; height:100%; pointer-events: none; z-index: 1; }
.scan-line {
    width: 100%; height: 2px; background: rgba(0, 243, 255, 0.1);
    position: absolute; top: 0; animation: scan 3s linear infinite;
}
@keyframes scan { from { top: 0; } to { top: 100%; } }

/* Inimigos */
.enemy {
    position: absolute;
    width: 65px; height: 65px;
    background: rgba(10, 10, 20, 0.8);
    border: 2px solid var(--neon-red);
    border-radius: 50%;
    color: white;
    display: flex; justify-content: center; align-items: center;
    font-family: 'Rajdhani'; font-size: 1.3rem; font-weight: 700;
    box-shadow: 0 0 15px var(--neon-red), inset 0 0 10px rgba(255, 59, 59, 0.3);
    z-index: 5; text-shadow: 0 0 5px black;
}
.enemy::after {
    content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    width: 2px; height: 20px; background: linear-gradient(to top, var(--neon-red), transparent);
    z-index: -1;
}

/* Base do Jogador */
.player-base {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 10;
}

.turret-base {
    width: 60px; height: 30px;
    background: #222; border-radius: 10px 10px 0 0;
    border: 1px solid var(--neon-blue);
    position: relative; display: flex; justify-content: center;
}
.cannon-barrel {
    width: 12px; height: 40px; background: var(--neon-blue);
    position: absolute; bottom: 100%;
    box-shadow: 0 0 15px var(--neon-blue);
}

.input-container input {
    width: 100px; height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-blue);
    color: white; font-size: 1.8rem;
    text-align: center; border-radius: 12px;
    outline: none; font-weight: bold; font-family: 'Rajdhani';
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    margin-top: 10px;
}
.input-container input:focus {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
}

/* Laser */
.laser {
    position: absolute; width: 4px; height: 30px;
    background: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green);
    border-radius: 2px; z-index: 8;
}

/* --- MODAL PADRÃO --- */
.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-red);
    padding: 40px; border-radius: 20px; text-align: center;
    width: 90%; max-width: 400px; position: relative; overflow: hidden;
    box-shadow: 0 0 60px rgba(255, 59, 59, 0.2);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 200px; height: 200px; background: var(--neon-red);
    filter: blur(100px); opacity: 0.2; z-index: 0; pointer-events: none;
}
.modal-card h1, .result-box, .action-buttons { position: relative; z-index: 1; }

.result-box {
    background: rgba(255,255,255,0.05); padding: 15px; border-radius: 10px;
    margin: 20px 0; border: 1px solid rgba(255,255,255,0.1);
}
.result-box small { color: #888; letter-spacing: 2px; }
#final-score { font-size: 3rem; font-weight: bold; color: white; line-height: 1; margin-top: 5px; }

.action-buttons { display: flex; flex-direction: column; gap: 10px; }
button.btn-primary, button.btn-secondary {
    padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer;
    font-family: 'Rajdhani'; font-size: 1.1rem; transition: 0.2s;
}
.btn-primary { background: var(--neon-red); color: black; border: none; }
.btn-primary:hover { box-shadow: 0 0 20px var(--neon-red); transform: scale(1.02); }

.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; }
.btn-secondary:hover { border-color: white; background: rgba(255,255,255,0.1); }

@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }