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

.logo img {
  width: 300px;
  position: relative;
  top: -30px;
}

.bienvenida {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  /* background: white;*/
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
}
.bienvenida {
  background-image: url(../img/brawl.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  position: fixed;
}

.bienvenida.visible {
  display: flex;
}

.bienvenida-botones {
  display: flex;
}

.bienvenida button {
  padding: 1rem 3rem;
  margin: 0 1rem;
  font-weight: 400;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;

  box-shadow: 3px 3px 0px black, 1px 4px black, 3px -1px black, -4px 4px black,
    -4px -1px black;
  border-radius: 5px;
}

.cabecera {
  padding: 0.5rem 2rem;
  background: #343c52;
  border-bottom: 7px solid #222b3f;
  border-top: 7px solid #4b546c;
  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: 400;
  font-size: 0.8rem;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  color: white;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
}

.cabecera-num {
  font-family: var(--font-display);
  color: #f2cf00;
  font-weight: 400;
  font-size: 3.5rem;
  line-height: 0.9;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
}

.contadores {
  display: flex;
}

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

main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  position: relative;
  background-image: url(../img/fondo.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.mesa {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  max-width: 56rem;
  margin: auto;
  justify-content: center;
  margin: 50px 0;
}

.tarjeta {
  width: 100px;
  height: 94px;
  margin: 0.5rem;
  border-radius: 10px;
  /*background-image: var(--gradient);*/
  background-image: url(../img/logo.jpg);
  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) translateZ(1px);
  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);
}

@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;
  backface-visibility: hidden;
}

.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;
}

.feedback,
.game-over,
.end-game {
  display: none;
  position: fixed;
  /* background-image: url(../img/victoria.jpg); */
  background: radial-gradient(50% 50% at 50% 50%, #5dc1f3 0%, #007dfe 100%);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.victoria {
  font-weight: 400;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404 !important;
  color: white !important;
  -webkit-transform: skew(343deg);
  position: absolute;
  z-index: 10;
  top: 50px;
  left: 50px;
}
.triangulo {
  width: 400px;
  position: absolute;
  top: 0;
  left: 0;
}
.surgue img {
  width: 170px;
  margin-top: 20px;
}
@media (max-width: 400px) {
  .victoria {
    left: 20px;
  }
  .derrota {
    left: 20px !important;
  }
}

#timeOver {
  background: radial-gradient(50% 50% at 50% 50%, #5dc1f3 0%, #007dfe 100%);
}
#gameOver {
  background: radial-gradient(50% 50% at 50% 50%, #5dc1f3 0%, #007dfe 100%);
}

.triangulo-rojo {
  width: 400px;
  position: absolute;
  top: 0;
  left: 0;
}
.derrota {
  font-weight: 400;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404 !important;
  color: #fe8500 !important;
  -webkit-transform: skew(343deg);
  position: absolute;
  z-index: 10;
  top: 50px;
  left: 50px;
}
.jessi img {
  width: 150px;
  margin-top: 20px;
}
.feedback.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: #f2cf00;
  font-family: var(--font-display);
  margin: 0;
  font-weight: 400;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
  font-size: 50px;
}

.modal p {
  font-size: 1.5rem;
  color: white;
  font-family: var(--font-display);
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
  font-size: 25px;
}

.modal button {
  margin: 1.5rem 0;
}

button {
  cursor: pointer;
  border: 0;
  color: white;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1;
  transition: 0.3s;
  -webkit-transform: skew(-5deg);
  background-color: #f2cf00;
  border-bottom: 4px solid #c7aa07;
  border-top: 4px solid #f1de6f;

  padding: 0 20px;
  box-shadow: 1px 3px #000, -1px -1px #000;
}

.derecho {
  -webkit-transform: skew(5deg);
}

#subir {
  padding: 10px;
  font-weight: 400px;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;

  box-shadow: 3px 3px 0px black, 1px 4px black, 3px -1px black, -4px 4px black,
    -4px -1px black;
  border-radius: 5px;
}

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

.modal .reiniciar {
  color: white;
  font-weight: 300;
  border-top: 2px solid #ff7582;
  border-bottom: 2px solid #bc0037;
  background-color: #eb3b57 !important;

  text-transform: capitalize;
  padding: 10px;
  border-radius: 5px;
  font-size: 1rem;
  margin: 0;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
}

.sonido {
  display: none;
}

.cronometro-oculto {
  display: none;
}

.control-nivel {
  position: absolute;
  font-size: 0.8rem;
  top: 2.9rem;
  right: 0.5rem;
  padding: 0;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 0.68rem;
  display: flex;
  justify-content: center;
  background: #f2cf00;
}

.control-oculto {
  display: none;
}

.selecciona-nivel {
  background: white;
  border: 5px solid black;
  border-radius: 10px 0 0 10px;
  position: fixed;
  width: 250px;
  right: 0;
  top: 0;
  bottom: 0;
  transform: translateX(100%);
  transition: transform 0.3s;
  padding: 0;
}

.selecciona-nivel.visible {
  transform: translateX(0);
}

.selecciona-nivel button {
  background: transparent;
  padding: 7px;
  margin: 4px;
  font-weight: 400;
  text-shadow: -1.5px -1.5px 0 #040404, 0 -1.5px 0 #040404,
    1.5px -1.5px 0 #040404, 1.5px 0 0 #040404, 1.5px 1.5px 0 #040404,
    0 1.5px 0 #040404, -1.5px 1.5px 0 #040404, -1.5px 0 0 #040404,
    0 3px 0 #040404, -1.5px 3px 0 #040404, 1.5px 3px 0 #040404;
}

.nivel {
  background: #343c52 !important;
  border-bottom: 3px solid #222b3f;
  border-top: 3px solid #4b546c;
}

.selecciona-nivel ul {
  list-style: none;
  padding-left: 0;
}

.selecciona-nivel li {
  margin-bottom: 1rem;
  text-align: center;
}

.cierra-niveles {
  position: absolute;
  width: 45px;
  top: 0.5rem;
  right: 1rem;
  border-radius: 5px;
  font-size: 2rem;
  font-family: sans-serif;
  font-weight: 300;
  border-top: 2px solid #ff7582;
  border-bottom: 2px solid #bc0037;
  background-color: #eb3b57 !important;
  padding: 0 !important;
  text-shadow: none !important;
}

/*Media querys*/

/*Inicio del juego*/

@media (max-width: 518px) {
  /*Headers*/
  .cabecera {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
  }
  .contadores {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
  }
  .contador-item {
    margin: 13px 0;
  }
  .nivel {
    margin: 13px 0;
  }
  .cabecera-titulo {
    text-align: center;
  }

  .mesa {
    justify-content: center;
  }
}

/*Bienvenida*/
@media (max-width: 414px) {
  .logo img {
    width: 200px;
  }
  .bienvenida button {
    padding: 10px;
    font-size: 20 px;
  }
}
