:root {
    --bg-dark: #0a0a10;
    --panel-bg: #13141c;
    --border-color: #2a2b36;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-hover: #2563eb;
    --success-green: #10b981;
    --error-red: #ef4444;
    --card-bg: #1e1f29;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.dashboard {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.nav-btn { background: transparent; color: var(--text-muted); border: none; padding: 10px; cursor: pointer; font-family: 'Share Tech Mono'; transition: 0.3s; }
.nav-btn:hover { color: var(--text-main); }
.nav-btn.active { color: var(--accent-blue); border-bottom: 2px solid var(--accent-blue); }

/* === CABEÇALHO GLOBAL === */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}
.logo { display: flex; align-items: center; gap: 15px; }
.logo-icon { font-size: 2.5rem; }
.logo-text h1 { font-family: 'Share Tech Mono', monospace; font-size: 1.8rem; color: var(--accent-blue); letter-spacing: 2px;}
.logo-text p { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.status { font-family: 'Share Tech Mono', monospace; font-size: 0.9rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px;}
.pulse { width: 10px; height: 10px; background-color: var(--text-muted); border-radius: 50%; }

/* === TELA DE SETUP === */
.tela-ativa { display: block; padding: 2rem; animation: fadeIn 0.5s ease; }
.hidden { display: none !important; }
.menu-hidden { display: none !important; }

.setup-container { display: flex; flex-direction: column; gap: 2rem; }
.setup-box h2 { font-family: 'Share Tech Mono', monospace; font-size: 1.4rem; color: var(--text-main); margin-bottom: 0.5rem; }
.setup-box p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; }

.input-moderno {
    width: 100%; padding: 12px 15px;
    background-color: var(--bg-dark); border: 1px solid var(--border-color);
    color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 1rem;
    border-radius: 6px; outline: none; transition: 0.3s;
}
.input-moderno:focus { border-color: var(--accent-blue); }

/* Grid de Papéis / Crachás */
.papeis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-top: 1rem; }
.papel-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    padding: 1rem; border-radius: 6px; display: flex; gap: 15px; align-items: center;
}
.papel-icon { font-size: 2rem; background: var(--bg-dark); padding: 10px; border-radius: 6px; }
.papel-info h3 { font-family: 'Share Tech Mono', monospace; font-size: 1.1rem; color: var(--accent-blue); }
.papel-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; line-height: 1.3;}

/* Botões */
.btn-primario {
    width: 100%; padding: 15px; background-color: var(--accent-blue);
    color: white; border: none; border-radius: 6px;
    font-family: 'Share Tech Mono', monospace; font-size: 1.2rem; font-weight: bold;
    cursor: pointer; transition: 0.3s; margin-top: 1rem;
}
.btn-primario:hover:not(:disabled) { background-color: var(--accent-hover); }
.btn-primario:disabled { background-color: var(--border-color); color: var(--text-muted); cursor: not-allowed; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }


/* === RELÓGIO GLOBAL === */
.tempo-display {
    background-color: #010409;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: var(--success-green);
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

/* Classe aplicada via JS quando o tempo estiver acabando */
.tempo-critico {
    color: var(--error-red);
    border-color: var(--error-red);
    animation: piscar-critico 1s infinite;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

@keyframes piscar-critico {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* === MODAL PROFISSIONAL === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; animation: fadeIn 0.2s ease;
}

.modal-box {
    background-color: var(--panel-bg); border: 1px solid var(--border-color);
    width: 90%; max-width: 500px; border-radius: 8px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.modal-header {
    background-color: rgba(239, 68, 68, 0.1); border-bottom: 1px solid var(--error-red);
    padding: 15px 20px; display: flex; align-items: center; gap: 10px;
}

.modal-header h3 { color: var(--error-red); font-family: 'Share Tech Mono', monospace; font-size: 1.2rem; }
.modal-body { padding: 25px 20px; font-size: 1.1rem; line-height: 1.5; }
.modal-footer { padding: 15px 20px; background-color: rgba(0,0,0,0.2); display: flex; justify-content: flex-end; gap: 10px; }

.btn-modal-cancel { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); padding: 10px 20px; border-radius: 4px; cursor: pointer; font-family: 'Share Tech Mono'; }
.btn-modal-cancel:hover { background: rgba(255,255,255,0.1); }

/* === TELA DO TERMINAL DE EVIDÊNCIAS === */
.terminal-container { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.terminal-header h2 { font-family: 'Share Tech Mono', monospace; font-size: 1.4rem; color: var(--text-main); margin-bottom: 0.5rem; }
.terminal-header p { color: var(--text-muted); font-size: 0.95rem; }

.input-container { display: flex; gap: 10px; }
.input-terminal {
    flex: 1; background-color: var(--bg-dark); border: 1px solid var(--border-color);
    padding: 15px; color: var(--text-main); font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem; border-radius: 6px; text-transform: uppercase; transition: 0.3s;
}
.input-terminal:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }

.btn-terminal {
    background-color: var(--accent-blue); color: white; border: none;
    padding: 0 25px; border-radius: 6px; font-family: 'Share Tech Mono', monospace;
    font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.3s;
}
.btn-terminal:hover { background-color: var(--accent-hover); }

/* Painel de Resultados do Terminal */
.display-panel { border-radius: 8px; border: 1px solid transparent; overflow: hidden; animation: fadeIn 0.3s ease; }
.success-state { border-color: var(--success-green); background-color: rgba(16, 185, 129, 0.05); }
.error-state { border-color: var(--error-red); background-color: rgba(239, 68, 68, 0.05); padding: 1.5rem; }

.evidence-header {
    background-color: rgba(16, 185, 129, 0.1); color: var(--success-green);
    padding: 1rem; font-family: 'Share Tech Mono', monospace; font-weight: bold;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}
.error-header { color: var(--error-red); font-family: 'Share Tech Mono', monospace; font-weight: bold; margin-bottom: 0.5rem; }

.evidence-body { padding: 1.5rem; }
.texto-evidencia { line-height: 1.6; font-size: 1.05rem; }
.midia-evidencia { width: 100%; max-height: 400px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-dark); }

/* === TELA DO QUADRO DE SUSPEITOS === */
.quadro-container { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; animation: fadeIn 0.3s ease; }

.grid-suspeitos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.suspeito-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.suspeito-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.suspeito-header { display: flex; gap: 15px; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.suspeito-foto { width: 100px; height: 100px; border-radius: 60%; border: 2px solid var(--border-color); object-fit: cover; }
.suspeito-info h3 { font-family: 'Share Tech Mono', monospace; font-size: 1.1rem; color: var(--accent-blue); }
.suspeito-info p { font-size: 0.8rem; color: var(--text-muted); }

.suspeito-perfil { font-size: 0.9rem; line-height: 1.4; padding-top: 5px; }
.label-status { font-family: 'Share Tech Mono', monospace; font-size: 0.8rem; font-weight: bold; align-self: flex-start; padding: 3px 8px; border-radius: 4px; margin-top: 5px; }

/* Status de Investigação (Cores que ela vai trocar) */
.status-neutro { border-color: var(--border-color); }
.status-neutro .label-status { background-color: var(--border-color); color: var(--text-muted); }

.status-inocente { border-color: var(--success-green); box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
.status-inocente .label-status { background-color: rgba(16, 185, 129, 0.2); color: var(--success-green); }

.status-suspeito { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.1); }
.status-suspeito .label-status { background-color: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.status-alvo { border-color: var(--error-red); box-shadow: 0 0 10px rgba(239, 68, 68, 0.1); }
.status-alvo .label-status { background-color: rgba(239, 68, 68, 0.2); color: var(--error-red); }

/* === TELA DE ACUSAÇÃO E FINALIZAÇÃO === */
.acusacao-container { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; animation: fadeIn 0.5s ease; }

.form-acusacao {
    background-color: rgba(239, 68, 68, 0.05); border: 1px solid var(--error-red);
    padding: 2rem; border-radius: 8px; display: flex; flex-direction: column; gap: 1.5rem;
}

.form-acusacao label { font-family: 'Share Tech Mono', monospace; font-size: 1.1rem; color: var(--error-red); }

.btn-perigo-large {
    background-color: var(--error-red); color: white; border: none; padding: 15px;
    border-radius: 6px; font-family: 'Share Tech Mono', monospace; font-size: 1.2rem;
    font-weight: bold; cursor: pointer; transition: 0.3s; width: 100%; text-align: center;
}
.btn-perigo-large:hover { background-color: #b91c1c; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

/* Painéis de Resultado Final */
.resultado-vitoria { border-color: var(--success-green); background-color: rgba(16, 185, 129, 0.1); padding: 3rem 2rem; text-align: center; }
.resultado-vitoria h2 { color: var(--success-green); font-family: 'Share Tech Mono', monospace; font-size: 2rem; margin-bottom: 1rem; }

.resultado-derrota { border-color: var(--error-red); background-color: rgba(239, 68, 68, 0.1); padding: 3rem 2rem; text-align: center; }
.resultado-derrota h2 { color: var(--error-red); font-family: 'Share Tech Mono', monospace; font-size: 2rem; margin-bottom: 1rem; }

/* === TELA DE OPERAÇÕES E DICAS === */
.operacoes-container { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; animation: fadeIn 0.3s ease; }

.painel-dicas {
    background-color: var(--card-bg);
    border: 1px dashed var(--border-color);
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-tempo {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-secundario {
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid var(--accent-blue);
    padding: 15px;
    border-radius: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secundario:hover:not(:disabled) {
    background-color: rgba(59, 130, 246, 0.1);
}

.btn-secundario:disabled {
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.lista-dicas { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

.dica-card {
    background-color: var(--bg-dark);
    border-left: 4px solid var(--accent-blue);
    padding: 1.5rem;
    border-radius: 4px;
    animation: fadeIn 0.5s ease;
}

.dica-card h3 { color: var(--accent-blue); font-family: 'Share Tech Mono', monospace; margin-bottom: 0.5rem; font-size: 1.1rem; }
.dica-card p { line-height: 1.5; color: var(--text-main); }

/* === PRÉVIA DO CASO (SETUP) === */
.preview-box {
    margin-top: 15px;
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.preview-item { font-size: 0.9rem; }
.preview-item strong { color: var(--accent-blue); font-family: 'Share Tech Mono', monospace; }
.preview-sinopse { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; border-top: 1px solid var(--border-color); padding-top: 10px; font-style: italic; }


/* === MÍDIAS DO TERMINAL === */
.media-evidencia {
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--accent-blue);
    margin-top: 15px;
    background-color: #000;
}

.audio-container {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px dashed var(--accent-blue);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
}

.icone-audio {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-blue);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.documento-container {
    background-color: var(--bg-dark);
    padding: 2rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-blue);
    margin-top: 15px;
}

/* === PROGRESSO DE EVIDÊNCIAS === */
.progresso-display {
    background-color: #010409;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

/* === HISTÓRICO DE CÓDIGOS === */
.historico-codigos {
    background-color: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.historico-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 5px;
}
.lista-codigos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.codigo-tag {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}
.codigo-tag:hover {
    background-color: rgba(16, 185, 129, 0.3);
}

/* === TELA DE NOTAS === */
.notas-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease;
}
.notas-painel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.area-notas {
    width: 100%;
    min-height: 320px;
    background-color: var(--bg-dark);
    border: none;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1.5rem;
    resize: vertical;
    outline: none;
}
.area-notas:focus {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);
}
.notas-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
}
.status-notas {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.btn-pequeno {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* === TEORIA DO CASO (ACUSAÇÃO) === */
.teoria-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}
.teoria-campo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.teoria-campo label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    color: var(--error-red);
}
.teoria-campo .input-moderno {
    font-size: 0.95rem;
}

/* Setup - dica física */
.setup-dica-fisica {
    background-color: rgba(59, 130, 246, 0.05);
    border: 1px dashed var(--accent-blue);
    padding: 1.25rem;
    border-radius: 8px;
}
.setup-dica-fisica h2 {
    color: var(--accent-blue);
    font-size: 1.1rem;
}
.setup-dica-fisica p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Resultado parcial (teoria) */
.resultado-parcial {
    border-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.08);
    padding: 2.5rem 2rem;
    text-align: center;
}
.resultado-parcial h2 {
    color: #f59e0b;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.score-teoria {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.3rem;
    margin: 1rem 0;
    color: var(--text-main);
}
.score-item {
    display: inline-block;
    margin: 0 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.score-ok { background: rgba(16,185,129,0.2); color: var(--success-green); }
.score-erro { background: rgba(239,68,68,0.2); color: var(--error-red); }

/* =========================================
   RESPONSIVIDADE (Telas de Celular)
========================================= */
@media (max-width: 650px) {
    /* 1. Ajuste Geral do Corpo para dar mais espaço útil */
    body {
        padding: 1rem 0.5rem;
    }

    /* 2. Cabeçalho: Empilha a Logo e o Relógio/Status */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 1rem;
    }

    /* 3. Relógio e Status: Garante que não vazem da tela */
    #painel-relogio {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap; 
    }
    .status {
        font-size: 0.75rem; /* Reduz a fonte do status para caber melhor */
    }

    /* 4. Menu de Navegação: Transforma em uma grade 2x2 */
    #menu-investigacao {
        flex-wrap: wrap !important; /* Permite que os botões caiam para a linha de baixo */
        justify-content: center;
        padding: 1rem 0.5rem !important; /* Sobrescreve o padding injetado pelo JS */
    }
    
    .nav-btn {
        flex: 1 1 40%; /* Cada botão ocupa cerca de metade da largura */
        font-size: 0.85rem;
        padding: 10px 5px;
        text-align: center;
    }

    /* 5. Terminal de Busca: Coloca o botão embaixo do input */
    .input-container {
        flex-direction: column;
    }
    
    .btn-terminal {
        width: 100%;
        padding: 15px;
    }

    /* 6. Ajuste de espaçamento interno das caixas para telas menores */
    .terminal-container, 
    .quadro-container, 
    .operacoes-container, 
    .acusacao-container, 
    .setup-container,
    .notas-container {
        padding: 1.5rem 1rem;
    }

    .logo-text h1 {
        font-size: 1.5rem;
    }

    .teoria-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        flex: 1 1 30%;
        font-size: 0.8rem;
    }
}