body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #87CEEB; /* Sky blue fallback */
    color: #333;
    display: flex;
    height: 100vh;
    position: relative;
}

.controls-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}


.controls-toggle:hover {
    background: rgba(44, 62, 80, 1);
    transform: scale(1.1);
}

.controls-toggle:active {
    transform: scale(0.95);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

#controls {
    width: 320px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    padding-top: 70px;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    opacity: 1;
}


#controls.controls-collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#controls.controls-collapsed * {
    pointer-events: none;
}

@media (max-width: 768px) {
    #controls {
        width: 280px;
        max-width: 85vw;
        padding-top: 55px;
    }
    
    .controls-toggle {
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
}

h1 {
    font-size: 1.5rem;
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

span[id$="Val"] {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #2c3e50;
    border-radius: 50%;
    cursor: pointer;
}

.instructions {
    font-size: 0.85rem;
    color: #555;
    margin-top: 10px;
    line-height: 1.5;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #2c3e50;
}

button {
    padding: 12px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

button:hover {
    background-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

.github-link {
    display: block;
    text-align: center;
    padding: 12px;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.github-link:hover {
    background-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.github-link:active {
    transform: translateY(0);
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    /* Canvas is added by script */
}
