/* © 2026 PassQuest Team (https://passquest.jp). All rights reserved. 無断複製・転載・改変を禁じます。 */
/* =============================================
   PassQuest - 年度別過去問モード CSS
   Dark Fantasy RPG Theme (Gold × Purple)
   v3 - Visible borders, prominent 全問通し, magic circle BG
   ============================================= */

/* === マスコット（そら・エマ）右下フローティング === */
#past-exam-mascots {
    position: fixed;
    bottom: 0;
    right: 90px;          /* メニュー☰(右下 bottom24/right24・56px)と重ならないよう左へ寄せる */
    z-index: 9990;
    pointer-events: none;
    display: flex;
    gap: 4px;
    padding: 0 8px 4px;
}
.pe-mascot {
    position: relative;
    width: 80px;
    height: 80px;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.pe-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
    animation: peMascotFloat 3s ease-in-out infinite alternate;
}
@keyframes peMascotFloat {
    from { transform: translateY(0) rotate(-2deg); }
    to   { transform: translateY(-5px) rotate(2deg); }
}
.pe-mascot.react-correct .pe-mascot-img {
    animation: peMascotJump 0.6s ease-in-out 2;
}
@keyframes peMascotJump {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-12px) rotate(-8deg) scale(1.08); }
    50% { transform: translateY(-6px) rotate(0) scale(1.05); }
    75% { transform: translateY(-12px) rotate(8deg) scale(1.08); }
}
.pe-mascot.react-wrong .pe-mascot-img {
    animation: peMascotShake 0.6s ease-in-out 1;
}
@keyframes peMascotShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotate(-3deg); }
    40% { transform: translateX(4px) rotate(3deg); }
    60% { transform: translateX(-4px) rotate(-3deg); }
    80% { transform: translateX(4px) rotate(3deg); }
}

/* 吹き出し（共通ベース） */
.pe-mascot-bubble {
    position: absolute;
    background: linear-gradient(180deg, #fff, #fff0e6);
    color: #3a2808;
    padding: 8px 12px;
    border-radius: 14px;
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 14px rgba(255,215,0,0.3);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
    max-width: 160px;
    min-width: 80px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s, visibility 0s linear 0.2s;
    line-height: 1.3;
    pointer-events: none;
    z-index: 1;
    text-align: center;
}
.pe-mascot-bubble.show {
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s, visibility 0s;
}

/* そら（左マスコット）：吹き出しは上方向、上にずらして衝突回避 */
.pe-mascot.pe-sora .pe-mascot-bubble {
    right: 0;
    left: auto;
    bottom: 130%;
    transform: translateX(0) scale(0);
    transform-origin: bottom right;
}
.pe-mascot.pe-sora .pe-mascot-bubble.show {
    transform: translateX(0) scale(1);
}
.pe-mascot.pe-sora .pe-mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 16px;
    left: auto;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fbbf24;
}

/* エマ（右マスコット）：吹き出しは画面右端に収まるよう左方向へ展開 */
.pe-mascot.pe-emma .pe-mascot-bubble {
    right: 0;
    left: auto;
    bottom: 88%;
    transform: translateX(0) scale(0);
    transform-origin: bottom right;
}
.pe-mascot.pe-emma .pe-mascot-bubble.show {
    transform: translateX(0) scale(1);
}
.pe-mascot.pe-emma .pe-mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 16px;
    left: auto;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fbbf24;
}

/* 空の吹き出しは表示しない（残像対策） */
.pe-mascot-bubble:empty {
    display: none !important;
}

/* ★2026-08-16 修正：そら・エマのセリフのふりがなが漢字から離れていたので、
     アプリ共通の値（手引き #adventure-guide-modal で決めた値）にそろえました。
         文字の大きさ 0.58em ／ 太さ 700 ／ 行の高さ 1
         PC・Android（Chromium系）… top -0.04em
         iPhone（Safari）………………… margin-bottom -0.55em
     ※Safari と Chromium では «ふりがなを動かせるCSS» が違うので、
       画面幅ではなく @supports（エンジン）で分けています。
     色（焦げ茶）は吹き出しが明るいので これまでどおりです。 */
.pe-mascot-bubble ruby rt {
    color: #6b3a1a !important;
    text-shadow: none !important;
    font-size: 0.58em !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    position: relative !important;
    top: -0.04em !important;
}
@supports (-webkit-touch-callout: none) {
    /* iPhone の Safari は top が効かないので margin-bottom で漢字に寄せる */
    .pe-mascot-bubble ruby rt {
        top: 0 !important;
        margin-bottom: -0.55em !important;
    }
}

/* モバイル：マスコット小さく、吹き出しも控えめに */
@media (max-width: 600px) {
    .pe-mascot { width: 60px; height: 60px; }
    .pe-mascot-bubble {
        font-size: 0.7rem;
        padding: 6px 10px;
        max-width: 130px;
    }
    .pe-mascot.pe-sora .pe-mascot-bubble { bottom: 115%; }
    .pe-mascot.pe-emma .pe-mascot-bubble { bottom: 85%; }
}

/* フリガナのデフォルト：暗い背景上では金色 */
#past-exam-screen ruby { ruby-position: over; }
#past-exam-screen ruby rt {
    font-size: 0.55em !important;
    color: #ffe66d !important;
    font-weight: 700 !important;
    text-shadow: 0 0 4px rgba(0,0,0,0.85), 0 1px 2px rgba(0,0,0,0.9) !important;
    opacity: 1 !important;
    line-height: 1.2 !important;
}
/* 羊皮紙系（明るい背景）の問題文・選択肢では暗色フリガナ */
#past-exam-screen .past-exam-question-card ruby rt,
#past-exam-screen .past-exam-question-text ruby rt,
#past-exam-screen .past-exam-options-list ruby rt,
#past-exam-screen .past-exam-option-btn ruby rt,
#past-exam-screen .past-exam-feedback ruby rt {
    color: #3a2808 !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}

/* --- 画面全体（古代魔法図書館 - 新背景） --- */
#past-exam-screen.app-overlay,
#past-exam-screen {
    min-height: 100vh;
    background-color: #0a0a16 !important;
    background-image:
        linear-gradient(rgba(8,5,28,0.55), rgba(12,5,40,0.75)),
        url('../images/past_exam_bg.png?v=20260428a') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    padding: 80px 15px 120px;
}

/* hiddenでない時だけapp-overlayのfixed配置を上書きする */
#past-exam-screen:not(.hidden) {
    position: relative !important;
    height: auto !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    display: block !important;
    z-index: 10000;
    flex-direction: unset !important;
    align-items: unset !important;
}

/* 魔法陣の背景画像（専用div） */
.past-exam-bg-circle {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    width: 550px;
    height: 550px;
    margin: 0 auto;
    background: url('../images/game_bg.png') center / contain no-repeat;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    animation: pastExamMagicSpin 60s linear infinite;
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 70%);
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 70%);
}

@keyframes pastExamMagicSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 浮遊パーティクル風の装飾 */
#past-exam-screen::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,232,122,0.5), transparent),
        radial-gradient(1px 1px at 30% 70%, rgba(255,232,122,0.35), transparent),
        radial-gradient(2px 2px at 50% 10%, rgba(212,175,55,0.6), transparent),
        radial-gradient(1px 1px at 70% 50%, rgba(255,232,122,0.35), transparent),
        radial-gradient(1.5px 1.5px at 90% 30%, rgba(212,175,55,0.5), transparent),
        radial-gradient(2px 2px at 15% 85%, rgba(255,232,122,0.4), transparent),
        radial-gradient(1px 1px at 85% 75%, rgba(212,175,55,0.35), transparent),
        radial-gradient(1.5px 1.5px at 45% 45%, rgba(255,232,122,0.3), transparent);
    pointer-events: none;
    z-index: 0;
    animation: pastExamTwinkle 4s ease-in-out infinite alternate;
}

@keyframes pastExamTwinkle {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* 魔法陣の回転アニメーション（背景画像を回転させるための追加レイヤー） */
@keyframes pastExamMagicSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === プラン制限：ロック表示（FREEプランは第38回以外がロック） === */
.past-exam-year-card.locked {
    position: relative;
    opacity: 0.5;
    filter: grayscale(0.5);
    cursor: not-allowed;
    transition: opacity 0.3s, filter 0.3s, transform 0.3s;
}
.past-exam-year-card.locked:hover {
    opacity: 0.75;
    filter: grayscale(0.2);
    transform: scale(1.02);
}
.past-exam-year-card.locked .past-exam-year-num,
.past-exam-year-card.locked .past-exam-year-info {
    color: rgba(220,200,255,0.5) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7) !important;
}
.past-exam-year-card .year-lock-icon {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fbbf24, #d97706);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.6), 0 0 12px rgba(251,191,36,0.6);
    pointer-events: none;
    z-index: 5;
}

/* --- ヘッダー（中央揃え） --- */
.past-exam-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    padding: 15px 10px;
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.past-exam-title {
    font-family: 'Cinzel', 'Noto Sans JP', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffe87a;
    text-shadow:
        0 2px 10px rgba(212,175,55,0.5),
        0 0 30px rgba(212,175,55,0.2),
        0 0 60px rgba(212,175,55,0.1);
    letter-spacing: 2px;
    text-align: center;
    position: relative;
}

/* タイトル下の装飾ライン */
.past-exam-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 2px;
    margin: 8px auto 0;
    background: linear-gradient(90deg, transparent, #d4af37, #ffe87a, #d4af37, transparent);
    border-radius: 1px;
}

.past-exam-header .action-btn {
    background: linear-gradient(135deg, #2a1a3e, #3a2050);
    border: 1.5px solid rgba(212,175,55,0.6);
    color: #ffe87a;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 24px;
    font-size: 0.95rem;
    box-shadow:
        0 3px 10px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,232,122,0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.past-exam-header .action-btn:hover {
    background: linear-gradient(135deg, #3a2550, #4a2d65);
    border-color: #ffe87a;
    box-shadow:
        0 4px 15px rgba(212,175,55,0.3),
        inset 0 1px 0 rgba(255,232,122,0.15);
    transform: translateY(-1px);
}

/* --- 年度カードグリッド --- */
.past-exam-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-width: 700px;
    margin: 0 auto 30px;
    padding: 0 5px;
    position: relative;
    z-index: 2;
}

.past-exam-year-card {
    background: rgba(212,175,55,0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(212,175,55,0.30);
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* カード上部のゴールドライン */
.past-exam-year-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    opacity: 0.5;
    transition: opacity 0.35s;
}

/* カードの光沢エフェクト */
.past-exam-year-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212,175,55,0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.past-exam-year-card:hover {
    border-color: #ffe87a;
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(212,175,55,0.2),
        0 0 15px rgba(212,175,55,0.15),
        0 4px 15px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.past-exam-year-card:hover::before,
.past-exam-year-card:hover::after {
    opacity: 1;
}

.past-exam-year-card.selected {
    border-color: #ffe87a;
    border-width: 2px;
    background: rgba(212,175,55,0.18);
    box-shadow: 0 0 18px rgba(212,175,55,0.3), 0 4px 14px rgba(0,0,0,0.4);
}

.past-exam-year-card.selected::before {
    opacity: 1;
}

.past-exam-year-num {
    font-family: 'Cinzel', 'Noto Sans JP', serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffe87a;
    text-shadow: 0 2px 8px rgba(212,175,55,0.5);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.past-exam-year-info {
    font-size: 0.75rem;
    color: rgba(255,232,122,0.6);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* --- 科目フィルターパネル --- */
.past-exam-subject-panel {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 5px;
    position: relative;
    z-index: 2;
}

.past-exam-subject-title {
    font-family: 'Cinzel', 'Noto Sans JP', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffe87a;
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: none;
    text-shadow: 0 2px 8px rgba(212,175,55,0.4);
    position: relative;
}

/* 科目タイトル下の装飾ライン */
.past-exam-subject-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    margin: 10px auto 0;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.5), transparent);
}

.past-exam-subject-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* --- 科目カード（1問1答画面と同じ透過感） --- */
.past-exam-subject-card {
    background: rgba(212,175,55,0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.past-exam-subject-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.6), transparent);
    opacity: 0.4;
    transition: opacity 0.3s;
}

.past-exam-subject-card:hover {
    background: rgba(212,175,55,0.12);
    border-color: rgba(212,175,55,0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212,175,55,0.15);
}

.past-exam-subject-card:hover::before {
    opacity: 1;
}

.past-exam-subject-card:active {
    transform: translateY(-1px);
}

/* ===== 全問通しカード（大きく目立つ特別デザイン・透過感） ===== */
.past-exam-subject-card.past-exam-all {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(60,200,140,0.06));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1.5px solid rgba(212,175,55,0.45);
    border-radius: 18px;
    padding: 28px 16px;
    margin-bottom: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4), 0 0 12px rgba(212,175,55,0.1);
}

.past-exam-subject-card.past-exam-all::before {
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, #d4af37 30%, #ffe87a 50%, #d4af37 70%, transparent 95%);
    opacity: 1;
}

/* 全問通しカードの下部グローライン */
.past-exam-subject-card.past-exam-all::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, rgba(212,175,55,0.4) 30%, rgba(212,175,55,0.6) 50%, rgba(212,175,55,0.4) 70%, transparent 90%);
    pointer-events: none;
}

.past-exam-subject-card.past-exam-all:hover {
    border-color: #ffe87a;
    box-shadow:
        0 12px 35px rgba(212,175,55,0.3),
        0 0 25px rgba(212,175,55,0.18),
        0 4px 15px rgba(0,0,0,0.5);
    transform: translateY(-4px);
}

.past-exam-subject-card.past-exam-all .past-exam-subject-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
}

.past-exam-subject-card.past-exam-all .past-exam-subject-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffe87a;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(212,175,55,0.4);
    margin-bottom: 6px;
}

.past-exam-subject-card.past-exam-all .past-exam-subject-count {
    font-size: 1rem;
    color: rgba(255,232,122,0.75);
    font-weight: 600;
}

/* --- 通常科目カードのアイコン・テキスト --- */
.past-exam-subject-icon {
    font-size: 1.6rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.past-exam-subject-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e8dcc8;
    line-height: 1.3;
    margin-bottom: 4px;
}

.past-exam-subject-count {
    font-size: 0.7rem;
    color: rgba(255,232,122,0.55);
    font-weight: 500;
}

/* =============================================
   5択表示モード（本番形式）
   ============================================= */
.past-exam-quiz-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 5px;
}

/* 問題ナビバー */
.past-exam-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    gap: 8px;
    border: 1px solid rgba(212,175,55,0.15);
}

.past-exam-nav-back {
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.2s;
}

.past-exam-nav-back:hover {
    background: rgba(255,255,255,0.25);
}

.past-exam-nav-mode {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    font-weight: bold;
    color: #f0d070;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.past-exam-nav-counter {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 600;
}

/* 問題文カード（羊皮紙テクスチャ＋金属フレーム：既存クイズと統一） */
.past-exam-question-card {
    background: url('../images/ui/parchment.png') center/cover no-repeat #dccdaa;
    border: none;
    border-radius: 4px;
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.6),
        inset 0 0 0 2px rgba(139, 110, 70, 0.8),
        inset 0 0 0 4px rgba(68, 48, 25, 0.4);
    color: #3a2808;
}

.past-exam-question-meta {
    font-size: 0.75rem;
    color: #6a5a3a;
    margin-bottom: 8px;
    font-weight: 600;
}

.past-exam-question-text {
    font-size: 1rem;
    color: #3a2808;
    line-height: 1.7;
    font-weight: 500;
}

.past-exam-question-text rt {
    color: #3a2808 !important;
    text-shadow: none !important;
    font-size: 0.6em;
    font-weight: 700;
}

/* 図表示（過去問モード） */
.past-exam-question-card .question-figure {
    margin: 12px auto 8px;
    padding: 12px;
    background: #fff;
    border: 2px solid #d4af37;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.past-exam-question-card .question-figure svg {
    width: 100%;
    height: auto;
    max-height: 350px;
}

/* 選択肢リスト */
.past-exam-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

/* 選択肢ボタン（羊皮紙テクスチャ：既存クイズと統一） */
.past-exam-option-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: url('../images/ui/parchment.png') center/cover no-repeat #dccdaa;
    border: none;
    border-radius: 6px;
    padding: 14px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    width: 100%;
    font-size: 0.95rem;
    color: #3a2808;
    line-height: 1.6;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px rgba(139, 110, 70, 0.9),
        inset 0 0 0 4px rgba(80, 58, 30, 0.3);
}

.past-exam-option-btn:hover {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px #c9a84c,
        inset 0 0 0 4px rgba(201, 168, 76, 0.3),
        0 0 15px rgba(201, 168, 76, 0.4);
    transform: translateY(-2px);
}

.past-exam-option-btn:active {
    transform: scale(0.99);
}

.past-exam-option-btn.selected {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px #c9a84c,
        inset 0 0 0 4px rgba(201, 168, 76, 0.3),
        0 0 15px rgba(201, 168, 76, 0.4);
}

.past-exam-option-btn.correct {
    background-color: rgba(220, 255, 220, 0.95);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px #2e7d32,
        inset 0 0 0 4px rgba(46, 125, 50, 0.3),
        0 0 15px rgba(46, 125, 50, 0.3);
}

.past-exam-option-btn.incorrect {
    background-color: rgba(255, 230, 230, 0.95);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px #c62828,
        inset 0 0 0 4px rgba(198, 40, 40, 0.3),
        0 0 15px rgba(198, 40, 40, 0.3);
}

.past-exam-option-btn.dimmed {
    opacity: 0.6;
}

.past-exam-option-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #aa8c2c);
    color: #fff;
    font-weight: 900;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.past-exam-option-btn.correct .past-exam-option-num {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
}

.past-exam-option-btn.incorrect .past-exam-option-num {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

.past-exam-option-text {
    flex: 1;
}

.past-exam-option-text rt {
    color: #3a2808 !important;
    text-shadow: none !important;
    font-size: 0.6em;
    font-weight: 700;
}

/* 結果フィードバック（羊皮紙テクスチャ） */
.past-exam-feedback {
    background: url('../images/ui/parchment.png') center/cover no-repeat rgba(255, 255, 240, 0.95);
    border: 2px solid rgba(139, 110, 70, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #3a2808;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.past-exam-feedback.correct-feedback {
    background-color: rgba(220, 255, 220, 0.95);
    border-color: #2e7d32;
    box-shadow: 0 0 15px rgba(46, 125, 50, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.05);
    color: #3a2808;
}

.past-exam-feedback.incorrect-feedback {
    background-color: rgba(255, 230, 230, 0.95);
    border-color: #c62828;
    box-shadow: 0 0 15px rgba(198, 40, 40, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.05);
    color: #3a2808;
}

/* 次へボタン */
.past-exam-next-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #d4af37, #aa8c2c);
    border: 2px solid #ffe87a;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 15px rgba(212,175,55,0.3);
    transition: all 0.2s;
    letter-spacing: 1px;
}

.past-exam-next-btn:hover {
    background: linear-gradient(135deg, #ffe87a, #d4af37);
    box-shadow: 0 6px 20px rgba(212,175,55,0.4);
}

/* --- レスポンシブ --- */
@media (max-width: 380px) {
    #past-exam-screen {
        padding: 70px 10px 60px;
        background-size: 300px 300px;
        background-position: center 180px;
    }

    .past-exam-year-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .past-exam-year-card {
        padding: 12px 6px;
    }

    .past-exam-year-num {
        font-size: 1rem;
    }

    .past-exam-title {
        font-size: 1.2rem;
    }

    .past-exam-option-btn {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .past-exam-subject-card.past-exam-all {
        padding: 18px 12px;
    }

    .past-exam-subject-card.past-exam-all .past-exam-subject-icon {
        font-size: 1.8rem;
    }

    .past-exam-subject-card.past-exam-all .past-exam-subject-name {
        font-size: 0.95rem;
    }
}

@media (min-width: 381px) and (max-width: 480px) {
    #past-exam-screen {
        padding: 75px 12px 70px;
        background-size: 350px 350px;
        background-position: center 190px;
    }

    .past-exam-year-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .past-exam-year-card {
        padding: 14px 8px;
    }

    .past-exam-year-num {
        font-size: 1.1rem;
    }

    .past-exam-title {
        font-size: 1.3rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .past-exam-year-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .past-exam-subject-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   ★2026-08-25 スマホ専用：問題カードに🔊よみあげ＋☑気になる
   （トモさん要望）。PCでは .pe-tools-row ごと非表示＝完全不変。
   よみあげの見た目はRPG/特訓/1問1答と同じ«金ピル»に統一。
   ═══════════════════════════════════════════════════════════ */
.pe-tools-row { display: none; }
@media (max-width: 600px) {
    .pe-tools-row {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 6px 4px;
    }
    #past-exam-screen .audio-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 6px 12px;
        border-radius: 99px;
        cursor: pointer;
        background: linear-gradient(180deg, #fff6d8, #f2c14a);
        border: 2px solid #8b5e12;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
        font-size: 1.05rem;
        white-space: nowrap;
    }
    #past-exam-screen .audio-btn::after {
        content: attr(title);
        font-size: 0.82rem;
        font-weight: 800;
        color: rgb(74, 47, 0);
    }
    body.lang-ja #past-exam-screen .audio-btn::after { content: "よみあげ"; }
    #past-exam-screen .audio-btn.speaking {
        filter: brightness(1.15);
        box-shadow: 0 0 10px rgba(255, 214, 90, 0.8);
    }
    #past-exam-screen .pe-unsure {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        font-weight: 700;
        color: #8b4513;
        cursor: pointer;
        background: rgba(255, 165, 0, 0.12);
        border: 1.5px solid rgba(255, 165, 0, 0.45);
        border-radius: 99px;
        padding: 6px 14px;
        white-space: nowrap;
    }
    #past-exam-screen .pe-unsure input {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }
}
