/* public/modules/chrono-hack/style.css */

:root {
    --glass-bg: rgba(13, 17, 23, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-green: #00ff88;
    --neon-blue: #00f3ff;
    --neon-red: #ff3b3b;
    --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;
    user-select: none; /* Evita seleção de texto ao arrastar */
}

.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 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-green); }
.app-logo { font-weight: 700; font-size: 1.4rem; color: white; letter-spacing: 1px; }

.header-right { display: flex; gap: 15px; }
.score-badge, .timer-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 { color: var(--neon-green); border-color: var(--neon-green); }

/* 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-green); }
.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-green); box-shadow: 0 0 20px rgba(0, 255, 136, 0.2); }
.icon-box { font-size: 2rem; margin-bottom: 10px; font-weight: bold; color: var(--neon-green); }
.mode-card h3 { margin: 0; font-size: 1.2rem; }
.mode-card p { margin: 5px 0 0 0; color: #888; font-size: 0.9rem; }

/* ÁREA DO JOGO */
.game-layout {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; padding: 20px; gap: 20px;
    max-width: 800px; margin: 0 auto; width: 100%;
}

.instructions-bar {
    background: rgba(0, 255, 136, 0.1); border: 1px solid var(--neon-green);
    padding: 10px 20px; border-radius: 30px;
    color: var(--neon-green); font-weight: bold; font-size: 1.1rem;
    display: flex; align-items: center; gap: 10px;
}

/* Linha do Tempo (Slots) */
.timeline-container {
    display: flex; width: 100%; position: relative;
    justify-content: center; align-items: center;
    padding: 20px 0; min-height: 120px;
}
.timeline-line {
    position: absolute; top: 50%; left: 0; width: 100%; height: 4px;
    background: rgba(255,255,255,0.1); z-index: 0; border-radius: 2px;
}
.slots-area {
    display: flex; gap: 15px; z-index: 1; flex-wrap: wrap; justify-content: center;
}

.slot {
    width: 100px; height: 100px;
    background: rgba(0,0,0,0.5);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #555; font-weight: bold; font-size: 1.5rem;
    position: relative; transition: 0.2s;
}
.slot::before { content: attr(data-index); position: absolute; top: -10px; font-size: 0.8rem; color: #888; background: var(--bg-dark); padding: 0 5px; }
.slot.drag-over { border-color: var(--neon-green); background: rgba(0, 255, 136, 0.1); box-shadow: 0 0 15px rgba(0, 255, 136, 0.2); }

/* Peças (Draggable) */
.pieces-area {
    display: flex; gap: 15px; flex-wrap: wrap; justify-content: center;
    min-height: 110px; width: 100%;
    padding: 15px; background: rgba(255,255,255,0.02);
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.05);
}

.piece {
    width: 90px; height: 90px;
    background: #1a1a2e;
    border: 1px solid var(--neon-green);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    color: white; font-weight: bold; font-size: 1.1rem;
    cursor: grab; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    user-select: none; touch-action: none; /* Crucial para mobile */
    z-index: 10; padding: 5px;
}
.piece:active { cursor: grabbing; transform: scale(1.05); box-shadow: 0 0 15px var(--neon-green); }
.piece.placed { width: 100%; height: 100%; border: none; background: transparent; box-shadow: none; }
.piece.success { background: rgba(0, 255, 136, 0.2); border-color: var(--neon-green); }
.piece.error { background: rgba(255, 59, 59, 0.2); border-color: var(--neon-red); }

/* Botão Verificar */
.btn-action {
    background: var(--neon-green); color: black; border: none;
    padding: 15px 40px; border-radius: 30px;
    font-size: 1.2rem; font-weight: bold; font-family: 'Rajdhani';
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    transition: 0.3s; margin-top: auto;
}
.btn-action:disabled { background: #333; color: #666; cursor: not-allowed; }
.btn-action:hover:not(:disabled) { box-shadow: 0 0 20px var(--neon-green); transform: scale(1.05); }

/* 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-green);
    padding: 40px; border-radius: 20px; text-align: center;
    width: 90%; max-width: 400px; position: relative;
    box-shadow: 0 0 60px rgba(0, 255, 136, 0.2);
}
.modal-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 200px; height: 200px; background: var(--neon-green);
    filter: blur(100px); opacity: 0.2; pointer-events: none;
}
.btn-primary {
    background: var(--neon-green); color: black; 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%;
}