@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Source Sans 3', Arial, sans-serif;
}

#simulation-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

#canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-width: 600px;
    max-height: 600px;
    margin: 0 auto;
}

#canvas-container canvas {
    display: block;
    /* p5 writes inline width/height styles on the element, so !important is
       required. height: auto keeps the aspect ratio while max-width downscales;
       height fitting is handled by windowResized() in sketch.js. */
    max-width: 100% !important;
    height: auto !important;
}

#controls-container {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 10px;
    background-color: #f8f5ec;
}

.slider {
    width: 90%;
    max-width: 400px;
    height: 30px;
    -webkit-appearance: none;
    appearance: none;
    background: #e6dfd0;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: 15px;
    margin: 20px 0;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background: #4f9143;
    cursor: pointer;
    border-radius: 50%;
}

.slider::-moz-range-thumb {
    width: 40px;
    height: 40px;
    background: #4f9143;
    cursor: pointer;
    border-radius: 50%;
}

label {
    font-size: 18px;
    margin-bottom: 10px;
}

@media (orientation: landscape) {
    #simulation-container {
        flex-direction: row;
    }

    #controls-container {
        width: 30%;
        max-width: 300px;
    }
}

/* Increase touch target size for mobile */
@media (max-width: 768px) {
    .slider {
        height: 40px;
    }

    .slider::-webkit-slider-thumb {
        width: 50px;
        height: 50px;
    }

    .slider::-moz-range-thumb {
        width: 50px;
        height: 50px;
    }
}