.speech-bubble-text {
    width: 100%;
    font-size: 1.08rem;
    line-height: 1.3;
    word-break: break-word;
    white-space: pre-line;
    overflow-wrap: break-word;
    text-align: left;
}

.canvas-area.rainbow-glow {
    box-shadow: 0 0 80px 24px rgba(255, 255, 255, 0.18);
    animation: rainbowGlow 1.2s ease-out;
}

@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 80px 24px rgba(255, 255, 255, 0.18), 0 0 0 0 rgba(0, 0, 0, 0);
        background:
            radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0) 55%),
            linear-gradient(135deg, #f3f2ff, #e1f4ff);
    }

    30% {
        box-shadow: 0 0 120px 48px rgba(255, 255, 255, 0.28), 0 0 0 0 rgba(0, 0, 0, 0);
        background:
            radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0) 55%),
            linear-gradient(135deg, #ffb6c1, #ffd700, #90ee90, #87cefa, #ff69b4, #ffa07a, #20b2aa, #9370db, #ff6347, #40e0d0);
    }

    70% {
        box-shadow: 0 0 120px 48px rgba(255, 255, 255, 0.28), 0 0 0 0 rgba(0, 0, 0, 0);
        background:
            radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0) 55%),
            linear-gradient(135deg, #ffb6c1, #ffd700, #90ee90, #87cefa, #ff69b4, #ffa07a, #20b2aa, #9370db, #ff6347, #40e0d0);
    }

    100% {
        box-shadow: 0 0 80px 24px rgba(255, 255, 255, 0.18), 0 0 0 0 rgba(0, 0, 0, 0);
        background:
            radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0) 55%),
            linear-gradient(135deg, #f3f2ff, #e1f4ff);
    }
}

/* ヘッダー背景画像（仮） */
.header-with-bg {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border-radius: 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
}

.header-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=900&q=80') center/cover no-repeat;
    opacity: 0.35;
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 32px 0 18px 0;
}

/* まとめポップアップボタン */
.summary-popup-btn {
    background: linear-gradient(135deg, #9f7bff, #6c8cff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(111, 137, 255, 0.18);
    transition: background 0.2s;
}

.summary-popup-btn:hover {
    background: linear-gradient(135deg, #6c8cff, #9f7bff);
}

/* まとめポップアップ本体 */
.summary-popup {
    position: absolute;
    top: 32px;
    right: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 24px 28px 18px 24px;
    min-width: 220px;
    max-width: 320px;
    z-index: 100;
}

.summary-popup-content {
    position: relative;
}

.close-popup {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.3rem;
    color: #888;
    cursor: pointer;
    padding: 2px 8px;
}

.close-popup:hover {
    color: #333;
}

.summary-popup #summaryPopupText {
    font-size: 1rem;
    color: #333;
    margin-top: 8px;
    white-space: pre-line;
}

/* 下部セクション左右分割レイアウト */
.side-by-side {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.left-side,
.right-side {
    flex: 1 1 0;
    min-width: 0;
}

.left-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.right-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (max-width: 900px) {
    .side-by-side {
        flex-direction: column;
        gap: 0;
    }

    .left-side,
    .right-side {
        width: 100%;
        margin-bottom: 18px;
    }
}

/*
========================================
 new.css
 MANY VOICES, ONE VOICE 用デザイン
========================================
*/

/* 0. ページ全体の基本ルール */
* {
    box-sizing: border-box;
}

/* 1. body（ページ全体）の設定 */
body {
    margin: 0;
    padding: 16px;
    font-family: 'Kaisei Opti', system-ui, -apple-system, BlinkMacSystemFont, "Yu Gothic", "Hiragino Sans", sans-serif;
    background: radial-gradient(circle at top, #fef9ff 0%, #e4f0ff 40%, #d7ecff 100%);
    color: #223;
}

/* 2. 全体コンテナ */
.page-wrapper {
    max-width: 1080px;
    margin: 0 auto;
}

/* 3. ヘッダー部分 */
.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.main-title {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

.main-title-sub {
    font-size: 1.1rem;
    font-weight: 400;
}

.caption {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #555;
}

/* 4. 各セクション共通の見た目 */
.section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.6),
        0 12px 25px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-size: 1.1rem;
    margin: 0 0 6px;
}

.section-text {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #555;
}

/* 5. フォームの見た目 */
.form-row {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #444;
}

.text-input,
.textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccd6ea;
    font-size: 0.95rem;
    outline: none;
    background: #fdfdff;
}

.text-input:focus,
.textarea:focus {
    border-color: #6c8cff;
    box-shadow: 0 0 0 2px rgba(108, 140, 255, 0.2);
}

/* 6. ボタンのスタイル */
.btn-primary,
.btn-secondary,
.btn-outline {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

/* メインのボタン（問いセット用） */
.btn-primary {
    background: linear-gradient(135deg, #6c8cff, #9f7bff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(111, 137, 255, 0.4);
}

/* 声追加ボタン */
.btn-secondary {
    background: linear-gradient(135deg, #ffb36b, #ff82a3);
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 142, 142, 0.4);
}

/* まとめボタン */
.btn-outline {
    background: #ffffff;
    border: 1px solid #9f7bff;
    color: #6446cc;
}

/* ボタン共通のホバー効果（少し浮く感じ） */
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* 7. キャンバス部分のレイアウト */
.section-canvas {
    margin-top: 4px;
}

.canvas-area {
    position: relative;
    margin-top: 12px;
    min-height: 520px;
    height: 60vh;
    border-radius: 32px;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #f3f2ff, #e1f4ff);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    font-family: 'BIZ UDPGothic', system-ui, sans-serif;
}

/* 中央の問いカード */
.question-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 80%);
    background: #ffffff;
    border-radius: 18px;
    padding: 12px 14px;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 10px 20px rgba(0, 0, 0, 0.12);
}

.question-label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a88b8;
    margin-bottom: 4px;
}

.question-text {
    font-size: 2.1rem;
    font-weight: bold;
    color: #222;
    letter-spacing: 0.02em;
    line-height: 1.25;
    font-family: 'BIZ UDPGothic', system-ui, sans-serif;
}

/* スピーチバブルを置くエリア */
.bubble-area {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow: hidden;
}

/* 8. スピーチバブルの見た目 */
.speech-bubble {
    position: absolute;
    /* ドラッグ可能なためtransformは使わない */

    max-width: 340px;
    min-width: 120px;
    /* キャンバス外にはみ出さないように */
    overflow: auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px 18px;
    font-size: 1.15rem;
    color: #333;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.10),
        0 8px 24px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.9);
    border: none;
    /* 立体感のためのグラデーションとシャドウ */
    background-blend-mode: lighten;
    font-family: 'BIZ UDPGothic', system-ui, sans-serif;

    /* トランプをめくるように、ふわっと浮くアニメーション */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* スピーチバブルの三角（しっぽ） */
.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 18px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.10));
}

/* ホバーしたとき、少し浮いて角度が変わる */
.speech-bubble:hover {
    /* ホバー時のtransformアニメーション（震える動き）を削除 */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 14px 26px rgba(0, 0, 0, 0.2);
}

/* 9. まとめ表示部分 */
.summary-display {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f4ff;
    border: 1px dashed #b9a6ff;
    font-size: 0.9rem;
    min-height: 40px;
}

/* 10. 画面幅が小さいとき（スマホ）の調整 */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .section {
        padding: 12px 12px;
    }

    .main-title {
        font-size: 1.3rem;
    }

    .canvas-area {
        min-height: 240px;
    }

    .question-card {
        padding: 10px 10px;
    }

    .speech-bubble {
        max-width: 180px;
        font-size: 0.8rem;
    }
}

/* セクションタイトルのツールチップ */
.section-tooltip {
    position: absolute;
    background: #fff;
    color: #333;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 16px 22px;
    font-size: 1.08rem;
    z-index: 9999;
    border: 1px solid #e0e0ff;
    max-width: 340px;
    pointer-events: none;
    white-space: pre-line;
}

.section-tooltip::after {
    content: "";
    position: absolute;
    top: 12px;
    left: -16px;
    border-width: 8px 16px 8px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

/* キャンバスの高さをさらに縮める */
.section-canvas .canvas-area {
    min-height: 220px;
    height: 26vh;
    border-radius: 32px;
}

/* 入力欄のプレースホルダーもKaisei Optiに */
.text-input::placeholder,
.textarea::placeholder {
    font-family: 'Kaisei Opti', system-ui, -apple-system, BlinkMacSystemFont, "Yu Gothic", "Hiragino Sans", sans-serif;
    font-size: 0.98em;
    color: #888;
    opacity: 1;
}

/* キャンバスの幅を広げる */
.section-canvas .canvas-area {
    min-width: 440px;
    width: 100%;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* キャンバスのサイズを大きく戻す */
.section-canvas .canvas-area {
    min-width: 0;
    width: 100%;
    max-width: 1400px;
    min-height: 520px;
    height: 60vh;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 900px) {
    .section-canvas .canvas-area {
        min-width: 0;
        max-width: 100%;
        min-height: 240px;
        height: 28vh;
    }
}