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

        body {
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            font-family: 'Avenir Next', Avenir, sans-serif;
            font-weight: 500;
            font-size: 20px;
            color: #555;
            background: #1a1a2e;
            user-select: none;
            -webkit-user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        /* ============ PRE-LOADER ============ */
        .preloader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #1a1a2e;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease, visibility 0.5s ease;
            cursor: pointer;
        }

        .preloader.is-hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .preloader__logo {
            width: 80px;
            height: 80px;
            position: relative;
            animation: preloaderPulse 1.5s ease-in-out infinite;
        }

        .preloader__logo-piece {
            position: absolute;
            width: 35px;
            height: 35px;
            border-radius: 8px;
            opacity: 0;
            animation: preloaderPieceIn 0.6s ease forwards;
        }

        .preloader__logo-piece:nth-child(1) {
            background: #ff6b6b;
            top: 0;
            left: 0;
            animation-delay: 0s;
        }

        .preloader__logo-piece:nth-child(2) {
            background: #4ecdc4;
            top: 0;
            right: 0;
            animation-delay: 0.15s;
        }

        .preloader__logo-piece:nth-child(3) {
            background: #ffe66d;
            bottom: 0;
            left: 0;
            animation-delay: 0.3s;
        }

        .preloader__logo-piece:nth-child(4) {
            background: #a29bfe;
            bottom: 0;
            right: 0;
            animation-delay: 0.45s;
        }

        @keyframes preloaderPieceIn {
            0% {
                opacity: 0;
                transform: scale(0) rotate(90deg);
            }

            60% {
                opacity: 1;
                transform: scale(1.2) rotate(-10deg);
            }

            100% {
                opacity: 1;
                transform: scale(1) rotate(0deg);
            }
        }

        @keyframes preloaderPulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.08);
            }
        }

        .preloader__progress-bar {
            width: 200px;
            height: 6px;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 3px;
            margin-top: 30px;
            overflow: hidden;
        }

        .preloader__progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #4ecdc4, #a29bfe);
            border-radius: 3px;
            width: 0%;
            transition: width 0.3s ease;
        }

        .preloader__text {
            color: rgba(255, 255, 255, 0.7);
            font-size: 14px;
            margin-top: 15px;
            letter-spacing: 2px;
            text-transform: uppercase;
            animation: preloaderFadeText 2s ease-in-out infinite;
        }

        @keyframes preloaderFadeText {

            0%,
            100% {
                opacity: 0.5;
            }

            50% {
                opacity: 1;
            }
        }

        .preloader__skip {
            color: rgba(255, 255, 255, 0.4);
            font-size: 12px;
            margin-top: 25px;
            letter-spacing: 1px;
            opacity: 0;
            animation: skipFadeIn 3s ease forwards;
        }

        @keyframes skipFadeIn {

            0%,
            80% {
                opacity: 0;
            }

            100% {
                opacity: 0.6;
            }
        }

        /* ============ HOW-TO-PLAY MODAL ============ */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.75);
            z-index: 900;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.4s ease, visibility 0.4s ease;
        }

        .modal-overlay.is-open {    
            opacity: 1;
            visibility: visible;
           
        }

        .modal {
            background: #ffffff;
            border-radius: 20px;
            padding: 30px 25px 25px;
            max-width: 420px;
            width: 90%;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            position: relative;
            transform: translateY(20px);
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .modal-overlay.is-open .modal {
            transform: translateY(0);
        }

        .modal__title {
            font-size: 28px;
            font-weight: 700;
            color: #1a1a2e;
            margin: 0 0 8px;
        }

        .modal__subtitle {
            font-size: 14px;
            color: #888;
            margin: 0 0 20px;
        }

        .modal__steps {
            text-align: left;
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .modal__step {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
            opacity: 0;
            transform: translateX(-15px);
            animation: modalStepIn 0.5s ease forwards;
        }

        .modal__step:nth-child(1) {
            animation-delay: 0.1s;
        }

        .modal__step:nth-child(2) {
            animation-delay: 0.25s;
        }

        .modal__step:nth-child(3) {
            animation-delay: 0.4s;
        }

        .modal__step:nth-child(4) {
            animation-delay: 0.55s;
            border-bottom: none;
        }

        @keyframes modalStepIn {
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .modal__step-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }

        .modal__step-icon--rotate {
            background: #e8f4fd;
            color: #2196F3;
        }

        .modal__step-icon--drag {
            background: #fce4ec;
            color: #e91e63;
        }

        .modal__step-icon--links {
            background: #fff3e0;
            color: #ff9800;
        }

        .modal__step-icon--goal {
            background: #fff9c4;
            color: #fbc02d;
        }

        .modal__step-text strong {
            display: block;
            color: #333;
            font-size: 15px;
            margin-bottom: 2px;
        }

        .modal__step-text span {
            color: #777;
            font-size: 13px;
            line-height: 1.4;
        }

        .modal__legend {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-top: 16px;
            padding-top: 14px;
            border-top: 1px solid #eee;
        }

        .modal__legend-item {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            color: #666;
        }

        .modal__legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .modal__legend-dot--blue {
            background: hsla(200, 80%, 50%, 0.8);
        }

        .modal__legend-dot--orange {
            background: hsla(30, 100%, 40%, 0.7);
        }

        .modal__legend-dot--green {
            background: hsla(150, 100%, 35%, 0.8);
        }

        .modal__legend-dot--red {
            background: hsla(0, 100%, 50%, 0.7);
        }

        .modal__btn {
            display: inline-block;
            margin-top: 20px;
            padding: 12px 40px;
            background: #4ecdc4;
            color: #fff;
            border: none;
            border-radius: 30px;
            font-size: 17px;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 1px;
            transition: all 0.3s ease;
            box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
        }

        .modal__btn:hover {
            background: #3dbdb5;
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(78, 205, 196, 0.5);
        }

        .modal__btn:active {
            transform: scale(0.96);
        }

        /* ============ GAME CANVAS ============ */
        canvas {
            cursor: move;
            display: block;
            position: absolute;
            max-width: 100%;
            left: 0;
            top: 0;
        }

        .is-cub-hovered,
        .is-cub-hovered canvas {
            cursor: grab;
        }

        .is-cub-dragging,
        .is-cub-dragging canvas {
            cursor: grabbing;
        }

        /* ============ UI ELEMENTS ============ */
        .instruction {
            padding: 0 10px;
            text-align: center;
            position: absolute;
            width: 100%;
            padding-bottom: 40px;
            color: #ccc;
            font-size: 18px;
            pointer-events: none;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            transition: opacity 0.3s;
        }

        .button {
            font-family: 'Avenir Next', Avenir, sans-serif;
            font-weight: 500;
            font-size: 20px;
            padding: 5px 15px;
            margin: 10px;
            background: #BBB;
            color: white;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            transition: all 0.25s ease;
        }

        .button:hover {
            background: #09F;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0, 153, 255, 0.35);
        }

        .button:active {
            transform: scale(0.94);
            transition: transform 0.08s ease;
        }

        .top-bar {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 5;
        }

        .level-select-button {
            position: relative;
            z-index: 2;
            background: rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(6px);
            color: #fff;
            border-radius: 25px;
            padding: 8px 20px;
            font-weight: 600;
            letter-spacing: 1px;
            transition: all 0.3s ease;
        }

        .level-select-button:hover {
            background: rgba(255, 255, 255, 0.22);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        }

        .next-level-button {
            position: absolute;
            left: 50%;
            transform: translateX(-110px) scale(0.5);
            opacity: 0;
            background: #4ecdc4;
            width: 200px;
            height: 60px;
            pointer-events: none;
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
            border-radius: 40px;
            font-weight: 700;
            font-size: 22px;
            letter-spacing: 2px;
            box-shadow: 0 10px 35px rgba(78, 205, 196, 0.5);
            z-index: 4;
            margin-top: 35px;
        }

        .next-level-button:hover {
            background: #3dbdb5;
            box-shadow: 0 14px 40px rgba(78, 205, 196, 0.65);
        }

        .next-level-button.is-open {
            display: inline-block;
            pointer-events: auto;
            transform: translateX(-110px) scale(1);
            opacity: 1;
            animation: nextBtnBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes nextBtnBounce {
            0% {
                transform: translateX(-110px) scale(0.3);
                opacity: 0;
            }

            50% {
                transform: translateX(-110px) scale(1.08);
                opacity: 1;
            }

            70% {
                transform: translateX(-110px) scale(0.94);
            }

            100% {
                transform: translateX(-110px) scale(1);
                opacity: 1;
            }
        }

        /* ============ LEVEL LIST ============ */
        .level-list {
            position: absolute;
            background: rgba(26, 26, 46, 0.97);
            width: 100%;
            min-height: 100%;
            left: 0;
            top: 0;
            margin: 0;
            list-style: none;
            padding: 20px;
            z-index: 3;
            left: -100%;
            transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            overflow-y: auto;
            backdrop-filter: blur(4px); margin-top: 4%;
        }

        .level-list.is-open {
            left: 0;
        }

        .level-list__item {
            display: inline-block;
            background: rgba(255, 255, 255, 0.08);
            margin: 5px;
            padding: 10px;
            width: 80px;
            height: 80px;
            text-align: center;
            border-radius: 14px;
            position: relative;
            color: #ccc;
            cursor: pointer;
            transition: all 0.25s ease;
            border: 2px solid transparent;
        }

        .level-list__item:hover {
            color: #4ecdc4;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.16);
            border-color: rgba(78, 205, 196, 0.4);
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        .level-list__item.is-playing {
            background: rgba(78, 205, 196, 0.25);
            color: #4ecdc4;
            border-color: #4ecdc4;
            box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
        }

        .level-list__item__number {
            display: block;
            font-size: 30px;
            line-height: 35px;
            font-weight: 700;
        }

        .level-list__item__blurb {
            display: block;
            font-size: 14px;
            font-weight: 500;
        }

        .level-list__item__check {
            position: absolute;
            right: -10px;
            top: -10px;
            width: 30px;
            line-height: 30px;
            background: #4ecdc4;
            border-radius: 15px;
            color: #fff;
            display: none;
            font-size: 16px;
            box-shadow: 0 3px 10px rgba(78, 205, 196, 0.5);
            animation: checkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes checkPop {
            0% {
                transform: scale(0);
            }

            60% {
                transform: scale(1.3);
            }

            100% {
                transform: scale(1);
            }
        }

        .level-list__item.did-complete .level-list__item__check {
            display: block;
        }

        .levels {
            display: none;
        }

        /* ============ PARTICLE OVERLAY ============ */
        .particle-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 50;
        }

        .particle {
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 3px;
            animation: particleFall 1.2s ease-out forwards;
            pointer-events: none;
        }

        @keyframes particleFall {
            0% {
                opacity: 1;
                transform: translateY(0) rotate(0deg) scale(1);
            }

            100% {
                opacity: 0;
                transform: translateY(100vh) rotate(720deg) scale(0.2);
            }
        }

        @media (max-width: 600px) {
            .modal {
                padding: 20px 16px 18px;
                max-width: 95%;
            }

            .modal__title {
                font-size: 22px;
            }

            .modal__step-text strong {
                font-size: 13px;
            }

            .modal__step-text span {
                font-size: 11px;
            }

            .next-level-button {
                width: 160px;
                height: 60px;
                font-size: 18px;
                transform: translateX(-80px) scale(0.5);
            }

            .next-level-button.is-open {
                transform: translateX(-80px) scale(1);
            }

            @keyframes nextBtnBounce {
                0% {
                    transform: translateX(-80px) scale(0.3);
                    opacity: 0;
                }

                50% {
                    transform: translateX(-80px) scale(1.08);
                    opacity: 1;
                }

                70% {
                    transform: translateX(-80px) scale(0.94);
                }

                100% {
                    transform: translateX(-80px) scale(1);
                    opacity: 1;
                }
            }
        }




        