body {
  margin: 0;
  font-family: 'Courier New', monospace;
  background-color: #000;
  color: #0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* todo arriba */
  padding: 0; /* quitar padding extra */
  overflow: hidden; /* eliminar scroll */
  height: 100vh; /* ocupar solo la altura visible */
}

header, footer { 
  text-align: center; 
  margin: 5px 0; 
}

main { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
}

canvas {
  background-color: #000;
  border: 2px solid #0f0;
  image-rendering: pixelated;
  width: 80vw;        /* canvas más pequeño para no generar scroll */
  max-width: 400px;   /* ajustar al máximo */
  aspect-ratio: 1/1;
  touch-action: none;
}

#score { 
  margin-top: 5px; 
  font-size: 1.2rem; 
  text-align: center; 
}

button {
  font-family: inherit;
  margin: 3px;
  padding: 8px 12px;
  font-size: 1.1rem;
  border: 2px solid #0f0;
  border-radius: 8px;
  cursor: pointer;
  background: #000;
  color: #0f0;
}

button i {
  margin-right: 8px;
}


button:hover { 
  background: #0f0; 
  color: #000; 
}

#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 5px;
  user-select: none;
}

#controls .middle-row {
  display: flex;
  gap: 10px;
  margin-top: 3px;
}

#startModal, #gameOverModal {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.95);
  display: flex; justify-content: center; align-items: center;
  flex-direction: column;
  z-index: 9999;
}

#startModal input { 
  padding: 8px; 
  font-size: 1rem; 
  border: 2px solid #0f0; 
  background: #000; 
  color: #0f0; 
  margin-bottom: 10px; 
}

#gameOverModal div { 
  background: #000; 
  border: 2px solid #0f0; 
  padding: 15px; 
  text-align: center; 
  border-radius: 8px; 
}

#gameOverModal h2 { 
  color: #f00; 
  margin-bottom: 10px; 
}

#highScores {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.8);
  padding: 8px;
  border: 2px solid #0f0;
  border-radius: 8px;
  max-width: 160px;
}

#highScores h3 { 
  margin-top: 0; 
  font-size: 0.9rem; 
  text-align: center; 
  border-bottom: 1px solid #0f0; 
}

#highScores ul { 
  list-style: none; 
  padding-left: 0; 
  font-size: 0.8rem; 
  margin: 0; 
}

@media (max-width: 600px){
  button { 
    width: 45px; 
    height: 45px; 
    font-size: 0.9rem; 
  }
}
