.math-container {
    margin-top: 80px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: #f5f5f5;
}

.math-title {
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    margin-top: 72px;
    margin-bottom: 8px;
    color: #f5f5f5;
}

.math-tagline {
    text-align: center;
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 16px;
}

.math-menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.math-menu-button {
    background: #202020;
    border: 1px solid #444;
    color: #eee;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.math-menu-button:hover {
    background: #2a2a2a;
    border-color: #666;
    transform: translateY(-1px);
}

.math-menu-button.active {
    background: #f5f5f5;
    color: #111;
    border-color: #f5f5f5;
}

.math-problem {
    background: #151515;
    border-radius: 12px;
    border: 1px solid #333;
    padding: 16px 18px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.math-problem-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.math-problem-number {
    font-family: monospace;
    font-size: 0.85rem;
    color: #aaa;
}

.math-problem-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.math-problem-genre {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 12px;
}

.math-question-body {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 2×2 グリッドの選択肢 */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #202020;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border: 1px solid #343434;
    font-size: 0.9rem;
}
/* ← 未選択時の背景（必要なら調整） */
.choice-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
/*
.choice-item input[type="radio"] {
    accent-color: #f5f5f5;
}

/* ★ 選択された label の背景紫化 */

/*
.choice-item input[type="radio"]:checked + .choice-text {
    background-color: #7c3aed;   
    color: white;
    padding: 10px;
    border-radius: 6px;
}
*/
/* ★ label 全体を紫にしたい場合はこちら

/*
.choice-item input[type="radio"]:checked ~ * {
    background-color: #7c3aed;
    color: white;
}


*/


.choice-text {
    flex: 1;
}

.math-button {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #444;
    background: #202020;
    color: #eee;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.math-button.primary {
    background: #f5f5f5;
    color: #111;
    border-color: #f5f5f5;
    margin-bottom: 8px;
}

.math-button.secondary {
    background: #202020;
    color: #eee;
}

.math-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #2a2a2a;
}

.math-button.primary:hover:not(:disabled) {
    background: #ffffff;
}

.math-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.math-result {
    min-height: 1.2em;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.math-result.correct {
    color: #8be38b;
}

.math-result.wrong {
    color: #ff8b8b;
}

.math-result.warn {
    color: #f5d38b;
}

.math-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.choice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #202020;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 1rem;
}

.choice-item input[type="radio"] {
    width: 22px;
    height: 22px;
    accent-color: #fff;
}

.choice-item:hover {
    background: #7c3aed;
}






.math-history {
    margin-top: 24px;
    border-top: 1px solid #333;
    padding-top: 12px;
}

.math-history-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.math-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.math-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 6px 4px;
    cursor: pointer;
}

.math-history-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.math-history-status {
    width: 1.5em;
}

.math-history-number {
    min-width: 5.5em; /* STAT-001 みたいな番号用 */
}

.math-history-item.correct .math-history-status {
    color: #10b981; /* ◯ */
}

.math-history-item.wrong .math-history-status {
    color: #f97316; /* × */
}
/* テキスト＆数式部分 */
.choice-text {
    font-size: 1.05rem;        /* 全体の字を少し大きく */
    display: inline-flex;
    align-items: center;
}
/* ▼ MathML を強調して見やすくする */
.choice-text math {
    font-size: 1.3em;          /* 周りより1.3倍くらいに拡大 */
    margin-left: 0.2rem;
}

/* 分数がつぶれないように */
.choice-text math mfrac {
    font-size: 1.1em;
}

/* 問題文側も大きめにしたいなら */
.math-question-body {
    font-size: 1.05rem;
}

.math-question-body math {
    font-size: 1.25em;
}