*::before, *, *::after{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Feris wheel - 7-686 */
:root{
  --time: 9s;
}

body:not(.cabin){
  overflow: hidden;
}

/* Turns the checkmarks invisable, but the labels make it oporational still */
input[type="checkbox"] {
  display: none;
}

.queue,
.wheel {
  pointer-events: none;
  opacity: 0.5;
}

#toggle:checked ~ .queue,
#toggle:checked ~ .wheel {
  pointer-events: auto;
  opacity: 1;
}

#toggle{
  display: none;
}

#toggle:checked ~ .wheel{
  animation-play-state: paused;
}

#toggle:checked ~ .wheel .cabin{
  animation-play-state: paused;
}

#toggle:checked ~ .wheel .cabin:not(.filled){
  opacity: 0.4;
}

.btn{
  position: absolute;
  top: 150px;
  left: 900px;
  padding: 10px 16px;
  background: #222;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  font-family: sans-serif;
}

.mode-btn{
  position: absolute;
  top: 725px;
  left: 9px;
  padding: 10px 16px;
  background: #000000;
  color: white;
  cursor: pointer;
  border-radius: 6px;
  font-family: sans-serif;
  font-size: 12px;
}

.mode-btn:hover{
  background: #444;
}

.wheel {
  border: 2px solid black;
  border-radius: 50%;
  margin-left: 800px;
  margin-top: 280px;
  position: absolute;
  height: 25vw;
  width: 25vw;
  max-width: 500px;
  max-height: 500px;
  animation-name: wheel;
  animation-duration: 10s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.line {
  background-color: black;
  width: 50%;
  height: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;
}

.line:nth-of-type(2) {
  transform: rotate(60deg);
}
.line:nth-of-type(3) {
  transform: rotate(120deg);
}
.line:nth-of-type(4) {
  transform: rotate(180deg);
}
.line:nth-of-type(5) {
  transform: rotate(240deg);
}
.line:nth-of-type(6) {
  transform: rotate(300deg);
}

.cabin {
  background-color: #aaa;
  transition: background-color 0.3s, box-shadow 0.3s;
  border-radius: 20px;
  width: 20%;
  height: 20%;
  position: absolute;
  top: 50%;
  left: 50%;
  border: 2px solid;
  transform-origin: center;
  animation: none;
}
.cabin:nth-of-type(1) {
  transform: translate(-160%, -50%) rotate(0deg) translateY(-13vw);
}
.cabin:nth-of-type(2) {
  transform: translate(-150%, -130%) rotate(60deg) translateY(-15vw);
}
.cabin:nth-of-type(3) {
  transform: translate(-3%, -150%) rotate(120deg) translateY(-13vw);
}
.cabin:nth-of-type(4) {
  transform: translate(50%, -50%) rotate(180deg) translateY(-12vw);
}
.cabin:nth-of-type(5) {
  transform: translate(-35%, 70%) rotate(240deg) translateY(-10vw);
}
.cabin:nth-of-type(6) {
  transform: translate(-90%, 70%) rotate(300deg) translateY(-12vw);
}

@keyframes wheel {
   0% {
     transform: rotate(0deg);
   }
   100% {
     transform: rotate(360deg);
   }
}

@keyframes cabins {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue .customer{
  pointer-events: none;
  opacity: 0.4;
  transition: 0.3s;
}

#toggle:checked ~ .queue .customer:first-child{
  pointer-events: auto;
  opacity: 1;
}

#fill1:checked ~ .wheel .cabin:nth-of-type(1){
  background-color: orange;
  opacity: 1;
  box-shadow: none;
}

#fill1:checked ~ .wheel .cabin:nth-of-type(2){
  background-color: limegreen;
  box-shadow: 0 0 15px limegreen;
  opacity: 1;
}


#fill2:checked ~ .wheel .cabin:nth-of-type(3){
  background-color: orange;
  opacity: 1;
  box-shadow: none;
}

#fill3:checked ~ .wheel .cabin:nth-of-type(4){
  background-color: limegreen;
  box-shadow: 0 0 15px limegreen;
  opacity: 1;
}


#fill3:checked ~ .wheel .cabin:nth-of-type(3){
  background-color: orange;
  opacity: 1;
  box-shadow: none;
}


#fill4:checked ~ .wheel .cabin:nth-of-type(4){
  background-color: orange;
  opacity: 1;
  box-shadow: none;
}

#fill4:checked ~ .wheel .cabin:nth-of-type(5){
  background-color: limegreen;
  box-shadow: 0 0 15px limegreen;
  opacity: 1;
}


#fill5:checked ~ .wheel .cabin:nth-of-type(5){ background-color: orange;
  opacity: 1;
  box-shadow: none;
}

#fill6:checked ~ .wheel .cabin:nth-of-type(6) {
  background-color: orange;
  opacity: 1;
  box-shadow: none;
}

#fill5:checked ~ .wheel .cabin:nth-of-type(6)
{
  background-color: limegreen;
  box-shadow: 0 0 15px limegreen;
  opacity: 1;
}


#fill1:checked ~ .wheel .cabin.cabin:nth-of-type(1)::after, #fill2:checked ~ .wheel .cabin.cabin:nth-of-type(2)::after, #fill3:checked ~ .wheel .cabin.cabin:nth-of-type(3)::after, #fill4:checked ~ .wheel .cabin.cabin:nth-of-type(4)::after, #fill5:checked ~ .wheel .cabin.cabin:nth-of-type(5)::after, #fill6:checked ~ .wheel .cabin.cabin:nth-of-type(6)::after{
  content: "🧑‍🤝‍🧑";
  color: #fff;
  font-size: 2rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#fill1:checked ~ .queue .customer:nth-child(1) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

#fill1:checked ~ .queue .customer:nth-child(2) {
  pointer-events: auto;
  opacity: 1;
}

/* STEP 2 */
#fill2:checked ~ .queue .customer:nth-child(2) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

#fill2:checked ~ .queue .customer:nth-child(3) {
  pointer-events: auto;
  opacity: 1;
}

/* STEP 3 */
#fill3:checked ~ .queue .customer:nth-child(3) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

#fill3:checked ~ .queue .customer:nth-child(4) {
  pointer-events: auto;
  opacity: 1;
}

#fill4:checked ~ .queue .customer:nth-child(4) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

#fill4:checked ~ .queue .customer:nth-child(5) {
  pointer-events: auto;
  opacity: 1;
}

#fill5:checked ~ .queue .customer:nth-child(5) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

#fill5:checked ~ .queue .customer:nth-child(6) {
  pointer-events: auto;
  opacity: 1;
}

#fill6:checked ~ .queue .customer:nth-child(6) {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

.loading{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: sans-serif;
  font-size: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 5;
}

#toggle:checked ~ .loading{
  opacity: 1;
}

.timer{
  width: 200px;
  height: 12px;
  background: lime;
transform-origin: left;
transform: scaleX(1);
z-index: 0;
}

#toggle:checked ~ .loading .timer{
  animation: drain var(--time) linear forwards;
}

@keyframes drain {
  from {
    width: 200px;
  }
  to {
    width: 0;
  }
}

.win{
  position: absolute;
  inset:0;
  background: rgba(0, 120, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f7f7f7;
  font-family: sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

#fill1:checked
~ #fill2:checked
~ #fill3:checked
~ #fill4:checked
~ #fill5:checked
~ #fill6:checked
~ .win {
  opacity: 1;
  pointer-events: auto;
}

.game-over{
  position: absolute;
  inset: 0;
  background: rgba(120, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f7f7f7;
  font-family: sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

#fill1:checked
~ #fill2:checked
~ #fill3:checked
~ #fill4:checked
~ #fill5:checked
~ #fill6:checked
~ .game-over {
  animation: none;
  opacity: 0;
  pointer-events: none;
}


#toggle:checked ~ .game-over{
  animation: showGameOver 0s linear var(--time) forwards;
}

@keyframes showGameOver{
  to {
    opacity: 1;
    pointer-events: auto;
  }
}

.win, .game-over{
  z-index: 10;
}

.reset-btn{
  margin-top: 20px;
  padding: 10px 16px;
  background: white;
  color: black;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}

.reset-btn:hover{
  background: black;
  color: white;
}


.customer{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 30rem;
}

.head {
  width: 42px;
  height: 42px;
  background-color: #f2c94c;
  border-radius: 50%;
  position: relative;
}

.eye {
  width: 6px;
  height: 6px;
  background-color: #111;
  border-radius: 50%;
  position: absolute;
  top: 12px;
}

.eye.left {
  left: 9px;
}

.eye.right {
  right: 9px;
}

.body {
  background-color: #eb5757;
}

.body, .body1, .body2, .body3, .body4, .body5{
  width: 25px;
  height: 28px;
  border-radius: 10px;
}

/* Day */
.body1{
  background-color: rgb(8, 97, 97);
}

.body2{
  background-color: rgb(9, 94, 37);
}

.body3{
  background-color: blueviolet;
}

.body4{
  background-color:coral;
}

.body5{
  background-color: rgb(122, 77, 8);
}

.c1{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 26rem;
}


.c2{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 22rem;
}


.c3{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 18rem;
}


.c4{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 14rem;
}


.c5{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  position: absolute;
  bottom: 15rem;
  left: 10rem;
}

body {
    /* Night */
    
        background: radial-gradient(
        closest-corner circle at 15% 15%,
        #ccc,
        #ccc 20%,
        #445 21%,
        rgb(2, 2, 65) 90%
      );
}

/* Day */
.scene{
  background: radial-gradient(
        closest-corner circle at 15% 15%,
        #faf602,
        #faf602 20%,
        rgb(233, 229, 7) 21%,
        rgba(19, 245, 234, 0.4) 80%
      );
}

.scene:has(#mode:checked){
  background: radial-gradient(
        closest-corner circle at 15% 15%,
        #ccc,
        #ccc 20%,
        #445 21%,
        rgb(2, 2, 65) 90%
      );
}

body::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 9%;
  background: repeating-linear-gradient(
    45deg,
    #d32f2f,
    #d32f2f 20px,
    #fbc02d 20px,
    #fbc02d 40px
  );
}

.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.loading, .win, .game-over{
  position: fixed;
  inset: 0;
}


@media (prefers-reduced-motion: reduce) {
  .wheel,
  .cabin{
    animation: none;
  }

  * {
    transition: none !important;
  }
}

/* tablets */

@media (max-width: 768px){
.scene{
position: relative; 
transform-origin: bottom left;
}
.wheel{
  right: 12%;
  bottom: 40%;
}
.cabin{
  border-radius: 10px;
}
.btn{
left: 600px;
}
.customer{
  left: 22rem;
}
.c1{
  left: 18rem;
}
.c2{
  left: 14rem;
}
.c3{
  left: 10rem;
}
.c4{
  left: 6rem;
}
.c5{
  left: 2rem;
}

.mode-btn{
  top: 900px;
  left: 3px;
}
}

/* phones */
@media (max-width: 480px){
  .btn{
    left: 300px;
  }
.mode-btn{
  top: 900px;
  left: 3px;
}

  .customer{
  left: 18rem;
}
.c1{
  left: 15rem;
}
.c2{
  left: 12rem;
}
.c3{
  left: 9rem;
}
.c4{
  left: 6rem;
}
.c5{
  left: 3rem;
} 
}