* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.upload-area {
    background: white;
    border: 3px dashed #667eea;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content p {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.hint {
    color: #888;
    font-size: 0.9rem !important;
}

.controls {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 25px;
}

.control-group:last-of-type {
    margin-bottom: 30px;
}

.control-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.control-group label span {
    color: #667eea;
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #667eea, #764ba2);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: #764ba2;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.preview-area {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.preview-box {
    text-align: center;
}

.preview-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.preview-box canvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    image-rendering: pixelated;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
    }

    .controls {
        padding: 20px;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }
}