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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 30px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}
.step-summary {
    display: none;
    margin-bottom: 20px;
    background: #f8f9ff;
    border: 1px solid #d8dcff;
    color: #334;
    padding: 12px 14px;
    border-radius: 8px;
}

.step-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.step-summary-count {
    font-weight: bold;
    color: #333;
    font-size: 13px;
}

.step-summary-label {
    font-weight: bold;
    color: #667eea;
    font-size: 13px;
    text-align: right;
}

.step-progress {
    margin-top: 10px;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
}

.step-progress-bar {
    height: 100%;
    width: 0%;
    background: #667eea;
    border-radius: 999px;
    transition: width 0.2s ease;
}


.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step.active .step-circle {
    background: #667eea;
    color: white;
}

.step.completed .step-circle {
    background: #4caf50;
    color: white;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.upload-area:hover {
    background: #eef0ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #eef0ff;
    border-color: #4caf50;
}

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

.preview-container {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 60vh;
    overflow: hidden;
}

.preview-image {
    max-width: 100%;
    max-height: 45vh;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin: 0px auto;
    display: block;
}

.canvas-container {
    position: relative;
    margin: 20px auto;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    max-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    max-width: 100%;
}

.notice {
    background: #f8f9ff;
    border: 1px solid #d8dcff;
    color: #334;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.controls {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.control-group {
    margin-bottom: 8px;
    width: 16%;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="range"], input[type="number"], select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="range"] {
    width: 100%;
    padding: 0;
    height: 32px;
}

.fixed-value {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

.control-note {
    margin-top: 6px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.checkbox-group label {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

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

button {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.checkbox-group {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 5px;
    gap: 10px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.red-frame {
    position: absolute;
    border: 3px solid red;
    pointer-events: none;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

.cut-path-canvas {
    cursor: crosshair;
}

.attachment-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff0000;
    border: 2px solid white;
    cursor: move;
}

.white-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.white-overlay.active {
    display: block;
}

.white-overlay:not(.active) {
    display: none;
}

.preview-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 0;
}

.preview-slider {
    width: 100%;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.preview-slider::-webkit-scrollbar {
    display: none;
}

.preview-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .step-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step {
        flex: 0 0 calc(33.333% - 10px);
        font-size: 12px;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

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

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
        margin-bottom: 10px;
    }

    .controls {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .control-group {
        width: 100%;
        margin-bottom: 0;
    }

    label {
        font-size: 13px;
        line-height: 1.4;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }

    .step-indicator {
        display: none;
    }

    .step-summary {
        display: block;
    }
}

@media (max-width: 480px) {
    .controls {
        padding: 12px;
    }

    input[type="number"], select {
        font-size: 13px;
        padding: 7px;
    }

    .step {
        flex: 0 0 calc(50% - 5px);
    }

    .step-indicator::before {
        display: none;
    }
}

/* ローディング表示 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

