body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #282c34;
  font-family: "Roboto", sans-serif;
}

#gameCanvas {
  background-color: #aad751;
  border: 2px solid #8bc34a;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  margin: 20px 0;
  border-radius: 5px;
  width: 90vw; /* Ajuste automático para caber na tela do celular */
  height: 90vw; /* Mantém a proporção quadrada */
  max-width: 400px; /* Limita o tamanho máximo em telas maiores */
  max-height: 400px; /* Limita a altura máxima em telas maiores */
}

.score-container {
  text-align: center;
  padding: 10px 20px;
  background-color: #8bc34a;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: space-between;
  width: 90%;
  max-width: 500px;
}

.score,
.high-score {
  font-size: 1.5em;
  color: #fff;
}

.mobile-controls {
  display: grid;
  grid-template-areas:
    " . up . "
    "left down right";
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.mobile-controls button {
  width: 60px;
  height: 60px;
  font-size: 1.5em;
  background-color: #8bc34a;
  border: none;
  border-radius: 5px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s, transform 0.2s;
}

.mobile-controls button:active {
  background-color: #5a9216;
  transform: scale(1.1);
}

#btnUp {
  grid-area: up;
}

#btnLeft {
  grid-area: left;
}

#btnDown {
  grid-area: down;
}

#btnRight {
  grid-area: right;
}

@media screen and (max-width: 600px) {
  .mobile-controls {
    gap: 5px;
  }

  .mobile-controls button {
    width: 50px;
    height: 50px;
    font-size: 1.2em;
  }

  .score-container {
    width: 100%;
    padding: 10px;
  }

  .score,
  .high-score {
    font-size: 1.2em;
  }

  #gameCanvas {
    width: 90vw;
    height: 90vw;
  }
}

@media screen and (min-width: 720px) and (max-width: 1080px) {
  #gameCanvas {
    max-height: 70vh;
  }
}

@media screen and (min-width: 1081px) {
  #gameCanvas {
    max-width: 800px;
    max-height: 600px;
  }
}

@media screen and (orientation: landscape) {
  #gameCanvas {
    height: 90%;
    width: auto;
  }
}
