.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-upload label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.image-upload input[type="file"] {
    display: none;
}

.preview {
    width: 200px;
    height: 200px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview::before {
    content: "クリックまたはドラッグ＆ドロップで画像をアップロード";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #666;
    text-align: center;
    width: 80%;
    pointer-events: none;
}

.preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview.has-image img {
    opacity: 1;
}

.preview.dragover {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.preview.has-image::before {
    display: none;
}

.button-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.preview-section {
    margin: 20px 0;
    position: relative;
}

.preview-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto;
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.section-title {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
}

#resultPreview {
    position: absolute;
    cursor: grab;
    user-select: none;
    max-width: 150px;
    max-height: 150px;
    transition: transform 0.1s ease;
    will-change: transform;
    touch-action: none;
}

#resultPreview.dragging {
    cursor: grabbing;
    transform: scale(1.02);
    opacity: 0.95;
    transition: none;
}

.name-preview {
    position: absolute;
    font-size: 24px;
    font-family: "游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", sans-serif;
    color: #333;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

#namePreview {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}