Click the game and usePointer().lock() captures the mouse: the cursor hides, and onMove keeps reporting movementX and movementY however far the mouse goes, which turn the camera. WASD walks.
Esc gives the mouse back. isLocked() turns false on its own, and the HUD reads it every frame to show the hint again.
The browser only captures the mouse in answer to a click or a key press, so lock() is called from onDown. Anywhere else it answers false instead of throwing. raw: true asks for the mouse's own movement, without the system's acceleration, where the browser offers it.