:root {
    --page-bg: #F9F4EC;
    --paper-bg: #FFFDF7;
    --header-bg: #FAF6EE;
    --text-main: #4A3A2A;
    --text-sub: #7A6855;
    --accent-brown: #573D30;
    --accent-red: #E75E40;
    --accent-teal: #4CA6A6;
    --accent-olive: #C9B44C;
    --accent-orange: #D87D4A;
    --radio-checked: #4CAF50;
    --dome-bg: #8CD6E6;
    --card-shadow: 0 4px 14px rgba(87, 61, 48, 0.08);
}

* { box-sizing: border-box; }

html {
    background: var(--page-bg);
    scroll-padding-top: 220px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'ヒラギノ丸ゴ Pro','Hiragino Maru Gothic Pro','メイリオ','Segoe UI',system-ui,sans-serif;
    color: var(--text-main);
    background: var(--page-bg);
    line-height: 1.5;
}

/* 全体コンテナ */
#app-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* 固定ヘッダー */
#header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    /* border-bottom: 4px solid var(--accent-brown); */
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 0.8rem 1rem 0;
    overflow: hidden;
}

/* 背景の淡いイラスト装飾 (SVGインライン表現) */
.header-bg-decor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: 
        url("../images/header__bg-1.png") no-repeat center/contain,
        url("../images/header__bg-2.png") no-repeat center/contain;
}

/* タイトルエリア */
.title-area {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: -1.6rem;
    z-index: 10;
    img {
        width: 100%;
        max-width: 240px;
        height: auto;
        margin-bottom: 0.2rem;
    }
}

.roof-icon {
    display: inline-block;
    width: 48px;
    height: 18px;
    margin-bottom: 2px;
}

.roof-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--accent-brown);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.title-area h1 {
    margin: 0;
    font-size: clamp(17px, 3.2vw, 26px);
    color: var(--accent-brown);
    letter-spacing: 0.05em;
    font-weight: 800;
}

.title-area h1 span {
    font-size: 0.85em;
    font-weight: normal;
}

/* ヘッダーメインビューポート（ドーム＆キャラクター＆吹き出し） */
.header-viewport {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
    min-height: 140px;
}

/* 水色半円ドーム */
.dome-container {
    position: relative;
    /* width: 100%; */
    /* max-width: 500px; */
    /* height: 250px; */
    width: clamp(280px, 50vw, 360px);
    aspect-ratio: 2 / 1;
    background: var(--dome-bg);
    /* border-radius: 120px 120px 0 0; */
    border-radius: 260px 260px 0 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.05);
    border-bottom: 14px solid #a47f4e;
}

/* 中央キャラクター画像 */
.character-img {
    position: relative;
    z-index: 3;
    height: clamp(100px, 18vw, 125px);
    margin-bottom: 0;
}

/* 吹き出し共通 */
.speech-bubble {
    position: absolute;
    bottom: clamp(-10px, 1.5vw, 25px);
    border-radius: 50px;
    color: #FFF;
    padding: 0.6rem 1.1rem;
    text-align: center;
    /* box-shadow: 0 4px 12px rgba(0,0,0,0.15); */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

/* 左吹き出し（合計金額） */
.bubble-left {
    width: clamp(135px, 25vw, 175px);
    height: clamp(135px, 25vw, 175px);
    background: url("../images/bubble-1.png") no-repeat center/contain;

    .b-label {
        position: absolute;
        top: 10%;
        -webkit-text-stroke: 3px #d1663f;
        font-size: 0.75rem;
        opacity: 0.9;
        line-height: 1;
        margin-bottom: 2px;
    }

    .b-label::after {
        content: attr(data-text);
        position: absolute;
        inset: 0;
        color: #fff;
        -webkit-text-stroke: 0;
        pointer-events: none;
    }

    .b-amount {
        font-size: clamp(1.4rem, 4vw, 2rem);
        font-weight: 900;
        letter-spacing: -0.02em;
        line-height: 1.1;
    }

    .b-unit {
        font-size: 0.75rem;
        line-height: 1;
        margin-top: 2px;
    }
}


/* 右吹き出し（メッセージ） */
.bubble-right {
    width: clamp(135px, 25vw, 175px);
    height: clamp(135px, 25vw, 175px);
    padding: 0.5rem 0.8rem;
    background: url("../images/bubble-2.png") no-repeat center/contain;

    .b-text {
        padding: 0 0 0.5rem;
        font-size: clamp(0.75rem, 2vw, 0.92rem);
        font-weight: 700;
        line-height: 1.3;
        word-break: break-word;
    }

}


/* PC大画面向けレイアウト調整 */
@media (min-width: 380px) {
    #header {
    padding-top: 1rem;
    }
    .bubble-left {
    right: calc(50% + clamp(50px, 15vw, 120px));
    }
    .bubble-right {
    left: calc(50% + clamp(50px, 15vw, 120px));
    }
}
@media (max-width:515px) {
    .header-bg-decor {
        background: 
            url("../images/header__bg-1.png") no-repeat left/cover,
            url("../images/header__bg-2.png") no-repeat right/cover;
    }
}
/* モバイル（スマホ）向け調整 */
@media (max-width:380px) {
    html {
    scroll-padding-top: 190px;
    }
    #header {
    padding: 0.5rem 0.5rem 0;
    }
    .bubble-left {
    left: 2px;
    }
    .bubble-right {
    right: 2px;
    }
}

/* ピル（カテゴリー見出し） */
.pill-wrapper {
    margin: 1.8rem 0 1rem;
}

.pill {
    display: inline-block;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #FFF;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    letter-spacing: 0.04em;
}

.pill.orange { background: var(--accent-orange); }
.pill.teal   { background: var(--accent-teal); }
.pill.olive  { background: var(--accent-olive); }

/* 質問カード */
.question-card {
    background: var(--paper-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.1rem;
    border-left: 8px solid var(--accent-orange);
    transition: all 0.25s ease;
}

.question-card:hover {
    box-shadow: 0 6px 18px rgba(87, 61, 48, 0.12);
    transform: translateY(-1px);
}

.question-card.answered {
    border-left-color: var(--radio-checked);
    background: #FFFFFF;
}

.question-title {
    margin: 0 0 0.8rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

/* ラジオボタン選択肢 */
.option-label {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    font-size: 1.02rem;
    margin: 0.35rem 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.option-label:hover {
    background: #F4EEDC;
}

.option-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-radio {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2.5px solid #8D6E63;
    border-radius: 50%;
    background: #FFF;
    margin-right: 0.75rem;
    transition: all 0.15s ease;
}

.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--radio-checked);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.option-label input:checked + .custom-radio {
    border-color: var(--radio-checked);
}

.option-label input:checked + .custom-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.option-text {
    color: var(--text-main);
    font-weight: 500;
}

.option-label input:checked ~ .option-text {
    font-weight: 700;
    color: #2E7D32;
}

@media (max-width: 600px) {
    .question-card {
    padding: 1rem;
    }
    .question-title {
    font-size: 1.05rem;
    }
    .option-label {
    font-size: 0.95rem;
    padding: 0.5rem 0.4rem;
    }
}