body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: white;
    background-color: #343a40;
    padding: 10px;
    border-radius: 5px;
}

.input-section {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.slider-value {
    display: flex;
    align-items: center;
}

input[type="range"] {
    flex: 1;
    margin-right: 10px;
    -webkit-appearance: none;
    height: 5px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    vertical-align: middle;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -7.5px; /* Adjust to center vertically */
}

input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 5px;
    background: linear-gradient(to right, #007bff 0%, #007bff var(--value, 0%), #ddd var(--value, 0%), #ddd 100%);
}

input[type="range"]::-moz-range-track {
    height: 5px;
    background: linear-gradient(to right, #007bff 0%, #007bff var(--value, 0%), #ddd var(--value, 0%), #ddd 100%);
}

input[type="range"]::-ms-track {
    height: 5px;
    background: linear-gradient(to right, #007bff 0%, #007bff var(--value, 0%), #ddd var(--value, 0%), #ddd 100%);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-ms-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: 0;
}

input[type="number"] {
    width: 80px;
    padding: 5px;
    text-align: right;
}

span {
    margin-left: 5px;
}

.output-section {
    background: #e8e8e8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.pie-section {
    background: #d0eaff;
}

.pie-section p {
    font-weight: bold;
}

.bar-legend, .pie-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.bar-legend > div, .pie-legend > div {
    display: flex;
    align-items: center;
}

.color-box {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 50%;
}

.red {
    background-color: crimson;
}

.blue {
    background-color: navy;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    input[type="number"] {
        width: 60px;
    }
}