@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
  background-color: #000;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  text-align: center;
}

canvas {
  background-color: #000;
  border: 2px solid #fff;
}

#playAgainBtn {
  display: none;
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #000;
  color: #fff;
  border: 2px solid #fff;
  padding: 15px 30px;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  font-size: 20px;
}

#playAgainBtn:hover {
  background-color: #fff;
  color: #000;
}

#gameContainer {
  position: relative;
  width: 100vw;
  height: 75vw; /* 4:3 aspect ratio */
  max-height: 100vh;
  max-width: 133.33vh; /* 4:3 aspect ratio */
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#mobileControls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #111;
  padding: 10px 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  user-select: none; /* Prevent text selection on buttons */
}

#mobileControls button {
  background-color: transparent;
  border: 2px solid #fff;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 18px;
  padding: 15px 20px;
  cursor: pointer;
  touch-action: manipulation; /* Improve touch responsiveness */
}

#mobileControls button:active {
  background-color: #fff;
  color: #000;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.title {
  font-size: 50px;
  margin-bottom: 20px;
}

.play-button {
  font-size: 30px;
  padding: 15px 30px;
  border: 2px solid #fff;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.play-button:hover {
  background-color: #fff;
  color: #000;
}