/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0d0d0d;
  color: #e5e5e5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenedor principal del juego */
main {
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 100%;
  padding: 0;
}

/* Área de imagen de sala */

.sala-imagen {
  flex: 1;
  background-color: black;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Área de texto tipo terminal */
#juego {
  background-color: #000;
  color: #f1f1f1;
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
  height: 40vh;
  overflow-y: auto;
}

/* Estilos especiales para la introducción tipo terminal
*/

.intro-terminal {
  position: relative;
  height: 120h; /* en lugar de 100vh, para dejar algo de espacio */
  padding: 20px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* comienza desde arriba */
  overflow-y: auto; /* permite scroll vertical */

  color: #00ff88;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid #0f0;
  box-shadow: 0 0 10px rgba(0, 255, 128, 0.2);
  border-radius: 8px;
}


.typewriter {
  white-space: pre-wrap;
  overflow: hidden;
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: #00ff88;
  }
}

input, button {
  font-family: inherit;
  background-color: #111;
  color: #e5e5e5;
  border: 1px solid #555;
  padding: 10px;
  margin-top: 15px;
  border-radius: 5px;
  width: 100%;
}

button:hover {
  background-color: #222;
  cursor: pointer;
  border-color: #888;
}

#input-codigo input {
  margin-top: 10px;
  width: 120px;
  text-align: center;
  font-size: 1.1em;
}

/* ------------- */
.contenedor-sala {
  display: flex;
  padding: 20px;
}

.botones-sala {
  width: 30%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.texto-sala {
  width: 70%;
  padding-left: 20px;
  background-color: rgba(0,0,0,0.3);
  border-left: 1px solid #444;
  color: #ccc;
}

.contenedor-superior {
  display: flex;
  height: 50vh;
}

.contenedor-inferior {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: #222;
  height: 50vh;
}

.boton-continuar {
  margin-top: 2rem;
  text-align: center;
}

#resultado-sala {
  flex: 1;
    border: 1px solid #555;
    padding: 1rem;
    background-color: #111;
    color: white;
    overflow: auto;
}

#opciones-sala {
  width: 33.33%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#texto-sala {
  width: 33.33%;
    padding: 1rem;
    overflow: auto;
    background-color: #111;
}

.opciones-sala-img {
  height: 50%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1rem;
}

.opciones-sala-img img {
  flex: 1;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border 0.2s;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.5rem;
  box-sizing: border-box;
}

.opciones-sala-img img:hover {
  transform: scale(1.03);
}

.opciones-sala-img img.seleccionada {
  border: 4px solid #ff4d4d;
  box-shadow: 0 0 12px #ff4d4d;
}

.resultado-sala-img {
  height: 50%;
  overflow: auto;
  padding: 1rem;
  background-color: #111;
  border: 1px solid #555;
  color: white;
}

.contenedor-inferior-img {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background-color: #222;
  height: 50vh;
  box-sizing: border-box;
}
