.split-flap {
  text-align: center;
  perspective: 400px;
  margin: 20px auto;

  *,
  *:before,
  *:after {
    box-sizing: border-box;
  }
}

.split-flap > div {
  display: inline-block;
  margin: 0 5px;
}

.split-flap__label {
  margin-top: 1vw;
  font-size: 2vw;
}

.split-flap__card {
  display: block;
  font-size: 4vw;
  line-height: 1.25;
  padding-bottom: 0.72em;
  position: relative;
}
@media only screen and (max-width: 767px) {
  .split-flap__card {
    font-size: 9vw;
  }
}

.card__top,
.card__bottom,
.card__back::before,
.card__back::after {
  backface-visibility: hidden;
  background: #222;
  border-radius: 0.15em 0.15em 0 0;
  color: #ccc;
  display: block;
  height: 0.72em;
  padding: 0 0.25em;
  transform: translateZ(0);
  transform-style: preserve-3d;
  width: fit-content;
  min-width: 1.8em;
}

.card__bottom {
  background: #393939;
  border-radius: 0 0 0.15em 0.15em;
  border-top: solid 1px #000;
  color: #fff;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  top: 50%;
}

.card__bottom::after {
  content: attr(data-value);
  display: block;
  margin-top: -0.72em;
}

.card__back {
  position: absolute;
  top: 0;
  height: 100%;
  left: 0%;
  pointer-events: none;
}

.card__back::before {
  content: attr(data-value);
  position: relative;
  z-index: -1;
  overflow: hidden;
}

.flip .card__back::before {
  animation: flipTop 0.3s cubic-bezier(0.37, 0.01, 0.94, 0.35);
  animation-fill-mode: both;
  transform-origin: center bottom;
}

.flip .card__back .card__bottom {
  transform-origin: center top;
  animation-fill-mode: both;
  animation: flipBottom 0.6s cubic-bezier(0.15, 0.45, 0.28, 1);
}

@keyframes flipTop {
  0% {
    transform: rotateX(0deg);
    z-index: 2;
  }
  0%,
  99% {
    opacity: 0.99;
  }
  100% {
    transform: rotateX(-90deg);
    opacity: 0;
  }
}

@keyframes flipBottom {
  0%,
  50% {
    z-index: -1;
    transform: rotateX(90deg);
    opacity: 0;
  }
  51% {
    opacity: 0.99;
  }
  100% {
    opacity: 0.99;
    transform: rotateX(0deg);
    z-index: 5;
  }
}
