@import url('https://fonts.googleapis.com/css?family=Comfortaa');

html, body {
  margin: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: relative;
  font-family: 'Comfortaa', cursive;
  background-color: hsl(180, 60%, 95%); 
  touch-action: manipulation; /* Previne o zoom e rolagem padrão em touch */
}

#container {
  width: 100%;
  height: 100%;
  position: relative;
}

#container #score {
  position: absolute;
  top: 20px;
  width: 100%;
  text-align: center;
  font-size: 10vh;
  transition: transform 0.5s ease;
  color: hsl(260, 70%, 40%); 
  transform: translateY(-200px) scale(1);
  z-index: 10; 
}

/* GAME AREA */
#container #game {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* GAME OVER SCREEN */
#container .game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10; 
}

#container .game-over * {
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  transform: translateY(-50px);
  color: hsl(260, 70%, 40%);
  text-align: center; 
}

#container .game-over h2 {
  margin: 0;
  padding: 0;
  font-size: 40px;
}

#container .game-ready {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  z-index: 10; 
}

#container .game-ready #start-button {
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  transform: translateY(-50px);
  border: 3px solid hsl(260, 70%, 40%); 
  padding: 10px 20px;
  background-color: transparent;
  color: hsl(260, 70%, 40%); 
  font-size: 30px;
  cursor: pointer;
  -webkit-user-select: none; 
  user-select: none;
  -webkit-tap-highlight-color: transparent; /* Remove o destaque de toque em mobile */
}

#container #instructions {
  position: absolute;
  width: 100%;
  top: 16vh;
  left: 0;
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  color: hsl(260, 50%, 50%); 
  z-index: 10; 
}

#container #instructions.hide {
  opacity: 0 !important;
}

#container.playing #score,
#container.resetting #score {
  transform: translateY(0px) scale(1);
}

#container.playing #instructions {
  opacity: 1;
}

#container.ready .game-ready #start-button {
  opacity: 1;
  transform: translateY(0);
}

#container.ended #score {
  transform: translateY(6vh) scale(1.5);
}

#container.ended .game-over * {
  opacity: 1;
  transform: translateY(0);
}

#container.ended .game-over p {
  transition-delay: 0.3s;
}

#mobile-touch {
  display: none; /* Escondido por padrão, mostrado apenas em mobile */
}

@media (max-width: 600px) {
  #mobile-touch {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 20; 
  }
  #touch-btn {
    font-size: 2rem;
    padding: 15px 30px;
    border: none;
    background-color: hsl(260, 70%, 40%); 
    color: white;
    border-radius: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Ajustes de fonte e espaçamento para mobile */
  #score {
    font-size: 5vh;
  }
  #instructions {
    top: 10vh;
    font-size: 1.2rem;
  }
  .game-over h2 {
    font-size: 2rem;
  }
  .game-over p {
    font-size: 1rem;
  }
  #start-button {
    font-size: 1.5rem;
    padding: 8px 16px;
  }
}