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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #E8F5E9;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

.title {
    font-size: 28px;
    font-weight: 900;
    color: #E91E63;
    margin-bottom: 8px;
}

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

/* Steps */
.step {
    margin-bottom: 32px;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-badge {
    display: inline-block;
    background: #E91E63;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Input fields */
.name-input-wrapper {
    max-width: 400px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    border: 2px solid #C8E6C9;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: #7CB342;
}

/* Character grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.character-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.character-card-image {
    width: 100%;
    aspect-ratio: 348 / 258;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.character-card-inputs {
    padding: 12px;
}

.character-card-inputs .input-field {
    margin-bottom: 8px;
    font-size: 14px;
    padding: 8px 12px;
}

.character-card-inputs textarea.input-field {
    resize: vertical;
    min-height: 60px;
    margin-bottom: 0;
}

.char-label {
    font-size: 12px;
    font-weight: 700;
    color: #7CB342;
    margin-bottom: 4px;
}

/* Font size control */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 300px;
}

.font-size-control input[type="range"] {
    flex: 1;
    accent-color: #7CB342;
    height: 6px;
}

.font-size-value {
    font-size: 16px;
    font-weight: 700;
    color: #7CB342;
    min-width: 44px;
}

/* Generate button */
.generate-wrapper {
    text-align: center;
    margin: 40px 0;
}

.btn-generate {
    display: inline-block;
    background: linear-gradient(135deg, #E91E63, #F06292);
    color: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 20px;
    font-weight: 700;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result section */
.result-section {
    display: none;
    text-align: center;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

.result-section.visible {
    display: block;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.result-image-wrapper {
    margin-bottom: 20px;
}

#resultCanvas {
    display: none;
}

.result-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 32px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-download {
    background: #7CB342;
    color: #fff;
    box-shadow: 0 3px 10px rgba(124, 179, 66, 0.4);
}

.btn-share {
    background: #000;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .title {
        font-size: 22px;
    }

    .btn-generate {
        font-size: 18px;
        padding: 14px 36px;
    }
}

@media (max-width: 480px) {
    .character-grid {
        grid-template-columns: 1fr;
    }

    .title {
        font-size: 18px;
    }

    .step-title {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
