ONE COLLISION PER FRAME
Every live brick is tested against the ball's axis-aligned box, but only the deepest overlap is resolved. The ball is ejected along that axis and the brick is cleared, so it can never be re-hit on the same tick or leave the brick grid with a corrupted velocity.
const ox = (BW/2 + R) - Math.abs(ball.x - brickCx);
const oy = (BH/2 + R) - Math.abs(ball.y - brickCy);
if (ox > 0 && oy > 0 && Math.min(ox, oy) < bestDepth) best = brick;