body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, #e0eafc, #cfdef3);
    color: #333;
    margin: 0;
    min-height: 100vh;
}

header {
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
    background-color: #4a6fa5;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    border-bottom: 3px solid #3b5998;
}

header a {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header a:hover {
    color: #e0eafc;
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    margin: 30px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.controls:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.controls label {
    font-weight: 500;
    font-size: 1.1rem;
    color: #3b5998;
}

.controls select, .controls button {
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

.controls select:focus, .controls button:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.controls button {
    background-color: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
}

.controls button:hover {
    background-color: #3b5998;
    border-color: #3b5998;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.controls button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container label {
    flex-shrink: 0;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4a6fa5;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    margin-top: -6px;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a6fa5;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(74, 111, 165, 0.2);
}

input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(74, 111, 165, 0.2);
}

.slider-container span {
    font-weight: 500;
    color: #3b5998;
    min-width: 45px;
    text-align: left;
}

canvas {
    background-color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    max-width: calc(100% - 40px);
    height: auto;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

canvas:hover {
    transform: scale(1.01);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    h1 {
        font-size: 1.5rem;
    }
    .controls {
        margin: 20px;
        padding: 20px;
    }
}