input.star {
  display: none;
}

form.form_stars {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  width: max-content;
}

label.star {
  display: inline-block;
  width: 56px;
  height: 44px;
  background: linear-gradient(187deg, #8a8a8a 40%, #ffffff 200%);
  -webkit-mask: url("../../images/stroke2.svg") no-repeat center;
  -webkit-mask-size: contain;
  mask: url("../../images/stroke2.svg") no-repeat center;
  mask-size: contain;
  cursor: pointer;
  margin-top: -6px;
  transition: all 0.18s;
  position: relative;
  z-index: 2; 
}

label.star:hover,
label.star:hover ~ label.star,
input.star:checked ~ label.star {
  -webkit-mask: url("../../images/starrate.svg") no-repeat center;
  -webkit-mask-size: contain;
  mask: url("../../images/starrate.svg") no-repeat center;
  mask-size: contain;
}
.form_stars:not(:hover) input.star:checked ~ label.star {
  background: linear-gradient(187deg, #e5d93c 40%, #ffffff 200%);
}

label.star-1:hover,
label.star-1:hover ~ label.star {
  background: linear-gradient(187deg, #ff4f4f 40%, #ffffff 200%);
}
label.star-2:hover,
label.star-2:hover ~ label.star {
  background: linear-gradient(187deg, #f67258 40%, #ffffff 200%);
}
label.star-3:hover,
label.star-3:hover ~ label.star {
  background: linear-gradient(187deg, #ff8f31 40%, #ffffff 200%);
}
label.star-4:hover,
label.star-4:hover ~ label.star {
  background: linear-gradient(187deg, #8a7bff 40%, #ffffff 200%);
}
label.star-5:hover,
label.star-5:hover ~ label.star {
  background: linear-gradient(187deg, #7ba5ff 40%, #ffffff 200%);
}

.stars-average {
  position: absolute;
  top: 6px;
  left: 0;
  height: 44px;
  width: 0; 
  background: linear-gradient(187deg, #e5d93c 40%, #ffffff 200%);
  -webkit-mask: url("../../images/starrate.svg") repeat-x;
  -webkit-mask-size: 56px 44px;
  mask: url("../../images/starrate.svg") repeat-x;
  mask-size: 56px 44px;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.15s;
}

form.form_stars:hover .stars-average {
  opacity: 0;
}

form.form_stars.voted .stars-average {
  display: none;
}
