body {
  --primary-color: hsl(198, 100%, 57%);
  --warning-color: hsl(51, 100%, 50%);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);
}

[transparent] {
  opacity: 0 !important;
}

[disabled] {
  pointer-events: none !important;
}

$bg-urls: url("https://i.loli.net/2020/05/28/svkFR1Hi7Cq8Mx2.png"),
  url("https://i.loli.net/2020/05/28/svkFR1Hi7Cq8Mx2.png"),
  url("https://i.loli.net/2020/05/28/sA2yFGVKOhdqIUW.png"),
  url("https://i.loli.net/2020/05/28/sA2yFGVKOhdqIUW.png"),
  url("https://i.loli.net/2020/05/28/C6IODEcktVi5mzA.png"),
  url("https://i.loli.net/2020/05/28/C6IODEcktVi5mzA.png"),
  url("https://i.loli.net/2020/05/28/jUB4ZQDHhJrbmLG.png"),
  url("https://i.loli.net/2020/05/28/jUB4ZQDHhJrbmLG.png"),
  url("https://i.loli.net/2020/05/28/V8k7AdNXZRcOMYh.png"),
  url("https://i.loli.net/2020/05/28/V8k7AdNXZRcOMYh.png"),
  url("https://i.loli.net/2020/05/28/KfJOeBVxzD76kYX.png"),
  url("https://i.loli.net/2020/05/28/KfJOeBVxzD76kYX.png"),
  url("https://i.loli.net/2020/05/28/67FrAT8uQgcXwv2.png"),
  url("https://i.loli.net/2020/05/28/67FrAT8uQgcXwv2.png"),
  url("https://i.loli.net/2020/05/28/tepla8GPhcF5unB.png"),
  url("https://i.loli.net/2020/05/28/tepla8GPhcF5unB.png");

.game {
  width: 264px;
  height: 264px;
  display: flex;
  flex-wrap: wrap;
  perspective: 800px;

  .card {
    --card-padding: 0;
    --card-bg: transparent;
    --card-radius: 0;

    position: relative;
    width: 60px;
    height: 60px;
    margin: 3px;
    transition: 0.6s ease-out;
    transform-style: preserve-3d;
    cursor: pointer;

    @for $i from 1 through 16 {
      &:nth-child(#{$i}) {
        order: var(--order);

        .card__face--back {
          background: nth($bg-urls, $i) 0 0 / cover no-repeat;
        }
      }
    }

    &.flipped {
      transform: rotateY(0.5turn);
      pointer-events: none;
    }

    &__face {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: url("https://i.loli.net/2020/05/28/mfWqsrGSXAELluD.jpg") 0 0 /
        cover no-repeat;
      backface-visibility: hidden;

      &--back {
        transform: rotateY(0.5turn);
      }
    }
  }
}

.btn-ark {
  position: relative;
  width: 38px;
  height: 38px;
  margin-top: 30px;
  font-size: 12px;
  font-style: italic;
  font-weight: bold;
  color: var(--warning-color);
  background-color: transparent;
  border: 5px solid currentColor;
  text-shadow: 0 0 rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transform: rotate(-45deg) scale(0.8);
  transition: 0.3s;

  .play-icon {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-left: 10px solid;
    border-bottom: 5px solid transparent;
    transform: rotate(45deg) translate(22px, -10px);
  }

  .label {
    transform: rotate(45deg) translateY(5px) scale(0.8);
  }

  &::after {
    position: absolute;
    content: "";
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    background: transparent;
    border: inherit;
    transform: translate(-50%, -50%);
    animation: shock 0.6s ease-out infinite;
  }
}

@keyframes shock {
  to {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.btn {
  width: 140px !important;
  height: 50px !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.statistics {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  color: white;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;

  .score {
    margin-right: 100px;
  }
}

#final-score-dialog {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -50%);
  background: white;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
  border-radius: 0;
  white-space: nowrap;

  .dialog-content {
    gap: 12px;
    padding: 18px 64px;
  }

  .dialog-body {
    text-align: center;
  }
}
