/* 🎮 かわいいクイズフロントエンドスタイル（モーダル対応＆元デザイン完全再現版） */

/* ========== プレースホルダー（高さ確保） ========== */
.cute-quiz-placeholder {
    min-height: 650px !important;
    display: block !important;
    position: relative !important;
    margin: 40px 0 !important;
    clear: both !important;
    overflow: visible !important;
}

/* ========== クイズラッパー ========== */
.cute-quiz-wrapper {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    clear: both !important;
    float: none !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ========== クイズコンテナ（元の#cute-quizと同じスタイル） ========== */
.cute-quiz-container {
    display: block !important;
    width: 440px !important;
    max-width: 90vw !important;
    margin: 32px auto !important;
    background: #fffefa;
    border-radius: 18px !important;
    box-shadow: 0 4px 20px rgba(137, 171, 151, 0.2);
    padding: 20px 16px 30px 16px; /* パディングを少し減らしてコンパクトに */
    text-align: center;
    font-size: 1em;
    box-sizing: border-box;
    position: relative !important;
    z-index: 1 !important;
    float: none !important;
    clear: both !important;
}

/* データ読み込み前は透明に */
.cute-quiz-container[data-quiz-loaded="false"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* データ読み込み後に表示 */
.cute-quiz-container[data-quiz-loaded="true"] {
    opacity: 1;
}

/* ========== モーダル関連のスタイル ========== */
.cute-quiz-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none;
}

.cute-quiz-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 999999 !important;
}

.cute-quiz-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 20px !important;
    width: calc(100% - 40px) !important;
    max-width: 500px !important; /* 最大幅を少し狭める */
    max-height: calc(100vh - 40px) !important; /* 高さを画面内に収める */
    overflow-y: auto !important;
    overflow-x: hidden !important; /* 横スクロールを防ぐ */
    box-shadow: none !important;
    z-index: 1000000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important; /* 上部から配置 */
    margin: 0 !important; /* マージンをリセット */
}

.cute-quiz-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    background: #89AB97 !important; /* コーポレートカラー */
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    line-height: 40px !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 1000001 !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cute-quiz-modal-close:hover {
    background: #7A9A88 !important;
    transform: scale(1.1) !important;
}

/* モーダル内のクイズコンテナ調整 */
.cute-quiz-modal .cute-quiz-container {
    margin: 20px auto !important; /* 上下に余白を追加 */
    width: 100% !important;
    max-width: 480px !important; /* 最大幅を少し狭める */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    border-radius: 18px !important;
}

.cute-quiz-modal .cute-quiz-placeholder {
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important; /* パディングを削除 */
    display: block !important; /* flexからblockに変更 */
    width: 100% !important;
}

.cute-quiz-modal .cute-quiz-wrapper {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* クイズ開始ボタン */
.cute-quiz-popup-trigger {
    background: #E5B458; /* コーポレートカラーに戻す */
    color: white;
    padding: 20px 40px 20px 80px; /* 左側のパディングを増やす */
    border: none;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(137, 171, 151, 0.3);
    transition: all 0.3s;
    display: block; /* blockに変更 */
    position: relative;
    overflow: visible; /* overflowをvisibleに確実に設定 */
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
    z-index: 1; /* z-indexを設定 */
}

.cute-quiz-popup-trigger:hover {
    background: #E5B458;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(137, 171, 151, 0.4);
}

/* キャラクターアイコン */
.cute-quiz-popup-trigger::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-image: url('https://naruhodoagent.com/wp-content/uploads/2023/09/スクリーンショット-2023-09-14-14.13.21.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: characterSwing 2s ease-in-out infinite;
    z-index: 2; /* z-indexを上げる */
}

/* より楽しげな揺れアニメーション */
@keyframes characterSwing {
    0%, 100% {
        transform: translateY(-50%) rotate(-8deg) scale(1);
    }
    25% {
        transform: translateY(-52%) rotate(8deg) scale(1.05);
    }
    50% {
        transform: translateY(-50%) rotate(-8deg) scale(1);
    }
    75% {
        transform: translateY(-52%) rotate(8deg) scale(1.05);
    }
}

/* ボタンのメインテキスト */
.quiz-button-main-text {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

/* ティッカー部分のコンテナ */
.quiz-ticker-container {
    height: 24px;
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* ティッカーのテキスト */
.quiz-ticker-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 14px;
    line-height: 24px;
    opacity: 0;
    transform: translateY(30px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* 各テキストのアニメーションタイミング */
.quiz-ticker-text:nth-child(1) {
    animation: tickerSlide 25s infinite 0s;
}

.quiz-ticker-text:nth-child(2) {
    animation: tickerSlide 25s infinite 5s;
}

.quiz-ticker-text:nth-child(3) {
    animation: tickerSlide 25s infinite 10s;
}

.quiz-ticker-text:nth-child(4) {
    animation: tickerSlide 25s infinite 15s;
}

.quiz-ticker-text:nth-child(5) {
    animation: tickerSlide 25s infinite 20s;
}

/* ティッカーアニメーション */
@keyframes tickerSlide {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    4%, 16% {
        opacity: 1;
        transform: translateY(0);
    }
    20% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* ボタンの内部構造 */
.quiz-button-content {
    display: block;
    width: 100%;
}

/* ========== 元のデザインのスタイルをそのまま適用 ========== */

/* メインブロック */
.cute-quiz-container .cq-main {
    position: static !important;
    z-index: 1 !important;
}

/* クリア画面 */
.cute-quiz-container .cq-clear {
    position: static !important;
    z-index: 1 !important;
    margin-top: 0; /* 上部マージンを削除 */
    display: none !important; /* 初期状態では非表示 */
    align-items: center !important; /* 上下中央配置 */
    justify-content: center !important; /* 左右中央配置 */
    min-height: 500px !important; /* 最小高さを設定 */
}

/* クリア画面が表示される時のスタイル */
.cute-quiz-container .cq-clear[style*="display: block"],
.cute-quiz-container .cq-clear[style*="display:block"],
.cute-quiz-container .cq-clear[style*="display: flex"],
.cute-quiz-container .cq-clear[style*="display:flex"] {
    display: flex !important; /* flexboxを使用 */
}

/* スター */
.cute-quiz-container .cq-stars {
    margin-bottom: 10px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: static !important;
}

.cute-quiz-container .cq-star {
    font-size: 2.1em;
    color: #e0e0e0;
    text-shadow: 0 2px 16px rgba(224, 224, 224, 0.13), 0 0px 8px rgba(255, 253, 230, 0.07);
    transition: color .22s, text-shadow .18s;
    opacity: 1;
    transform: scale(1);
    display: inline-block;
}

.cute-quiz-container .cq-star.cq-on {
    color: #ffe66b;
    text-shadow: 0 2px 14px rgba(255, 219, 109, 0.33), 0 1px 10px rgba(255, 230, 107, 0.67);
    animation: cqStarPop .45s cubic-bezier(.26, 2.1, .7, 1.05) forwards;
}

@keyframes cqStarPop {
    0% {
        opacity: 1;
        transform: scale(0.7) rotate(-40deg);
    }
    55% {
        opacity: 1;
        transform: scale(1.22) rotate(16deg);
    }
    85% {
        transform: scale(.98) rotate(-8deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* スコア */
.cute-quiz-container .cq-score {
    color: #ff8c3e;
    font-size: 1.13em;
    font-weight: bold;
    margin: 10px 0 13px 0;
    position: static !important;
}

/* クイズ画像 */
.cute-quiz-container .cq-qimgwrap {
    display: flex;
    justify-content: center;
    align-items: center;
    position: static !important;
}

.cute-quiz-container .cq-qimg {
    width: 136px;
    height: 136px;
    object-fit: contain;
    margin: 4px auto 10px auto;
    display: block;
    transition: transform .24s;
    position: static !important;
    z-index: 1;
}

.cute-quiz-container .cq-qimg.cq-anim {
    animation: cqJump 0.65s;
}

@keyframes cqJump {
    0% { transform: scale(1); }
    20% { transform: scale(1.22); }
    40% { transform: scale(.96); }
    60% { transform: scale(1.11); }
    100% { transform: scale(1); }
}

.cute-quiz-container .cq-qimg.cq-sad {
    animation: cqSad .7s;
}

@keyframes cqSad {
    0% { transform: rotate(0deg) scale(1); }
    30% { transform: rotate(-16deg) scale(.85); }
    80% { transform: rotate(-8deg) scale(.9); }
    100% { transform: rotate(0deg) scale(1); }
}

/* 吹き出し */
.cute-quiz-container .cq-balloon-wrap {
    display: flex;
    justify-content: center;
    position: static !important;
}

.cute-quiz-container .cq-balloon {
    background: #fff;
    border-radius: 20px;
    position: relative;
    min-width: 60%;
    max-width: 95%; /* 最大幅を制限 */
    display: inline-block;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(242, 136, 62, 0.09);
    padding: 18px 22px 18px 22px;
    text-align: left;
    font-size: 1.3em; /* 1.08emから1.3emに拡大 */
    font-weight: bold;
    color: #333;
    line-height: 1.8; /* 行間も少し広げる */
    z-index: 2;
    word-wrap: break-word; /* 長い単語の改行 */
    overflow-wrap: break-word;
    word-break: keep-all; /* 日本語の改行を適切に */
}

.cute-quiz-container .cq-balloon:after {
    content: "";
    position: absolute;
    left: 35px;
    bottom: -16px;
    border: 12px solid transparent;
    border-top: 18px solid #fff;
    filter: drop-shadow(0 1px 5px rgba(242, 136, 62, 0.1));
    z-index: 2;
}

/* 選択肢 */
.cute-quiz-container .cq-choices {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
    position: static !important;
}

.cute-quiz-container .cq-choice {
    background: #C9EDE8 !important; /* 指定の背景色に変更 */
    border-radius: 14px !important;
    border: none !important;
    color: #5A5A5A !important;
    font-size: 1.11em !important;
    font-weight: bold !important;
    padding: 15px 20px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 10px rgba(137, 171, 151, 0.1) !important;
    transition: background .13s, transform .11s !important;
    outline: none !important;
    letter-spacing: 0.02em !important;
    line-height: 1.6 !important; /* 行間をさらに広げる */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: auto !important; /* 自動改行に変更 */
    hyphens: auto !important;
    position: relative !important; /* staticからrelativeに変更 */
    text-align: center !important; /* テキストを中央揃え */
    width: 100% !important; /* 幅を統一 */
    min-height: auto !important; /* 高さを自動調整 */
    white-space: normal !important; /* 改行を許可 */
    display: flex !important; /* flexboxで中央配置 */
    align-items: center !important; /* 垂直中央揃え */
    justify-content: center !important; /* 水平中央揃え */
    box-sizing: border-box !important; /* ボックスモデルを統一 */
    max-width: 100% !important; /* 最大幅を制限 */
    overflow: hidden !important; /* はみ出し防止 */
}

.cute-quiz-container .cq-choice:hover {
    background: #B8E2DB;
    transform: translateY(-2px);
}

.cute-quiz-container .cq-choice:active {
    transform: scale(1.02);
}

.cute-quiz-container .cq-choice.cq-correct {
    background: #5AB7B2; /* 正解時の色を指定色に変更 */
    color: #fff;
    animation: cqBounce .7s;
}

.cute-quiz-container .cq-choice.cq-wrong {
    background: #e1e1e1;
    color: #bbb;
    animation: cqShake .5s;
}

/* 不正解時に正解を表示するスタイル */
.cute-quiz-container .cq-choice.cq-show-correct {
    background: #FFE66B !important; /* 目立つ黄色でハイライト */
    color: #5A5A5A !important;
    border: 3px solid #FFC700 !important;
    box-shadow: 0 0 20px rgba(255, 199, 0, 0.6) !important;
    animation: cqPulse 1.5s ease-in-out infinite !important;
    transform: scale(1.05) !important;
    z-index: 10 !important;
}

/* 正解ラベル */
.cute-quiz-container .cq-correct-label {
    position: absolute !important;
    top: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #FF6B6B !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 15px !important;
    font-size: 0.85em !important;
    font-weight: bold !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3) !important;
    animation: cqBounceIn 0.5s ease-out !important;
}

/* 正解ラベルの矢印 */
.cute-quiz-container .cq-correct-label::after {
    content: "" !important;
    position: absolute !important;
    bottom: -6px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 6px solid transparent !important;
    border-right: 6px solid transparent !important;
    border-top: 6px solid #FF6B6B !important;
}

/* 正解表示のパルスアニメーション */
@keyframes cqPulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 199, 0, 0.6);
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 199, 0, 0.8), 0 0 50px rgba(255, 199, 0, 0.4);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 199, 0, 0.6);
        transform: scale(1.05);
    }
}

/* 正解ラベルのバウンスイン */
@keyframes cqBounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.5);
    }
    60% {
        transform: translateX(-50%) translateY(2px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes cqBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    60% { transform: scale(.95); }
    100% { transform: scale(1); }
}

@keyframes cqShake {
    10% { transform: translateX(-7px); }
    20% { transform: translateX(7px); }
    30% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    100% { transform: translateX(0); }
}

/* フィードバック */
.cute-quiz-container .cq-feedback {
    min-height: 39px;
    font-size: 1.19em;
    font-weight: bold;
    margin-bottom: 8px;
    position: static !important;
}

.cute-quiz-container .cq-stamp {
    color: #5AB7B2; /* 正解時のフィードバックも同じ色に */
}

/* 次へボタン */
.cute-quiz-container .cq-next {
    background: #89AB97; /* コーポレートカラー */
    color: #fff;
    font-weight: bold;
    border-radius: 16px;
    padding: 11px 33px;
    border: none;
    margin-top: 10px;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 2px 9px rgba(137, 171, 151, 0.2);
    position: static !important;
    transition: all 0.3s;
}

.cute-quiz-container .cq-next:hover {
    background: #7A9A88;
    transform: translateY(-2px);
}

/* プログレスバー */
.cute-quiz-container .cq-bar-wrap {
    position: relative;
    height: 14px;
    width: 100%;
    margin: 15px 0 0 0;
}

.cute-quiz-container .cq-bar-bg {
    width: 100%;
    height: 12px;
    background: #E8E8E8;
    border-radius: 8px;
    overflow: hidden;
    position: absolute;
    left: 0;
    top: 0;
}

.cute-quiz-container .cq-bar-inner {
    height: 12px;
    background: #89AB97; /* コーポレートカラー */
    border-radius: 8px;
    width: 100%;
    transition: width .18s;
}

/* クリア画面 */
.cute-quiz-container .cq-clearimg {
    margin-top: 20px;
    margin-bottom: 20px;
    max-width: 90%; /* 横幅の90%に拡大 */
    width: 90%;
    height: auto; /* アスペクト比を維持 */
    border-radius: 15px; /* 角丸を少し大きく */
    box-shadow: 0 6px 20px rgba(137, 171, 151, 0.25); /* 影を強調 */
}

.cute-quiz-container .cq-cleartitle {
    font-size: 1.5em; /* タイトルを少し大きく */
    color: #89AB97;
    margin-bottom: 15px; /* 余白を増やす */
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 軽い影を追加 */
}

.cute-quiz-container .cq-clearsub {
    font-size: 1.2em; /* サブタイトルも少し大きく */
    color: #7A9A88;
    margin-bottom: 20px; /* 余白を増やす */
    font-weight: bold;
    line-height: 1.6; /* 行間を広げる */
}

.cute-quiz-container .cq-retry {
    margin: 25px auto 0 auto; /* 上部マージンを増やす */
    background: #89AB97;
    color: #fff;
    font-weight: bold;
    border: none;
    font-size: 1.2em; /* ボタンを少し大きく */
    padding: 15px 40px; /* パディングを増やす */
    border-radius: 25px; /* より丸みを帯びたボタンに */
    box-shadow: 0 4px 15px rgba(137, 171, 151, 0.3); /* 影を強調 */
    cursor: pointer;
    transition: all 0.3s; /* アニメーション時間を調整 */
    transform: translateY(0); /* ホバー効果の準備 */
}

.cute-quiz-container .cq-retry:hover {
    background: #7A9A88;
    transform: translateY(-3px); /* ホバー時に浮き上がる */
    box-shadow: 0 6px 20px rgba(137, 171, 151, 0.4); /* 影を強調 */
}

.cute-quiz-container .cq-cleargroup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0; /* 上下にパディングを追加 */
    width: 100%; /* 幅を100%に */
}

.cute-quiz-container .cq-clearstars {
    margin-bottom: 20px; /* 余白を増やす */
    height: 40px; /* 高さを増やす */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* スター間の間隔を広げる */
}

.cute-quiz-container .cq-clearstars .cq-star {
    font-size: 2.5em; /* スターを大きく */
}

/* モアインフォ（元のデザインに追加可能） */
.cute-quiz-container .cq-moreinfo {
    margin: 24px 0 0 0;
    font-size: 1.01em;
    color: #36a;
    font-weight: bold;
    display: block;
}

.cute-quiz-container .cq-moreinfo a {
    color: #07a;
    text-decoration: underline;
}

/* ローディング */
.quiz-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* レスポンシブ対応（元のデザインと同じ） */
@media (max-width: 500px) {
    .cute-quiz-container {
        font-size: 0.80em;
        width: calc(95vw - 20px) !important; /* 左右10pxずつパディングを考慮 */
        max-width: calc(400px - 20px) !important; /* 最大幅からもパディングを引く */
        margin: 20px 10px !important; /* 左右10pxのマージン */
        padding: 20px 12px 30px 12px !important; /* 内部パディングはそのまま */
    }
    
    /* モーダル内でのスマホ表示調整 */
    .cute-quiz-modal .cute-quiz-container {
        width: calc(100% - 20px) !important; /* 左右10pxずつ余白 */
        max-width: none !important; /* 最大幅制限を解除 */
        margin: 20px 10px !important;
    }
    
    /* モーダルコンテンツのモバイル調整 */
    .cute-quiz-modal-content {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        max-height: 100vh !important; /* 画面の高さに合わせる */
    }
    
    .cute-quiz-container .cq-qimg {
        width: 88px;
        height: 88px;
    }
    .cute-quiz-container .cq-clearimg {
        max-width: 95%; /* モバイルではさらに大きく */
        width: 95%;
    }
    .cute-quiz-container .cq-balloon {
        font-size: 1.2em; /* モバイルでも大きめに保つ */
        padding: 13px 16px; /* パディングを少し調整 */
        min-width: 80%; /* モバイルでの最小幅を拡大 */
        max-width: 100%; /* モバイルでの最大幅を100%に */
        line-height: 1.7; /* 行間を維持 */
    }
    .cute-quiz-container .cq-cleartitle {
        font-size: 1.3em; /* モバイルでも読みやすく */
    }
    .cute-quiz-container .cq-clearsub {
        font-size: 1.1em;
    }
    .cute-quiz-container .cq-clear {
        min-height: 400px !important; /* モバイルでは高さを調整 */
    }
    
    /* モバイルでの選択肢調整 */
    .cute-quiz-container .cq-choice,
    .elementor-widget .cute-quiz-container .cq-choice,
    .e-con .cute-quiz-container .cq-choice {
        font-size: 1em !important; /* フォントサイズを少し大きく */
        padding: 12px 15px !important; /* パディングを調整 */
        min-height: 50px !important; /* 最小高さを設定 */
        line-height: 1.5 !important; /* 行間を確保 */
        word-break: auto !important; /* 自動改行 */
        overflow: visible !important; /* ラベル表示のため */
    }
    
    /* モバイルでの正解ラベル調整 */
    .cute-quiz-container .cq-correct-label {
        font-size: 0.75em !important;
        padding: 3px 10px !important;
        top: -18px !important;
    }
    
    /* モバイルでのボタン調整 */
    .cute-quiz-popup-trigger {
        min-width: calc(300px - 20px);
        font-size: 18px;
        padding: 20px 40px 20px 70px;
        margin: 20px 10px; /* 左右10pxのマージン */
    }
    
    .cute-quiz-popup-trigger::before {
        width: 45px;
        height: 45px;
        left: 10px;
    }
    
    .quiz-button-main-text {
        font-size: 18px;
    }
    
    .quiz-ticker-text {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .cute-quiz-container {
        width: calc(98vw - 20px) !important; /* さらに小さな画面でも左右10pxパディング */
        max-width: calc(350px - 20px) !important;
        margin: 15px 10px !important; /* 左右10pxのマージン */
        padding: 20px 12px 30px 12px !important;
    }
    
    /* モーダル内でのより小さな画面調整 */
    .cute-quiz-modal .cute-quiz-container {
        width: calc(100% - 20px) !important; /* 左右10pxずつ余白 */
        max-width: none !important;
        margin: 15px 10px !important;
    }
    
    .cute-quiz-container .cq-choice,
    .elementor-widget .cute-quiz-container .cq-choice,
    .e-con .cute-quiz-container .cq-choice {
        font-size: 0.95em !important; /* フォントサイズを少し大きく維持 */
        padding: 10px 12px !important; /* パディングを調整 */
        line-height: 1.4 !important; /* 行間を確保 */
        min-height: 45px !important; /* 最小高さを設定 */
        word-break: auto !important; /* 自動改行 */
        overflow: visible !important; /* ラベル表示のため */
    }
    
    /* より小さい画面での正解ラベル調整 */
    .cute-quiz-container .cq-correct-label {
        font-size: 0.7em !important;
        padding: 2px 8px !important;
        top: -16px !important;
    }
    
    .cute-quiz-container .cq-balloon {
        font-size: 1.15em; /* さらに小さい画面でも読みやすく */
        padding: 16px 18px;
        min-width: 90%; /* 小さい画面での最小幅をさらに拡大 */
        line-height: 1.7; /* 行間を維持 */
    }
    
    /* ポップアップトリガーボタンの調整 */
    .cute-quiz-popup-trigger {
        min-width: calc(280px - 20px);
        margin: 15px 10px;
        padding: 15px 35px 15px 60px;
    }
}

/* ========== Elementor対策 ========== */
.elementor-widget .cute-quiz-wrapper,
.elementor-widget-container .cute-quiz-wrapper,
.elementor-shortcode .cute-quiz-wrapper {
    position: static !important;
    z-index: 1 !important;
}

.elementor-widget .cute-quiz-container,
.elementor-widget-container .cute-quiz-container,
.elementor-shortcode .cute-quiz-container {
    position: static !important;
    z-index: 1 !important;
}

/* Elementor環境での選択肢スタイル強制適用 */
.elementor-widget .cute-quiz-container .cq-choice,
.elementor-widget-container .cute-quiz-container .cq-choice,
.elementor-shortcode .cute-quiz-container .cq-choice,
.e-con .cute-quiz-container .cq-choice {
    background: #C9EDE8 !important;
    border-radius: 14px !important;
    border: none !important;
    color: #5A5A5A !important;
    font-size: 1.11em !important;
    font-weight: bold !important;
    padding: 15px 20px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 10px rgba(137, 171, 151, 0.1) !important;
    transition: background .13s, transform .11s !important;
    outline: none !important;
    letter-spacing: 0.02em !important;
    line-height: 1.6 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: auto !important;
    hyphens: auto !important;
    position: relative !important; /* staticからrelativeに変更 */
    text-align: center !important;
    width: 100% !important;
    min-height: auto !important;
    white-space: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: visible !important; /* hiddenからvisibleに変更（ラベル表示のため） */
    margin: 0 !important; /* 余分なマージンを削除 */
}

/* Elementor環境での正解表示スタイル */
.elementor-widget .cute-quiz-container .cq-choice.cq-show-correct,
.elementor-widget-container .cute-quiz-container .cq-choice.cq-show-correct,
.elementor-shortcode .cute-quiz-container .cq-choice.cq-show-correct,
.e-con .cute-quiz-container .cq-choice.cq-show-correct {
    background: #FFE66B !important;
    color: #5A5A5A !important;
    border: 3px solid #FFC700 !important;
    box-shadow: 0 0 20px rgba(255, 199, 0, 0.6) !important;
    animation: cqPulse 1.5s ease-in-out infinite !important;
    transform: scale(1.05) !important;
    z-index: 10 !important;
}

/* ========== 強制的な重なり防止 ========== */

/* すべてのクイズ関連要素を含むコンテナに境界を設定 */
.cute-quiz-placeholder::before,
.cute-quiz-placeholder::after {
    content: "";
    display: table;
    clear: both;
}

/* 次の要素への影響を完全に遮断 */
.cute-quiz-placeholder {
    contain: layout style;
    isolation: isolate;
}

/* Elementor環境での追加対策 */
.elementor-widget .cute-quiz-placeholder {
    min-height: 700px !important;
}

/* 次の要素を確実に下に配置 */
.cute-quiz-placeholder + * {
    clear: both !important;
    position: relative !important;
    margin-top: 20px !important;
}

/* ========== z-index競合対策 ========== */

/* 他の要素よりも確実に前面に表示 */
body.quiz-modal-open {
    overflow: hidden !important;
}

/* 特定の要素のz-indexを調整 */
.cute-quiz-modal {
    z-index: 2147483647 !important; /* 最大値に近い値 */
}

.cute-quiz-modal-overlay {
    z-index: 2147483646 !important;
}

.cute-quiz-modal-content {
    z-index: 2147483647 !important;
}

/* Elementorの要素より前面に */
.elementor-widget,
.elementor-element,
.elementor-top-section {
    z-index: auto !important;
}

/* WordPressの管理バーよりも前面に */
#wpadminbar {
    z-index: 99999 !important;
}

/* その他の一般的な要素のz-index調整 */
.cute-quiz-modal.active,
.cute-quiz-modal:not([style*="display: none"]) {
    z-index: 2147483647 !important;
}