/* Load the custom font here */

@font-face {
  font-family: "Helsky";
  src: url("../../assets/fonts/Helsky-Regular.eot");
  src: url("../../assets/fonts/Helsky-Regular.eot?#iefix") format("embedded-opentype"),
    url("../../assets/fonts/Helsky-Regular.woff2") format("woff2"),
    url("../../assets/fonts/Helsky-Regular.woff") format("woff"),
    url("../../assets/fonts/Helsky-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Colorscheme */

:root {
  --white: #ffffff;
  --red: #ff0000;
  --black: #000000;
  --darkGray: #c3c3c3;
  --toggleBorder: #e4e7ec;
  --sunBackground: #ffeccf;
  --toggleShading: #ffbb52;
  --toggleBackground: #ffa500;
  --yellow: #ffff00;
  --blueGray: #374151;
  --disabledButton: rgba(255, 0, 0, 0.308);
  --dirt: #a52a2a;
  --pipeTop: #c00000;
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --gold: #ffd700;
  --darkBlueGray: #1c1c2a;
  --moonDot: #E6E6E6;
  --alertPopup: rgba(255, 255, 255, 0.8);
  --lightBrown: #bc9360;
  --darkBrown: #a38054;
}

/* 

Custom properties to work with gradients
Done with https://stackoverflow.com/questions/6542212/use-css3-transitions-with-gradient-backgrounds/63848864#63848864 

*/

@property --skyColor1 {
  syntax: '<color>';
  initial-value: rgb(163, 222, 251);
  inherits: false;
}

@property --skyColor2 {
  syntax: '<color>';
  initial-value: rgb(207, 235, 249);
  inherits: false;
}

@property --groundColor1 {
  syntax: '<color>';
  initial-value: rgb(92, 157, 13);
  inherits: false;
}

@property --groundColor2 {
  syntax: '<color>';
  initial-value: rgb(175, 217, 57);
  inherits: false;
}

@property --sun {
  syntax: '<color>';
  initial-value: rgb(92, 157, 13);
  inherits: false;
}

@property --moon {
  syntax: '<color>';
  initial-value: rgb(175, 217, 57);
  inherits: false;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
  font-family: "Open Sans", sans-serif;
  background: linear-gradient(var(--skyColor1), var(--skyColor2));
  transition: --skyColor1 1s, --skyColor2 1s;
  overflow: hidden;
}

/* --- TITLE OF PAGE --- */

body > div:first-of-type {
  display: flex;
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 0;
  width: max-content;
}

body > div {
  span {
    color: var(--white);
    font-family: "Helsky", sans-serif;
    font-weight: 300;
    text-align: center;
    letter-spacing: 3px;
    position: relative;

    &:after {
      position: absolute;
      transform: translate(-50%, -50%);
      width: 100%;
      color: var(--darkGray);
      text-align: center;
      z-index: -1;
      letter-spacing: 3px;
    }

    &:first-of-type {
      position: absolute;
      left: -700px;
      top: 800%;

      &:after {
        content: "F";
        top: 54.5%;
        left: 50.2%;
      }
    }

    &:nth-of-type(2){
      &:after {
        content: "ancy Fi";
        top: 54.5%;
        left: 50.2%;
      }
    }

    &:nth-of-type(3){
      &:after {
        content: "r";
        top: 54.5%;
        left: 50.2%;
      }
    }

    &:last-of-type {
      &:after {
        content: "eworks";
        top: 54.5%;
        left: 50.2%;
      }
    }
  }
}

@media only screen and (max-width: 599px) {
  body > div:first-of-type {
    left: 35px;
    top: 20px;
  }

  body > div span {
    font-size: 30px;
  }
}

@media only screen and (min-width: 600px) {
  body > div:first-of-type {
    transform: translateX(-50%);
    top: 30px;
  }

  body > div span {
    font-size: 50px;
  }
}

@media only screen and (min-width: 1200px) {
  body > div:first-of-type {
    transform: translate(-50%);
    margin-top: 50px;
  }

  body > div span {
    font-size: 80px;
  }
}

/* Animation of letter F from title */

body:has(input[name="popup-intro"]:checked) > div span:first-of-type {
  animation: moveFirstLetter;
  animation-duration: 3s;
  animation-delay: 0s;
  transition-timing-function: ease;
  animation-fill-mode: forwards;
}

@keyframes moveFirstLetter{
  from {
    left: -700px;
    top: 800%;
    transform: rotate(0deg);
  }

  25% {
    left: -100px;
  }

  50% {
    left: -300px;
  }

  to {
    left: -7%;
    top: 0;
    transform: rotate(360deg);
  }
}


/* Rocket behind the letter F + animation */

body:has(input[name="popup-intro"]:checked) > div span:first-of-type:before {
  content: "";
  position: absolute;
  background-image: url("../img/rocket-power2.svg");
  background-size: 50%;
  background-repeat: no-repeat;
  width: 90px;
  height: 50px;
  top: 55%;
  left: -25%;
  transform: rotate(-43deg);
  animation: rocketFade;
  animation-duration: .5s;
  animation-delay: 3.2s;
  transition-timing-function: ease;
  animation-fill-mode: forwards;
}

@keyframes rocketFade{
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* End of title */

/* --- TOGGLE BUTTON --- */

body > article {
  position: absolute;
  height: max-content;
  width: 100%;
  z-index: 2;

  div {
    display: flex;
    justify-content: flex-end;

    label {
      margin-right: 15px;
      margin-top: 15px;

      &:hover {
        cursor: pointer;
      }

      ul {
        position: relative;
        height: 31px;
        width: 65px;
        border: 3px solid var(--toggleBorder);
        border-radius: 10em;
        background-color: var(--white);
        transition: background-color 250ms;
        padding: 0;
        margin: 0;

        li {
          transform: translate(5px, 3px);
          position: absolute;
          height: 25px;
          width: 25px;
          border-radius: 50%;
          background-color: var(--toggleBackground);
          box-shadow: inset 0px 0px 0px 0.75em var(--toggleShading);
          transition: background-color 250ms, border-color 250ms,
            transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
          list-style-type: none;
        }
      }
    }

    input[type="checkbox"] {
      appearance: none;
      position: absolute;
      height: 0;
      width: 0;
      cursor: pointer;
    }
  }
}

@media only screen and (max-width: 600px) {
  body > article {
    z-index: 6;
  }
}

body > article div input[type="checkbox"]:checked ~ ul {
  background-color: var(--blueGray);
}

body > article div input[type="checkbox"]:checked ~ ul li {
  box-shadow: inset 0px 0px 0px 0.75em var(--white);
  transform: translate(33px, 3px);
}

/* End of toggle button */

/* --- GROUND + PIPE --- */

/* Ground */
body section:nth-of-type(2) {
  height: 100vh;
  width: 100%;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;


  div {
    &:first-of-type {
      height: 100px;
      width: 25px;
      background: linear-gradient(0deg, var(--red) 0%, var(--red) 100%);
      position: absolute;
      bottom: 22%;
      left: 50%;
      transform: scale(1) translate(-50%);
      z-index: 4;
      transition: .3s ease-in-out;

      &:before {
        content: "";
        position: absolute;
        width: 25px;
        height: 6px;
        background-color: var(--pipeTop);
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
      }

      &:after {
        content: "";
        position: absolute;
        width: 50px;
        height: 11px;
        background-color: var(--dirt);
        bottom: 0;
        left: 50%;
        transform: translate(-50%, 40%);
        border-radius: 20% 80% 0% 0% / 80% 100% 0 0;
      }
    }

    &:last-of-type {
      background: linear-gradient(var(--groundColor1), var(--groundColor2));
      transition: --groundColor1 1s, --groundColor2 1s, .3s ease-in-out;
      height: 25vh;
      width: 100%;
      border-radius: 150% 150% 50% 60% / 150% 150% 0% 0%;
      position: absolute;
      bottom: 0;

      input[type="checkbox"] {
        appearance: none;
      }
  
      /* Launch button - Disabled by default */

      label {
        padding: 20px 40px 15px 40px;
        background-color: transparent;
        border-radius: 2px;
        font-size: 25px;
        font-family: "helsky", sans-serif;
        letter-spacing: 2px;
        font-weight: 200;
        border: 2px solid var(--disabledButton);
        color: var(--disabledButton);
        pointer-events: none;
        transition: .3s ease-in-out;
  
        &:hover {
          background-color: var(--red);
          color: var(--white);
          cursor: pointer;
          transition: 0.3s ease-in-out;
        }
      }
    }
  }
}

body:has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) div label::before {
  content: 'Reload!';
}

body:has(section:nth-of-type(2) input[type="checkbox"]) section:nth-of-type(2) div label::before {
  content: 'Fire!';
}

body:has(article div input[type="checkbox"]:checked) section:nth-of-type(2) div:last-of-type {
  --groundColor1: rgb(8, 115, 94);
  --groundColor2: rgb(0, 40, 81);
}

body section:nth-of-type(2) input[type="checkbox"], body section:nth-of-type(2) label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/** Firework Launching - Send ball up in the air **/

body:has(section:nth-of-type(1) ul li input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked)
  section:nth-of-type(2)
  article {
  height: 35px;
  width: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  animation: launchFirework 1s;
  animation-duration: 1s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-in-out;
  animation-delay: 0s, 0.7s;
  position: absolute;
  top: 0;
  left: -5px;
}

@keyframes launchFirework {
  from {
    transform: translate(0px, 0px);
  }

  to {
    transform: translate(0px, -300px);
  }
}

@keyframes hideLaunch {
  from {
    opacity: 1;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

body section:nth-of-type(2) article ul {
  height: 100%;
  width: 100%;
  position: relative;
  z-index: -1;
  margin: 0;
  padding: 0;

  li {
    list-style-type: none;
    position: absolute;
    width: 15px;
    height: 15px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-out;
    border-radius: 50%;
    aspect-ratio: 1/1;
    z-index: -1;
    list-style-type: none;
  }
}

/* Firework mode 1: Explode in sphere */

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article ul li {
  background-color: var(--cyan);
  box-shadow: var(--cyan) 0px 0px 10px;
  animation-name: explodeSphere, hideLaunch;
  animation-delay: 1.5s, 1.7s;
  animation-duration: 1.5s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-in-out;
}

@keyframes explodeSphere {
  from {
    top: 50%;
    left: 50%;
    transform: translate(-55%, -55%);
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  to {
    top: var(--explode-top, 150px);
    left: var(--explode-left, 50%);
    opacity: 1;
  }
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(1) {
  --explode-top: -120px;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(2) {
  --explode-top: 140px;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(3) {
  --explode-top: 50%;
  --explode-left: 150px;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(4) {
  --explode-top: 50%;
  --explode-left: -110px;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(5) {
  --explode-top: 290%;
  --explode-left: 290%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(6) {
  --explode-top: 290%;
  --explode-left: -190%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(7) {
  --explode-top: -190%;
  --explode-left: 290%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(8) {
  --explode-top: -190%;
  --explode-left: -190%;
}


/* Firework mode 2: Explode in a heart */

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article ul li {
  background-color: var(--magenta);
  box-shadow: var(--magenta) 0px 0px 10px;
  list-style-type: none;
  z-index: -1;  
  animation-name: explodeHeart, hideLaunch;
  animation-delay: 1.5s, 1.9s;
  animation-duration: 1s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-in-out;
  border-radius: 50%;
  aspect-ratio: 1/1;
}

@keyframes explodeHeart {
  from {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  to {
    top: var(--explode-top, 50%);
    left: var(--explode-left, 50%);
    opacity: 0;
  }
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(1) {
  --explode-top: -250%;
  --explode-left: -210%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(2) {
  --explode-top: -60%;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(3) {
  --explode-top: -250%;
  --explode-left: 310%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(4) {
  --explode-top: 0%;
  --explode-left: -350%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(5) {
  --explode-top: 0%;
  --explode-left: 460%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(6) {
  --explode-top: 240%;
  --explode-left: -210%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(7) {
  --explode-top: 440%;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(8) {
  --explode-top: 240%;
  --explode-left: 300%;
}


/* Firework mode 3: Explode in star */

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article ul{
  animation-name: fireworkRotate;
  animation-delay: 2s;
  animation-duration: 4s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-in-out;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article ul li{
  background-color: var(--gold);
  box-shadow: var(--gold) 0px 0px 10px;
  animation-name: explodeStar, twinkle, hideLaunch;
  animation-delay: 1.5s, 3s, 4.5s;
  animation-duration: 1.5s, 3s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-in-out;
}

@keyframes fireworkRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes explodeStar {
  from {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(0.1);
  }

  to {
    top: var(--explode-top, 50%);
    left: var(--explode-left, 50%);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes twinkle {
  from {
    opacity: 1;
  }

  10% {
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  30% {
    opacity: 0;
  }

  40% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  60% {
    opacity: 1;
  }

  70% {
    opacity: 0;
  }

  80% {
    opacity: 1;
  }

  90% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(1) {
  --explode-top: -120px;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(2) {
  --explode-top: 140px;
  --explode-left: 50%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(3) {
  --explode-top: 50%;
  --explode-left: 150px;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(4) {
  --explode-top: 50%;
  --explode-left: -110px;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(5) {
  --explode-top: 150%;
  --explode-left: 160%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(6) {
  --explode-top: 150%;
  --explode-left: -70%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(7) {
  --explode-top: -100%;
  --explode-left: 160%;
}

body:has(section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) article ul li:nth-of-type(8) {
  --explode-top: -100%;
  --explode-left: -70%;
}

/** End Firework Launching **/

/** Sidebar **/

body section:nth-of-type(1) {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  height: 100%;
  width: 175px;
  z-index: 5;
  top: 0;

  &:after {
    width: 400px;
  }

  ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    margin: 0;
    background: repeating-linear-gradient(90deg, var(--lightBrown), var(--lightBrown) 30px, var(--darkBrown) 30px, var(--darkBrown) 32px);
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    border: 10px solid var(--darkBrown);
    border-left: none;
  
    li {
      list-style-type: none;
      position: relative;
      display: flex;
      justify-content: center;
      width: 100px;
      height: 100px;
      background-color: var(--darkBlueGray);
      border-radius: 50%;
      aspect-ratio: 1/1;
  
      &:not(:first-of-type) {
        margin-top: 30px;
      }
  
      input[type="radio"] {
        appearance: none;
        border-radius: 50%;
        aspect-ratio: 1;
        position: relative;
        margin: 0;
        border: 6px solid lightgray;
        width: 100px;
        height: 100px;
      }
    }
  } 
}

body section:nth-of-type(1) ul li input[type="radio"]:checked {
  box-shadow: var(--red) 0px 0px 30px 0px;
}

body section:nth-of-type(1) ul li input[type="radio"]:hover {
  cursor: pointer;
}

body section:nth-of-type(1) ul > input[type="checkbox"] {
  appearance: none;
}

body section:nth-of-type(1) ul > label {
  display: none;
}

@media only screen and (max-width: 600px) {
  body section:nth-of-type(1) {
    width: 90%;

    ul {
      align-items: flex-start;
      padding: 40px 20px;
      position: relative;

      > label {
        position: absolute;
        right: -20px;
        top: -30px;
        background: var(--red);
        color: var(--white);
        padding: 15px;
        border-radius: 50%;
        aspect-ratio: 1 / 1;
        width: 10px;
        height: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      li {
        width: 80px;
        height: 80px;

        input[type="radio"] {
          width: 80px;
          height: 80px;
        }
      }
    }
  }

  body:has(section:nth-of-type(1) ul > input[type="checkbox"]:checked) section:nth-of-type(1) {
    width: 125px;
  }

  body:has(section:nth-of-type(1) ul > input[type="checkbox"]:checked) section:nth-of-type(5), 
  body:has(section:nth-of-type(1) ul > input[type="checkbox"]:checked) section:nth-of-type(4){
    opacity: 0;
  }
}

body section:nth-of-type(1) ul li:nth-of-type(1) input[type="radio"] {
  background: url('../img/firework-ball.png');
  background-size: 65%;
  background-repeat: no-repeat;
  background-position: center;
}

body section:nth-of-type(1) ul li:nth-of-type(2) input[type="radio"] {
  background: url('../img/firework-heart.png');
  background-size: 65%;
  background-repeat: no-repeat;
  background-position: center;
}

body section:nth-of-type(1) ul li:nth-of-type(3) input[type="radio"] {
  background: url('../img/firework-star.png');
  background-size: 65%;
  background-repeat: no-repeat;
  background-position: center;
}

/* End of sidebar */

/** --- MOON & SUN --- **/

section:nth-of-type(3){
  position: absolute;
  top: 100px;
  right: 10%;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background-color: var(--sunBackground);
  box-shadow: 0 0 45px 5px var(--yellow),0 0 65px 10px var(--yellow) inset;
}

@media only screen and (max-width: 600px) {
  section:nth-of-type(3) {
    width: 85px;
    height: 85px;
  }
}

body:has(article div input[type="checkbox"]:checked) section:nth-of-type(3) {
  box-shadow: none;
  background: linear-gradient(50deg, var(--white) 0%, var(--white) 30%, var(--white) 100%);
  box-shadow: 0 0 10px 2px var(--white);
  pointer-events: none;
}

/* Big dot on the moon */

body:has(article div input[type="checkbox"]:checked) section:nth-of-type(3) div:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 30px;
  left: 25px;
  background: linear-gradient(50deg, var(--moonDot) 0%, var(--moonDot) 30%, var(--moonDot) 100%);
  border-radius: 50%;
}

/* Small dot on the moon */

body:has(article div input[type="checkbox"]:checked) section:nth-of-type(3) div:after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  top: 60px;
  left: 20px;
  background-color: var(--moonDot);
  border-radius: 50%;
}

/* End of sun and moon */

/* --- ZOOM BUTTONS --- */

section:nth-of-type(4) {
  height: max-content;
  width: max-content;
  position: absolute;
  bottom: 100px;
  right: 100px;

  ul {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0;

    li {
      list-style-type: none;
      display: flex;
      justify-content: center;

      input[type="radio"] {
        appearance: none;
        border: 4px solid var(--red);
        aspect-ratio: 1;
        position: relative;
        margin: 0;
        width: 75px;
        height: 75px;
        border-radius: 10px;

        &:hover {
          cursor: pointer;
        }

        &:checked {
          background-color: var(--red);
        }
      }
    }
  }
}

/* Zoom buttons */

section:nth-of-type(4) ul li input[type="radio"]:before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(10deg);
  content: var(--zoomContent);
  font-size: 22px;
  font-weight: bold;
  color: var(--white);
}

section:nth-of-type(4) ul li:first-of-type input[type="radio"]:before {
  --zoomContent: "1x";
}

section:nth-of-type(4) ul li:nth-of-type(2) input[type="radio"]:before {
  --zoomContent: "2x";
}

section:nth-of-type(4) ul li:last-of-type input[type="radio"]:before {
  --zoomContent: "3x";
}

/* Zoom function on screen (2x zoom) */

body:has(section:nth-of-type(4) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) div:last-of-type {
  height: 18vh;
}

body:has(section:nth-of-type(4) ul li:nth-of-type(2) input[type="radio"]:checked) section:nth-of-type(2) div:first-of-type {
  transform: scale(0.8) translate(-50%);
  bottom: 14%;
}

/* Zoom function on screen (3x zoom) */

body:has(section:nth-of-type(4) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) div:last-of-type {
  height: 12vh;
}

body:has(section:nth-of-type(4) ul li:nth-of-type(3) input[type="radio"]:checked) section:nth-of-type(2) div:first-of-type {
  transform: scale(0.6) translate(-50%);
  bottom: 9%;
}

@media only screen and (max-width: 600px) {
  section:nth-of-type(4) {
    z-index: 6;
    bottom: 260px;
    right: 45%;

    ul {
      flex-direction: column;
    }
  }
}

@media only screen and (min-width: 600px) {
  section:nth-of-type(4) {
    z-index: 6;
    bottom: 70px;
    right: 160px;

    ul {
      flex-direction: column;
    }
  }
}

@media only screen and (min-width: 1200px) {
  section:nth-of-type(4) {
    z-index: 6;
    bottom: 135px;
    right: 50px;

    ul {
      flex-direction: row;
    }
  }
}

/* End of zoom */

/* --- FIREWORK POWER --- */

section:nth-of-type(5) {
  height: max-content;
  width: max-content;
  position: absolute;
  bottom: 200px;
  right: 100px;
  opacity: 1;

  ul {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0;

    li {
      list-style-type: none;
      display: flex;
      justify-content: center;

      input[type="radio"] {
        appearance: none;
        border: 4px solid var(--red);
        aspect-ratio: 1;
        position: relative;
        margin: 0;
        width: 75px;
        height: 75x;
        border-radius: 10px;

        &:before {
          content: "";
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          width: 40px;
          height: 40px;
          background-size: 100%;
        }

        &:hover {
          cursor: pointer;
        }

        &:checked {
          background-color: var(--red);
        }
      }
    }
  }
}

/* Firework power buttons */

section:nth-of-type(5) ul li input[type="radio"]:hover:before {
  animation: moveIcon 0.2s infinite alternate;
}

@keyframes moveIcon{
  from {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  to {
    top: 45%;
    left: 55%; 
  }
}

section:nth-of-type(5) ul li:first-of-type input[type="radio"]:before {
  background-image: url('../img/rocket-power1.svg');
}

section:nth-of-type(5) ul li:nth-of-type(2) input[type="radio"]:before {
  background-image: url('../img/rocket-power2.svg');
}

section:nth-of-type(5) ul li:last-of-type input[type="radio"]:before {
  background-image: url('../img/rocket-power3.svg');
}

/* Firework function - Power 1 */

body:has(section:nth-of-type(5) ul li:first-of-type input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article {
  animation-name: launchFirework;
  animation-delay: 0s, 1.7s;
  animation-duration: 1.5s, 1.5s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-out;
  z-index: -1;
}

/* Firework function - Power 2 */

body:has(section:nth-of-type(5) ul li:nth-of-type(2) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article {
  animation-name: firePower2;
  animation-delay: 0s, 1.7s;
  animation-duration: 1.5s, 1.5s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-out;
}

/* Firework function - Power 3 */

body:has(section:nth-of-type(5) ul li:nth-of-type(3) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) section:nth-of-type(2) article {
  animation-name: firePower3;
  animation-delay: 0s, 1.7s;
  animation-duration: 1.5s, 1.5s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-out;
}

/* Power animations */

@keyframes firePower2 {
  from {
    transform: translate(0px, 0px) ;
  }

  to {
    transform: translate(0px, -600px);
  }
}

@keyframes firePower3 {
  from {
    transform: translate(0px, 0px);
  }

  to {
    transform: translate(0px, -800px);
  }
}

@media only screen and (max-width: 600px) {
  section:nth-of-type(5) {
    z-index: 6;
    bottom: 260px;
    right: 15%;

    ul {
      flex-direction: column;
    }
  }
}

@media only screen and (min-width: 600px) {
  section:nth-of-type(5) {
    z-index: 6;
    bottom: 70px;
    right: 50px;

    ul {
      flex-direction: column;
    }
  }
}

@media only screen and (min-width: 1200px) {
  section:nth-of-type(5) {
    bottom: 240px;
    right: 50px;

    ul {
      flex-direction: row;
    }
  }
}

/* Move letter in title animation */

body:has(section:nth-of-type(4) ul li:nth-of-type(1) input[type="radio"]:checked):has(section:nth-of-type(5) ul li:nth-of-type(3) input[type="radio"]:checked):has(section:nth-of-type(2) input[type="checkbox"]:checked) > div span:nth-of-type(3){
  animation-name: letterFly;
  animation-delay: .55s;
  animation-duration: 6s;
  animation-fill-mode: forwards;
  transition-timing-function: ease-out;
}

@keyframes letterFly {
  from {
    transform: translateY(0) scale(1) rotate(0deg);
  }

  6% {
    transform: translateY(-200px) scale(1);
  }

  100% {
    transform: translate(650px, 30px) scale(0.01) rotate(360deg);
  }
}

/* End of firework power */


/* --- ALERT POPUP --- */

section:nth-of-type(6) {
  width: 300px;
  height: 200px;
  padding: 30px;
  background-color: var(--alertPopup);
  border: 3px solid var(--red);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  z-index: 6;

  input[type="checkbox"] {
    appearance: none;
    position: absolute;
    height: 0;
    width: 0;
    cursor: pointer;
  }

  label {
    color: var(--red);
    border: 2px solid var(--red);
    padding: 10px 20px;
    transition: 0.3s ease-in-out;

    &:hover {
      background-color: var(--red);
      color: var(--white);
      cursor: pointer;
    }
  }
}

body :not(section:nth-of-type(6)) * {
  filter: blur(4px);
  pointer-events: none;
}

body:has(section:nth-of-type(6) input[type="checkbox"]:checked) section:nth-of-type(6) {
  display: none;
}

body:has(section:nth-of-type(6) input[type="checkbox"]:checked) :not(section:nth-of-type(6)) {
  filter: none;
}

body:has(section:nth-of-type(6) input[type="checkbox"]:checked) :not(section:nth-of-type(2) div label) {
  pointer-events: all;
}

/* End of popup */


/* --- STYLE QUERIES --- */

html:has(input[name="dayNightMode"]:checked) {
  --dayAndNight: night;
}

@container style(--dayAndNight:night) {
  body {
    --skyColor1: rgb(0, 0, 0, 1);
    --skyColor2: rgb(30, 100, 151);
  }

  body section:nth-of-type(2) div:last-of-type label {
    border-color: var(--red);
    color: var(--red);
    pointer-events: all;
    border-radius: 10px;
  }
  
  body section:nth-of-type(2) div:last-of-type label:hover {
    color: var(--white);
  }
}

/* End of style queries */