let circle = document.getElementById("circle");
let scoreText = document.getElementById("score");
let score = 0;

function moveCircle(){

    let gameArea = document.getElementById("gameArea");

    let maxX = gameArea.clientWidth - 50;
    let maxY = gameArea.clientHeight - 50;

    let randomX = Math.random() * maxX;
    let randomY = Math.random() * maxY;

    circle.style.left = randomX + "px";
    circle.style.top = randomY + "px";
}

circle.addEventListener("click", function(){

    score++;
    scoreText.innerText = score;

    moveCircle();
});

moveCircle();