html, body {
    font-family: sans-serif;
    font-size: 12px;
    padding: 0;
    margin: 0;
}

.viewport {
    width: 165px;
    height: 250px;
    float: left;
    position: relative;
    margin-left: 30px;
}

.viewport-3d {
    margin-right: -10px;
}

.viewport-flat {
    left: 35px;
}

.scene3d {
    width: 100%;
    height: 100%;
    transform: rotateY(15deg) rotateX(60deg);
    transform-style: preserve-3d;
}

.a {
    width: 70px;
    height: 70px;
    background: red;
    font-size: 60px;
    text-align: center;
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 2;
    color: #fff;
}

.a::before {
    content: 'A';
}

.b {
    width: 70px;
    height: 70px;
    background: blue;
    font-size: 60px;
    text-align: center;
    position: absolute;
    z-index: 1;
    color: #fff;
}

.b::before {
    content: 'B';
}

.bg {
    background: #ddd;
    width: 100%;
    height: 100%;
}

.ghost {
    width: 70px;
    height: 70px;
    box-sizing: border-box;
    border: 2px solid red;
    position: absolute;
}

.block {
    width: 70px;
    height: 70px;
    position: absolute;
    background: #999;
}

.layer {
    opacity: 0.8;
    position: absolute;
    width: 100%;
    height: 100%;
}

.layer-comp1 {
    transform: translateZ(60px);
    z-index: 2;
}

.layer-comp2 {
    transform: translateZ(30px);
    z-index: 1;
}

.label {
    display: block;
    text-align: center;
    font-size: 12px;
    position: absolute;
    top: 100%;
    width: 100%;
    margin-top: 10px;
}

:lang(en) .label::before,
:lang(en) .text::before {
    content: attr(data-en);
}

:lang(ru) .label::before,
:lang(ru) .text::before {
    content: attr(data-ru);
}

.arrow {
    height: 1px;
    background: currentColor;
    width: 100px;
    transform-origin: 0 0;
    position: absolute;
}

.arrow::before,
.arrow::after {
    position: absolute;
    width: 6px;
    height: 100%;
    content: '';
    transform-origin: 100% 50%;
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    background: inherit;
}

.arrow::before {
    transform: rotate(-30deg);
}

.arrow::after {
    transform: rotate(30deg);
}

.arrow.to-top {
    transform: rotate(-90deg);
}

.arrow.to-bottom {
    transform: rotate(90deg);
}

.arrow.to-left {
    transform: rotate(-180deg);
}

.comment {
    position: absolute;
    font-size: 11px;
    line-height: 1.4;
    color: #2e7ea7;
    transform: translateZ(100px); /* Fix artifacts in Safari 10 */
}

.question {
    width: 100%;
    height: 100%;
    border: 3px dashed currentColor;
    text-align: center;
    font-size: 100px;
    color: #ccc;
    border-radius: 10px;
    font-weight: bold;
}

.question::before {
    content: '?';
    position: relative;
    top: 60px;
}

.row::after {
    content: '';
    display: block;
    clear: both;
}

.anim-left {
    animation: anim-left 3s ease-in-out alternate infinite both;
}

.anim-translate {
    animation: anim-translate 3s ease-in-out alternate infinite both;
}

@keyframes anim-left {
    from { left: 30px; }
    to { left: 80px; }
}

@keyframes anim-translate {
    from { transform: translateX(0); }
    to { transform: translateX(50px); }
}
