body {
  display: grid;
  height: 100dvh;
  margin: 0;
  place-content: center;
  min-width: 20.5rem;
}

main {
  width: 20rem;
  height: 20rem;
  perspective: 32.5rem;
}

.inner {
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  height: 100%;
}

main:hover .inner {
  transform: rotateY(180deg);
}

.front {
  background-color: rgb(187, 187, 187);
}

.front img {
  width: 20rem;
}

.front,
.back {
  position: absolute;
  backface-visibility: hidden;
}

.back {
  transform: rotateY(180deg);
  background-color: rgb(144, 108, 170);
  color: white;
  text-align: center;
  padding: 5px 10px;
  height: 100%;
}
