:root {
  --open-duration: 200ms;
  --hiding-duration: 300ms;
  --closing-duration: 400ms;
}

/* third party spinner */
.lds-grid {
  display: inline-block;
  position: absolute;
  width: 80px;
  height: 80px;
}

.lds-grid div {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  animation: lds-grid 1.2s linear infinite;
}

.lds-grid div:nth-child(1) {
  top: 8px;
  left: 8px;
  animation-delay: 0s;
}

.lds-grid div:nth-child(2) {
  top: 8px;
  left: 32px;
  animation-delay: -0.4s;
}

.lds-grid div:nth-child(3) {
  top: 8px;
  left: 56px;
  animation-delay: -0.8s;
}

.lds-grid div:nth-child(4) {
  top: 32px;
  left: 8px;
  animation-delay: -0.4s;
}

.lds-grid div:nth-child(5) {
  top: 32px;
  left: 32px;
  animation-delay: -0.8s;
}

.lds-grid div:nth-child(6) {
  top: 32px;
  left: 56px;
  animation-delay: -1.2s;
}

.lds-grid div:nth-child(7) {
  top: 56px;
  left: 8px;
  animation-delay: -0.8s;
}

.lds-grid div:nth-child(8) {
  top: 56px;
  left: 32px;
  animation-delay: -1.2s;
}

.lds-grid div:nth-child(9) {
  top: 56px;
  left: 56px;
  animation-delay: -1.6s;
}

@keyframes lds-grid {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (max-aspect-ratio: 4/1) {
  :root {
    --columns: 4;
    --rows: 3;
    --card-size: 150px;
  }
  @media (max-height: 490px) {
    :root {
      --card-size: 30vh;
    }
  }
}

@media (max-aspect-ratio: 9/10) {
  :root {
    --columns: 3;
    --rows: 4;
    --card-size: 150px;
  }
  @media (max-width: 490px) {
    :root {
      --card-size: 30vw;
    }
  }
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: rgb(41, 41, 41);
}

.container {
  display: grid;
  grid-template-columns: repeat(var(--columns), var(--card-size));
  grid-template-rows: repeat(var(--rows), var(--card-size));
  grid-gap: 10px;
}

.cardPlace {
  position: relative;
  perspective: 2000px;
  border: 1px solid rgba(0, 0, 0, 0.19);
  border-radius: 8px;
}

.card {
  background-color: rgba(56, 56, 56, 1);
  background-size: 100%, 0%;
  background-image: none, none;
  position: absolute;
  height: 100%;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.3),
    0px 3px 28px 0px rgba(0, 0, 0, 0.21);
}

.open {
  transform: rotateY(180deg);
  background-size: 0%, 100%;
  transition: transform var(--open-duration) linear,
    background-size 0ms linear calc(var(--open-duration) / 2);
}

.closing {
  transition: transform var(--closing-duration) linear,
    background-size 0ms linear calc(var(--closing-duration) / 2);
}

.hiding {
  box-shadow: 0px 0px 48px 200px rgba(54, 49, 255, 0.33),
    0px 3px 28px 0px rgba(0, 0, 0, 0.21);
  opacity: 0;
  transition: opacity var(--hiding-duration) ease-out,
    box-shadow var(--hiding-duration) ease-out;
}

.card:hover {
  cursor: pointer;
}
