body {
    font-family: 'Comic Sans MS', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}
  h1 {
    margin-top: 1rem;
  }
  #stats {
    margin: 1rem;
    font-size: 1.2rem;
  }
  #game-board {
    padding-top: 25px;
    display: grid;
    grid-template-columns: repeat(6, 200px);
    grid-gap: 10px;
    justify-content: center;
  }
  .card {
    width: 200px;
    height: 200px;
    perspective: 600px;
  }
  .card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
  }
  .card.flipped .card-inner,
  .card.matched .card-inner {
    transform: rotateY(180deg);
  }
  .card-front,
  .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 5px;
    overflow: hidden;
  }
  .card-front img {
    width: 100%;
    height: 100%;
  }
  .card-back {
    transform: rotateY(180deg);
  }
  .card.matched {
    pointer-events: none;
  }
  button {
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: 'Comic Sans MS', sans-serif;
  }
  .card-front img,
  .card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* o 'contain' si no quieres recorte */
    display: block;
  }


#confeti-container {
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 9999;
}

.confeti {
  position: absolute;
  background-color: red;
  opacity: 0.7;
  animation: caer 8s ease-out forwards;
  border-radius: 2px;
}

@keyframes caer {
  0% {
    transform: translateY(0) rotate(0);
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 1260px) {
  #game-board {
    display: grid;
    grid-template-columns: repeat(6, 150px);
    grid-gap: 10px;
    justify-content: center;
  }
  .card {
    width: 150px;
    height: 150px;
    perspective: 600px;
  }
}

@media (max-width: 955px) {
  #game-board {
    display: grid;
    grid-template-columns: repeat(5, 100px);
    grid-gap: 10px;
    justify-content: center;
  }
  .card {
    width: 100px;
    height: 100px;
    perspective: 600px;
  }
}
@media (max-width: 570px) {
  #game-board {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-gap: 10px;
    justify-content: center;
  }
  .card {
    width: 80px;
    height: 80px;
    perspective: 600px;
  }
  .title{
    text-align: center;
  }
}
/* Fondo oscuro del modal */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}

/* Caja central del modal */
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  width: 80%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-bottom: 10px;
}

.modal-content button {
  margin-top: 15px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  background: #4CAF50;
  color: white;
  transition: background 0.3s;
}

.modal-content button:hover {
  background: #45a049;
}
