close the web page and don't play that game.
You aren't hacked, it's just meant to trick you into doing something that you shouldn't or don't need to do.
Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
Notably this part of that link
If your web browser displays annoying pop-ups
While browsing the web, if you see a pop-up or alert that offers you a free prize or warns you about security problems or viruses on your device, don't believe it. These types of pop-ups are usually fraudulent advertisements, designed to trick you into downloading damaging software or giving the scammer personal information or money.
Don't call the number or follow the links to claim the prize or fix the problem. Ignore the message and simply navigate away from the page or close the entire window or tab.