* {
    margin: 0;
    padding: 0;
}

.wrapper {
}

.box {
    display: inline-block;
}

.box-inner {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 800px;
    perspective-origin: 200% 200%;
    /* backface-visibility: hidden; */
}

.box-inner.margin-left {
    margin-left: 100px;
    margin-top: 100px;
}

.face {
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: inherit;
}
.front {
    background-color: rgba(255, 0, 0, 0.3);
    transform: translateZ(50px);
}

.back {
    background-color: rgba(0, 255, 0, 0.3);
    transform: rotateY(-180deg) translateZ(50px);
}

.left {
    background-color: rgba(0, 0, 255, 0.3);
    transform: rotateY(-90deg) translateZ(50px);
}

.right {
    background-color: rgba(255, 255, 0, 0.3);
    transform: rotateY(90deg) translateZ(50px);
}

.top {
    background-color: rgba(255, 0, 255, 0.3);
    transform: rotateX(90deg) translateZ(50px);
}

.bottom {
    background-color: rgba(0, 255, 255, 0.3);
    transform: rotateX(-90deg) translateZ(50px);
}
