﻿html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', sans-serif; 
    background-color: #000F0D;
}

#p5-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

#controls-container {
    position: fixed;
    bottom: 2vh;
    left: 2vh;
    transform: scale(1);
    transform-origin: bottom left;
    transition: transform 0.3s ease-out, opacity 0.72s ease-out;

    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 16px; 
    border-radius: 12px;
    z-index: 10;
    
    backdrop-filter: blur(8px);
    background-color: rgba(17, 24, 39, 0.5);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); 
    color: #E2E8F0;

    opacity: 1;
    pointer-events: auto !important;
    touch-action: auto !important;
}

#controls-container.inactive {
    opacity: 0;
    transition: opacity 1.44s ease-out;
    pointer-events: none !important;
}

.slider-label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #94A3B8;
}

#volatility-value, #fade-value {
    color: #ffffff;
    font-weight: bold;
}

.slider-base {
    -webkit-appearance: none;
    appearance: none;
    width: 200px;
    height: 8px;
    background: #4A5568; 
    outline: none;
    opacity: 0.8;
    transition: opacity .2s;
    border-radius: 4px;
}

.slider-base:hover {
    opacity: 1;
}

.slider-style-volatility::-webkit-slider-thumb,
.slider-style-volatility::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22D3EE;
    cursor: grab;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.8); 
    border: none;
}
    
.slider-style-fade::-webkit-slider-thumb,
.slider-style-fade::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FBBF24;
    cursor: grab;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.8); 
    border: none;
}

.slider-style-hue::-webkit-slider-thumb,
.slider-style-hue::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #C084FC;
    cursor: grab;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.8);
    border: none;
}

.slider-style-saturation::-webkit-slider-thumb,
.slider-style-saturation::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10B981;
    cursor: grab;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    border: none;
}

.slider-style-brightness::-webkit-slider-thumb,
.slider-style-brightness::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #F472B6;
    cursor: grab;
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.8);
    border: none;
}

#controls-container {
    pointer-events: auto !important;
    touch-action: auto !important;
}

.slider-base {
    pointer-events: auto !important;
    touch-action: auto !important;
    cursor: pointer !important;
}

.slider-base::-webkit-slider-thumb {
    pointer-events: auto !important;
    cursor: grab !important;
}

.slider-base::-moz-range-thumb {
    pointer-events: auto !important;
    cursor: grab !important;
}

#controls-container {
    gap: 20px;
}

.toggle-group {
    flex-direction: column;
    align-items: flex-start;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 5px;
}

.toggle-label.slider-label {
    margin-bottom: 0; 
}

#evolve-toggle {
    /* Hide the default checkbox input */
    display: none;
}

.toggle-switch {
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #4B5563;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.toggle-switch::before {
    content: 'OFF';
    position: absolute;
    top: 2px;
    left: 4px;
    width: 16px;
    height: 16px;
    background-color: #E2E8F0;
    border-radius: 50%;
    transition: transform 0.3s, content 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: bold;
    color: #4B5563;
}

#evolve-toggle:checked + .toggle-switch {
    background-color: #10B981;
}

#evolve-toggle:checked + .toggle-switch::before {
    transform: translateX(16px);
    content: 'ON';
    color: #10B981;
}

@media (max-width: 600px) {
    #controls-container {
        transform: scale(min(1, max(0.5, 60vw / 1000)));
        bottom: 0.5vh;
        left: 0.5vw;
        padding: 10px;
    }
    
    .slider-base {
        width: 150px;
    }
}