* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #121212;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.container {
  position: relative;
  text-align: center;
  background-color: #1e1e1e;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0, 255, 128, 0.3);
}

h1 {
  margin-bottom: 1rem;
  color: #00ff99;
  font-size: 2rem;
}

canvas {
  background-color: #2c2c2c;
  border: 2px solid #00ff99;
  border-radius: 10px;
  z-index: 1;
  position: relative;
}

.scoreboard {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 1.2rem;
}

button {
  background-color: #00ff99;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #00cc77;
}

#gameOverScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.95);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 20px #ff4d4d;
  z-index: 10;
  opacity: 0; /* começa invisível */
  pointer-events: none; /* bloqueia cliques quando invisível */
  transition: opacity 0.4s ease-in-out;
}

#gameOverScreen h2 {
  font-size: 2rem;
  color: #ff4d4d;
}

#gameOverScreen p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

#gameOverScreen button {
  background-color: #00ff99;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.3s;
}

#gameOverScreen button:hover {
  background-color: #00cc77;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.hidden {
  display: none;
}

.score-animate {
  animation: pulseScore 0.3s ease-in-out;
}

@keyframes pulseScore {
  0% { transform: scale(1); color: #00ff99; }
  50% { transform: scale(1.4); color: #ffff00; }
  100% { transform: scale(1); color: #00ff99; }
}