Core Task:
Generate a complete, single-file HTML document that uses the Three.js library to create an interactive 3D scene. The scene is a swimming pool area where the user can move around in a first-person perspective and interact with the environment.
Technology Requirements:
Single File: All HTML, CSS, and JavaScript must be contained within one .html file.
Three.js: Use the Three.js library.
Modules: Load Three.js and its add-ons (like PointerLockControls) via ES6 modules using an importmap.
No External Files: Do not require any local assets. If textures are used, they must be loaded from a public URL.
Scene Details:
Environment: Create a sky-blue background with fog for atmospheric perspective. The scene should be well-lit with both ambient (HemisphereLight) and directional (DirectionalLight) lighting.
Pool Deck: A flat, solid ground plane that the player can walk on. This should surround the pool.
Pool with Depth:
The pool must be a 3D basin, not a flat plane. It should have a visible floor and four walls, giving it a clear sense of depth (e.g., 5-10 units deep).
Use a tile texture for the pool's interior floor and walls.
Create a separate, semi-transparent blue THREE.Mesh at y=0 to represent the water's surface. The player should be able to see the pool floor through this surface.
Player Controls & Physics:
Controls: Implement first-person shooter (FPS) style controls using PointerLockControls.
A "Click to play" overlay should block the view initially, disappearing when the user clicks to lock the pointer.
Movement: W, A, S, D keys for movement.
Look: Mouse movement controls the camera direction.
Player Physics:
On Land: The player should be subject to gravity and have a fixed eye-level height. They should be able to jump using the SPACE bar. Collision with the ground plane should prevent falling through.
In Water: When the player's y-position is below the water surface level:
Buoyancy: The player should gently float up towards the water surface. Gravity should be counteracted by an upward force.
Water Resistance: Movement speed (from WASD keys) should be significantly reduced.
No Jumping: The SPACE bar jump should be disabled while in the water.
Primary Interaction: "Pineapple Juice" Stream
Continuous Stream: The liquid stream is a particle effect that should be emitted continuously only while the left mouse button is held down. The stream should stop immediately when the button is released.
Use mousedown and mouseup event listeners to control a boolean state variable (e.g., isStreaming).
The main animation loop should check this boolean on every frame to decide whether to emit new particles.
Particle Physics:
Particles should be emitted from the camera's current position and direction.
They must follow a realistic parabolic arc, visibly affected by a downward gravity force.
Collision: When a particle's y-position reaches the water surface level, its movement should stop. Particles should not go through the water or the pool floor.
Dynamic Color:
Default Color: The particles should be bright yellow (0xffff00).
Critical Color: When the Bladder Health metric (see below) is "Critical," the color of any newly emitted particles must change to red (0xff0000).
UI / Head-Up Display (HUD):
Overlay: Create a fixed-position div element on the screen to display game metrics.
Metrics to Display:
Pee Meter: A numeric value, displayed as a percentage (e.g., "100%"). It starts at 100. It should decrease over time only while the mouse button is held down.
Bladder Health: A text string that updates based on the Pee Meter's value:
> 80%: "Excellent"
> 50%: "Good"
> 20%: "Warning"
<= 20%: "Critical"
Score: A number that starts at 0 and increases over time only while the mouse button is held down.