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

body {
  background: linear-gradient(135deg, #1e1e1e, #121212);
  color: #fff;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 20px;
}

h1 {
  font-size: 2rem;
  font-weight: bold;
  word-wrap: break-word; /*asegura que el texto se ajuste al contenedor */
}

.container {
  display: none;
  flex-direction: row;
  background: #222;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  align-items: center;
  gap: 20px;
  max-width: 95vw;
  margin: 0 auto;
  justify-content: center;
  position: relative;
}

.contenedorJuego {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #333;
  padding: 15px;
  border-radius: 10px;
  margin-top: 20px;
}

.iconoInterrogante {
  color: #222;
}
.carta {
  background: linear-gradient(135deg, #ffb88c, #ffd4b3); /* Degradado naranja aún más claro */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
  width: 100%;
}

.carta.size-small {
  font-size: 2rem;
}

.carta.size-medium {
  font-size: 2rem;
}

.carta.size-large {
  font-size: 2rem;
}

.carta.size-small .back {
  font-size: 4rem;
}

.carta.size-medium .back {
  font-size: 4rem;
}

.carta.size-large .back {
  font-size: 3rem;
}

.carta.pareja {
  pointer-events: none;
}

.carta:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); 
  transform: scale(1.05) rotate(2deg); 
  animation: rebote 0.5s;
}
.carta .cara {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  transition: transform 0.5s ease-in-out;
}

.carta .front {
  background: linear-gradient(135deg,rgb(47, 91, 128), rgb(120, 155, 201));
  transform: rotateY(180deg);
  font-size: 2rem;
}

.carta .back {
  background: linear-gradient(135deg, #dd7055, #d69a6c);
  transform: rotateY(0deg);
  font-size: 4rem;
}

.carta.flipped {
  background: #efefef; 
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.carta.pareja {
  box-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 30px rgb(179, 133, 73);
}

.carta:active {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.carta.flipped .front {
  transform: rotateY(0deg);
}

.carta.flipped .back {
  transform: rotateY(-180deg);
}

.noClick .carta {
  /* para descactivar las cartas */
  pointer-events: none;
  opacity: 0.8;
}

.pareja {
  animation: latidoBrillo 0.5s ease;
}

.carta:active {
  animation: rebote 0.3s ease-in-out;
}

.fallo {
  animation: temblor 0.3s linear;
}

.info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  width: 100%;
}

.info p {
  background: #333;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid white;
  min-width: 100px;
}

button {
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
  color: white;
  padding: 12px 20px;
  border: none;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

button:hover {
  background: linear-gradient(135deg, #feb47b, #ff7e5f);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 165, 0, 0.3);
}

button:active {
  transform: scale(0.9);
}

/* Mensaje ganador */
#mensajeGanador {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
  padding: 2rem;
  border-radius: 15px;
  font-size: 1.5rem;
  text-align: center;
  z-index: 1000;
  display: none;
  box-shadow: 0 0 20px rgba(252, 60, 2, 0.3);
  animation: pulso 1s infinite;
  pointer-events: none;
  opacity: 0.9;
}

#mensajeGanador.ganador {
  border-color: #00ff00;
  box-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 30px rgba(0, 255, 0, 1);
  animation: pulso 1s infinite;
}

#mensajeGanador.perdedor {
  border-color: #ff0000;
  box-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 30px rgba(255, 0, 0, 1);
  animation: vibracion 0.5s infinite;
}
