varying vec2 vUv;
uniform vec3 uOuterColor;
uniform float uTime;

void main() {
    // Map vUv into -1..1 range like Shadertoy
    vec2 uv = (vUv - 1.0) * 0.5;

    // Distortion loop – slowed down (uTime * 0.25)
    for (float i = 1.0; i < 8.0; i++) {
        uv.y += 0.1 * sin(uv.x * i * i + uTime * 0.25)
                     * sin(uv.y * i * i + uTime * 0.25);
    }

    // Base color influenced by uv + zone color
    vec3 col = uOuterColor;
    col.r += uv.y * 0.2;
    col.g += uv.y * 0.3;
    col.b += uv.y * 0.4;

    // Vertical fade
    float verticalFade = 1.0 - vUv.y;

    gl_FragColor = vec4(col * verticalFade, verticalFade);
}
