@font-face {
  font-family: "Gameplay";
  src: url("gamefont.ttf");
}

html,
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  --font-color: white;
  --font-border-color: black;
}

h1 {
  position: absolute;
  z-index: -3;
  font-size: 0.1rem;
}

#game label:has(:checked),
body #game {
  cursor: url("../assets/cursor-idle.png"), auto !important;
}

main > section,
main {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

input[type="checkbox"] {
  display: none;
}

#game {
  position: fixed;
  top: 0px;
  left: 0px;
  height: 100%;
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;

  /* Gameset */
  & #scene {
    position: absolute;
    height: 100%;
    aspect-ratio: 32/9;
    background-image: url("../assets/background.png");
    overflow: hidden;
    background-size: cover;

    & label {
      position: absolute;
      transform: scale(0);
      will-change: transfrom;
    }
  }

  & #count-down {
    position: fixed;

    & h2 {
      font-size: 0.001rem;
      color: black;
    }
  }

  & #board {
    position: fixed;

    & h2 {
      font-size: 0.001rem;
      color: black;
    }
  }

  & #honeystate {
    position: fixed;
  }

  /* Mouse-Pointer */
  & label:has(:not(:checked)) {
    cursor: url("../assets/cursor.png"), auto !important;
  }

  & label:has(:not(:checked)):active {
    cursor: url("../assets/cursor-clicked.png"), auto !important;
  }

  /* Counter */
  counter-reset: gamepoints;

  & label:has(:checked) {
    counter-increment: gamepoints;
  }

  /* Honeystate */
  & #honeystate {
    bottom: 20px;
    right: 10px;
    display: flex;
    flex-direction: row;

    & ul {
      margin: 0;
      padding: 0;
      list-style-type: none;
      display: flex;
      flex-flow: row;
      position: absolute;
      left: -650px;
      bottom: 115px;

      & li {
        position: relative;
        width: 73px;
      }
      & li img {
        position: absolute;
      }
    }
    & svg {
      width: 180px;
      height: 180px;
      background-color: rgba(0, 0, 0, 0.5);
      border-radius: 50%;
      padding: 10px;
      bottom: 10px;
    }
  }

  /* Overlay */
  & aside:has(:checked) {
    z-index: -1 !important;
    display: none;
  }
  & aside {
    position: fixed;
    width: 100%;
    height: 100%;
    bottom: 0;
    z-index: calc(calc(2 * var(--prod)) - 1);
    --sec: calc(calc(1.5 * var(--prod)) * 1s);

    & label {
      width: 180px;
      height: 180px;
      border-radius: 50%;
      padding: 10px;
      bottom: 20px;
      animation: neonred var(--sec) ease-in-out infinite alternate;
      position: absolute;
      right: 10px;
      display: block;
    }

    & span {
      font-size: 2rem;
      font-family: "Gameplay";
      display: inline-block;
      position: absolute;
      left: -660px;
      top: 100px;
      color: white;
      animation: neonred var(--sec) ease-in-out infinite alternate;
      background-color: rgba(255, 200, 200, 0.5);
      padding: 30px 140px;
      text-shadow: 2px 2px 1px black, -2px -2px 1px black, 2px -2px 1px black, -2px 2px 1px black;
    }
  }
}

/* Board */
#board h2::after {
  content: counter(gamepoints) "/81";
  font-size: 80px;
  border-color: var(--font-border-color);
  text-shadow: 2px 2px 1px var(--font-border-color), -2px -2px 1px var(--font-border-color),
    2px -2px 1px var(--font-border-color), -2px 2px 1px var(--font-border-color);
  position: absolute;
  left: 10px;
  top: 0;
  font-family: Gameplay;
  z-index: 1;
  color: var(--font-color);
}

/* Countdown */
#count-down {
  --font-size: 80px;
  font-family: Gameplay;
  z-index: 1;
  color: var(--font-color);
  position: absolute;
  right: 10px;

  & h2 {
    margin: 0;
    padding: 0;
    text-shadow: 2px 2px 1px var(--font-border-color), -2px -2px 1px var(--font-border-color),
      2px -2px 1px var(--font-border-color), -2px 2px 1px var(--font-border-color);
  }

  & span {
    font-size: 20px;
  }
}

main:has(#start details ol :checked) #count-down {
  & span::before {
    color: var(--font-color);
    content: "9";
    font-size: var(--font-size);
    animation: counttens 90s step-end 1 forwards;
    animation-delay: 1s;
  }

  & span::after {
    color: var(--font-color);
    content: "0";
    font-size: var(--font-size);
    animation: countones 10s step-end 9 forwards;
    animation-delay: 1s;
  }
}

#game {
  display: none;
}

main:has(#start details ol :checked) #start {
  display: none;
}

main:has(#start details ol :checked) #game {
  display: block;
}

#gameover {
  left: 50%;
  top: -50%;
  position: absolute;
  width: 0px;
  height: 0px;
  z-index: 5;
  background-color: rgb(0, 0, 0, 0.7);
  overflow: hidden;
  border: 0;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  --border-color: #ff5b00;
  --background-color: #ff9700;

  & h2 {
    font-family: Gameplay;
    color: var(--font-color);
    font-size: 150px;
    margin: 0;
    padding: 0;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff5200, 0 0 35px #ff5200, 0 0 40px #ff5200,
      0 0 50px #ff5200, 0 0 75px #ff5200;
  }

  & button {
    cursor: pointer;
    padding: 10px 20px;
    border: 5px solid var(--border-color);
    border-radius: 5px;
    margin: 10px;
    font-family: Gameplay;
    background-color: var(--background-color);
    display: inline-block;
    width: fit-content;
    font-size: 35px;
  }
}

main:has(#start details ol :checked) #gameover {
  animation: gameOver 1s linear 91s forwards;
}

@keyframes gameOver {
  from {
    height: 0px;
    width: 0px;
    left: 50%;
    top: -50%;
  }
  to {
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
  }
}

@keyframes counttens {
  0% {
    content: "8";
  }
  11.111111% {
    content: "7";
  }
  22.222222% {
    content: "6";
  }
  33.333333% {
    content: "5";
  }
  44.444444% {
    content: "4";
  }
  55.555555% {
    content: "3";
  }
  66.666666% {
    content: "2";
  }
  77.777777% {
    content: "1";
  }
  88.888888% {
    content: "";
  }
  100% {
    content: "";
  }
}

@keyframes countones {
  0% {
    content: "9";
  }
  10% {
    content: "8";
  }
  20% {
    content: "7";
  }
  30% {
    content: "6";
  }
  40% {
    content: "5";
  }
  50% {
    content: "4";
  }
  60% {
    content: "3";
  }
  70% {
    content: "2";
  }
  80% {
    content: "1";
  }
  90%,
  100% {
    content: "0";
  }
}

@keyframes neonred {
  from {
    box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff5200, 0 0 35px #ff5200, 0 0 40px #ff5200,
      0 0 50px #ff5200, 0 0 75px #ff5200;
  }
  to {
    box-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 7px #fff, 0 0 10px #ff5200, 0 0 17px #ff5200, 0 0 20px #ff5200,
      0 0 25px #ff5200, 0 0 37px #ff5200;
  }
}
