/* Global styles */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #e8f5e9; /* soft green background behind canvas */
}

/* Container for the Three.js renderer */
#game-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* General overlay styling */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* disable pointer events by default */
}

.overlay.hidden {
  display: none;
}

/* Start menu styling */
#start-menu .menu-box {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  pointer-events: auto;
}

#start-menu h1 {
  margin-top: 0;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

#start-menu button {
  display: block;
  margin: 0.5rem auto;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background-color: #43a047;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
  pointer-events: auto;
}

#start-menu button:hover {
  background-color: #2e7d32;
}

/* HUD styling */
#hud {
  pointer-events: none;
}

#hud-content {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

/* Battle UI styling */
#battle-ui {
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

#battle-view {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
}

#battle-status {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.status-box {
  width: 48%;
  border: 1px solid #fff;
  padding: 0.5rem;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
}

#battle-messages {
  min-height: 3rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.9rem;
}

#battle-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

#battle-actions button {
  padding: 0.75rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  background-color: #1e88e5;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

#battle-actions button:hover {
  background-color: #1565c0;
}

/* Message overlay styling */
#message-overlay {
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

#message-box {
  background-color: #fff;
  color: #000;
  padding: 1rem;
  border-radius: 4px;
  max-width: 400px;
  text-align: center;
}

/* Mobile controls container (created dynamically). Hidden on desktop. */
#mobile-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}
#mobile-controls .dpad,
#mobile-controls .action-buttons {
  pointer-events: auto;
}