body {
    font-family: Arial, sans-serif;
    background: #f4f4f9;
    margin: 0;
    padding: 20px;
    color: #333;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.actions {
    display: flex;
    gap: 15px;
}
.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}
.upload-btn input {
    display: none;
}
.reset-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.thumb-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}
.preview-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: grab;
    transition: transform 0.2s, opacity 0.2s;
    user-select: none;
}
.preview-grid .thumb-wrapper.dragging img {
    opacity: 0.5;
    border-color: #007bff;
    cursor: grabbing;
}
.remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
}
.settings label {
    margin-right: 20px;
}
.settings input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.canvas-container {
    max-width: 100%;
    overflow: auto;
    background: #e9e9e9;
    padding: 10px;
    border-radius: 4px;
}
canvas {
    display: block;
    max-width: 100%;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
button#downloadBtn {
    padding: 10px 25px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
button#downloadBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
