/* &copy; Lamec Sánchez Contreras, Alle Rechte vorbehalten */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #1f1515;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

#gameContainer {
  flex: 1;
  background-color: #000;
  border: 2px solid #2f0bcc;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #0a0e27;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#startContainer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 32px;
  font-size: 16px;
  color: #fff;
  width: 85%;
  max-width: 450px;
  box-sizing: border-box;
}

#startButton {
  background: linear-gradient(135deg, #1c4067 0%, #2a6db5 100%);
  border: 2px solid #3ed546;
  border-radius: 8px;
  padding: 16px 48px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(62, 213, 70, 0.3);
}

#startButton:hover {
  background: linear-gradient(135deg, #2a6db5 0%, #3a8fd9 100%);
  box-shadow: 0 6px 20px rgba(62, 213, 70, 0.5);
  transform: scale(1.05);
}

#startButton:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(62, 213, 70, 0.3);
}

#nombreContainer {
  width: 100%;
  display: flex;
  justify-content: center;
}

#nombreInput {
  width: 100%;
  max-width: 300px;
  padding: 10px 12px;
  border: 2px solid #3ed546;
  border-radius: 6px;
  background-color: rgba(31, 21, 21, 0.9);
  color: #fff;
  font-size: 14px;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#nombreInput::placeholder {
  color: #888;
}

#nombreInput:focus {
  outline: none;
  border-color: #5fff66;
  box-shadow: 0 0 10px rgba(62, 213, 70, 0.5);
  background-color: rgba(31, 21, 21, 1);
}

#dificultadSelector {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.dificultad-btn {
  padding: 10px 20px;
  border: 2px solid #3ed546;
  border-radius: 6px;
  background-color: rgba(31, 21, 21, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.dificultad-btn:hover {
  background-color: rgba(62, 213, 70, 0.2);
  transform: scale(1.05);
}

.dificultad-btn.selected {
  background-color: #3ed546;
  color: #000;
  box-shadow: 0 0 15px rgba(62, 213, 70, 0.7);
}

.objetos {
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  flex-wrap: wrap;
  width: 100%;
}

.objetos label {
  font-size: 13px;
  font-weight: bold;
  color: #3ed546;
}

.objetos img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 3px rgba(62, 213, 70, 0.5));
}

.controles {
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  width: 100%;
  border-top: 1px solid rgba(62, 213, 70, 0.3);
  padding-top: 12px;
}

.controles p {
  margin: 4px 0;
  color: #cccccc;
}

.controles p:first-child {
  color: #3ed546;
  font-weight: bold;
  margin-bottom: 8px;
}

.teclas {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background-color: rgba(62, 213, 70, 0.15);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(62, 213, 70, 0.3);
  display: inline-block;
  margin-bottom: 6px;
}

.teclas span {
  color: #3ed546;
  font-size: 16px;
  font-weight: bold;
}

.controles span {
  background-color: rgba(62, 213, 70, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(62, 213, 70, 0.4);
  font-weight: bold;
  color: #3ed546;
  display: inline-block;
  min-width: 22px;
}

.start-text {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #3ed546;
  text-transform: uppercase;
}


#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #3ed546;
  font-size: 18px;
  z-index: 10;
  border-top-style: dotted;
  border-bottom-style: double;
  background-color: rgba(226, 41, 41, 0.2);
  display: none;
}

#hud div {
  margin-bottom: 3px;
}

#languageSelector {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(62, 213, 70, 0.3);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

#languageSelector label {
  color: #3ed546;
  font-weight: bold;
  font-size: 18px;
  margin: 0;
  cursor: pointer;
}

#languageSelector select {
  background-color: rgba(62, 213, 70, 0.1);
  color: #3ed546;
  border: 1px solid #3ed546;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
  pointer-events: auto;
}

#languageSelector select:hover {
  background-color: rgba(62, 213, 70, 0.2);
}

#languageSelector select option {
  background-color: #1f1515;
  color: #3ed546;
}

#soundToggleBtn {
  cursor: pointer;
  transition: all 0.3s ease;
}

#soundToggleBtn:hover {
  background-color: rgba(62, 213, 70, 0.4);
  transform: scale(1.1);
}

.version {
  color: white;
  position: absolute;
  bottom: 0;
  right: 0;
}

.portfolio {
  position: absolute;
  top: -45px;
  right: 0px;
  display: inline-block;
  padding: 10px 15px;
  font-size: 16px;
  color: #fff;
  background-color: #007bff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.portfolio:hover {
  background-color: #0056b3;
}
/* ----Revisar */
@media (max-width: 600px) {
  #gameContainer {
    width: 100vw;
    height: auto;
  }
  #startButton {
    font-size: 14px;
    padding: 8px 16px;
  }
}

footer {
  background-color: #222;
  color: #fff;
  font-size: 14px;
  position: relative;
  width: 100%;
  text-align: center;
  z-index: 999;
}

footer p {
  margin: 10px 0;
  text-align: center;
  hyphens: auto;
}

footer a {
  color: #3c97bf;
  text-decoration: none;
}

#menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.98);
  padding: 0;
  border: 3px solid #253126;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 30px rgba(62, 213, 70, 0.5);
  font-family: 'Arial', sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
  display: none;
  z-index: 500;
  min-width: 320px;
  max-width: 450px;
  flex-direction: column;
}

#menu.visible {
  display: flex;
}

#menuHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(62, 213, 70, 0.1);
  padding: 16px 24px;
  border-bottom: 2px solid #3ed546;
  margin: 0;
}

#menuHeader h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  color: #3ed546;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#closeMenuBtn {
  background: none;
  border: none;
  color: #3ed546;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

#closeMenuBtn:hover {
  color: #fff;
  transform: scale(1.15);
}

#soundControlsMenu {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#soundToggleMenuBtn:hover {
  color: #5fff66;
  transform: scale(1.2);
}

#soundToggleBtn:hover {
  background-color: rgba(62, 213, 70, 0.4);
  box-shadow: 0 0 10px rgba(62, 213, 70, 0.3);
}

#soundControls {
  max-height: 200px;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

#soundControls label {
  font-size: 13px;
  font-weight: bold;
  color: #3ed546;
  margin: 8px 0 4px 0;
}

#soundControls input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #333;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#soundControls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3ed546;
  cursor: pointer;
  transition: all 0.2s ease;
}

#soundControls input[type="range"]::-webkit-slider-thumb:hover {
  background: #5fff66;
  transform: scale(1.2);
}

#soundControls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3ed546;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

#soundControls input[type="range"]::-moz-range-thumb:hover {
  background: #5fff66;
  transform: scale(1.2);
}

#soundControls.hidden {
  max-height: 0px;
  opacity: 0;
}

#menu label {
  display: block;
  margin-bottom: 12px;
  margin-top: 12px;
  font-weight: bold;
  color: #3ed546;
  font-size: 14px;
}

#menu label:first-of-type {
  margin-top: 0;
}

#menu input[type="range"] {
  width: 100%;
  margin-bottom: 14px;
  cursor: pointer;
  accent-color: #3ed546;
  height: 6px;
}
/* Asegura que el SweetAlert se vea por encima de todo */
div:where(.swal2-container) {
  z-index: 2000 !important;
}

/* Mejora la visualización del canvas */
canvas {
  touch-action: none; /* Crucial para evitar scroll al jugar en móvil */
  width: 100%;
  height: 100%;
}

/* Eliminar duplicación visual si existe, el JS ahora controla el display */
#startButton {
    z-index: 100; /* Asegurar que esté encima del canvas */
}

/* --- Estilos para el contenedor de controles de sonido --- */
#soundControlsMenu {
    /* Quitamos el 'display: none' para ver los cambios de estilo. 
       Recuerda que deberás manejar esto con JavaScript para mostrar/ocultar el menú. */
    /* display: block !important;  -- Descomenta si quieres probar sin JS */
    
    padding: 10px 0;
    margin-top: 5px; /* Pequeño espacio debajo del encabezado */
    margin-bottom: 15px;
    border-top: 1px solid rgba(62, 213, 70, 0.1);
}

/* --- Estilos para las etiquetas y los rangos (más visibles) --- */

/* Estilo para todas las etiquetas (Música, Efectos) */
#soundControlsMenu label {
    display: block; /* Hace que la etiqueta ocupe su propia línea */
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #3ed546; /* Color verde para resaltar */
    font-size: 14px;
}

/* Estilo general para los input de rango */
#soundControlsMenu input[type="range"] {
    width: 100%; /* Asegura que el rango ocupe todo el ancho disponible */
   
    background: transparent; /* Fondo transparente */
    margin: 0;
}

/* 🟢 Estilo para la barra de rango (Track) */
#soundControlsMenu input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #555; /* Fondo oscuro para la barra */
    border-radius: 4px;
    border: 1px solid #3ed546; /* Borde verde */
}

/* ⚪ Estilo para el "pulgar" o controlador (Thumb) */
#soundControlsMenu input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: 1px solid #3ed546;
    height: 16px;
    width: 16px;
    border-radius: 50%; /* Circular */
    background: #fff;
    cursor: pointer;
    margin-top: -5px; /* Centra el pulgar sobre la barra */
    box-shadow: 0 0 5px rgba(62, 213, 70, 0.5);
}


