@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* Reset básico y tipografía */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Fondo degradado sutil */
  background: linear-gradient(135deg, #333 0%, #444 100%);
  color: #f7f7f7;
  line-height: 1.6;
  padding: 10px;
}

/* Contenedor común: ancho fluido y centrado vertical (en móviles) */
.container {
  width: 90%;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

/* Futurista: estilos para títulos, clave y cronómetro */
#main-screen h1,
#secretKey,
.digit,
#timer,
#main-screen h2 {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Efecto glow sutil en dígitos */
.digit {
  text-shadow: 0 0 8px rgba(0, 150, 255, 0.6);
}

/* Botón general */
.btn {
  display: inline-block;
  padding: 12px 24px;
  margin: 10px;
  text-decoration: none;
  font-weight: 500;
  color: #fff;
  background-color: #333;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(219, 219, 219, 0.3);
}

.btn:hover {
  background-color: #a30000;
  transform: translateY(-2px);
}

/* Contenedor para agrupar y centrar botones */
.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Botón redondo (home y play) */
.home-btn {
  width: 50px;
  height: 50px;
  background-color: #333;
  color: #f7f7f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease;
  z-index: 1100;
}

.home-btn:hover {
  color: #333;
  background-color: #f7f7f7;
  box-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Configuración del icono de Google Fonts */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* Pantalla principal */
#main-screen {
  text-align: center;
  padding: 40px 20px;
}

#main-screen h1 {
  font-size: 2.8em;
  margin-bottom: 20px;
}

#main-screen p {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #f7f7f7;
}

/* Sección de juego con efecto "frosted glass" */
#game {
  background: rgba(51, 51, 51, 0.8);
  backdrop-filter: blur(5px);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
  padding: 30px;
  text-align: center;
  margin: 20px auto;
}

#game h1 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #333;
}

/* Clave secreta */
#secretKey {
  font-size: 2.5em;
  margin-bottom: 20px;
}

/* Aseguramos que cada dígito sea inline-block para animaciones */
.digit {
  display: inline-block;
  margin: 0 10px;
}

/* Animación flip para dígitos revelados */
@keyframes flip {
  0% {
    transform: rotateX(0deg);
  }
  50% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

.hidden-digit {
  color: #c00000;
}

.revealed-digit {
  color: #3ca300;
  animation: flip 0.5s ease;
}

/* Intentos y cronómetro */
#attempts,
#timer {
  font-size: 1.2em;
  margin: 15px 0;
  color: #f7f7f7;
  font-family: 'Orbitron', sans-serif;
}

/* Cronómetro con fuente Orbitron */
#timer {
  font-size: 2.5em;
  font-family: 'Orbitron', sans-serif;
  color: #a30000;
  margin: 20px 0;
  letter-spacing: 2px;
}

/* Botones del juego */
#buttons {
  margin-top: 20px;
}

/* Contenedor de botones de dígitos */
#digitButtons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Botones de dígitos y control */
#digitButtons button,
#controlButtons button {
  font-size: 1.1em;
  padding: 12px 18px;
  margin: 8px;
  border: none;
  border-radius: 12px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
}

#digitButtons button:hover,
#controlButtons button:hover {
  background-color: #f7f7f7;
  transform: translateY(-3px);
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Botones de dígitos redondos */
#digitButtons button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Panel inferior de reglas (Bottom Sheet) */
.rules-panel {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #333;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
  box-shadow: 0 -2px 10px rgba(255, 255, 255, 0.8);
  z-index: 1100;
}

.rules-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.rules-panel-content {
  padding: 20px;
  text-align: center;
}

.rules-panel-content h2 {
  margin-bottom: 15px;
}

.rules-panel-content ul {
  list-style: none;
  padding: 0;
}

.rules-panel-content ul li {
  padding: 10px 0;
  border-bottom: 1px solid #e5e5ea;
}

.rules-panel-content ul li:last-child {
  border-bottom: none;
}

.close-btn {
  float: right;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
}

/* Botón redondo alternativo */
.home-btn2 {
  width: 50px;
  height: 50px;
  background-color: #333;
  color: #f7f7f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
  transition: background-color 0.3s ease;
  z-index: 1100;
}

.home-btn2:hover {
  color: #333;
  background-color: #ffffff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.8);
}

/* Media queries para pantallas pequeñas */
@media (max-width: 750px) {
  .container {
    width: 95%;
    margin: 20px auto;
    padding: 10px;
  }
  
  #main-screen h1 {
    font-size: 2em;
  }
  
  #main-screen p {
    font-size: 1em;
  }
  
  #game {
    padding: 20px;
    margin: 10px auto;
  }
  
  #game h1 {
    font-size: 1.8em;
  }
  
  #secretKey {
    font-size: 2em;
  }
  
  #attempts,
  #timer {
    font-size: 1em;
  }
  
  /* Reducir tamaño de los botones de dígitos */
  #digitButtons button {
    width: 50px;
    height: 50px;
    font-size: 1em;
  }
  
  /* Disposición de los dígitos en grid */
  #digitButtons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    justify-items: center;
  }
  
  /* Centrar el botón sobrante */
  #digitButtons button:last-child {
    grid-column: 2;
  }
  
  /* Ajustar padding en el panel inferior */
  .rules-panel-content {
    padding: 15px;
  }
}

/* Modal de mensaje estilo futurista */
.message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75); /* Fondo más oscuro para resaltar el contenido */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message-modal.active {
  display: flex;
}

.message-content {
  background: linear-gradient(145deg, #222, #444);  /* Fondo degradado oscuro */
  border: 2px solid #006eff;  /* Borde neon azul */
  border-radius: 12px;
  padding: 30px;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(25, 0, 255, 0.5);
  color: #f7f7f7;
  position: relative;
  animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.message-content h2 {
  margin-bottom: 15px;
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  color: #0077ff;
  letter-spacing: 1px;
}

.message-content p {
  font-size: 1em;
  color: #ddd;
  font-family: 'Orbitron', sans-serif;
}

.close-message {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5em;
  cursor: pointer;
  color: #0077ff;
  transition: color 0.3s ease;
}

.close-message:hover {
  color: #f7f7f7;
}

