
/* ==========================================
   結果表示モーダル - 追加スタイル
   ========================================== */

.result-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 29, 0.75); /* 背景を少し暗くして選択肢を見やすく */
    backdrop-filter: blur(3px); /* 軽くぼかしを入れて視認性を向上 */
    z-index: 2000; /* 最前面に表示 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* モーダル内のカードスタイル調整 */
.result-modal-overlay .result-display {
    width: 100%;
    max-width: 420px;
    margin: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--card-border);
    animation: modalPopUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(26, 26, 46, 0.95); /* カード自体の不透明度を高めに */
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* コンテンツが多くなった場合に備えて、モーダル内部でのスクロールを許可するがバーは隠す */
    max-height: 90vh; /* 画面高さの90%を上限に */
    overflow-y: auto; /* 必要に応じて縦スクロール */
    scrollbar-width: none; /* Firefox: スクロールバー非表示 */
    -ms-overflow-style: none; /* IE/Edge: スクロールバー非表示 */
}

/* Chrome/Safari用スクロールバー非表示 */
.result-modal-overlay .result-display::-webkit-scrollbar {
    display: none;
}

@keyframes modalPopUp {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 回答比較エリア */
.answer-comparison {
    width: 100%;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.answer-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    width: 100%;
}

.answer-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.answer-row .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.answer-row .value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.option-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    flex-shrink: 0;
    color: #fff;
}

.option-badge.correct {
    background: var(--correct-green);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.option-badge.wrong {
    background: var(--wrong-red);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
}

/* 解説エリア */
.explanation-section {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 221, 68, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 221, 68, 0.2);
    text-align: left;
}

.explanation-title {
    font-size: 0.95rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.explanation-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* モバイル対応の微調整 */
@media (max-width: 480px) {
    .result-modal-overlay {
        padding: 0.75rem;
        align-items: center;
    }
    
    .result-modal-overlay .result-display {
        padding: 1rem;
        max-width: 100%;
        max-height: 85vh;
    }
    
    .result-icon {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }
    
    .result-text {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    
    .answer-comparison {
        margin-bottom: 0.75rem;
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .answer-row {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        gap: 0.2rem;
    }
    
    .answer-row .label {
        font-size: 0.7rem;
    }
    
    .answer-row .value {
        font-size: 0.8rem;
        gap: 0.4rem;
    }
    
    .option-badge {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .explanation-section {
        margin-bottom: 0.75rem;
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .explanation-title {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .explanation-text {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .next-button {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}

/* iPhone SE 専用最適化 */
@media (max-width: 375px) {
    .result-modal-overlay {
        padding: 0.5rem;
    }
    
    .result-modal-overlay .result-display {
        padding: 0.8rem;
        max-height: 82vh;
    }
    
    .result-icon {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
    }
    
    .result-text {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    
    .answer-comparison {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .answer-row .label {
        font-size: 0.65rem;
    }
    
    .answer-row .value {
        font-size: 0.75rem;
    }
    
    .option-badge {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    
    .explanation-section {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .explanation-title {
        font-size: 0.75rem;
    }
    
    .explanation-text {
        font-size: 0.7rem;
        line-height: 1.4;
    }
    
    .next-button {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
    }
}
