t.focus({ preventScroll: true });
            loop();
          });
        }

        function togglePause() {
          if (!state.running) return;
          state.paused = !state.paused;
          pauseBtn.textContent = state.paused ? 'Resume' : 'Pause';
          if (!state.paused) { state.lastTime = performance.now(); loop(); }
        }

        function gameOver() {
          state.running = false;
          over.style.display = 'flex';
          const acc = accuracy();
          goScore.textContent 