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

body {
    font-family: 'Arial', sans-serif;
    background: #000510;
    overflow: hidden;
    color: white;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Instruction Panel */
.instruction-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 5, 16, 0.8);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 280px;
    z-index: 100;
}

.instruction-panel h3 {
    margin-bottom: 10px;
    color: #64b5f6;
    font-size: 16px;
}

.instruction-panel p {
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 5, 16, 0.8);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    min-width: 200px;
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.theme-swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.theme-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.theme-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.theme-swatch.cosmic {
    background: linear-gradient(45deg, #4c1d95, #ff00ff);
}

.theme-swatch.solar {
    background: linear-gradient(45deg, #ea580c, #ffff00);
}

.theme-swatch.matrix {
    background: linear-gradient(45deg, #166534, #00ff00);
}

.theme-swatch.rainbow {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff);
    animation: rainbow-rotate 3s linear infinite;
}

@keyframes rainbow-rotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.density-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.density-control label {
    font-size: 14px;
    color: #64b5f6;
}

.density-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.density-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #64b5f6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.density-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #64b5f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#densityValue {
    text-align: center;
    font-size: 12px;
    color: #ffffff;
    opacity: 0.8;
}

/* Bottom Controls */
.bottom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(0, 5, 16, 0.8);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.control-btn {
    background: rgba(100, 181, 246, 0.2);
    border: 1px solid rgba(100, 181, 246, 0.4);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: rgba(100, 181, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.3);
}

.control-select {
    background: rgba(0, 5, 16, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.control-select:hover {
    border-color: rgba(100, 181, 246, 0.6);
    background: rgba(100, 181, 246, 0.1);
}

.control-select option {
    background: #000510;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .instruction-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 15px;
    }
    
    .control-panel {
        top: auto;
        bottom: 100px;
        right: 10px;
        left: 10px;
        padding: 15px;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px 20px;
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        justify-content: center;
    }
    
    .control-btn, .control-select {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .theme-swatch {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .instruction-panel h3 {
        font-size: 14px;
    }
    
    .instruction-panel p {
        font-size: 12px;
    }
    
    .theme-selector {
        gap: 8px;
    }
    
    .theme-swatch {
        width: 30px;
        height: 30px;
    }
}

/* Loading and transition effects */
.control-btn, .control-select, .theme-swatch {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow effects for active elements */
.instruction-panel, .control-panel, .bottom-controls {
    box-shadow: 0 8px 32px rgba(0, 5, 16, 0.8);
}

/* Scrollbar styling for select dropdowns */
.control-select::-webkit-scrollbar {
    width: 8px;
}

.control-select::-webkit-scrollbar-track {
    background: rgba(0, 5, 16, 0.5);
}

.control-select::-webkit-scrollbar-thumb {
    background: rgba(100, 181, 246, 0.5);
    border-radius: 4px;
}

.control-select::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 181, 246, 0.7);
}