.index_body { /* Index */
  display: flex;
  flex-direction: column;  
  height: 98vh;
  margin: 0;
  background-color: rgb(27, 85, 45);
}

#gameCanvas {

  max-width: 90vw;
  max-height: 80vh;
  border-radius: 5%;  
  margin-top: 10px;
  padding: 3px;
  background: rgba(220, 215, 206, 0.5);
}

.index_container { /* Index */
  display: block;
  flex-direction: column;
  justify-content: center;
  background-color: blue;
  text-align: center;
  width: 90vw;
  height: 80%;
  margin: 0 auto;
  color: #ebdcdc;
}

.body-container { /* principal y campaña */
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 98vh;
  position: absolute;    
  background: rgba(220, 215, 206, 0.5);
}

.container-background { /* Para la imagen de fondo de principal */
  background-image: url("../img/login.webp");
  height: 100vh;
  background-position: center center;  
  background-size: cover;
  background-repeat: no-repeat; /* Evita que la imagen se repita */
  background-attachment: fixed; /* Opción para que la imagen permanezca fija al desplazarse */
}

.over_image { /* Para el contenedor arriba de la imagen*/
  position: absolute;  
  width: 40rem;   
  background: rgba(220, 215, 206, 0.65);  
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  color: rgb(0, 0, 0); 
  font-size: medium;  
  font-weight: bold;  
}
 
.card_over_image { /* Para el contenedor arriba de la imagen*/
  position: absolute;  
  width: 40rem;     
  top: 50%;
  left: 50%;  
  transform: translate(-50%, -55%);
  color: rgb(0, 0, 0); 
  font-size: medium;  
  font-weight: bold;  
}

.bg-gradient-primary {    /*color de fondo del menú */
  background: linear-gradient(to bottom, #8a0d1f, #2c5631);
  background-size: cover;  
}

.title-image {  
  height: 10%;  
  align-items: center;  
}

.title-image img {      
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));  
  height: 64px;
  width: auto;  
  border: 1px solid #032236;
  background:#fff; 
  border-radius:12px; 
  padding:6px;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
  margin-top: 1em;
} 

.height-fixed {
  height: 33rem;
  overflow: scroll;
}
  
.scrollbar {
  overflow: scroll;
}

.pointed {
  cursor: pointer;
}

.maxSize {
  width: max-content;
}

.w-90 {
  width: 90%;
}

#preloader {
  background:#000; 
  height: 100%;
  width: 100%;
  position: fixed;
  z-index: 99;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bg-login-image {
  background: url("../img/login.webp");
  background-position: center;
  background-size: cover;
  border-radius: 1rem;
}

.bg-fondo-image {  
  height: 100%;      
  background-position: top;
  background-size:cover;  
}

.card70 {
  width: 70%;
  margin: 0 auto;
}

.mensaje {
  color: #dbc6c6;
}

.container {
  display: flex;
  flex-direction: column;
}

.part { /* pantalla dividida en 3 partes */
  width: 70%;
  height: 98vh;
}

#center { /* el centro empieza oculto */
  display: none;
}

.centrado {
  display: block;
  margin: 0 auto;
  text-align: center;
}

.card {
  width: 95%;
  margin: 0 auto;
  border: 0.3rem solid rgb(9, 10, 10);
  border-radius: 1rem;
  box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.75);
  font-size: small;
  min-height: 90%;
  max-height: 90%;
  overflow: auto;
  background-image: url("../img/fondo.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  padding: 0px;
  max-width: 640px;
  max-height: 400px;
  position: relative;
}
.card.red {
  border: 1rem solid rgb(231, 18, 18);
}
.card.blue {
  border: 1rem solid #0d5cd3;
}
.card.green {
  border: 1rem solid #076b2a;
}
.card.yellow {
  border: 1rem solid #f4cc3b;
}

.card img {
  max-width: 35vh;
  max-height: 35vh;
  aspect-ratio: 1/1;
  display: block;
  margin: 0 auto;
  border: 0.1rem solid rgb(111, 202, 209);
}

.card-decks {
  display: flex;
  justify-content: space-around;
}

.deck {
  width: 16%;
}

.card-count {
  position: absolute;
  bottom: 11%;
  background-color: rgba(0, 0, 0, 0.8);
  display: block;  
  top: 46px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 2px solid white;
  z-index: 10;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
}

.perfil {
  height: 95%;
  width: 95%;
  border: 0.3rem solid rgb(172, 105, 50);
  background-color: rgb(229, 151, 77);
  padding: 1px;
  border-radius: 0.5rem;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

.perfil img {
  width: 85%;  
  border-radius: 0.5rem;
  border: 0.1rem solid rgb(242, 207, 124);
}

#control-panel {
  display: flex; /* Organiza los elementos en una fila */
  justify-content: center; /* Centra los elementos en el div */
  align-items: center; /* Alinea los elementos verticalmente */
  gap: 20px; /* Espacio entre los elementos */
  margin-top: 10px; /* Un poco de espacio arriba del div */
  max-height: 5em;
}

.contextos {
  width: 90%;
  height: 90%;
  margin: 0 auto;
  border: 0.5rem solid rgb(162, 46, 17);
  background-color: rgb(215, 118, 0);
  padding: 3px;
  border-radius: 1rem;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

.contextos img {
  width: 95%;
  padding: 3px;
  display: block;
  margin: 0 auto;
}

#tablero {
  position: relative;
  height: 80%;
}

#dado {
  width: 15%;  
  height: 5em;
}

#ficha {
  position: absolute;
  width: 15rem;
  height: 20rem;
  left: 30vw;
  top: 24vh;
}

.hidden {
  display: none;
}

.margen {
  margin: 30px 5px;
}

.key {
  background-color: #27662e;
  color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);  
}

.key:hover {
  background-color: #8b1515;
}

.key:active {
  background-color: #de1313;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.determinacion {
  width: 15%;
  border: 0.1rem solid #000;
  background: #222;
  color: #FFF;
}

.apoyo {
  width: 15%;
  border: 0.1rem solid #FFF;
  background: #EEE;
  color: #000;
}

.alegria {
  width: 15%;
  border: 0.1rem solid #f6be05;
  background: #e4d905;
  color: #000;
}

.salud {
  width: 15%;
  border: 0.1rem solid #ff0e01;
  background: #d31905;
  color: #ffffff;
}

.tiempo {
  width: 15%;
  border: 0.1rem solid #0901ff;
  background: #2610e9;
  color: #ffffff;
}

.dinero {
  width: 15%;
  border: 0.1rem solid #02730f;
  background: #028311;
  color: #000000;
}

.personaje {
  width: 75%;
  height: 75%;
  margin: 0 auto;
  border: 0.1rem solid rgb(162, 46, 17);
  background-color: rgb(215, 118, 0);
  padding: 1px;
  padding-bottom: 3%;
  border-radius: 1rem;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

#contenedor_personaje {  
  position: relative;
  height: 70%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 0.1rem solid rgb(162, 46, 17);
  background-color: rgb(229 140 32);
  padding: 1px;
  border-radius: 1rem;  
}

#select_player {
  width: 30%;  
  height: 80vh;  
  max-height: 50vw;
  padding-right: 2%;
  font-size: 3vh;
}

#sel_personaje {
  max-width: 45vh;
}

#logo {
  height: 50%;
  margin: 1em auto;
  border: 0.1rem solid rgb(162, 46, 17);
  background-color: rgb(215, 118, 0);
  padding: 1px;
  border-radius: 1rem;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

img#logo_iems {
  width: 80px;
  margin-top: 10px;
  border-radius: 10px;
}

.transition {
  transition: opacity 1s ease;
}

.nombre {
  font-size: 2rem;
  font-style: bold;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}

#diceModal {
  width: 20rem;
  height: 20rem;
}

.dado {
  width: 10rem;
  height: 10rem;
}

#letreroImagen {    
  color: #e6e8ec;
  padding: 5px; 
  font-size: 1.2rem; 
}

#user_stats {
  position: absolute;
  padding: 5px;
  height: 21rem;
  width: 16rem;  
  z-index: 1;
  top: unset;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 248, 232, 0.9);
  border: 2px solid #b0742b;
  border-radius: 12px;
  padding: 8px;      
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
  display: flex;
}

.card20 {
  width: 96%;
  margin: 0 auto;
  border: 0.5rem solid rgb(42, 119, 80);
  padding: 3px;
  border-radius: 1rem;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

.modal {
  display: none;
  color: #fff;
  position: fixed;
  background-color: #0c69f3;
  padding: 20px; 
  border-radius: 1rem;
  width: 50%; 
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);  
  z-index: 2;
}

/* Contenedor principal de los feedbacks y el GIF */
.flex-container {
  display: flex;
  justify-content: flex-start; 
  align-items: flex-start; 
  gap: 20px; 
  margin-top: 20px;
  max-height: 90vh;
}

/* Flex item para el GIF */
.flex-item.gif {
  flex: 0 0 200px;
  text-align: center; 
}

/* Ajustar tamaño del GIF si es necesario */
#gifContainer img {
  max-width: 200px; 
  height: auto;
  border-radius: 10%;
}

/* Flex item para los mensajes */
.flex-item.feedback {
  flex: 1; /* Ocupará más espacio que el GIF */
}

#feedbackMessages p {
  margin: 5px 0; /* Ajusta el espacio entre los mensajes */
}

/* Diseño de la modal para centrar el contenido */
.modal-content {
  max-width: 800px; 
  margin: auto;
  padding: 20px;
  background-color: #0c69f3;
  border-radius: 8px;
}

#ver-atributos-toggle, #intercambiar-atributos {
  margin-top: 10px;
  margin-left: 10px;
  display: block;
  background-color: #4CAF50; /* Verde */
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

#ver-atributos-toggle:hover, #intercambiar-atributos:hover {
  background-color: #45a049;
}

button#confirmar-intercambio, .close {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 10px;
}

button#confirmar-intercambio:hover, .close:hover {
  background-color: #45a049;
}

/* Asegurar que el select y labels sean visibles con tu esquema de colores */
.atributos label {
  color: #fff;
}

select {
  margin-top: 10px;
  padding: 5px;
  border-radius: 5px;
}

.modal .close {
  position: absolute;
  top: 10px; 
  right: 10px; 
  background-color: #f44336; 
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 50%;
}

.modal .close:hover {
  background-color: #d32f2f; /* Más oscuro al pasar el cursor */
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: red;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  z-index: 3;
}

.close-modal:hover {
  background-color: darkred;
}

#imagen-perdida {
  max-width: 80%;
  max-height: 60%;
  border-radius: 10%;
}

footer .footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  flex-wrap: wrap;
}

footer img.iems-footer-logo {
  width: 60px;
  height: auto;
}

footer p {
  flex: 1;
  text-align: center;
  font-size: 0.9em;
  color: #f0f0f0;
  margin: 10px 0;
}

.close-card {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  z-index: 10;
}

.texto-historia {
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background: #cb7512;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 10px #aaa;
  text-align: justify;  
}

.deck:hover .card-count {
  transform: scale(1.1);
}

.count-personal {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.2),
      rgba(0, 0, 0, 0.1)
    ),
    #003049;
}
.count-social {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.2),
      rgba(0, 0, 0, 0.1)
    ),
    #9b2226;
}
.count-academico {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.2),
      rgba(0, 0, 0, 0.1)
    ),
    #ddcc30;
  color: black;
}
.count-azar {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.2),
      rgba(0, 0, 0, 0.1)
    ),
    #004d40;
}

/* -----------------------------
   ATRIBUTOS E ÍCONOS
----------------------------- */
.atributos-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.icono-atributo {
  width: 100px;
  height: 100px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.icono-atributo:hover {
  transform: scale(1.1) rotate(2deg);
}

/* -----------------------------
   PREGUNTA Y RESPUESTA
----------------------------- */
.contenido-pergamino {
  text-align: center;
  width: 100%;
}

.titulo-pregunta {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.imagen-contexto {
  width: 250px;
  height: auto;
  margin: 10px 0 20px 0;
  border-radius: 8px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.opciones-marcadas label {
  display: block;
  margin: 10px 0 4px;
  font-size: 1.2rem;
  text-align: left;
  padding-left: 30px;
  position: relative;
}

.explicacion-pergamino {
  margin-top: 20px;
  font-style: italic;
  font-size: 1.2rem;
  color: #262626;
}

.boton-siguiente {
  margin-top: 25px;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 12px;
  background-color: #005f73;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  width: 80%;
  font-size: 14px;
}

.atributos-evaluacion {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
}

.atributo {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.2rem;
}

.atributo img {
  width: 90px;
  height: 90px;
  border: #000;
}

/* -----------------------------
   EFECTOS ESPECIALES Y ADAPTACIÓN MÓVIL
----------------------------- */
.deck:nth-child(2),
.deck:nth-child(3) {
  transform: translateY(30vh);
}

@media (max-width: 768px) {
  .container {
    display: flex;
    flex-direction: column;
  }

  .part {
    width: 100%;
  }

  .card {
    padding: 15px;
    max-width: 95vw;
    max-height: none;
  }

  .imagen-contexto {
    width: 80%;
    max-width: 300px;
  }

  .atributos-evaluacion {
    flex-direction: row;
    gap: 10px;
  }

  .atributo img {
    width: 40px;
    height: 40px;
  }

  .titulo-pregunta {
    font-size: 16px;
  }

  .explicacion-pergamino {
    font-size: 14px;
  }

  .icono-atributo {
    width: 50px;
    height: 50px;
  }

  .atributos-container {
    gap: 10px;
  }

  .card-decks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .deck {
    width: 45%;
    margin: 5px 0;
  }

  .deck:nth-child(2),
  .deck:nth-child(3) {
    transform: translateY(0);
  }

  .card20 {
    width: 90%;
  }

  .modal-content {  
    padding: 0px;  
  }

  #summaryModal {
    width: 96%;
    font-size: 0.8rem;
    gap: 10px;
  }

  #touch-controls {
    bottom: 10px;
    left: 10px;
    flex-direction: column;
    gap: 10px;
  }

  #touch-controls button {
    font-size: 2rem;
    padding: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
  }
}

@media (max-height: 640px), (orientation: landscape) and (max-width: 768px) {
  .deck:nth-child(2),
  .deck:nth-child(3) {
    transform: translateY(0);
  }
}

@media only screen and (min-width: 768px) {
  .part {
    width: 70%;
  }
}

.modal-historia {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(20, 20, 20, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.historia-contenedor {
  background: #fefaf2;
  border: 3px solid #c87c2e;
  border-radius: 20px;
  padding: 0.2rem;
  max-width: 800px;  
  max-height: 90vh;
  color: #333;
  font-family: 'Georgia', serif;
}

.titulo-historia {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #6a3e14;    
}

.historia-flex {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.columna-izquierda {
  flex: 1 1 250px;
  text-align: center;
}

.imagen-personaje {
  width: 100%;
  max-width: 200px;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.tabla-atributos {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tabla-atributos td {
  padding: 0.3rem 0.5rem;
}

.columna-derecha {
  flex: 2 1 400px;
}

.bloque-historia {
  background: #fff8e5;
  padding: 2rem;
  border-radius: 10px;
  border: 2px solid #c87c2e;
  min-height: 80px;
  text-align: justify;
  margin-bottom: 2rem;
  margin-right: 2rem;
}

.btn-comenzar {
  background-color: #c87c2e;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  display: block;
  margin: 0 auto;
}

.atributos-horizontales {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.mini-stats {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;  
}

.mini-stats img {
  width: 38px;
  height: 38px;
}

.mini-stats span {
  font-size: 1.2rem;
  margin-right: 6px;
  font-weight: bold;
  color: #222;
}

#touch-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#touch-controls button {
  font-size: 1.5rem;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background-color: #27662e;
  color: white;
  box-shadow: 0 0 5px black;
}

#touch-controls button:hover {
  background-color: #4caf50;
}

#abrirUserStats {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 100;
  font-size: 2rem;
  padding: 8px;
  border: none;
  border-radius: 50%;
  background-color: #27662e;
  color: white;
  box-shadow: 2px 2px 5px black;
  display: none; /* Aparece solo si se cierra manual o auto */
}

/* —— Modal Decisiones y Azares —— */
.mz-modal[aria-hidden="true"] { display: none; }
.mz-modal[aria-hidden="false"] { display: block; }

.mz-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

.mz-dialog {
  position: fixed; inset: 0;
  max-width: 880px;
  width: calc(100% - 1rem);
  margin: auto;
  background: #ffffff;
  color: #111;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 1.25rem 1.25rem 1.5rem;
  outline: none;
}

.index_body .mz-dialog { /* armoniza con tu tema si usas fondos oscuros */
  background: #fffdfc;
}

.mz-close {
  position: absolute; top: .5rem; right: .75rem;
  border: none; background: transparent; font-size: 2rem; line-height: 1;
  cursor: pointer; color: #444;
}

.mz-content p { margin: .75rem 0; line-height: 1.6; }
.mz-content ul { margin: .25rem 0 .75rem 1.25rem; }
.mz-content li { margin: .25rem 0; }

.mz-sep {
  border: none; border-top: 1px solid rgba(0,0,0,.1);
  margin: 1rem 0 .75rem;
}

.mz-credits {
  font-size: .95rem;
  opacity: .9;
}

.footer-link {
  text-decoration: underline;
  cursor: pointer;
  color: white;
}

/* Responsive */
@media (min-width: 768px) {
  .mz-dialog { padding: 1.5rem 2rem 2rem; }
}

/* ——— Modal: scroll y móvil ——— */
.mz-modal { position: fixed; inset: 0; z-index: 9999; }
.mz-dialog {
  max-width: 920px;
  width: calc(100% - 2rem);
  max-height: min(88dvh, 720px);   /* alto máx. visible */
  overflow: auto;                   /* scroll interno */
  -webkit-overflow-scrolling: touch;/* inercia en iOS */
  overscroll-behavior: contain;     /* evita “arrastre” al body */
}

/* Que el contenido no se pegue a los bordes al hacer scroll */
.mz-content { padding-bottom: .5rem; }

/* En pantallas pequeñas, un poquito más compacto */
@media (max-width: 480px) {
  .mz-dialog { padding: 1rem; max-height: 90dvh; }
  .mz-content p { line-height: 1.55; }
}
