body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #EDE7DC; /* 全体の背景色を明るい茶色に */
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    display: flex;
    background-color: #F8F5F0; /* コンテナの背景色をより明るい茶系に */
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

.character-area {
    /* flex: 1; を削除し、必要に応じてflex-growを使用するか、heightをautoにする */
    /* 今回は画像が主要なコンテンツなので、flex-growは削除し、高さをコンテンツに合わせる方向で */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #D4B89C; /* キャラクターエリアの背景色を少し濃い茶色に */
    padding: 10px; /* 上下左右のパディングを調整 */
    height: auto; /* 高さをコンテンツに合わせる */
    flex-shrink: 0; /* 縮小しないように設定 */
}

.character-image {
    max-width: 100%;
    height: auto; /* 画像の元の縦横比を維持 */
    display: block;
}

.chat-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: #4A4A4A; /* テキスト色を暗めの茶色に */
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto; /* メッセージが多い場合にスクロール */
    border-bottom: 1px solid #CCC; /* 区切り線を茶色に */
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.message {
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.bot {
    background-color: #E6E0D4; /* ボットの吹き出しを明るい茶色に */
    color: #4A4A4A;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background-color: #8C7B6B; /* ユーザーの吹き出しを落ち着いた茶色に */
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.user-input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#user-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #B0A190; /* 入力欄の枠線も茶色に */
    border-radius: 8px;
    font-size: 16px;
    background-color: #F8F5F0;
    color: #4A4A4A;
}

#send-button {
    padding: 12px 20px;
    background-color: #6B5B4A; /* 送信ボタンを濃い茶色に */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#send-button:hover {
    background-color: #5A4C3E; /* ホバー時の色 */
}

.options-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto; /* オプションボタンが多い場合にスクロール */
}

.option-button {
    padding: 12px 15px;
    background-color: #8C7B6B; /* オプションボタンをユーザー吹き出しと同じ落ち着いた茶色に */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    text-align: left;
    transition: background-color 0.2s ease;
}

.option-button:hover {
    background-color: #7A695B; /* ホバー時の色 */
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .character-area {
        height: auto; /* 高さをコンテンツに合わせる */
        flex-shrink: 0; /* 縮小させない */
        padding: 5px; /* スマホでのパディングも調整 */
        /* ここで必要であればmax-heightを設定して、高さを制限できます。例: max-height: 20vh; */
    }

    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 15px;
        min-height: 250px;
    }

    .chat-messages {
        flex-grow: 1;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .user-input-area {
        flex-direction: column;
        flex-shrink: 0;
    }

    #send-button {
        width: 100%;
    }

    .options-area {
        flex-shrink: 0;
        margin-top: 10px;
    }
}