
       * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            user-select: none;
        }

        body {
            font-family: 'Poppins', sans-serif;
            height: 100vh;
            overflow: hidden;
            background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
            color: white;
            position: relative;
        }

        /* Preloader */
        .preloader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            opacity: 1;
            transition: opacity 0.8s ease-out;
        }

        .preloader.fade-out {
            opacity: 0;
            pointer-events: none;
        }

        .preloader-cube {
            width: 80px;
            height: 80px;
            position: relative;
            transform-style: preserve-3d;
            animation: preloaderSpin 3s linear infinite;
        }

        .preloader-face {
            position: absolute;
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.5rem;
        }

        .preloader-face:nth-child(1) { transform: rotateY(0deg) translateZ(40px); }
        .preloader-face:nth-child(2) { transform: rotateY(90deg) translateZ(40px); }
        .preloader-face:nth-child(3) { transform: rotateY(180deg) translateZ(40px); }
        .preloader-face:nth-child(4) { transform: rotateY(-90deg) translateZ(40px); }
        .preloader-face:nth-child(5) { transform: rotateX(90deg) translateZ(40px); }
        .preloader-face:nth-child(6) { transform: rotateX(-90deg) translateZ(40px); }

        @keyframes preloaderSpin {
            0% { transform: rotateX(20deg) rotateY(0deg); }
            100% { transform: rotateX(20deg) rotateY(360deg); }
        }

        .loading-text {
            color: white;
            font-family: 'Orbitron', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            margin-top: 2rem;
            text-shadow: 0 0 20px rgba(102, 126, 234, 0.7);
            letter-spacing: 2px;
            animation: pulse 2s ease-in-out infinite alternate;
        }

        @keyframes pulse {
            from { opacity: 0.6; text-shadow: 0 0 10px rgba(102, 126, 234, 0.7); }
            to { opacity: 1; text-shadow: 0 0 25px rgba(102, 126, 234, 1); }
        }

        .progress-bar {
            width: 300px;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            margin-top: 1.5rem;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 3px;
            width: 0%;
            animation: progressFill 3s ease-out;
            box-shadow: 0 0 10px rgba(102, 126, 234, 0.7);
        }

        @keyframes progressFill {
            0% { width: 0%; }
            100% { width: 100%; }
        }

        /* Header */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            padding: 1.5rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 100;
            background: rgba(15, 12, 41, 0.8);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-icon {
            font-size: 2rem;
            color: #667eea;
            filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.7));
        }

        .logo-text {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.8rem;
            font-weight: 900;
            background: linear-gradient(to right, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        /* Timer Container */
        .timer-container {
            position: fixed;
            top: 1.5rem;
            right: 2rem;
            z-index: 101;
        }

        .circle {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: rgba(15, 12, 41, 0.9);
            border: 3px solid rgba(102, 126, 234, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 0 30px rgba(102, 126, 234, 0.4),
                        inset 0 0 20px rgba(102, 126, 234, 0.1);
            position: relative;
            overflow: hidden;
        }

        .circle::before {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: conic-gradient(#667eea, #764ba2, #667eea);
            animation: rotate 3s linear infinite;
            opacity: 0.2;
        }

        @keyframes rotate {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .time {
            font-family: 'Orbitron', monospace;
            font-size: 1.8rem;
            font-weight: 700;
            color: white;
            text-shadow: 0 0 10px rgba(102, 126, 234, 0.7);
            z-index: 1;
        }

        /* Controls Panel */
        .controls-panel {
            position: fixed;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(15, 12, 41, 0.9);
            backdrop-filter: blur(15px);
            border-radius: 20px;
            padding: 1.5rem 2rem;
            display: flex;
            gap: 1.5rem;
            z-index: 100;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        }

        .control-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            padding: 0.8rem 1.8rem;
            border-radius: 12px;
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }

        .control-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
        }

        .control-btn:active {
            transform: translateY(0);
        }

        .control-btn i {
            font-size: 1.2rem;
        }

        /* Info Panel */
        .info-panel {
            position: fixed;
            top: 50%;
            right: 2rem;
            transform: translateY(-50%);
            background: rgba(15, 12, 41, 0.9);
            backdrop-filter: blur(15px);
            border-radius: 20px;
            padding: 1.5rem;
            width: 280px;
            z-index: 100;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        }

        .info-panel h3 {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.3rem;
            margin-bottom: 1rem;
            color: #667eea;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .info-panel h3 i {
            font-size: 1.5rem;
        }

        .info-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 1rem;
            padding: 0.8rem;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .info-item:hover {
            background: rgba(102, 126, 234, 0.1);
            transform: translateX(5px);
        }

        .info-item i {
            font-size: 1.2rem;
            color: #764ba2;
            width: 24px;
        }

        .info-text {
            font-size: 0.95rem;
            line-height: 1.4;
        }

        /* Stats Panel */
        .stats-panel {
            position: fixed;
            top: 50%;
            left: 2rem;
            transform: translateY(-50%);
            background: rgba(15, 12, 41, 0.9);
            backdrop-filter: blur(15px);
            border-radius: 20px;
            padding: 1.5rem;
            width: 220px;
            z-index: 100;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        }

        .stats-panel h3 {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.3rem;
            margin-bottom: 1rem;
            color: #667eea;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .stats-panel h3 i {
            font-size: 1.5rem;
        }

        .stat-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.8rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stat-label {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9rem;
        }

        .stat-value {
            font-family: 'Orbitron', sans-serif;
            font-weight: 600;
            color: #764ba2;
        }

        /* FIXED: Cube Scene - Centered properly */
        .scene {
            width: 100%;
            height: 100%;
            perspective: 1200px;
            transform-style: preserve-3d;
            position: fixed;
            top: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .scene > .pivot {
            position: absolute;
            transform-origin: center center;
            transition: transform 0.18s;
            /* Default rotation to show front, top, and right faces */
            transform: rotateX(-25deg) rotateY(-45deg);
        }

        .scene .anchor {
            width: 2em;
            height: 6em;
        }

        .scene div {
            position: absolute;
            transform-style: inherit;
        }

        #piece4 > .element.top > .sticker {
            background-color: #DDD;
        }

        /* FIXED: Cube positioning */
        .cube {
            font-size: 200%; /* Increased for better visibility */
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .cube > .piece {
            width: 1.9em;
            height: 1.9em;
        }

        .cube > .piece > .element {
            width: 100%;
            height: 100%;
            background: #2e2a5b;
            border: 0.05em solid #2e2a5b;
            border-radius: 10%;
        }

        .cube > .piece > .element.left {
            transform: rotateX(0deg) rotateY(-90deg) rotateZ(180deg) translateZ(1em);
        }

        .cube > .piece > .element.right {
            transform: rotateX(0deg) rotateY(90deg) rotateZ(90deg) translateZ(1em);
        }

        .cube > .piece > .element.back {
            transform: rotateX(0deg) rotateY(180deg) rotateZ(-90deg) translateZ(1em);
        }

        .cube > .piece > .element.front {
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateZ(1em);
        }

        .cube > .piece > .element.bottom {
            transform: rotateX(-90deg) rotateY(0deg) rotateZ(-90deg) translateZ(1em);
        }

        .cube > .piece > .element.top {
            transform: rotateX(90deg) rotateY(0deg) rotateZ(180deg) translateZ(1em);
        }

        .cube > .piece > .element > .sticker {
            transform: translateZ(2px);
            width: 100%;
            height: 100%;
            border-radius: 10%;
            outline: 1px solid transparent;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25);
            text-align: center;
            margin: auto;  
            padding-top: 10px;          
        }

        .cube > .piece > .element > .sticker.blue {
            background-color: #001ca8;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(0, 28, 168, 0.5);
        }

        .cube > .piece > .element > .sticker.green {
            background-color: #006E16;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(0, 110, 22, 0.5);
        }

        .cube > .piece > .element > .sticker.white {
            background-color: #DDD;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(221, 221, 221, 0.5);
        }

        .cube > .piece > .element > .sticker.yellow {
            background-color: #E0AE00;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(224, 174, 0, 0.5);
        }

        .cube > .piece > .element > .sticker.orange {
            background-color: #FF5000;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(255, 80, 0, 0.5);
        }

        .cube > .piece > .element > .sticker.red {
            background-color: #DF0500;
            box-shadow: inset 0.05em 0.05em 0.2rem 0 rgba(255, 255, 255, 0.25), 
                        inset -0.05em -0.05em 0.2rem 0 rgba(0, 0, 0, 0.25),
                        0 0 10px rgba(223, 5, 0, 0.5);
        }

        /* Particle Background */
        .particles {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
        }

        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: white;
            border-radius: 50%;
            animation: float 8s linear infinite;
            opacity: 0.3;
        }

        @keyframes float {
            0% {
                transform: translateY(100vh) translateX(0px);
                opacity: 0;
            }
            10% {
                opacity: 0.3;
            }
            90% {
                opacity: 0.3;
            }
            100% {
                transform: translateY(-100px) translateX(100px);
                opacity: 0;
            }
        }

        /* Glow Effects */
        .glow {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
            border-radius: 50%;
            animation: glowPulse 4s ease-in-out infinite alternate;
            z-index: 0;
        }

        @keyframes glowPulse {
            0% { 
                transform: translate(-50%, -50%) scale(1);
                opacity: 0.3;
            }
            100% { 
                transform: translate(-50%, -50%) scale(1.2);
                opacity: 0.6;
            }
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .stats-panel, .info-panel {
                display: none;
            }
            
            .controls-panel {
                bottom: 1rem;
                padding: 1rem 1.5rem;
            }
            
            .timer-container {
                top: 1rem;
                right: 1rem;
            }
            
            .circle {
                width: 100px;
                height: 100px;
            }
            
            .time {
                font-size: 1.5rem;
            }
        }

        @media (max-width: 768px) {
            .header {
                padding: 1rem;
            }
            
            .logo-text {
                font-size: 1.4rem;
            }
            
            .controls-panel {
                flex-wrap: wrap;
                justify-content: center;
                width: 90%;
                gap: 0.8rem;
            }
            
            .control-btn {
                padding: 0.7rem 1.2rem;
                font-size: 0.9rem;
            }
            
            .timer-container {
                position: fixed;
                top: auto;
                bottom: 1rem;
                right: 1rem;
            }
            
            .circle {
                width: 80px;
                height: 80px;
            }
            
            .time {
                font-size: 1.2rem;
            }
            
            .cube {
                font-size: 160%; /* Smaller on mobile */
            }
        }

        /* Footer */
        .footer {
            position: fixed;
            bottom: 0.5rem;
            left: 0;
            width: 100%;
            text-align: center;
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.5);
            z-index: 99;
        }