:root {
  --col-gap: 5%;
  --row-gap: 5%;
  --cube-perspective: 99999999px;
  --cube-face-border: 2px dashed #5227FF;
  --cube-face-bg: #1a1a2e;
  --cube-face-shadow: none;
}

.cubes-animation {
  position: relative;
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cubes-animation--scene {
  display: grid;
  width: 400px;
  height: 400px;
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
  perspective: var(--cube-perspective);
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  transform-style: preserve-3d;
  cursor: pointer;
}

.cube::before {
  content: '';
  position: absolute;
  top: -36px;
  right: -36px;
  bottom: -36px;
  left: -36px;
}

.cubes-animation .cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cube-face-bg);
  border: var(--cube-face-border);
  opacity: 1;
  box-shadow: var(--cube-face-shadow);
}

.cubes-animation .cube-face--top {
  transform: translateY(-50%) rotateX(90deg);
}

.cubes-animation .cube-face--bottom {
  transform: translateY(50%) rotateX(-90deg);
}

.cubes-animation .cube-face--left {
  transform: translateX(-50%) rotateY(-90deg);
}

.cubes-animation .cube-face--right {
  transform: translateX(50%) rotateY(90deg);
}

.cubes-animation .cube-face--back,
.cubes-animation .cube-face--front {
  transform: rotateY(-90deg) translateX(50%) rotateY(90deg);
}

@media (max-width: 768px) {
  .cubes-animation--scene {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .cubes-animation--scene {
    width: 250px;
    height: 250px;
  }
} 