text: "use stric";
  // console.log(document.querySelector(".message").textContent);
  // document.querySelector(".message").textContent = "Correct number!";
  // console.log(document.querySelector(".message").textContent);
  
  // document.querySelector(".number").textContent = 13;
  // document.querySelector(".score").textContent = 20;
  
  // document.querySelector(".guess").value = 23;
  // console.log(document.querySelector(".guess").value);
  
  let secretNumber = Math.trunc(Math.random() * 20) + 1;
  let score = 20;
  let highscore = 0;
  
  const displayMessage = (message) => {
    document.querySelector(".message").textContent = message;
  };
  document.querySelector(".number").textContent = "?";
  
  //Check button
  document.querySelector(".check").addEventListener("click", () => {
    const guess = Number(document.querySelector(".guess").value);
    console.log(typeof guess, guess);
  
    //When there is no input
    if (!guess) {
      displayMessage("No Number!");
  
      //When player wins
    } else if (guess === secretNumber) {
      displayMessage("Correct Number!");
      document.querySelector(".number").textContent = secretNumber;
      document.querySelector("body").style.backgroundColor = "#60b347";
      document.querySelector(".number").style.width = "30rem";
  
      if (score > highscore) {
        highscore = score;
        document.querySelector(".highscore").textContent = highscore;
      }
      //When guess is too high
    } else if (guess !== secretNumber) {
      if (score > 1) {
        displayMessage(guess > secretNumber ? "Too high!" : "Too low!");
        score--;
        document.querySelector(".score").textContent = score;
      } else {
        displayMessage("You lost the game!");
        document.querySelector(".score").textContent = 0;
      }
    }
  
    //Again button
    document.querySelector(".again").addEventListener("click", () => {
      secretNumber = Math.trunc(Math.random() * 20) + 1;
      score = 20;
      document.querySelector(".score").textContent = score;
      document.querySelector(".number").textContent = "?";
      document.querySelector(".guess").value = "";
      displayMessage("Start guessing...");
      document.querySelector("body").style.backgroundColor = "#222";
      document.querySelector(".number").style.width = "15rem";
    });
  });
  