* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #ffffff;
    overflow: hidden;
    cursor: crosshair;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* Quantum HUD */
#quantum-hud {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    pointer-events: none;
}

.hud-panel {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.hud-title {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    color: #00d4ff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.metric {
    margin-bottom: 15px;
}

.label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b8b9f;
    margin-bottom: 5px;
}

.value {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00d4ff;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.monospace {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.meter-container {
    background: rgba(0, 0, 0, 0.5);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.meter {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #a855f7);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.density-viz {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #a855f7;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.5);
}

#wave-canvas {
    display: block;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* Control Panel */
#control-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.quantum-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    color: #00d4ff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.quantum-btn:hover {
    background: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.quantum-btn.primary {
    background: rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
    color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.quantum-btn.primary:hover {
    background: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.quantum-btn.large {
    padding: 15px 40px;
    font-size: 16px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b8b9f;
}

input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00d4ff;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked {
    background: rgba(0, 212, 255, 0.3);
}

input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00d4ff;
    top: 1px;
    left: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

input[type="checkbox"]:checked::before {
    left: 21px;
}

/* Tutorial Overlay */
.tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.tutorial-content {
    max-width: 600px;
    padding: 40px;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
}

.tutorial-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.tutorial-content p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #a0a0b0;
}

.tutorial-content ul {
    text-align: left;
    list-style: none;
    margin: 20px 0;
}

.tutorial-content li {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
    color: #c0c0d0;
}

.tutorial-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00d4ff;
}

.tutorial-content em {
    color: #a855f7;
    font-style: normal;
}

/* Status Message */
#status-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.95);
    border: 2px solid #00d4ff;
    padding: 20px 40px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    z-index: 200;
    display: none;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
    text-align: center;
}

#status-message.collapse {
    border-color: #ffd700;
    color: #ffd700;
    animation: pulse 0.5s ease-in-out infinite;
}

#status-message.success {
    border-color: #a855f7;
    color: #a855f7;
}

/* Flavor Text */
#flavor-text {
    position: fixed;
    bottom: 100px;
    right: 30px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(139, 139, 159, 0.8);
    opacity: 0;
    animation: fadeInOut 5s ease-in-out infinite;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    font-size: 11px;
    color: rgba(139, 139, 159, 0.6);
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(5px);
    z-index: 50;
}

footer p {
    margin: 3px 0;
}

footer a {
    color: #00d4ff;
    text-decoration: none;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

footer a:hover {
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #quantum-hud {
        top: 10px;
        left: 10px;
    }
    
    .hud-panel {
        padding: 15px;
        min-width: auto;
        max-width: calc(100vw - 20px);
    }
    
    #control-panel {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        bottom: 10px;
    }
    
    .quantum-btn {
        width: 100%;
        padding: 12px;
    }
    
    .tutorial-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .tutorial-content h2 {
        font-size: 24px;
    }
    
    .tutorial-content p {
        font-size: 16px;
    }
    
    #flavor-text {
        bottom: auto;
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    footer {
        font-size: 10px;
        padding: 10px;
    }
}

@media (max-height: 600px) {
    #control-panel {
        bottom: 5px;
        padding: 10px 15px;
    }
    
    .quantum-btn {
        padding: 8px 15px;
        font-size: 11px;
    }
}