@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;500&family=Red+Hat+Text:wght@700&display=swap");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: hsl(234, 17%, 12%);
  background-image: url(pattern-hills.svg), url(bg-stars.svg);
  background-repeat: no-repeat, repeat;
  background-position: bottom;
  background-size: contain;
  font-family: "Red Hat Text", sans-serif;
  padding: 25px;
  padding-top: 70px;
}

/* THEMES */

.flipdown.flipdown__theme-custom {
  font-family: "Red Hat Text", sans-serif;
  font-weight: bold;
}
/* Rotor group headings */
.flipdown.flipdown__theme-custom .rotor-group-heading:before {
  color: hsl(237, 18%, 59%);
}

/* Rotor tops */
.flipdown.flipdown__theme-custom .rotor,
.flipdown.flipdown__theme-custom .rotor-top,
.flipdown.flipdown__theme-custom .rotor-leaf-front {
  color: hsl(345, 95%, 68%);
  background-color: hsl(236, 21%, 26%);
}
/* Rotor bottoms */
.flipdown.flipdown__theme-custom .rotor-bottom,
.flipdown.flipdown__theme-custom .rotor-leaf-rear {
  color: hsl(345, 95%, 68%);
  background-color: hsl(236, 21%, 26%);
}

/* END OF THEMES */

.flipdown {
  margin: 180px auto 0;
  width: fit-content;
  height: 110px;
  transform: translateY(-50%);
}

.flipdown .rotor-group {
  position: relative;
  float: left;
  padding-right: 30px;
}

.flipdown .rotor-group:last-child {
  padding-right: 0;
}

.flipdown .rotor-group-heading:before {
  display: block;
  height: 30px;
  line-height: 30px;
  text-align: center;
}

.flipdown .rotor-group:nth-child(1) .rotor-group-heading:before {
  content: attr(data-before);
}

.flipdown .rotor-group:nth-child(2) .rotor-group-heading:before {
  content: attr(data-before);
}

.flipdown .rotor-group:nth-child(3) .rotor-group-heading:before {
  content: attr(data-before);
}

.flipdown .rotor-group:nth-child(4) .rotor-group-heading:before {
  content: attr(data-before);
}

.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 115px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
  content: "";
  position: absolute;
  bottom: 50px;
  left: 115px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.flipdown .rotor {
  position: relative;
  float: left;
  width: 70px;
  height: 80px;
  margin: 0px 5px 0px 0px;
  border-radius: 4px;
  font-size: 4rem;
  text-align: center;
  perspective: 200px;
}

.flipdown .rotor:last-child {
  margin-right: 0;
}

.flipdown .rotor-top,
.flipdown .rotor-bottom {
  overflow: hidden;
  position: absolute;
  width: 70px;
  height: 40px;
}

.flipdown .rotor-leaf {
  z-index: 1;
  position: absolute;
  width: 70px;
  height: 80px;
  transform-style: preserve-3d;
  transition: transform 0s;
}

.flipdown .rotor-leaf.flipped {
  transform: rotateX(-180deg);
  transition: all 0.5s ease-in-out;
}

.flipdown .rotor-leaf-front,
.flipdown .rotor-leaf-rear {
  overflow: hidden;
  position: absolute;
  width: 70px;
  height: 40px;
  margin: 0;
  transform: rotateX(0deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flipdown .rotor-leaf-front {
  line-height: 80px;
  border-radius: 4px 4px 0px 0px;
}

.flipdown .rotor-leaf-rear {
  line-height: 0px;
  border-radius: 0px 0px 4px 4px;
  transform: rotateX(-180deg);
}

.flipdown .rotor-top {
  line-height: 80px;
  border-radius: 4px 4px 0px 0px;
}

.flipdown .rotor-bottom {
  bottom: 0;
  line-height: 0px;
  border-radius: 0px 0px 4px 4px;
}

.flipdown .rotor:after {
  content: "";
  z-index: 2;
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 70px;
  height: 40px;
  border-radius: 0px 0px 4px 4px;
}

@media (max-width: 730px) {
  .flipdown {
    width: 312px;
    height: 70px;
  }

  .flipdown .rotor {
    font-size: 2.2rem;
    margin-right: 3px;
  }

  .flipdown .rotor,
  .flipdown .rotor-leaf,
  .flipdown .rotor-leaf-front,
  .flipdown .rotor-leaf-rear,
  .flipdown .rotor-top,
  .flipdown .rotor-bottom,
  .flipdown .rotor:after {
    width: 30px;
  }

  .flipdown .rotor-group {
    padding-right: 20px;
  }

  .flipdown .rotor-group:last-child {
    padding-right: 0px;
  }

  .flipdown .rotor-group-heading:before {
    font-size: 0.8rem;
    height: 20px;
    line-height: 20px;
  }

  .flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before,
  .flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
    left: 69px;
  }

  .flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before {
    bottom: 13px;
    height: 8px;
    width: 8px;
  }

  .flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
    bottom: 29px;
    height: 8px;
    width: 8px;
  }

  .flipdown .rotor-leaf-front,
  .flipdown .rotor-top {
    line-height: 50px;
  }

  .flipdown .rotor-leaf,
  .flipdown .rotor {
    height: 50px;
  }

  .flipdown .rotor-leaf-front,
  .flipdown .rotor-leaf-rear,
  .flipdown .rotor-top,
  .flipdown .rotor-bottom,
  .flipdown .rotor:after {
    height: 25px;
  }
}

.text {
  color: white;
  font-family: inherit;
  font-size: 1.5em;
  text-align: center;
}

.footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  font-family: "Open Sans", sans-serif;
  color: #f5f5f5;
  background-color: black;
  padding: 10px 0px;
  font-size: min(2vw, 15px);
  position: fixed;
  left: 0px;
  bottom: 0px;
  width: 100%;
}
