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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c2b 0%, #1a1a3a 50%, #2d1b4e 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    background: linear-gradient(45deg, #4fc3f7, #9c27b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.powered-by {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.powered-by:hover {
    color: #4fc3f7;
}

.main-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding-top: 80px;
}

#canvas {
    width: 100%;
    height: calc(100vh - 80px);
    display: block;
    cursor: crosshair;
}

.controls-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    min-width: 280px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.controls-header h3 {
    font-size: 1.2rem;
    font-weight: 400;
    color: #4fc3f7;
}

.toggle-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4fc3f7;
}

.control-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h4 {
    font-size: 1rem;
    color: #9c27b0;
    margin-bottom: 10px;
    font-weight: 500;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
}

select, input[type="range"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

select {
    padding: 8px 12px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

select option {
    background: #1a1a3a;
    color: white;
}

input[type="range"] {
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4fc3f7, #9c27b0);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4fc3f7, #9c27b0);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.audio-btn, .fullscreen-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(45deg, #4fc3f7, #9c27b0);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.audio-btn:hover, .fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.preset-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(156, 39, 176, 0.3);
    border-color: #9c27b0;
    transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .controls-panel {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
        min-width: auto;
        max-width: none;
        border-radius: 15px 15px 0 0;
    }
    
    .main-container {
        padding-top: 70px;
    }
    
    #canvas {
        height: calc(100vh - 70px);
    }
    
    .preset-buttons {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    
    .preset-btn {
        font-size: 0.7rem;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .controls-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .header {
        padding: 10px;
    }
    
    .powered-by {
        font-size: 0.8rem;
    }
}

/* Fullscreen styles */
:fullscreen .controls-panel {
    top: 20px;
    right: 20px;
    bottom: auto;
    left: auto;
    position: absolute;
}

:fullscreen .main-container {
    padding-top: 0;
}

:fullscreen #canvas {
    height: 100vh;
}

:fullscreen .header {
    display: none;
}

/* Smooth animations */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Glow effects */
.controls-panel {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(79, 195, 247, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.audio-btn:active, .fullscreen-btn:active, .preset-btn:active {
    transform: translateY(0);
}

/* Loading animation for better UX */
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}