* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #111;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: #e0aaff;
    text-shadow: 0 0 10px rgba(224, 170, 255, 0.5);
    letter-spacing: 2px;
}

.canvas-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 480px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

#outputCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.controls {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(30, 30, 40, 0.7);
    padding: 15px;
    border-radius: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    min-width: 100px;
    color: #c8b6ff;
}

select, input[type="range"] {
    flex: 1;
    padding: 8px;
    background-color: #2a2a35;
    color: #fff;
    border: 1px solid #7b2cbf;
    border-radius: 4px;
}

select {
    cursor: pointer;
}

input[type="range"] {
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #7b2cbf 0%, #c77dff 100%);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0aaff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(224, 170, 255, 0.8);
}

#intensityValue {
    min-width: 50px;
    text-align: right;
}

.advanced-controls {
    display: none;
    border-top: 1px solid rgba(123, 44, 191, 0.5);
    padding-top: 15px;
    margin-top: 5px;
}

.advanced-controls.show {
    display: block;
}

.control-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.toggle-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #9d4edd, #5a189a);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-button.small {
    flex: 0.45;
    font-size: 0.9rem;
    padding: 8px 10px;
}

#toggleButton {
    flex: 1;
    margin: 10px 10px 0;
}

.toggle-button:hover {
    background: linear-gradient(135deg, #c77dff, #7b2cbf);
    box-shadow: 0 0 10px rgba(201, 125, 255, 0.5);
}

.toggle-button.active {
    background: linear-gradient(135deg, #ff5e5e, #d00000);
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #9d4edd;
    cursor: pointer;
}

#webcamVideo {
    display: none;
}

@media (max-width: 600px) {
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    label {
        margin-bottom: 5px;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .toggle-button.small {
        width: 100%;
        margin-top: 5px;
    }
}