/* RESET BÁSICO */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(135deg, #6bb4f3, #0d4f8b);
  color: #222;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-x: hidden;
  user-select: none;
}

/* CONTAINER DO JOGO */
#gameContainer {
  background: rgba(255, 255, 255, 0.95);
  width: 420px;
  max-width: 95vw;
  border-radius: 18px;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.3);
  padding: 20px 24px 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-height: 700px;
}

/* TÍTULO */
header h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
  color: #0d3b6e;
  text-shadow: 0 0 5px #7bb1ec;
}

/* CABEÇALHO DE INFORMAÇÕES */
#hudContainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 10px;
}

.infoBloco {
  background: #f3e5f5;
  border: 2px solid #ce93d8;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  font-size: 1.05rem;
  font-weight: 600;
  color: #4e342e;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  text-align: center;
}

.infoBloco span {
  color: #6a1b9a;
  font-weight: bold;
}

.infoBloco strong {
  color: #2e1b33;
  font-weight: bold;
}

/* ÁREA DE JOGO */
#playArea {
  position: relative;
  width: 100%;
  height: 400px;
  background: linear-gradient(to bottom, #a7d8f7, #0d4f8b);
  border-radius: 14px;
  box-shadow: inset 0 0 14px #0867d8;
  overflow: hidden;
}

/* PLAYER (CESTA) */
#player {
  font-size: 56px;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  border-radius: 12px;
  background: #ffef82;
  box-shadow: 0 0 14px #ffd800, inset 0 0 10px #ffa700;
}

/* EMOJIS CAINDO */
.fallingItem {
  position: absolute;
  font-size: 36px;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
  transition: top 0.05s linear;
}

/* FIM DE JOGO */
#gameOver {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.97);
  border: 4px solid #b22222;
  border-radius: 20px;
  padding: 40px 50px;
  font-size: 28px;
  color: #b22222;
  font-weight: 700;
  text-align: center;
  display: none;
  z-index: 20;
  box-shadow: 0 0 26px #b22222;
}

/* BOTÃO RESTART */
#btnRestart {
  margin-top: 25px;
  padding: 14px 36px;
  font-size: 20px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: #b22222;
  color: white;
  box-shadow: 0 0 10px #a00;
  transition: background-color 0.3s ease;
}

#btnRestart:hover,
#btnRestart:focus {
  background: #7a1212;
  outline: none;
}

/* BOTÃO VOLTAR */
#btnBack {
  margin-top: 15px;
  padding: 14px 0;
  width: 100%;
  background: #0d3b6e;
  border: none;
  color: white;
  font-size: 20px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 14px #0b3051;
  transition: background-color 0.3s ease;
}

#btnBack:hover,
#btnBack:focus {
  background: #0a2a4c;
  outline: none;
}

/* CONTROLES MOBILE */
#mobileControls {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 50px;
}

#mobileControls button {
  font-size: 36px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  background: #1982c4;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(25, 130, 196, 0.7);
  transition: background-color 0.3s ease;
}

#mobileControls button:active,
#mobileControls button:focus {
  background: #0f496f;
  outline: none;
}

/* RESPONSIVO */
@media (max-width: 600px) {
  #hudContainer {
    gap: 14px;
  }

  .infoBloco {
    flex-direction: column;
    gap: 8px;
    font-size: 1rem;
  }
}
