* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e8e8e8;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #ff6b9d, #c44569, #ff6b9d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.3);
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.subtitle {
    color: #8892b0;
    margin-top: 10px;
    font-size: 1.1rem;
}

.main-area {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.draw-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ff6b9d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '✂';
    font-size: 1.5rem;
}

.canvas-wrapper {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 400px;
    height: 400px;
    display: inline-block;
}

.fold-indicator {
    display: none;
}

.fold-line-h {
    display: none;
}

.fold-line-v {
    display: none;
}

.draw-area-label {
    text-align: center;
    margin-bottom: 10px;
    color: #ff6b9d;
    font-size: 0.9rem;
    font-weight: bold;
}

#drawCanvas {
    cursor: crosshair;
    display: block;
    width: 400px;
    height: 400px;
}

.tools {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.tool-group {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 10px;
}

.tool-label {
    font-size: 0.85rem;
    color: #8892b0;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* トグルスイッチのスタイル */
input[type="checkbox"] {
    display: none;
}

.transparent-label {
    font-size: 0.85rem;
    color: #8892b0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 48px;
}

.transparent-label::before {
    content: '';
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.transparent-label::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"]:checked + .transparent-label::before {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 107, 157, 0.3);
}

input[type="checkbox"]:checked + .transparent-label::after {
    left: 22px;
}

.transparent-label:hover::before {
    background: rgba(255, 255, 255, 0.3);
}

input[type="checkbox"]:checked + .transparent-label:hover::before {
    background: linear-gradient(135deg, #ff7aab, #d45579);
}

input[type="range"] {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.5);
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.result-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.result-section .section-title::before {
    content: '🎨';
}

#resultCanvas {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: block;
    background: #fff;
}

.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.animation-overlay.active {
    display: flex;
}

.paper-animation {
    width: 400px;
    height: 400px;
    position: relative;
    perspective: 1000px;
}

.fold-paper {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: unfold 2s ease-out forwards;
}

@keyframes unfold {
    0% {
        transform: rotateX(0deg) rotateY(0deg) scale(0.5);
    }
    30% {
        transform: rotateX(180deg) rotateY(0deg) scale(0.6);
    }
    60% {
        transform: rotateX(180deg) rotateY(180deg) scale(0.8);
    }
    100% {
        transform: rotateX(0deg) rotateY(0deg) scale(1);
    }
}

.tips {
    background: rgba(255, 107, 157, 0.1);
    border-left: 4px solid #ff6b9d;
    padding: 15px 20px;
    border-radius: 0 10px 10px 0;
    margin-top: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tips strong {
    color: #ff6b9d;
}

.brush-preview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-dot {
    border-radius: 50%;
    background: currentColor;
}

@media (max-width: 900px) {
    .main-area {
        flex-direction: column;
        align-items: center;
    }

    h1 {
        font-size: 1.8rem;
    }

    #drawCanvas {
        width: 280px !important;
        height: 280px !important;
    }
    
    .canvas-wrapper {
        width: 280px !important;
        height: 280px !important;
    }
    
    #resultCanvas {
        width: 280px !important;
        height: 280px !important;
    }
}

.sparkle {
    position: fixed;
    pointer-events: none;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ff6b9d, transparent);
    border-radius: 50%;
    animation: sparkle 1s ease-out forwards;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(2) rotate(180deg);
        opacity: 0;
    }
}

.mode-toggle {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 25px;
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: #8892b0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
}

/* 確認モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f2e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.5s ease-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.modal-title {
    font-size: 1.5rem;
    color: #ff6b9d;
    margin-bottom: 15px;
    font-weight: bold;
}

.modal-message {
    font-size: 1rem;
    color: #e8e8e8;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.6);
}

/* Toast通知 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1e3a5f, #2a5298);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast.success {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.toast span {
    font-size: 1.3em;
}

