* {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #f6abcb;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section h1 {
  font-size: 2rem;
  text-align: center;
  color: #c03578;
}

.info-panel {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  background: #ffe1ef;
  border-radius: 12px;
  border: 2px solid #f8b8d0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  width: max-content;
}

.info-panel p {
  margin: 0;
  font-size: 1.1rem;
  color: #c03578;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  padding: 15px;
  background: #f87bb1;
  border-radius: 15px;
  width: max-content;
}

.card {
  width: 100px;  
  height: 100px; 
  position: relative;
  cursor: pointer;
  background-color: #ffffff;
  border-radius: 12px;
  border: 2px solid #f8d0db;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);

  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card .front,
.card .back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  border-radius: 10px;
  background-size: contain; 
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.5s;
}

.card .front {
  background-image: url("imagenes/Pregunta.png");
  transform: rotateY(0deg);
}

.card .back {
  transform: rotateY(180deg);
}

.card.active {
  transform: rotateY(180deg);
}

#reiniciar {
  margin: 15px 0 30px;
  background: #f87bb1;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s;
}

#reiniciar:hover {
  background: #e66aae;
}

/* Oculto */
.hidden {
  display: none;
}

/* Pantalla final */
.win-screen {
  margin-top: 30px;
  text-align: center;
  background: #ffe0f0;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.win-screen h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.win-screen p {
  font-size: 1.3rem;
  margin: 10px 0;
}

#btn-restart-win {
  margin-top: 20px;
  padding: 12px 20px;
  font-size: 1.2rem;
  background: #ff4fa5;
  border: none;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

#btn-restart-win:hover {
  background: #ff1f84;
}

/* RESPONSIVE */
@media (max-width: 480px) {

  .section {
    margin-top: 50px;
  }

  .board {
    grid-template-columns: repeat(4, 70px);
    gap: 8px;
    padding: 10px;
  }

  .card {
    width: 70px;
    height: 70px;
  }

  .card .front,
  .card .back {
    background-size: 80%; 
  }

  .info-panel {
    flex-direction: column;
    gap: 5px;
    padding: 10px;
  }

  .section h1 {
    font-size: 1.5rem;
  }
}
