@import url("https://fonts.googleapis.com/css2?family=Major+Mono+Display&family=Nabla&family=Outfit:wght@300;400;600&family=Roboto+Slab:wght@500&family=VT323&display=swap");



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}



html  {
  --colorfondo: #ffefd6;
  --colorDegradadoCarta: #0e5d6fc5;
  --colorDegradadoCartaE: #6aa4aa;
  --colorSecundario: #f2deba;
  --color-letra: #19282f;
  --color-sombra: #ebae4b6f;
  --font: Major Mono Display;
  
}


body.dark {
  --colorfondo: #191919;
  --colorDegradadoCarta: #481e9b;
  --colorDegradadoCartaE: #542da2;
  --colorSecundario: #2D4263;
  --color-letra: #ECDBBA;
  --color-sombra: #3f3e3d;
  --table: #e73939d2;
}

body {
  display: grid;
  grid-template-rows: 4rem 1fr;
  background-color: var(--colorfondo);
}

/* ENCABEZADO*/
h1 {
  display: flex;
  font-size: 3rem;
  font-weight: 100;
  color: var(--color-letra);
  font-family: var(--font);
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  /* text-shadow: 1px 1px var(--sombra); */
}
header {
  width: 100%;
  height: 4rem;
  box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.24);
  border-bottom: 2px solid var(--color-letra);
  background-color: var(--colorSecundario);
}

#dark {
  border-radius: 100px;
  cursor: pointer;
  padding: 1px;
  border: none;
  background: transparent;
  display: flex;
  color: black;
  font-weight: bold;
}

#dark:hover {
  background-color: black;
  color: white;
}

ul {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  color: var(--color-letra);
  font-weight: bold;
  box-shadow: 1px 1px 5px var(--color-sombra);
  border-radius: 5px;
  margin: 1rem 0.5rem;
  padding: 0.5rem;
  background-color: var(--colorSecundario);
}


.tablero {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  border: 2px solid var(--colorSecundario);
  border-radius: 5px;
  grid-column-gap: 1rem;
  width: 25rem;
  height: 25rem;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--colorSecundario);
 
}
.card {
 
  border: 1px solid var(--colorSecundario);
  border-radius: 0.5rem;
  background-color: var(--colorfondo);
  box-shadow: 1px 1px 1px var(--color-sombra);
  width: 5rem;
  height: 5rem;
}

.content {
  position: relative;
  height: 100%;
  width: 100%;
  transition: transform 1s;
  transform-style: preserve-3d;
  display: flex;
  align-content: center;
  justify-content: center;
}

.front,
.back {
  position: absolute;
  height: 100%;
  width: 100%;
  background: var(--colorDegradadoCarta);
  display: grid;
  place-content: center;
  font-size: 8rem;
  border-radius: 0.5rem;
  backface-visibility: hidden;
  user-select: none;
  box-shadow: 0px 0px 4px black;
  font-family: var(--font);
  font-size: 1rem;
}

.back {
  background: var(--colorDegradadoCartaE);
  transform: rotateY(180deg);
  font-size: 3em;
}

table {
  margin: auto;
  margin-top: 1rem;
  border: 1px solud black;
  background-color: var(--table);
  border-radius: 5px;
  box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.281);
}
.card.flipped .content {
  transform: rotateY(180deg);
  transition: transform 0.5s;
}

.match {
  -webkit-animation: blink-1 1s both;
  animation: blink-1 1s both;
  animation-delay: 0.5s;
}


.rotate,
.card {
  transform: rotate(720deg);
}



button {
  width: min-content;
  height: min-content;

  /* align-self: flex-end; */
  background-color: #1b2430;
  color: var(--colorSecundario);
  border: 1px solid;
  border-radius: 4px;
}

.front:hover {
  background-color: var(--colorDegradadoCartaE);
}

/*MOVIMIENTO AMBAS CARTAS COINCIDEN*/

@keyframes movimiento {
  50% {
    transform: translateY(5rem);
  }
  75% {
    transform: translateY(10rem);
  }
  100% {
    transform: translateY(15rem);

    opacity: 0;
  }
}

.move {
  animation: movimiento 2s;
  animation-timing-function: ease-in;
  animation-direction: alternate;
  animation-fill-mode: both;
  animation-delay: 0.5s;
}

/* //////////////////////MODAL////////////////////////// */
#modal {
  background-color: rgba(128, 128, 128, 0.616);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  color: var(--color-letra);
}

#modal div {
  display: flex;
  flex-direction: column;
  align-items: center;

  font-family: var(--font2);
  font-weight: bold;
  background-color: var(--colorSecundario);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0px 1px 1px 1px rgba(0, 0, 0, 0.39);
}

#modal button {
  font-family: var(--font2);
  color: #19282f;
  font-weight: bold;
  border-radius: 1rem;
  align-self: center;
  margin-top: 1rem;
  width: 80%;
  height: 3rem;
  border-color: #6aa4aa;
}

#modal button {
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: white;
  background-color: black;
  border-radius: 1rem;
  box-shadow: 0px 3px 0px rgb(68, 66, 66);
  line-height: 35px;
}

#modal button:hover {
  background-color: rgb(78, 64, 64);
}

#modal button:active {
  background-color: black;
  box-shadow: 0 1px #666;
  transform: translateY(5px);
}

/* CURSOR */
.card {
  cursor: pointer;
}

ul,
h1 {
  cursor: default;
}

/*MODO OSCURO */

.switch-button {
  display: inline-block;
}
.switch-button .switch-button__checkbox {
  display: none;
}
.switch-button .switch-button__label {
  background-color: var(--colorSecundario);
  width: 2rem;
  height: 1rem;
  border-radius: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  border: 1px solid black;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.281);
}
.switch-button .switch-button__label:before {
  transition: 0.2s;
  display: block;
  position: absolute;
  width: 0.9rem;
  height: 0.85rem;
  background-color: rgb(255, 255, 255);
  content: "";
  border-radius: 50%;
  box-shadow: inset 0px 0px 0px 1px rgb(0, 0, 0);
}
.switch-button .switch-button__checkbox:checked + .switch-button__label {
  background-color: var(--colorSecundario);
}
.switch-button .switch-button__checkbox:checked + .switch-button__label:before {
  transform: translateX(1rem);
}
.pBtn {
  margin-top: 1px;
  margin: 1px;
  font-size: 10px;
  user-select: none;
}
