body {
  font-size: 2rem;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.mesa {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;

}

.tarjeta {
  width: 7rem;
  height: 7rem;
  margin: 2rem;
  border-radius: 0.3em;
  background-image: var(--gradient);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: 0.3s;
  cursor: pointer;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.tarjeta__contenido {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform: rotateY(-180deg);
  backface-visibility: hidden;
  background-color: white;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
  border-radius: 0.3em;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  padding-top: 0.4rem;
}

.tarjeta__contenido::selection {
  background: transparent;
}

.tarjeta.descubierta {
  transform: rotateY(-180deg);
}

.boton-repartir {
  background-image: var(--gradient);
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: 0.3em;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
}

.boton-repartir:focus {
  outline: 0;
  border: 3px solid #515151;
  background-color: transparent;
}

.boton-repartir:hover {
  box-shadow:  0px 0px 3px 3px #39FF14;
  
}


.tarjeta.descubierta {
  transform: rotateY(-180deg);
}

@keyframes error {
  10%,
  90% {
    transform: rotateY(-180deg) translateX(-1px);
  }
  20%,
  80% {
    transform: rotateY(-180deg) translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: rotateY(-180deg) translateX(-4px);
  }
  40%,
  60% {
    transform: rotateY(-180deg) translateX(4px);
  }
}

@keyframes acierto {
  from {
    transform: rotateY(-180deg) scale3d(1, 1, 1);
    opacity: 1;
  }

  25% {
    transform: rotateY(-180deg) scale3d(1.1, 1.1, 1.1);
    opacity: 1;
  }

  to {
    transform: rotateY(-180deg) scale3d(1, 1, 1);
    opacity: 0;
  }
}

.acertada {
  pointer-events: none;
}

.acertada .tarjeta__contenido {
  animation: acierto 1.3s ease-in-out forwards;
}

.error {
  animation: error 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}


.cabecera {
  padding: 0.5rem 2rem;
  background: white;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cabecera-titulo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  color: rgba(0, 0, 0, 0.4);
}

.cabecera-num {
  font-family: var(--font-display);
  color: var(--hotpink);
  font-weight: 400;
  font-size: 3.5rem;
  line-height: 0.9;
}

.contadores {
  display: flex;
}

.contador-item {
  margin-right: 2rem;
}

.sube-nivel,
.game-over,
.end-game {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-image: var(--gradient);
}

.sube-nivel.visible,
.game-over.visible,
.end-game.visible{
  display: flex;
}

.modal {
  background: white;
  padding: 3rem 3rem 1rem;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
}

.modal h2 {
  color: var(--orange);
  font-family: var(--font-display);
  margin: 0;
}

.modal p {
  font-size: 1.5rem;
}

.modal button {
  margin: 3rem 0;
}

button {
  cursor: pointer;
  border: 0;
  background-image: var(--gradient);
  padding: 0.75rem 4rem;
  border-radius: 5rem;
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1;
  transition: 0.3s;
}

button:hover,
button:focus {
  opacity: 0.9;
  outline: 0;
}

.modal .reiniciar {
  color: var(--hotpink);
  background: transparent;
  border: 0;
  text-transform: capitalize;
  font-family: var(--font);
  font-size: 1rem;
  margin: 0;
}


.sonido{
  display: none;
}

.oculto{
  display: none;
}

@media screen and (max-width: 350px) {
	.mesa{
	  margin:50%;
	}
}
