* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f7fdff;
  font-family: sans-serif;
}
body.denied {
  background-color: rgb(204, 79, 79);
  color: rgb(116, 122, 117);
  text-align: center;
  padding-top: 20%;
  font-size: 2em;
  font-family: "Courier New", Courier, monospace;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100vh;
  background-size: cover;
  overflow: hidden;
  border: 2px solid #ccc;
}
.character {
  position: absolute;
  width: 100px;
  bottom: 0;
  left: 50px;
}
.excalibur {
  position: absolute;
  width: 100px;
  bottom: 0;
  right: 30px;
}
.logo {
  position: absolute;
  width: 400px;
  top: 40px;
}
.obstacle {
  position: absolute;
  width: 140px;
  bottom: 0;
  right: -50px;
}
.exc {
  position: absolute;
  top: 75%;
  left: 85%;
  width: 200px;
  text-align: center;
}
.score {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 30px;
  font-weight: bold;
  color: rgb(202, 199, 199);
}
#pauseBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 13px 18px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 20px;
  background-color: #333;
  color: white;
  border: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}
#pauseBtn:hover {
  background-color: #555;
  transform: scale(1.1);
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
}
#startBtn {
  position: absolute;
  top: 40%;
  right: 48%;
  padding: 20px 25px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 20px;
  background-color: #888;
  color: white;
  border: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}
#startBtn:hover {
  background-color: #888;
  transform: scale(1.1);
}
.red {
  position: absolute;
  width: 80px;
  top: 50px;
  right: 50%;
  text-align: center;
}
.red:hover {
  transform: scale(1.3);
}
.eth {
  position: absolute;
  top: 50px;
  right: 85%;
  text-align: center;
}
.eth1 {
  position: absolute;
  top: 50px;
  left: 85%;
  text-align: center;
}
#gameText {
  position: absolute;
  top: 80px;
  width: 100%;
  text-align: center;
  font-family: "Comic Sans MS", cursive, sans-serif;
  font-size: 100px;
  font-weight: bold;
  color: #888;
  text-shadow: 1px 1px 2px black;
  z-index: 10;
}
.game-over {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Comic Sans MS", cursive;
  font-size: 48px;
  font-weight: bold;
  color: black;
  text-shadow: 2px 2px black;
  z-index: 10;
}
.hidden {
  display: none;
}
.restart-button {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  font-size: 20px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  color: white;
  background-color: #888;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: transform 0.2s ease;
}
.restart-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}
.modal {
  display: block;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #222;
  color: white;
  margin: 15% auto;
  padding: 30px;
  border: 1px solid #888;
  width: 400px;
  text-align: center;
  font-family: "Courier New", monospace;
  border-radius: 10px;
}

.modal-content input {
  padding: 10px;
  width: 80%;
  margin: 15px 0;
  border: none;
  border-radius: 5px;
}

.modal-content button {
  padding: 10px 20px;
  background-color: rgb(70, 72, 73);
  border: none;
  color: white;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.modal-content button:hover {
  background-color: rgb(165, 174, 179);
}
@media (max-width: 768px) {
  html,
  body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Prevent scrolling */
  }

  .game-container {
    width: 100%;
    height: 100dvh; /* Dynamic viewport height — mobile safe */
    overflow: hidden;
    position: relative;
    background-size: cover;
  }

  .character {
    position: absolute;
    width: 80px;
    bottom: 0;
  }

  .excalibur {
    display: none; /* Hide large element on small screen */
  }

  .logo {
    width: 150px;
    top: 40px;
  }

  .obstacle {
    position: absolute;
    width: 80px;
    right: -30px;
    bottom: 0;
  }

  .exc {
    width: 120px;
    left: 70%;
    top: 70%;
  }

  .score {
    font-size: 20px;
  }

  #pauseBtn,
  #startBtn,
  .restart-button {
    padding: 10px 15px;
    font-size: 16px;
    font-family: sans-serif;
  }

  #startBtn {
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  .red,
  .eth,
  .eth1 {
    width: 50px;
    top: 30%;
  }

  #gameText {
    font-size: 30px;
    font-family: sans-serif;
  }

  .game-over {
    font-size: 20px;
    font-family: sans-serif;
  }

  .modal-content {
    width: 90%;
    margin-top: 40%;
    font-family: sans-serif;
  }

  .modal-content input {
    width: 90%;
    font-size: 16px;
    font-family: sans-serif;
  }

  .modal-content button {
    font-size: 16px;
    font-family: sans-serif;
  }
}
