body,
html {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
  background-color: #f0f8ff;
  font-family: Arial, sans-serif;
  touch-action: none; /* Prevent default touch actions like pull-to-refresh or scrolling */
  overscroll-behavior: none; /* Prevent bounce effects */
  overflow: hidden; /* Strictly prevent scrolling */
}

h1 {
  color: #1e90ff;
  margin-bottom: 20px;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

canvas {
  border: 2px solid #1e90ff;
  background-color: #e6f2ff;
  margin-bottom: 20px;
  touch-action: none;
  max-width: 95vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
}

button {
  padding: 8px 16px;
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background-color: #0078e7;
}

/* Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  padding: 30px;
  border: 2px solid #1e90ff;
  border-radius: 10px;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal h2 {
  color: #1e90ff;
  margin-top: 0;
}

.stats-container {
  margin: 20px 0;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.primary-btn {
  background-color: #1e90ff;
  color: white;
}

.secondary-btn {
  background-color: #ddd;
  color: #333;
}

.secondary-btn:hover {
  background-color: #ccc;
}

/* Toast Styles */
.toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 16px;
  position: fixed;
  z-index: 1001;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 17px;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.show {
  visibility: visible;
  opacity: 1;
}
