* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: #000000;
    overscroll-behavior: none;
    touch-action: none;
}

canvas {
    display: block;
    width: 100vw;
    height: 100dvh;
    touch-action: none;
}

/* TELA DE CARREGAMENTO */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 110vw;
    height: 100vh;
    background: #050505;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #00aaff;
    font-family: monospace;
    transition: opacity 0.5s ease;
}

#loading-bar-container {
    width: 300px;
    height: 12px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: #00ff88;
    transition: width 0.1s;
    box-shadow: 0 0 10px #00ff88;
}

/* PAINEL QUÂNTICO */
/* --- PAINEL QUÂNTICO (Dashboard Inferior com Estética Original) --- */
#quantum-panel {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid #00aaff;
    border-radius: 12px;
    padding: 20px 30px;
    color: #fff;
    font-family: monospace;
    z-index: 100;
    width: 90%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

#quantum-panel.hidden {
    transform: translate(-50%, 150%); 
    opacity: 0;
    pointer-events: none;
}

.panel-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

input[type=range] {
    -webkit-appearance: none; 
    appearance: none;
    background: transparent; 
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #00aaff;
    cursor: pointer;
    margin-top: -6px; 
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #555;
    border-radius: 2px;
}

#btn-update {
    width: 100%;
    background: #00aaff;
    color: #000;
    border: none;
    padding: 12px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: 0.2s;
    font-size: 14px;
}

#btn-update:hover {
    background: #0088cc;
    box-sizing: 0 0 10px #00aaff;
}

#toggle-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    color: #00aaff;
    border: 1px solid #00aaff;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-family: monospace;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.1);
}

#toggle-panel:hover {
    background: #00aaff;
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.4);
}

#error-msg {
    color: #00ff88;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    min-height: 15px;
}

#stark-hud {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid #00aaff;
    border-radius: 40px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 50;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0, 170, 255, 0.1);
    font-family: monospace;
    color: #fff;
}

#stark-hud label {
    font-weight: bold;
    color: #00aaff;
    white-space: nowrap;
}

#stark-hud input {
    flex-grow: 1;
}

/* --- BOTÕES SUPERIORES E EXPORTAÇÃO --- */
.top-btn {
    position: absolute;
    top: 20px;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    color: #00aaff;
    border: 1px solid #00aaff;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-family: monospace;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.1);
}

.top-btn:hover {
    background: #00aaff;
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.4);
}

.export-btn {
    flex: 1;
    background: #111;
    color: #00aaff;
    border: 1px solid #555;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: 0.2s;
}

.export-btn:hover {
    background: #222;
    border-color: #00aaff;
}

.export-btn.recording {
    background: #ff3366;
    color: #fff;
    border-color: #ff3366;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- MODAL EDUCACIONAL --- */
#help-modal {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

#help-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#close-help {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 28px;
    color: #ff3366;
    padding: 10px;
    line-height: 1;
    z-index: 10;
}

.modal-content {
    position: relative;
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid #00aaff;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    color: #ddd;
    font-family: monospace;
    font-size: 14px;
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
}

.modal-content p {
    margin-bottom: 8px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    #quantum-panel {
        flex-direction: column;
        gap: 10px;
        bottom: 85px;
        width: 95%;
        padding: 15px;
        max-height: 85vh;
        overflow-y: auto;
    }
    #quantum-panel.hidden {
        transform: translate(-50%, 120%);
    }

    #stark-hud {
        bottom: 10px;
        padding: 10px 15px;
        width: 95%;
    }
}