body {
  margin: 0;
  overflow: hidden;
  background-color: #f0f0f0;
}

.illusion-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.illusion {
  width: 80vmin;
  height: 80vmin;
  perspective: 1000px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
}

.tile {
  width: 100%;
  height: 100%;
  position: relative;
  perspective: 1000px;
  animation: flip 2s infinite linear, changeContent 2s infinite linear, changeColor 2s infinite linear;
  font-size: 4em;
}

.front, .back {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  backface-visibility: hidden;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.front {
  transform: rotateY(0deg);
  color: #fff;
}

.back {
  transform: rotateY(180deg);
  color: #fff;
}

@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

@keyframes changeContent {
  0%, 100% {
    content: '';
  }
  25% {
    content: '';
  }
  50% {
    content: '';
  }
  75% {
    content: '';
  }
}

@keyframes changeColor {
  0%, 100% {
    background-color: #4caf50;
  }
  25% {
    background-color: #2196f3;
  }
  50% {
    background-color: #ff9800;
  }
  75% {
    background-color: #e91e63;
  }
}
