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

body {
  background: #0b061f;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;
  padding: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  color: #a855f7;
  margin-bottom: 10px;
  font-size: 28px;
}

.hud {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 15px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: bold;
  color: #e9d5ff;
}

.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
}

canvas {
  background: #020617;
  border: 3px solid #7c3aed;
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

/* OVERLAY (MENU / GAME OVER) */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 100;
}

.overlay.show {
  opacity: 1;
  pointer-events: all;
}

.overlay-content h2 {
  color: #a855f7;
  font-size: 24px;
  margin-bottom: 10px;
}

.overlay-content p {
  margin-bottom: 15px;
  color: #ddd;
  font-size: 14px;
}

.overlay-content button {
  background: #7c3aed;
  color: white;
  border: none;
  padding: 10px 26px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}

.overlay-content button:hover {
  background: #a855f7;
}

/* CONTROLES MOBILE */
.mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-direction {
  width: 50px;
  height: 50px;
  border: 2px solid #a855f7;
  background: #7c3aed;
  color: white;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: bold;
}

.btn-direction:active {
  background: #a855f7;
  transform: scale(0.95);
}

.btn-up {
  align-self: flex-start;
  margin-left: auto;
  margin-right: auto;
}

/* RESPONSIVO */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .hud {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .game-wrapper {
    margin-bottom: 15px;
  }

  canvas {
    max-width: 90vw;
  }

  .overlay-content h2 {
    font-size: 20px;
  }

  .overlay-content p {
    font-size: 12px;
  }

  .overlay-content button {
    padding: 8px 20px;
    font-size: 14px;
  }

  /* Mostrar controles em mobile */
  .mobile-controls {
    display: flex;
  }

  .btn-direction {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

@media (max-width: 400px) {
  h1 {
    font-size: 20px;
  }

  .hud {
    font-size: 12px;
    gap: 10px;
  }

  .btn-direction {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
