/* Reset and base settings */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #222;
  color: white;
  font-family: sans-serif;
}

/* Use flex layout to center content vertically and keep footer at the bottom */
body {
  display: flex;
  flex-direction: column;
}

/* Main content: centered both vertically and horizontally */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

/* Center container wrapper (se usato per contenere elementi generali) */
.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* Limit the label width */
label[for="playerName"] {
  max-width: 400px;
  display: inline-block;
}

/* Canvas container: fully centered using margin: 0 auto; */
.canvas-container {
  position: relative;
  width: 100%;       /* Usa tutta la larghezza disponibile */
  max-width: 800px;  /* Limite massimo */
  margin: 20px auto; /* Il margine auto centra orizzontalmente */
}

.canvas-container::before {
  content: "";
  display: block;
  padding-bottom: 75%;  /* For a 4:3 aspect ratio */
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  border: 2px solid white;
}

/* Utility classes */
.hidden {
  display: none;
}

.center {
  text-align: center;
}

.game-info {
  margin-bottom: 20px;
}

/* Footer styling */
footer {
  text-align: center;
  padding: 10px 0;
  background-color: #111;
  width: 100%;
}
