/*
 * enotech 3D Cube
 * Version: 0.3.6
 * No external dependencies.
 */

.enotech-cube-wrap {
    --enotech-cube-size: 240px;
    --enotech-cube-half: calc(var(--enotech-cube-size) / 2);
    --enotech-cube-border: rgba(30, 30, 30, 0.18);
    --enotech-cube-bg: rgba(255, 255, 255, 0.94);
    --enotech-cube-text: #1f1f1f;
    --enotech-cube-accent: #c8202f;

    width: 100%;
    max-width: 760px;
    margin: 2rem auto;
}

.enotech-cube-stage {
    position: relative;
    min-height: calc(var(--enotech-cube-size) * 2);
    display: grid;
    place-items: center;
    perspective: 1050px;
    touch-action: none;
    user-select: none;
    overflow: visible;
}

.enotech-cube-hint {
    position: absolute;
    left: 50%;
    bottom: 0.7rem;
    transform: translateX(-50%);
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--enotech-cube-border);
    border-radius: 999px;
    background: var(--enotech-cube-bg);
    color: var(--enotech-cube-text);
    font-size: 0.7rem;
    line-height: 1;
    opacity: 0.72;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 180ms ease;
}

.enotech-cube-wrap.has-interacted .enotech-cube-hint {
    opacity: 0;
}

.enotech-cube {
    position: relative;
    width: var(--enotech-cube-size);
    height: var(--enotech-cube-size);
    transform-style: preserve-3d;
    transform: rotateX(-18deg) rotateY(32deg);
    transition: none;
    will-change: transform;
    cursor: default;
    touch-action: none;
}

.enotech-cube.is-dragging,
.enotech-cube.is-dragging .enotech-cube-face {
    cursor: grabbing;
}

.enotech-cube.is-dragging {
    transition: none;
}

.enotech-cube-face {
    position: absolute;
    inset: 0;
    width: var(--enotech-cube-size);
    height: var(--enotech-cube-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-sizing: border-box;
    padding: 1.25rem;
    border: 1px solid var(--enotech-cube-border);
    background: var(--enotech-cube-bg);
    color: var(--enotech-cube-text);
    text-decoration: none;
    text-align: center;
    backface-visibility: hidden;
    cursor: pointer;
    touch-action: none;
    -webkit-user-drag: none;
    box-shadow:
        inset 0 0 45px rgba(0, 0, 0, 0.035),
        0 0 0 1px rgba(255, 255, 255, 0.25);
}

.enotech-cube-face:hover,
.enotech-cube-face:focus-visible {
    color: var(--enotech-cube-accent);
    border-color: var(--enotech-cube-accent);
    outline: none;
}

.enotech-cube-face__image {
    display: block;
    max-width: 78%;
    max-height: 58%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.enotech-cube-face__label {
    display: block;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.25;
    pointer-events: none;
}

.enotech-cube-face--front  { transform: rotateY(0deg) translateZ(var(--enotech-cube-half)); }
.enotech-cube-face--back   { transform: rotateY(180deg) translateZ(var(--enotech-cube-half)); }
.enotech-cube-face--right  { transform: rotateY(90deg) translateZ(var(--enotech-cube-half)); }
.enotech-cube-face--left   { transform: rotateY(-90deg) translateZ(var(--enotech-cube-half)); }
.enotech-cube-face--top    { transform: rotateX(90deg) translateZ(var(--enotech-cube-half)); }
.enotech-cube-face--bottom { transform: rotateX(-90deg) translateZ(var(--enotech-cube-half)); }

.enotech-cube-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem 1.4rem;
    margin-top: 0.8rem;
}

.enotech-cube-button {
    appearance: none;
    border: 1px solid var(--enotech-cube-border);
    border-radius: 0.4rem;
    background: transparent;
    color: inherit;
    padding: 0.55rem 0.85rem;
    font: inherit;
    cursor: pointer;
}

.enotech-cube-button:hover,
.enotech-cube-button:focus-visible {
    border-color: var(--enotech-cube-accent);
    color: var(--enotech-cube-accent);
}

.enotech-cube-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
}

.enotech-cube-toggle input {
    width: 1.1rem;
    height: 1.1rem;
}

@media (max-width: 520px) {
    .enotech-cube-wrap {
        --enotech-cube-size: min(68vw, 210px) !important;
    }

    .enotech-cube-stage {
        min-height: calc(var(--enotech-cube-size) * 1.82);
    }
}

@media (prefers-color-scheme: dark) {
    .enotech-cube-wrap {
        --enotech-cube-border: rgba(255, 255, 255, 0.22);
        --enotech-cube-bg: rgba(26, 26, 26, 0.95);
        --enotech-cube-text: #f2f2f2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .enotech-cube {
        transition: none;
    }
}