body {
  background-color: #0b0c10;
  color: #ffffff;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  padding: 0;
}

#intro-text {
  text-align: center;
  font-size: 14px;
  color: #cccccc;
  max-width: 600px;
  margin: 20px auto;
}
#intro-text a {
  text-decoration: underline;
}

#game-container h1 {
  text-align: center;
  font-size: 2em;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #ffffff;
}

#game-container > div.wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

#game-container {
  max-width: 900px;
  margin: 30px auto 60px auto;
  padding: 0 20px;
}


@media (max-width: 768px) {
  #game-container > div.wrapper {
    flex-direction: column;
    align-items: center;
  }

  #labirinto {
    transform: scale(0.9);
  }

  #interface, #ranking {
    width: 90%;
    margin-top: 20px;
  }
}

.wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 40px;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .wrapper {
    flex-direction: column-reverse;
    align-items: center;
    gap: 2px;
  }

  #labirinto,
  #interface {
    width: 100%;
    max-width: 400px;
  }

  #interface {
    margin-top: 20px;
  }
}

#labirinto {
  display: grid;
  grid-template-columns: repeat(10, 40px);
  grid-template-rows: repeat(10, 40px);
  margin: 0px auto; /* Antes poderia ser 40px */
  gap: 2px;
}


.tile {
  width: 40px;
  height: 40px;
  background-color: #1f2833;
}

.wall {
  background-color: #45a29e;
}

.goal {
  background-color: #66fcf1;
}

.foguete {
  background-color: #ffe100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#interface {
  background-color: #1f2833;
  padding: 20px;
  border-radius: 10px;
  min-width: 220px;
}

#painel h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #66fcf1;
}

#painel ul {
  list-style: none;
  padding: 0;
}

#painel li {
  margin: 10px 0;
  color: #ffffff;
  font-size: 14px;
}

.barra {
  height: 10px;
  background-color: #66fcf1;
  margin-top: 5px;
  border-radius: 5px;
  transition: width 0.3s;
}

#labirinto.colisao {
  animation: shake 0.15s;
}

@keyframes shake {
  0% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

#labirinto.colisao {
  animation: flashVermelho 0.2s ease;
  box-shadow: 0 0 10px 3px rgba(255, 50, 50, 0.7);
}

@keyframes flashVermelho {
  0% { background-color: #ff000033; }
  50% { background-color: transparent; }
  100% { background-color: #ff000033; }
}
#controles-touch {
  margin: 0px 0 10px 0;
  display: grid;
  grid-template-areas:
    ". up ."
    "left down right";
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px;
  gap: 6px;
  justify-content: center;
}

#controles-touch button {
  background-color: #66fcf1;
  color: #0b0c10;
  font-size: 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 5px #000;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

#controles-touch button:active {
  transform: scale(0.95);
}


#controles-touch .up    { grid-area: up; }
#controles-touch .down  { grid-area: down; }
#controles-touch .left  { grid-area: left; }
#controles-touch .right { grid-area: right; }

@media (min-width: 768px) {
  #controles-touch {
    display: none;
  }
}

@media (max-width: 500px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
  }

  #controles-touch button {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
}

.instructions {
  text-align: center;
  font-style: italic;
  font-size: 0.75rem;
  color: #ccc;
  margin: 10px 0 20px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }
}



