
body {
 
  margin: 0px;
  counter-reset: points;
  
  display: inline;
  flex-direction: column-reverse;
  --gameLength: 20s;
}

#points {
  text-align: center;
  width: 100%;
  color: #575757;
  position: relative;
  margin: 0px;
  padding: 10px 0px;
}

@keyframes timer {
  0% {
    transform: scaleX(1);
  }
  98%, 100% {
    transform: scaleX(0);
  }
}
#points:after {
  content: '';
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  background: #3eb489;
  opacity: 0.4;
  transform-origin: left;
  animation: timer var(--gameLength) linear;
  animation-fill-mode: forwards;
}



#game {
  position: relative;
  width: 100%;
  height: 100%;
}

#field {
  
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 80vw;
  height: 80vw;
  max-width: 80vh;
  max-height: 80vh;
  margin: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-gap: 10px;
  background: #3eb489;
  border-radius: 20px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

@keyframes gameEndBackground {
  0%, 98% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.7;
  }
}
#field:before {
  content: "";
  font-size: 30px;
  text-align: center;
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 2;
  animation: gameEndBackground var(--gameLength) linear;
  animation-fill-mode: forwards;
}

@keyframes gameEndFont {
  0%, 98% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
#field:after {
  content: "Вие имате откъснати " counter(points) " целини от 16 саксийки.";
  font-size: 30px;
  color: #575757;
  text-align: center;
  position: absolute;
  pointer-events: none;
  top: 50%;
  left: 50%;
  right: -50%;
  transform: translate(-50%, -60%);
  animation: gameEndFont var(--gameLength) linear;
  animation-fill-mode: forwards;
  z-index: 3;
}

#field > div {
  border: solid gray 10px;
  border-radius: 50%;
  overflow: hidden;
}

#field > div {
  border: solid #b44e3e 10px;
  background: #f5fcf9;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  -webkit-touch-callout: none;
  /* iOS Safari */
  -webkit-user-select: none;
  /* Safari */
  -khtml-user-select: none;
  /* Konqueror HTML */
  -moz-user-select: none;
  /* Old versions of Firefox */
  -ms-user-select: none;
  /* Internet Explorer/Edge */
  user-select: none;
}

@keyframes rise {
  0%, 30%, 100% {
    transform: translateY(100%);
  }
  15% {
    transform: translateY(0%);
  }
}
#field > div > input {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0px;
  transform: translateY(100%);
  -webkit-appearance: none;
  background-position: center;
  background-size: contain;
}

#field > div:nth-of-type(1) > input {
  animation: rise 7s ease 2.6s infinite;
}

#field > div:nth-of-type(2) > input {
  animation: rise 6s ease 5.4s infinite;
}

#field > div:nth-of-type(3) > input {
  animation: rise 6s ease 8.6s infinite;
}

#field > div:nth-of-type(4) > input {
  animation: rise 7s ease 1.6s infinite;
}

#field > div:nth-of-type(5) > input {
  animation: rise 6s ease 0.4s infinite;
}

#field > div:nth-of-type(6) > input {
  animation: rise 8s ease 4.6s infinite;
}

#field > div:nth-of-type(7) > input {
  animation: rise 5s ease 1.2s infinite;
}

#field > div:nth-of-type(8) > input {
  animation: rise 5s ease 7.8s infinite;
}

#field > div:nth-of-type(9) > input {
  animation: rise 6s ease 6s infinite;
}

#field > div:nth-of-type(10) > input {
  animation: rise 8s ease 4.4s infinite;
}

#field > div:nth-of-type(11) > input {
  animation: rise 6s ease 2.6s infinite;
}

#field > div:nth-of-type(12) > input {
  animation: rise 7s ease 4.2s infinite;
}

#field > div:nth-of-type(13) > input {
  animation: rise 5s ease 7.8s infinite;
}

#field > div:nth-of-type(14) > input {
  animation: rise 7s ease 2.6s infinite;
}

#field > div:nth-of-type(15) > input {
  animation: rise 8s ease 1.4s infinite;
}

#field > div:nth-of-type(16) > input {
  animation: rise 5s ease 6.6s infinite;
}

#field > div input:checked {
  pointer-events: none;
  animation-play-state: paused;
  counter-increment: points;
  filter: saturate(0%);
}

#field > div input:focus {
  outline: none;
}

@keyframes gameEndMole {
  0%, 98% {
    background: none;
  }
  100% {
    background: #f5fcf9;
  }
}
#field > div input:not(:checked):before {
  animation: gameEndMole var(--gameLength) linear;
  animation-fill-mode: forwards;
}

#field > div input:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
}

@media only screen and (max-height: 500px) {
  #field > div {
    border: solid #4E342E 5px;
  }
}
@media only screen and (max-width: 500px) {
  #field > div {
    border: solid #4E342E 5px;
  }
}
#field > div > input {
  background-image: url("images/game/chov.png");
}