body {
  margin: 0; 
  background: #111; 
  color: white; 
  font-family: sans-serif;
  user-select: none; 
  overflow: hidden; 
  display: flex;
  flex-direction: column; 
  align-items: center; 
  padding: 10px;
  box-sizing: border-box;
}
a {
  color: #a22; 
  text-decoration: none; 
  font-weight: bold;
}
#backLink {
  margin-bottom: 10px;
}
#instructions {
  font-size: 16px; /* un poco más grande en escritorio */
  background: rgba(0,0,0,0.6);
  padding: 10px 20px; 
  border-radius: 8px; 
  text-align: center;
  margin-bottom: 15px; 
  line-height: 1.4;
  max-width: 600px;
  width: 90vw;
  box-sizing: border-box;
}
canvas {
  background: #222; 
  border: 2px solid #555;
  max-width: 600px;
  width: 90vw;
  max-height: 70vh;
  height: auto;
  border-radius: 10px; 
  box-shadow: 0 0 15px #a22;
  touch-action: none;
}
#score {
  font-family: monospace; 
  font-size: 24px; /* un poco más grande en escritorio */
  background: rgba(0,0,0,0.6);
  padding: 10px 0; 
  border-radius: 10px; 
  width: 100%;
  max-width: 600px; 
  text-align: center; 
  margin-top: 15px;
  box-shadow: 0 0 10px #700;
}
#pauseOverlay {
  position: fixed; 
  top: 0; left: 0; 
  width: 100vw; 
  height: 100vh;
  background: rgba(0,0,0,0.85); 
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center; 
  font-size: 28px;
  visibility: hidden; 
  z-index: 100; 
  text-align: center;
  padding: 20px; 
  box-sizing: border-box;
}


.pause-button {
  margin-top: 30px; 
  padding: 14px 36px; 
  background: #a22;
  border: none; 
  color: white; 
  font-size: 22px;
  cursor: pointer; 
  border-radius: 8px;
  box-shadow: 0 0 15px #a22;
  transition: background 0.3s;
}

.pause-button:hover {
  background: #d33;
}


#btnPauseMobile {
  position: fixed; 
  top: 12px; 
  right: 12px;
  background: #a22; 
  width: 48px; 
  height: 48px;
  border-radius: 10px; 
  font-size: 26px;
  line-height: 48px; 
  text-align: center;
  z-index: 30; 
  box-shadow: 0 0 10px #700;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, box-shadow 0.2s;
}
#btnPauseMobile:active {
  background: #d33; 
  box-shadow: 0 0 15px #d33;
}
.joystickContainer {
  position: fixed; 
  bottom: 20px;
  width: 130px; /* más pequeño en escritorio */
  height: 130px;
  background: #444; 
  border-radius: 50%;
  opacity: 0.7; 
  touch-action: none;
  user-select: none; 
  z-index: 25;
  box-shadow: 0 0 20px #a22;
  transition: width 0.3s, height 0.3s, opacity 0.3s;
}
.joystickStick {
  width: 65px; /* ajustado al joystickContainer */
  height: 65px;
  background: #a22;
  border-radius: 50%; 
  position: absolute;
  left: 32.5px; /* centrado en joystickContainer */
  top: 32.5px; 
  box-shadow: 0 0 15px #700;
  touch-action: none;
  transition: width 0.3s, height 0.3s, left 0.3s, top 0.3s;
}
#joystickMove {
  left: 15px;
}
#joystickAim {
  right: 15px;
}

/* Ajustes para pantallas pequeñas (celular) */
@media (max-width: 650px) {
  #instructions {
    font-size: 14px;
    padding: 8px 15px;
  }
  #score {
    font-size: 20px;
    padding: 8px 0;
  }
  .joystickContainer {
    width: 100px;
    height: 100px;
    opacity: 0.75;
  }
  .joystickStick {
    width: 50px;
    height: 50px;
    left: 25px;
    top: 25px;
  }
  #btnPauseMobile {
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 44px;
    top: 8px;
    right: 8px;
  }
}

/* Ajustes para pantallas muy pequeñas (móviles) */
@media (max-width: 450px) {
  #instructions, #score {
    font-size: 16px;
  }
  canvas {
    max-height: 50vh;
  }
  .joystickContainer {
    width: 90px;
    height: 90px;
    opacity: 0.8;
  }
  .joystickStick {
    width: 45px;
    height: 45px;
    left: 22.5px;
    top: 22.5px;
  }
}
