:root {
    --boxSize: 500px;
    --scale: 4;
    --circleScale: calc(1/var(--scale));
}

[data-theme="dark"] {
    --theme-background: #000000;
    --theme-font: #ffffff;
}
[data-theme="light"] {
    --theme-background: #ffffff;
    --theme-font: #000000;
}

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

body {
    width: 100vw;
    height: 100dvh;
    padding: 20px;
    background-color: var(--theme-background);
    
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 140px;
}

#inputBox {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px 40px;
    background: transparent; /* Matching the black theme */
    color: var(--theme-font);
    border: 2px solid var(--theme-font);
    border-radius: 40px;
    font-family: sans-serif;
    max-width: 300px;
}

label, button {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* Base styling for the slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
}

/* The Track */
input[type="range"]::-webkit-slider-runnable-track {
    /* background: #333; Dark grey track */
    background: linear-gradient(90deg, #ffb3ba, #ffdfba, #ffffba, #baffc9, #bae1ff, #e0baff);
    height: 8px;
    border: 1px solid #fff; /* White border for high contrast */
}

input[type="range"]::-moz-range-track {
    /* background: #333; */
    background: linear-gradient(90deg, #ffb3ba, #ffdfba, #ffffba, #baffc9, #bae1ff, #e0baff);
    height: 8px;
    border: 1px solid #fff;
}

/* The Thumb (The part you grab) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -8px; /* Centers thumb on track */
    background-color: #fff;
    height: 24px;
    width: 12px;
    border: 1px solid #000;
}

input[type="range"]::-moz-range-thumb {
    border: none;
    border-radius: 0;
    background-color: var(--theme-background);
    height: 24px;
    width: 12px;
    border: 1px solid var(--theme-font);
}

/* Hover & Active States */
input[type="range"]:hover::-webkit-slider-thumb {
    background-color: #ccc; /* Subtle feedback */
}

/* The Number Input */
input[type="number"] {
    padding: 10px 12px;
    border: 2px solid var(--theme-font);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background-color: var(--theme-background);
    color: var(--theme-font);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%; /* Or a specific width like 120px */
    max-width: 200px;
}

/* Focus state - matches most modern UI */
input[type="number"]:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

#darkLightMode {
    padding: 10px;
    border-radius: 20px;
    background-color: transparent;
    border: 2px solid var(--theme-font);
    color: var(--theme-font)
}

#box {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    min-height: 0;

    display: flex;
    justify-content: center;
    align-items: center;
}

#innerBox {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;
}

#shadow {
    /* outline: 2px solid black; */
    position: absolute;
    width: 105%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    opacity: 1;
    box-shadow: inset 0 0 30px 50px var(--theme-background);
}

.colorSquare {
    position: absolute;
    width: calc(100% * var(--circleScale));
    aspect-ratio: 1/1;
    border-radius: 50%;
    opacity: 0.4;
}


@media (max-height: 1100px) and (max-width: 580px) {
    body {
        gap: 50px;
    }
    #inputBox {
        gap: 10px;
    }
}

@media (max-height: 900px) and (max-width: 580px) {
    body {
        gap: 30px;
    }
    #inputBox {
        gap: 10px;
    }
    #box {
        width: 80%;
    }
}

@media (max-height: 775px) and (max-width: 580px) {
    body {
        gap: 30px;
    }
    #inputBox {
        padding-top: 10px;
        padding-bottom: 10px;
        /* border-radius: 10px; */
        gap: 10px;
    }
    #box {
        width: 75%;
    }
    input[type="number"] {
        padding: 5px 12px;
        border: 1px solid var(--theme-font);
    }
    #darkLightMode {
        padding: 10px;
        border: 1px solid var(--theme-font);
    }
}