/* FONDO INICIAL ANIMADO*/
body {
    margin: 0;
    padding: 0;
    height: 100vh; /*ocupa toda la pantalla*/
    display: flex; /*centra el contenido*/
    justify-content: center;
    align-items: center;
    font-family: 'Courier New', monospace;
    background: linear-gradient(270deg, #1e1e2f, #3b0a45, #1e1e2f);
    background-size: 600% 600%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}
/*animación de fondo*/
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/*fondo fija cuando arranca el juego*/
body.in-game {
    background: #1e1e2f;
    animation: none;
}

/*PANTALLA DE INICIO / CONTROLES*/
.start-screen, .controls-screen {
    text-align: center;
    background: rgba(0, 0, 0, 0.7); /*fondo oscuro traslucido*/
    padding: 50px 40px;
    border-radius: 25px;
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}
/*titulo principal*/
.game-title {
    font-size: 3.5em;
    color: #f0c674;
    text-shadow: 0 0 20px #ffcc00;
    margin-bottom: 20px;
}
/*subtitulos*/
.subtitle {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #ddd;
}

/* BOTONES*/
.buttons button, .controls-screen button {
    font-size: 1.3em;
    padding: 14px 40px;
    margin: 15px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    background: linear-gradient(45deg, #ffcc00, #ff8800); /*==degradado amarillo/naranja==*/
    color: #1e1e2f;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.8);
    transition: transform 0.2s, box-shadow 0.2s;
}
/*efecto*/
.buttons button:hover, .controls-screen button:hover { /*==cambia el color de los botones==*/
    transform: scale(1.1);
    box-shadow: 0 0 30px #ffcc00;
}

/*CONTROLES*/
.controls {
    display: flex; /*caja una al lado de la otra*/
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap; /*acomoda los renglones con palabras*/
}
/*caja de controles individuales*/
.control-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    width: 180px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}
/*titulo del control*/
.control-box h3 {
    margin-bottom: 10px;
    color: #6cf;
    text-shadow: 0 0 10px #6cf;
}
/*botón visual estilo una "tecla"*/
.key {
    font-size: 2.5em;
    background: #222;
    border: 2px solid #6cf;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    color: #fff;
    box-shadow: 0 0 5px #6cf;
}

#game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%; /*centra los canvas*/
    gap: 20px;
    flex-wrap: wrap;
}
/*estilo visual del canvas*/
canvas {
    width: 380px;
    height: 640px;
    border: 3px solid #333;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
}


.modal {
    position: fixed; /*ocupa toda la pantalla*/
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /*oscurece la pantalla*/
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /*encima de todo*/
}

.modal-content {
    background: #1e1e2f;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 2em;
    color: #f0c674;
}
/*botones del modal*/
.modal-content button {
    margin: 12px;
    padding: 16px 36px;
    font-size: 1.2em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: linear-gradient(135deg, #ffcc00, #ff8800);
    color: #1e1e2f;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 200, 0, 0.4), 0 0 10px #ffaa00;
    transition: all 0.3s ease;
}
/*hover modal*/
.modal-content button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 200, 0, 0.6), 0 0 20px #ffaa00;
}

/*RESPONSIVE*/
@media (max-width: 800px) {
    canvas {
        width: 90vw; /*se adapta al ancho*/
        height: auto;
    }
    .controls {
        flex-direction: column; /*controles uno abajo del otro*/
        align-items: center;
    }
    .control-box {
        width: auto;
    }
}

/*CARRUSEL*/
.carousel-container {
    width: 100%;
    height: 100%;
    perspective: 1000px; /*profundidad en 3D*/
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 1001; 
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
}
/*carrusel para los personajes*/
.carousel {
    width: 300px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d; /*mantiene el 3D*/
    transition: transform 0.6s ease;
}
/*imagenes del carrusel*/
.carousel img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    position: absolute;
    top: 0; 
    left: 50%;
    margin-left: -60px;
    transform-origin: center center -180px;
    box-shadow: 0 5px 15px rgba(255,255,255,0.4); 
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    border: 3px solid #ffcc00;
}
/*hover de personajes*/
.carousel img:hover {
    transform: scale(1.1) translateZ(50px);
    box-shadow: 0 10px 25px rgba(255,255,255,0.6);
}
/*botones del carrusel*/
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-controls button {
    font-size: 1em;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #ffcc00, #ff8800);
    color: #1e1e2f;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255,200,0,0.4);
    transition: all 0.3s ease;
}
/*hover del carrusel*/
.carousel-controls button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255,200,0,0.6);
}
/*HISTORIAS*/
.subtitle {
  font-size: 1.2em;
  color: #ccc;
}

.histories {
  margin-top: 30px;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;

  max-height: 400px; /* Altura máxima visible */
  overflow-y: auto;  
  padding-right: 10px; /* Espacio para que no se corte con el scroll (desplaza el contenido) */
}
/*caja individual de cada historia*/
.story {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 15px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
  color: #ddd;
}

.story h2 {
  color: #f0c674;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #ffaa00;
}

.story p {
  line-height: 1.6;
}
/*botón general*/
button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #ffaa00;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #000;
  box-shadow: 0 0 10px #ffaa00;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #ffcc33;
}

