        @font-face {
          font-family: 'PixelFont';
          src: url('Chava-Regular.otf') format('opentype');
        }

        :root {
            --mac-blue: #007AFF;
            --icon-size: 84px;
            --slot-size: 100px;
            --gap: 20;
        }

        body {
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
            background: #8e8e93;
            height: 100vh;
            overflow: hidden;
            user-select: none;
            position: relative;
        }

                /* ========== ЗАСТАВКА ========== */
        .splash-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #1a1a1a;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            transition: opacity 0.8s ease, transform 0.8s ease;
            cursor: pointer;
        }

        .splash-screen.hidden {
            opacity: 0;
            transform: scale(1.05);
            pointer-events: none;
        }

        .splash-image {
            max-width: 90%;
            max-height: 85%;
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
            animation: subtleZoom 3s ease-in-out infinite;
        }

        .splash-hint {
            color: rgba(255,255,255,0.6);
            font-size: 14px;
            margin-top: 30px;
            letter-spacing: 2px;
            text-transform: uppercase;
            animation: fadeInOut 2s infinite;
        }

        @keyframes subtleZoom {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.02); }
        }

        @keyframes fadeInOut {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 0.8; }
        }

        /* --- ВЕРХНЯЯ ПАНЕЛЬ --- */
        .menu-bar {
            height: 28px;
            backdrop-filter: blur(20px);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            color: black;
            font-size: 13px;
            font-weight: 500;
            z-index: 1000;
            position: relative;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
            border-bottom: 2px solid;
        }

        .menu-left span { margin-right: 15px; cursor: default; }
        .bold { font-weight: 700; }

        /* --- ДОК --- */
        .dock-container {
            position: absolute;
            bottom: 10px;
            width: 100%;
            display: flex;
            justify-content: center;
            z-index: 1000;
        }

        .dock {
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(15px);
            border: 1px solid rgba(255,255,255,0.2);
            padding: 8px 15px;
            border-radius: 20px;
            display: flex;
            gap: 12px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }

        .dock-icon {
            width: 50px; height: 50px;
            background: rgba(255,255,255,0.8);
            border-radius: 12px;
            display: flex; justify-content: center; align-items: center;
            font-size: 24px;
            transition: transform 0.2s;
            cursor: pointer;
        }
        .dock-icon:hover { transform: scale(1.2) translateY(-10px); }

        /* --- ИГРОВАЯ ЗОНА --- */
        #game-area {
            position: absolute;
            top: 40px;
            left: 0;
            width: 100%;
            height: calc(100% - 120px);
            pointer-events: none;
        }

        /* Сетка - видна только при запоминании */
        .grid-slot {
            position: absolute;
            width: var(--slot-size);
            height: var(--slot-size);
            border: 2px dashed rgba(255, 255, 255, 0.4);
            border-radius: 12px;
            box-sizing: border-box;
            transition: opacity 0.5s;
            pointer-events: none;
        }

        .grid-slot.hidden {
            opacity: 0;
        }

        /* Точка центра ячейки (для наглядности при проверке) */
        .center-point {
            position: absolute;
            width: 8px;
            height: 8px;
            background: #ff3b30;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.5s;
        }

        .center-point.visible {
            opacity: 0.8;
        }

        /* Папки */
        .folder {
            position: absolute;
            width: var(--icon-size);
            height: var(--icon-size);
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: grab;
            z-index: 100;
            transition: top 0.3s ease-out, left 0.3s ease-out, transform 0.1s, opacity 0.3s;
            pointer-events: auto;
            transform: translate(-50%, -50%);
        }

        .folder:active {
            cursor: grabbing;
            transform: translate(-50%, -50%) scale(1.15);
            z-index: 1000;
        }

        .folder.locked {
            pointer-events: none;
            opacity: 0.7;
            cursor: default;
        }

        .folder.dragging {
            transition: none;
        }

        .folder-svg {
            width: 70px; height: 70px;
            filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
        }

        /* При проверке показываем где должна была быть */
        .folder.original-position {
            opacity: 0.4;
            transform: translate(-50%, -50%) scale(0.9);
            pointer-events: none;
        }

        /* Линия ошибки */
        .error-line {
            position: absolute;
            height: 2px;
            background: linear-gradient(90deg, #4cd964, #ffcc00, #ff3b30);
            transform-origin: left center;
            pointer-events: none;
            z-index: 50;
            opacity: 0;
            transition: opacity 0.5s;
        }

        /* Кнопка старта */
        #start-btn {
            width: 250px;
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            border: none;
            cursor: pointer;
            transition: 0.2s;
        }
        #start-btn:hover { transform: translate(-50%, -50%) scale(1.05); }

        /* Кнопка проверки */
        #check-btn {
            width: 150px;
            position: absolute;
            bottom: 25px;
            left: 50%;
            transform: translate(-50%, -50%);
            border: none;
            cursor: pointer;
            display: none;
            transition: 0.2s;
            z-index: 2000;
        }
        #check-btn:hover { transform: translate(-50%, -50%) scale(1.05); }

        /* Сообщение о статусе */
        #status-msg {
            font-family: 'PixelFont', sans-serif;
            position: absolute;
            top: 40px;
            width: 100%;
            text-align: center;
            color: white;
            font-size: 24px;
            font-weight: 700;
            text-shadow: 0 2px 10px rgba(0,0,0,0.5);
            pointer-events: none;
            z-index: 1500;
            opacity: 0;
            transition: opacity 0.5s;
        }

        /* Результаты */
        #results {
            font-family: 'PixelFont', sans-serif;
            position: absolute;
            top: 50%;
            left: 20%;
            transform: translate(-50%, -50%);
            background-image: url('result_back.svg');
            background-repeat: no-repeat;
            background-size: cover;
            padding: 100px 120px;
            text-align: center;
            z-index: 3000;
            display: none;
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }

        #results h2 {
            margin: 0 0 20px 0;
            color: #333;
            font-size: 32px;
        }

        .score-circle {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: conic-gradient(var(--mac-blue) 0%, #e5e5e5 0%);
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0 auto 20px;
            position: relative;
        }

        .score-circle::before {
            content: '';
            position: absolute;
            width: 130px;
            height: 130px;
            background: white;
            border-radius: 50%;
        }

        .score-value {
            position: relative;
            z-index: 1;
            font-size: 36px;
            font-weight: 700;
            color: #333;
        }

        .score-label {
            color: #666;
            font-size: 14px;
            margin-bottom: 20px;
        }

        .error-details {
            text-align: left;
            padding: 15px 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            font-size: 14px;
            color: #333;
            max-height: 200px;
            overflow-y: auto;
        }

        .error-details p {
            margin: 5px 0;
        }

        #results-actions {
            position: absolute;
            bottom: 50px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 30px;
            z-index: 3001;
        }

        #results-actions img {
            width: 150px;
            cursor: pointer;
            transition: transform 0.2s;
        }

        #results-actions img#restart-level-btn {
            width: 185px;
        }

        #results-actions img:hover {
            transform: scale(1.05);
        }

        #victory-screen {
            font-family: 'PixelFont', sans-serif;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 60px 80px;
            border-radius: 20px;
            text-align: center;
            z-index: 5000;
            box-shadow: 0 30px 80px rgba(0,0,0,0.5);
        }
        #victory-screen h2 {
            margin: 0 0 10px 0;
            color: #333;
            font-size: 42px;
        }
        .victory-subtitle {
            color: #666;
            font-size: 18px;
            margin-bottom: 30px;
        }
        #play-again-btn {
            width: 200px;
            margin: 0 auto;
            cursor: pointer;
            transition: 0.2s;
        }
        #play-again-btn:hover {
            transform: scale(1.05);
        }

        /* Таймер запоминания */
        #timer-bar {
            position: absolute;
            top: 0;
            left: 0;
            height: 4px;
            background: var(--mac-blue);
            width: 0%;
            transition: width 0.1s linear;
            z-index: 1600;
        }

        #achievement-img {
            display: none;
            width: 125px;
            height: 125px;
            margin: 0 auto 20px;
        }
