* {
    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;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.05);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 14px;
    color: #999;
}

.mobile-hint {
    color: #667eea;
    font-weight: 500;
    margin-top: 5px;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
}

.settings-section h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.setting-item label {
    color: #666;
    font-size: 14px;
    min-width: 80px;
}

.setting-item input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.setting-item input[type="color"] {
    flex: 1;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    flex: 1;
    cursor: pointer;
}

.setting-item span {
    color: #666;
    font-size: 14px;
    min-width: 50px;
}

.info-text {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.info-text p {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.info-text span {
    color: #667eea;
    font-weight: bold;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    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 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

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

.result-section {
    margin-bottom: 30px;
}

.result-section h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.result-container {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    text-align: center;
}

#resultCanvas {
    max-width: 100%;
    height: auto;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.preview-hint {
    text-align: center;
    color: #667eea;
    font-size: 14px;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 8px;
}

.fullscreen-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-preview img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.close-preview {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-preview:hover {
    background: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .upload-text {
        font-size: 16px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}