*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  margin: 0;
  background: #6589F9;
}

.stats {
  max-width: 960px;
  margin: 10px auto;
  text-align: center;
  color: white;
  font-size: 14px;
}

.grid {
  max-width: 960px;
  margin: 0 auto;
  display: -webkit-grid;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  justify-items: center;
}

.card {
  position: relative;
  -webkit-transition: all .4s linear;
  -o-transition: all .4s linear;
  transition: all .4s linear;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  margin: 0;
}

.card,
.back,
.front {
  height: 80px;
  width: 80px;
}

/* Ajustar tamaño de cartas en pantallas más grandes, manteniendo 4 columnas */
@media (min-width: 480px) {
  .card,
  .back,
  .front {
    height: 90px;
    width: 90px;
  }
}

@media (min-width: 768px) {
  .card,
  .back,
  .front {
    height: 120px;
    width: 120px;
  }
}

@media (min-width: 1024px) {
  .card,
  .back,
  .front {
    height: 140px;
    width: 140px;
  }
}

.back,
.front {
  position: absolute;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}

.front {
  background: #FAB942 url('../img/question_v2.gif') no-repeat center center / contain;
}

.back {
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
  background-color: #6589F9;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

.selected {
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
}

.match .front {
  background: #6589F9 !important;
}
