/* 音読で記憶力トレーニング（ondoku.php / ondoku_history.php） */
.od-title { font-size: clamp(22px, 6vw, 28px); }
.od-title small { font-size: 16px; }
.od-lead { font-size: 16px; line-height: 1.8; margin: 10px 0 20px; }
.od-card .panel-heading small { color: inherit; opacity: .85; margin-left: 4px; }
/* サイト共通の css/style.css が .row を中央寄せにしているので、カードの中は左寄せに戻す */
.od-card { text-align: left; }
.od-steps { padding-left: 20px; line-height: 1.9; }
/* コースの選択（初級・中級・上級） */
.od-courses { display: flex; gap: 6px; margin-bottom: 12px; }
.od-course { flex: 1; margin: 0; cursor: pointer; font-weight: normal; }
.od-course input { position: absolute; opacity: 0; pointer-events: none; }
.od-course span { display: block; height: 100%; border: 2px solid #d6e2f2; border-radius: 6px; padding: 6px 8px; text-align: center; }
.od-course span b { display: block; font-size: 17px; }
.od-course span small { display: block; font-size: 11px; color: #666; line-height: 1.4; margin-top: 2px; }
.od-course input:checked + span { border-color: #2a78d6; background: #eaf3ff; }
.od-course input:focus-visible + span { outline: 2px solid #2a78d6; outline-offset: 2px; }
.od-hint { color: #31708f; font-weight: bold; }
.od-history-link { margin: 0 0 20px; }

.od-history-link .text-muted { margin-left: 10px; }
.od-research li { margin-bottom: 6px; line-height: 1.7; }

/* トレーニング中の画面 */
#ondoku-app { max-width: 760px; margin: 0 auto 120px; }
.od-step { font-size: 20px; font-weight: bold; margin: 10px 0 14px; padding-bottom: 8px; border-bottom: 2px solid #2a78d6; }
.od-step-no { display: inline-block; background: #2a78d6; color: #fff; border-radius: 12px; padding: 1px 10px; font-size: 14px; margin-right: 6px; vertical-align: middle; }
.od-instr { font-size: clamp(14px, 3.8vw, 16px); line-height: 1.8; background: #f5f8fc; border-left: 4px solid #2a78d6; padding: 10px 14px; margin-bottom: 16px; }
/* 本文の文字サイズは画面幅から決める。スマホでも 1 行に 20 字ほど入るようにする
   （固定の 22px だと 390px 幅で 1 行 14 字ほどになり、改行が多すぎて読みにくかった）。
   100vw から左右の余白（ページ 30px＋枠の内側 26px＋枠線など）を引いて 20 字で割る。上限はパソコンでの 22px */
.od-passage { font-size: clamp(15px, calc((100vw - 64px) / 20), 22px); line-height: 2.1; padding: 12px 13px; border: 1px solid #ddd; border-radius: 6px; background: #fff; margin-bottom: 6px; word-break: normal; overflow-wrap: anywhere; }
.od-passage ruby rt { font-size: 0.5em; color: #666; }
@media (min-width: 768px) { .od-passage { padding: 16px 18px; } }
.od-tok { transition: color .15s, background-color .15s; border-radius: 3px; }
.od-tok.od-done { color: #9a9a9a; background: #eaf3ff; }
.od-mark { color: #c7254e; background: #fff3f6; padding: 0 2px; border-radius: 3px; }
.od-source { font-size: 12px; color: #777; margin-bottom: 16px; }
.od-actions { text-align: center; margin: 20px 0; }
.od-actions .btn { margin: 4px; min-width: 200px; }
.od-live { min-height: 48px; font-size: 16px; color: #333; background: #fafafa; border-radius: 6px; padding: 10px 14px; margin-top: 10px; white-space: pre-wrap; }
.od-live:empty { display: none; }
.od-listening { color: #c9302c; font-weight: bold; }
.od-listening .fa-circle { animation: od-blink 1s infinite; }
@keyframes od-blink { 50% { opacity: .2; } }
.od-answer { text-align: center; }
.od-answer textarea { font-size: 16px; margin-bottom: 12px; }
.od-answer .btn { min-width: 220px; margin: 4px; }
.od-switch { margin-top: 12px; font-size: 13px; }
.od-result { text-align: center; font-size: 16px; }
.od-big { font-size: clamp(34px, 10vw, 44px); font-weight: bold; color: #2a78d6; margin: 10px 0; }
.od-big small { font-size: 18px; color: #666; }
.od-kw { list-style: none; padding: 0; margin: 14px auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.od-kw li { padding: 3px 10px; border-radius: 14px; font-size: 15px; }
.od-kw .od-hit { background: #e3f4ea; color: #1d6b3a; }
.od-kw .od-miss { background: #f4f4f4; color: #777; }
.od-result .od-passage { text-align: left; font-size: clamp(14px, calc((100vw - 64px) / 22), 18px); }
.od-summary { max-width: 520px; margin: 0 auto 16px; text-align: left; }
.od-summary th { font-weight: normal; color: #555; }
.od-loading { text-align: center; font-size: 18px; padding: 40px 0; }

/* 計算 */
.od-arith { text-align: center; }
.od-timer { font-size: 16px; color: #777; }
.od-q { font-size: 44px; font-weight: bold; margin: 16px 0; }
.od-choices .btn { min-width: 90px; font-size: 26px; margin: 6px; }
.od-arith-score { margin-top: 12px; color: #555; }
.od-heard { min-height: 28px; font-size: 18px; font-weight: bold; margin-bottom: 6px; }
.od-heard-ok { color: #1d6b3a; }
.od-heard-ng { color: #a94442; }

/* 数唱のキーパッド */
.od-keypad { display: grid; grid-template-columns: repeat(3, 80px); gap: 8px; justify-content: center; margin: 10px auto; }
.od-keypad .btn { font-size: 24px; height: 60px; }
.od-keypad-show { grid-column: 1 / -1; font-size: 30px; letter-spacing: 6px; text-align: center; min-height: 48px; border-bottom: 2px solid #ddd; margin-bottom: 6px; }

/* 記録のグラフ（ondoku_history.php）。色は役割ごとのトークンにしておく */
.od-viz {
    --surface-1: #ffffff;
    --grid: #e6e6e3;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --series-1: #2a78d6;
    --series-2: #eb6834;
}
.od-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.od-chart { position: relative; background: var(--surface-1); border: 1px solid #ddd; border-radius: 6px; padding: 10px 12px 6px; }
.od-chart h3 { font-size: 15px; font-weight: bold; margin: 0 0 2px; color: var(--text-primary); }
.od-chart .od-sub { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }
.od-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.od-chart .od-empty { color: var(--text-secondary); font-size: 13px; padding: 30px 0; text-align: center; }
.od-legend { font-size: 12px; color: var(--text-secondary); margin: 0 0 4px; }
.od-legend span { margin-right: 12px; white-space: nowrap; }
.od-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.od-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 4px 8px; font-size: 12px; color: var(--text-primary); box-shadow: 0 2px 6px rgba(0,0,0,.12); white-space: nowrap; display: none; z-index: 5; }
.od-table-wrap { overflow-x: auto; }
