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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: black;
    font-family: 'Outfit', sans-serif;
    color: white;
}

canvas {
    display: block;
    background: black;
}

#appTitle {
    position: absolute;
    top: 25px;
    left: 30px;
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 10;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#appTitle span {
    font-weight: 700;
    background: linear-gradient(90deg, #00aaff, #00ffcc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

#clearBtn {
    position: absolute;
    top: 25px;
    right: 30px;
    background: rgba(200, 50, 50, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#clearBtn:hover {
    background: rgba(200, 50, 50, 0.4);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 77, 0.4);
}

#ui {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 25px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    min-width: 220px;
}

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

.control-group label {
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#colorPicker {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.color-btn:hover {
    transform: scale(1.2);
}

.color-btn.selected {
    transform: scale(1.2);
    box-shadow: 0 0 12px currentColor;
    border-color: white !important;
}

/* Custom Range Slider */
input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]:focus {
    outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #00ffcc;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 24px;
}
.slider-toggle:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider-toggle {
    background-color: #00ffcc;
}
input:checked + .slider-toggle:before {
    transform: translateX(20px);
}