/* ---Estilos genericos--- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #ddd;
  font-family: "Raleway", Arial, sans-serif;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  padding-bottom: 3em;
  min-height: 100vh;
}

#creditos>* {
  position: relative;
  z-index: 1;
  /* mantiene el contenido por encima de la imagen */
}

/* HEADER: Logo + título */
.header-brand {
  padding-left: .5em;
  margin-top: .5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding-left: .5em;
  margin-top: .5em;
}

.header-brand a {
  padding: 0;
  margin: 0;
}

.logo-header {
  width: 5em;
  height: auto;
  vertical-align: middle;
}

.logo-studio img {
  max-width: 10vh;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

#titulo {
  color: #352f16;
  font-size: 3em;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 4px;
  text-wrap: balance;
  white-space: nowrap;
}

.titulos-reglas,
.titulos-inicio {
  color: #352f16;
  font-size: 3em;
  font-weight: bold;
  vertical-align: middle;
  text-align: center;
}

.texto-cab {
  color: #d1cea9;
}

.texto-cajas{
  background: #f6f4e8;              
  border: 2px solid #c7c3a4;         
  border-radius: 12px;
  padding: .5em .5em;
  margin: .5em auto;
  max-width: 900px;
  color: #352f16;                    
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
}

/* Separador */
hr {
  margin: 3px 0 1vh;
  background-color: #25210f;
}

/* --- IMÁGENES DE EQUIPOS --- */
.img-equipos {
  display: inline-block;
  width: 40%;
  max-width: 400px;
  height: auto;
  margin: 1em;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  object-fit: cover;
}

.img-equipos:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}


/* BOTONES */
button {
  padding: 8px 8px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(135deg, #556b2f, #3b5323);
  color: white;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background: linear-gradient(135deg, #3b5323, #2a3a1d);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.4);
}

button:active {
  background: #253f11;
  transform: scale(0.95);
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.5);
  border-color: #5d473a;
}

#btn-jugar {
  height: 4em;
  width: 10em;
  margin: 1em;

}

#btn-jugar span {
  font-size: 2em;
}

/* Contenedor (padre) del canvas del juego */
.seccion-juego {
  text-align: center;
  margin: 0;
  padding: 0;
   align-items: center;  
}

.jugar,
.logo-studio,
.izq,
.mid,
.der,
.info {
  text-align: center;
}

.reglas-creditos {
  text-align: right;
  margin-top: 3.5em;
}

/* FOOTER */
footer {
  font-weight: bold;
  position: absolute;
  bottom: 0;
  padding: .5em;
  width: 100%;
}

/* Enlaces */

a,
a:visited {
  color: #352f16;
  text-decoration: none;
  margin: 0 0.5em;
}

footer a:hover {
  color: #464323;
  text-decoration: none;
  opacity: 0.8;
}



/* ----- PAGINA SOBRE COMO JUGAR ----- */

#reglas h3.info {
  color: #455036;
  font-size: 1.6em;
  margin-top: 1em;
  margin-bottom: 0.3em;
  text-align: center;
}

#reglas table {
  width: 80%;
  border-collapse: collapse;
  margin: auto;
  font-size: 0.95em;
  background-color: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

#reglas th {
  background: #747537;
  color: #fff;
  padding: 10px;
  text-align: center;
  font-weight: 600;
}

#reglas td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

#reglas tr:nth-child(even) {
  background-color: #efefef;
}
#reglas ul li::before {
  content: "📖";
}
#reglas li::marker {
  content: ""; /* oculta el marcador */
}

/* ----- FIN PAGINA SOBRE COMO JUGAR ----- */

/*--------------- PAGINA SOBRE CREDITOS-------- */

/* GIRAR LAS TARJETAS */

/*Div de Tarjetas*/
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5%;
  row-gap: 10px;
  justify-content: center;
  padding: 20px;
}

/*Boton Card*/
.card {
  background: #ccc;
  border: none;
  padding-bottom: 30px;
  width: 300px;
  height: 360px;
  cursor: pointer;
  outline: none;
}

.card.referencias {
  width: 350px;
  height: 250px;
}


/*Div Card (a este div se le aplica la clase flipped)*/
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 12px;
}

/* Al añadir la clase flipped, rotamos 180 grados en Y */
.card.flipped .card-inner {
  /*js - cuando se hace click en una tarjeta aplica la funcion flipped*/
  transform: rotateY(180deg);
}

/*Front and Back*/

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

}

/*Front and Back*/

.card-front {
  background: #f3f4f6;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  margin: 0;
  display: block;
  /* elimina el espacio fantasma de las imágenes inline */
}

/* Posicionamos las imagenes de las ref en horizontal */
.card.referencias .card-front {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 10px;
  flex-direction: row;
}

/* Img circulares */
img.iconos-ref {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

}

.card-back {
  background: #f3f4f6;
  transform: rotateY(180deg);
  text-align: center;
  color: #708238;
}

.card-back img {
  width: 80%;
  border-radius: 8px;
}

.card-back p {
  margin-left: 30px;
  margin-right: 30px;
  margin-top: 0px;
  color: black;
}

.titulos-creditos {
  text-align: center;
  color: #352f16;
  font-size: 3em;
  font-weight: bold;
}

/* --FIN DE CREDITOS-- */

/* ---Pantallas mayores a 1031px--- */
@media screen and (min-width: 1029px) {

  header,
  footer {
    background: linear-gradient(to bottom, #aca98a, #d3cf9c);
    box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, 0.5);
    height: auto;
  }
}

/* ---Pantallas menores a 1029px--- */
@media screen and (max-width: 1029px) {

  /* NOTA: si el juego se haec responsive hay que modificar selectores y diferentes contrastes */
  #titulo,
  .fila div p a {
    color: #fff;
  }

  header,
  footer {
    background: linear-gradient(to bottom, #4f7222, #47883f);
    box-shadow: 2px 1px 2px 1px rgba(0, 0, 0, 0.5);
    height: auto;
  }

  header {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo-header {
    display: none;
  }

  #titulo {
    margin: 0;
    text-align: center;
    font-size: 2.5em;
  }
}