.rubiks-container {
    width: 120px;
    /* Fixed from 10px to prevent layout clipping */
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    pointer-events: none;
    transform: scale(0.4);
}

/* New Optimized Background Glow */
.optimized-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    margin-top: -125px;
    margin-left: -125px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.4) 0%, rgba(253, 224, 71, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    animation: organicGlow 4s ease-in-out infinite alternate;
}

@keyframes organicGlow {
    0% {
        scale: 0.8 0.8 0.8;
        opacity: 0.5;
    }

    100% {
        scale: 1.2 1.2 1.2;
        opacity: 1;
    }
}

/* Continuous Ambient Tumble Animation */
.ambient-wrapper {
    transform-style: preserve-3d;
    animation: ambientTumble 20s infinite linear;
}

@keyframes ambientTumble {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg);
    }
}

/* Cube Structural Elements */
.cube,
.pivot,
.cubie {
    transform-style: preserve-3d;
}

.cube {
    position: relative;
}

.pivot {
    position: absolute;
    will-change: transform;
    /* Hardware acceleration hint */
}

.cubie {
    position: absolute;
    width: 0;
    height: 0;
    will-change: transform;
    /* Hardware acceleration hint */
}

/* Faces and Pastel Stickers */
.face {
    position: absolute;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    background: #1e293b;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Crucial for mobile performance: hides the inside of the cube */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.sticker {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 3D Face Orientations */
.face.f {
    transform: rotateY(0deg) translateZ(20px);
}

.face.b {
    transform: rotateY(180deg) translateZ(20px);
}

.face.r {
    transform: rotateY(90deg) translateZ(20px);
}

.face.l {
    transform: rotateY(-90deg) translateZ(20px);
}

.face.u {
    transform: rotateX(90deg) translateZ(20px);
}

.face.d {
    transform: rotateX(-90deg) translateZ(20px);
}

/* Minimal Pastel Color Palette */
.sticker.white {
    background: #f1f5f9;
}

.sticker.yellow {
    background: #eab308;
}

.sticker.green {
    background: #10b981;
}

.sticker.blue {
    background: #3b82f6;
}

.sticker.orange {
    background: #f97316;
}

.sticker.red {
    background: #ef4444;
}
