* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: sans-serif;
}
h1 {
  text-align: center;
  color: forestgreen;
  margin: 30px 0 50px;
}
.gallery {
    width: 90%;
    margin: 10px auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-evenly;
}
.gallery .square {
  width: 100px;
  height: 100px;
  padding: 5px;
  margin-bottom: 25px;
  border: 5px solid black;
  border-left: dotted black;
  border-radius: 50%;
  transform: rotate(45deg);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  filter: brightness(.8);
  transition: all 2000ms bounceRotation();
  border-radius: 50%;
  transform: rotate(-45deg);
}
.gallery img:hover {
  filter: none;
  transform: scale(1.025); 
/*     rotate(-40deg); */
  animation: bounceRotation 200ms ;
}

@keyframes bounceRotation {
	0% {
		transform: rotate(deg);
	}

	12% {
		transform: rotate(36.89deg);
	}

	24% {
		transform: rotate(-166deg);
	}

	36% {
		transform: rotate(-340.01deg);
	}

	54% {
		transform: rotate(-720.02deg);
	}

	74% {
		transform: rotate(-340.37deg);
	}

	82% {
		transform: rotate(-330.75deg);
	}

	92% {
		transform: rotate(-360.34deg);
	}

	96% {
		transform: rotate(-350deg);
	}

	100% {
		transform: rotate(-365deg);
	}

}