:root {
    --primary-color: #A3C9C7;
    /* Soft sage green */
    --primary-dark: #7A9E9C;
    --background-color: #F2F0EB;
    /* Slightly darker warm gray for contrast */
    --text-color: #4A4440;
    /* Soft warm dark gray/brown */
    --card-bg: #FFFFFF;
    --accent-color: #E6BFA5;
    /* Soft Peach */
    --border-color: #E2DDD5;
    --btn-unselected: #F2EBE5;
    --line-color: #06C755;
    /* LINE official brand color */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Kiwi Maru', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 10px;
}

h1 {
    font-size: 1.4rem;
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
    font-weight: 400;
}

h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
}

.subtitle {
    font-size: 0.95rem;
    color: #7B736D;
    text-align: center;
    margin-bottom: 25px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.step-info {
    font-size: 0.85rem;
    color: #8C847E;
}

/* Step Container */
.step-container {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 30px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
    flex: 1;
}

/* Options Grid */
.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 30px;
}

.options-grid.vertical {
    flex-direction: column;
    align-items: stretch;
}

.option-btn {
    background-color: var(--btn-unselected);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-family: 'Kiwi Maru', serif;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background-color: #E8DED6;
}

.option-btn.selected {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(163, 201, 199, 0.5);
}

/* Feeling Selection Area */
.feeling-selection-area {
    background-color: #F7F5F0;
    /* Slightly deeper gray to hold clouds */
    border: 1px solid #E6E2DA;
    border-radius: 20px;
    padding: 30px 15px;
    margin: 20px -10px;
    /* Slight overflow for better mobile feel */
}

/* Feeling Buttons (Cloud-like / Moyamoya Style) */
.feeling-btn {
    position: relative;
    background-color: rgba(255, 255, 255, 0.92);
    /* Much more opaque */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid #fff;
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
    /* Irregular shape */
    padding: 12px 25px;
    margin: 8px;
    font-size: 0.95rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatCloud 5s ease-in-out infinite;
    color: var(--text-color);
}

.feeling-btn:nth-child(even) {
    border-radius: 65% 35% 50% 50% / 50% 50% 50% 50%;
    animation-delay: -1.5s;
    animation-duration: 6s;
}

.feeling-btn:nth-child(3n) {
    border-radius: 45% 55% 40% 60% / 60% 40% 60% 40%;
    animation-delay: -3s;
}

.feeling-btn:nth-child(4n) {
    border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%;
    animation-delay: -4.5s;
}

.feeling-btn:hover {
    transform: scale(1.05);
    background-color: #fbfbfb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.feeling-btn.selected {
    background-color: var(--primary-color);
    border-radius: 50px;
    /* Morph to normal when selected or keep cloud? Let's keep a softer cloud */
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: none;
    transform: scale(1.1);
}

@keyframes floatCloud {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

/* Action Buttons */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.actions.split {
    justify-content: space-between;
}

.actions.vertical {
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

button {
    font-family: 'Kiwi Maru', serif;
}

.next-btn {
    background-color: var(--text-color);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 200px;
}

.next-btn:disabled {
    background-color: #D3CDC7;
    cursor: not-allowed;
}

.next-btn.complete {
    background-color: var(--primary-color);
}

.back-btn {
    background-color: transparent;
    color: #8C847E;
    border: 1px solid #C4BCB4;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 200px;
}

.back-btn:hover {
    background-color: #F4EFEA;
}

.copy-btn {
    background-color: #fff;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.line-btn {
    background-color: var(--line-color);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.2);
}

/* Beliefs List */
.beliefs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.belief-card {
    background-color: var(--btn-unselected);
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.belief-card:hover {
    background-color: #E8DED6;
}

.belief-card.selected {
    background-color: var(--primary-color);
    color: white;
}

/* Custom Input */
.custom-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-input-group label {
    font-size: 0.9rem;
    color: #7B736D;
}

.custom-input-group input[type="text"],
.custom-input-group textarea {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background-color: #fff;
    resize: vertical;
}

.custom-input-group input:focus,
.custom-input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Message Boxes */
.message-box {
    background-color: #fcfcfc;
    border: 1px solid #f0f0f0;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.message-box p {
    white-space: pre-wrap;
    margin: 0;
}

#needs-true {
    font-size: 1.05rem;
    font-weight: 500;
    color: #4a4440;
    background-color: #ffffff;
    padding: 1.5rem 1.8rem;
    border-radius: 12px;
    border-left: 6px solid var(--accent-color);
    margin-top: 1.5rem;
    text-align: left;
    /* 親の中央揃えを上書きして左寄せ */
    display: block;
    /* 確実に全幅を使って、左揃えを効かせる */
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    line-height: 1.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.message-box.gentle {
    background-color: #fdfaf7;
    border-color: #f7ede2;
    color: #5C4C42;
}

.message-box.highlight {
    background-color: #EBF3F2;
    /* very soft sage */
}

.message-box.reframe {
    background-color: #f0f7f4;
    border-color: #e0f0e9;
    color: #2d5a4c;
}

.message-box.story-message {
    text-align: left;
    background-color: #fff;
    border: 1px solid #eee;
}

.mt-2 {
    margin-top: 12px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mt-5 {
    margin-top: 48px;
}

/* Breathing Screen (Step 8) */
.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.breathing {
    background-color: var(--background-color);
    box-shadow: none;
}

.breath-text {
    font-size: 1.3rem;
    margin-bottom: 24px;
    transition: opacity 1.5s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    /* so it doesn't take layout space initially */
    transform: translateY(10px);
}

/* Summary Box */
.summary-box {
    background-color: #F5F2EF;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
}

.summary-box pre {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0;
}

.guidance {
    text-align: center;
    font-size: 0.95rem;
}

.guidance .note {
    font-size: 0.85rem;
    color: #8C847E;
    margin-top: 5px;
}

.copy-success-msg {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        position: relative;
        /* restores layout if hidden was absolute */
    }
}