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

        body {
            font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .editor-container {
            flex: 1;
            display: grid;
            grid-template-columns: 280px 1fr 300px;
            grid-template-rows: 60px 1fr 80px;
            gap: 2px;
            background: rgba(0, 0, 0, 0.1);
            height: 100vh;
        }

        .header {
            grid-column: 1 / -1;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 15px 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .header h1 {
            color: white;
            font-size: 1.5rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header-controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .toolbox {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 20px;
            overflow-y: auto;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        }

        .tool-section {
            margin-bottom: 25px;
        }

        .tool-section h3 {
            color: white;
            font-size: 1rem;
            margin-bottom: 15px;
            padding-bottom: 8px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
        }

        .tool-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }

        .tool-btn {
            aspect-ratio: 1;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tool-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.05);
        }

        .tool-btn.active {
            background: #ff6b6b;
            border-color: #ff6b6b;
            box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
        }

        .canvas-area {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        .canvas-container {
            position: relative;
            background: #fff;
            border: 3px solid #333;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }

        #pixelCanvas {
            display: block;
            image-rendering: pixelated;
            image-rendering: -moz-crisp-edges;
            image-rendering: crisp-edges;
            cursor: crosshair;
        }

        .grid-overlay {
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none;
            opacity: 0.3;
        }

        .properties-panel {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 20px;
            overflow-y: auto;
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        }

        .color-palette {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 3px;
            margin-bottom: 15px;
        }

        .color-swatch {
            aspect-ratio: 1;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .color-swatch:hover {
            transform: scale(1.1);
            border-color: rgba(255, 255, 255, 0.5);
        }

        .color-swatch.active {
            border-color: #ffd93d;
            border-width: 3px;
            transform: scale(1.1);
        }

        .custom-color {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-bottom: 15px;
        }

        .color-picker {
            width: 50px;
            height: 30px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
        }

        .slider-group {
            margin-bottom: 15px;
        }

        .slider-group label {
            color: white;
            font-size: 0.9rem;
            font-weight: 600;
            display: block;
            margin-bottom: 8px;
        }

        .slider {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.2);
            outline: none;
            -webkit-appearance: none;
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #ff6b6b;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        }

        .btn {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            width: 100%;
            margin-bottom: 10px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
        }

        .btn.secondary {
            background: linear-gradient(135deg, #4ecdc4, #44a08d);
        }

        .btn.small {
            padding: 6px 12px;
            font-size: 0.8rem;
        }

        .layers-panel {
            margin-bottom: 20px;
        }

        .layer-item {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .layer-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .layer-item.active {
            background: rgba(255, 107, 107, 0.2);
            border-color: #ff6b6b;
        }

        .layer-name {
            color: white;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .layer-controls {
            display: flex;
            gap: 5px;
        }

        .layer-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.7rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .layer-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .status-bar {
            grid-column: 1 / -1;
            background: rgba(0, 0, 0, 0.2);
            color: white;
            padding: 10px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
        }

        .canvas-size-input {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            color: white;
            padding: 5px 8px;
            width: 60px;
            text-align: center;
        }

        .animation-controls {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
        }

        .frame-timeline {
            display: flex;
            gap: 5px;
            margin: 10px 0;
            overflow-x: auto;
            padding: 5px 0;
        }

        .frame-thumb {
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .frame-thumb:hover {
            border-color: rgba(255, 255, 255, 0.5);
        }

        .frame-thumb.active {
            border-color: #ff6b6b;
            border-width: 3px;
        }

        .preview-area {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
            text-align: center;
        }

        .preview-canvas {
            background: #fff;
            border: 2px solid #333;
            border-radius: 4px;
            image-rendering: pixelated;
        }

        @media (max-width: 1200px) {
            .editor-container {
                grid-template-columns: 250px 1fr 280px;
            }
        }

        @media (max-width: 900px) {
            .editor-container {
                grid-template-columns: 1fr;
                grid-template-rows: 60px 1fr 200px 60px;
            }
            
            .toolbox, .properties-panel {
                display: none;
            }
            
            .mobile-controls {
                display: flex;
                background: rgba(255, 255, 255, 0.1);
                backdrop-filter: blur(20px);
                padding: 10px;
                gap: 10px;
                overflow-x: auto;
            }
        }

        .brush-preview {
            width: 30px;
            height: 30px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            margin: 10px 0;
        }

        .onion-skin {
            opacity: 0.3;
            pointer-events: none;
        }

        .export-options {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 15px;
            margin-top: 20px;
        }

        .file-input {
            display: none;
        }

        .zoom-controls {
            display: flex;
            gap: 5px;
            align-items: center;
        }

        .zoom-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .zoom-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .transform-controls {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin: 10px 0;
        }