* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f0f0f0;

  min-height: 100vh;
}

.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  width: 100%;
}

.game-container {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 90%;
  max-width: 600px;
  text-align: center;
}

.game-info {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}

h1 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 10px;
}

.instructions {
  color: #666;
  margin-bottom: 15px;
}

.game-area {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.controls {
  margin-top: 20px;
}

.red-text {
  color: #ff4081;
}

.green-text {
  color: #4caf50;
}

button {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #45a049;
}

.control-info {
  color: #777;
  font-size: 0.9em;
  margin-bottom: 10px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 400px;
  text-align: left;

  .instructions {
    padding: 15px 0px;
    p {
      margin: 15px 0px;
    }
  }
}

#gameOverMessage {
  margin-bottom: 15px;
  color: #333;
}

#gameOverReason {
  margin-bottom: 20px;
  color: #555;
}

/* For mobile devices */
@media (max-width: 600px) {
  .game-container {
    width: 95%;
    padding: 15px;
  }

  .game-area {
    max-width: 300px;
  }

  button {
    padding: 8px 16px;
    font-size: 14px;
  }
}
