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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.info-card {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-card ul {
    list-style-position: inside;
    color: #555;
    line-height: 1.8;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h3 {
    color: #555;
    margin: 20px 0 10px 0;
}

.upload-section {
    margin: 20px 0;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s;
}

.file-label:hover {
    background: #5568d3;
}

.preview-section {
    margin-top: 20px;
    text-align: center;
}

#previewCanvas, #pixelCanvas {
    border: 2px solid #ddd;
    border-radius: 8px;
    max-width: 100%;
    margin: 10px 0;
    background: white;
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-group label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.setting-group input[type="number"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    flex: 1;
    min-width: 150px;
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-group input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.info-text {
    color: #667eea;
    font-weight: 500;
    margin-top: 15px;
    padding: 10px;
    background: #f0f0ff;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.btn-primary, .btn-secondary, .btn-success {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102,126,234,0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    width: auto;
    margin-top: 0;
    padding: 10px 20px;
    font-size: 0.9em;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16,185,129,0.3);
}

.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.status.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.pixel-preview {
    margin-top: 20px;
    text-align: center;
}

#imageInfo, #pixelInfo {
    color: #666;
    margin-top: 10px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .setting-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting-group label {
        min-width: auto;
    }
    
    .setting-group input[type="number"] {
        width: 100%;
    }
}
