body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #fff;
  color: #4d0b0b;
}

header {
  background-color: #4d0b0b;
  color: white;
  text-align: center;
  padding: 1rem;
}

main {
  padding: 2rem;
  text-align: center;
}

.imagen-juego .imagen {
  max-width: 100%;
  height: auto;
  border: 3px solid #c4a000;
  margin-bottom: 2rem;
}

.entrada-respuesta input[type="text"] {
  width: 80%;
  max-width: 400px;
  padding: 0.5rem;
  font-size: 1rem;
  border: 2px solid #c4a000;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.entrada-respuesta {
  position: relative; 
  display: inline-block; 
  width: 80%;
  max-width: 400px;
  margin: 0 auto; 
  text-align: left;
}

.entrada-respuesta input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 2px solid #c4a000;
  border-radius: 4px;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.sugerencias {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  max-height: 150px; 
  overflow-y: auto;
}

.sugerencias li {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.sugerencias li:hover {
  background-color: #f4f4f4;
}

.mensaje-respuesta {
  margin-top: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}


.sugerencias li {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.sugerencias li:hover {
  background-color: #f4f4f4;
}

button[type="submit"] {
  display: block;         
  margin: 20px auto 0 auto; 
  background-color: #B9975B; 
  color: #8C1515;          
  border: 2px solid #8C1515;
  padding: 10px 30px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

button[type="submit"]:hover {
  background-color: #8C1515;
  color: #F9E79F; 
}

h1, h2 {
  color: #B9975B;
}

#imagen-juego {
  transition: opacity 0.5s ease;
}

.boton-estadisticas {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #4d0b0b;
  color: #B9975B;
  border: 2px solid #B9975B;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.boton-estadisticas:hover {
  background-color: #B9975B;
  color: #4d0b0b;
}

.puzzle {
  width: 600px;
  height: 400px;
  position: relative;
  margin: 0 auto 2rem auto;
  display: flex;
  flex-wrap: wrap;
  border: 3px solid #c4a000;
}

.pieza {
  width: 200px;  
  height: 200px; 
  background-image: url('../imagenes/<?= htmlspecialchars($nombre_imagen) ?>');
  background-size: 300px 200px;
  background-repeat: no-repeat;
  position: relative;
}

.form-alias-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 2rem;
  border: 2px solid #B9975B; 
  border-radius: 12px;
  background-color: #fdf8f2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.form-alias-container h2 {
  margin-bottom: 1.5rem;
  color: #8C1515; 
}

.form-alias-container input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #c4a000;
  border-radius: 6px;
  box-sizing: border-box;
}

.dificultad-selector {
  display: flex;
  align-items: center;
  justify-content: center; 
  gap: 12px;
  margin: 20px 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}



.dificultad-selector label {
  font-weight: 600;
  font-size: 1.1rem;
  color: #800000;
}


.dificultad-selector select {
  appearance: none; 
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff8e1;
  border: 2px solid #800000;
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #800000;
  cursor: pointer;
  position: relative;
  min-width: 160px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}


.dificultad-selector select {
  background-image: url("data:image/svg+xml,%3Csvg fill='%23800000' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}


.dificultad-selector select:hover,
.dificultad-selector select:focus {
  border-color: #b22222;
  box-shadow: 0 0 6px #b22222;
  outline: none;
}

.botones-extra {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.dificultad-selector button {
  background-color: #B9975B;  /* dorado */
  color: #8C1515;              /* granate oscuro */
  border: 2px solid #8C1515;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dificultad-selector button:hover {
  background-color: #8C1515;
  color: #F9E79F;  /* beige claro */
}


.stats-container {
  max-width: 400px;
  margin: 2rem auto;
  background: #540b0e; 
  border-radius: 10px;
  padding: 25px 30px;
  box-shadow: 0 0 15px rgba(84, 11, 14, 0.6);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f9d342; 
  text-align: left;
}

.stats-container p {
  font-size: 1.25rem;
  margin: 1.2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f9d342aa;
  padding-bottom: 6px;
}

.stats-container p:last-child {
  border-bottom: none;
}

.stats-container p strong {
  color: #f9d342;
  font-weight: 600;
  text-shadow: 0 0 5px #f9d342cc;
}

.stats-number {
  font-weight: 700;
  font-size: 1.7rem;
  color: #540b0e;
  background-color: rgba(249, 211, 66, 0.6);
  padding: 6px 18px;
  border-radius: 30px;
  min-width: 60px;
  text-align: center;
  box-shadow: 0 0 12px #f9d342cc;
  font-family: 'Georgia', serif;
}

.stats-flex {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}


#chart-container {
  max-width: 400px;
  margin: 2rem auto 0;
}




@media (max-width: 600px) {
  .entrada-respuesta input[type="text"] {
    width: 90%;
  }

  .sugerencias {
    width: 90%;
    left: 5%;
  }
}

/* Dropdown Ayudas */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: #B9975B;
  color: #8C1515;
  border: 2px solid #8C1515;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dropbtn:hover {
  background-color: #8C1515;
  color: #F9E79F;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff8e1;
  min-width: 180px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  border: 2px solid #8C1515;
  border-radius: 8px;
  z-index: 1000;
}

.dropdown-content button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  font-weight: bold;
  color: #8C1515;
}

.dropdown-content button:hover {
  background-color: #f4e3c1;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: #800000;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-weight: 600;
}

.dropdown-content a:hover {
  background-color: #B9975B;
  color: #4d0b0b;
}