.sq-page { display: flex; flex-direction: column; gap: 14px; }
.sq-progress { color: var(--text-muted); font-size: 0.9rem; text-align: center; }
.sq-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sq-play { width: 84px; height: 84px; border-radius: 50%; border: none; background: var(--accent-soft); color: var(--accent); font-size: 2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sq-play svg { width: 36px; height: 36px; }
.sq-hint { color: var(--text-muted); font-size: 0.95rem; }
.sq-sentence { font-size: 1.5rem; line-height: 1.6; }
.sq-blank { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--accent); padding: 0 4px; color: var(--accent); }
.sq-blank.correct { color: var(--good); border-color: var(--good); border-bottom-style: solid; font-weight: 700; }
.sq-blank.correct::after { content: ' ✓'; }
.sq-blank.wrong { color: var(--bad); border-color: var(--bad); border-bottom-style: dashed; }
.sq-blank.wrong::after { content: ' ✗'; }
.sq-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .sq-options { grid-template-columns: 1fr; } }
.sq-option { padding: 14px 10px; font-size: 1.05rem; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.sq-option:disabled { cursor: default; }
.sq-option.correct { border-color: var(--good-fill); background: var(--good-fill); color: var(--good-on); font-weight: 700; opacity: 1; }
.sq-option.correct * { color: inherit; }
.sq-option.wrong { border-color: var(--bad); border-style: dashed; background: var(--bad-soft); color: var(--text); opacity: 1; }
.sq-option.correct::before { content: '✓ '; font-weight: 800; }
.sq-option.wrong::before { content: '✗ '; font-weight: 800; color: var(--bad); }
.sq-type { display: flex; gap: 8px; }
.sq-type input { flex: 1; font-size: 1.1rem; padding: 12px; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); color: var(--text); }
.sq-toggle { align-self: center; }
.sq-result { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sq-verdict { font-weight: 700; font-size: 1.1rem; }
.sq-verdict.correct { color: var(--good); }
.sq-verdict.correct::before { content: '✓ '; }
.sq-verdict.wrong { color: var(--bad); }
.sq-verdict.wrong::before { content: '✗ '; }
.sq-final { font-size: 2.4rem; font-weight: 800; }
.sq-start, .sq-next { align-self: center; min-width: 160px; }

/* Matching game */
.mg-page { display: flex; flex-direction: column; gap: 14px; }
.mg-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mg-tile { min-height: 64px; padding: 10px 8px; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; font: inherit; font-size: 1.05rem; overflow-wrap: anywhere; transition: border-color .15s, background .15s, opacity .3s; -webkit-tap-highlight-color: transparent; }
.mg-tile.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.mg-tile.matched { border-color: var(--good-fill); background: var(--good-fill); color: var(--good-on); cursor: default; }
.mg-tile.matched * { color: inherit; }
.mg-tile.matched::before { content: '✓'; position: absolute; top: 4px; right: 8px; font-weight: 800; }
.mg-tile.wrong { border-color: var(--bad); border-style: dashed; background: var(--bad-soft); animation: fl-shake .4s; }
.mg-tile.wrong::before { content: '✗'; position: absolute; top: 4px; right: 8px; font-weight: 800; color: var(--bad); }
.mg-tile.matched, .mg-tile.wrong { position: relative; }
.mg-tile .drill-reading, .mg-sum-target .drill-reading { display: flex; flex-direction: column; align-items: center; }
.mg-tile .drill-primary, .mg-sum-target .drill-primary { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 0; }
.mg-tile .drill-secondary, .mg-tile .drill-romaji, .mg-sum-target .drill-secondary, .mg-sum-target .drill-romaji { font-size: .8rem; margin: 0; }
.mg-target { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mg-hint { text-align: center; }
.mg-empty-icon svg { width: 36px; height: 36px; color: var(--accent); }
.mg-sum-title { font-size: 1rem; margin: 6px 0 0; }
.mg-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mg-sum-row { background: var(--surface); border: 2px solid var(--border); border-left: 4px solid var(--success); border-radius: 4px; padding: 10px 12px; }
.mg-sum-row.missed { border-left-color: var(--primary); }
.mg-sum-pair { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mg-sum-en { font-weight: 600; }
.mg-sum-target { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.mg-sum-target .drill-primary { font-size: 1.1rem; }
.mg-sum-note { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
@media (max-width: 380px) { .mg-tile { font-size: .95rem; min-height: 58px; } .mg-tile .drill-primary { font-size: 1.1rem; } }

/* Furigana in the fill-the-gap quizzes (Japanese). "Hide furigana" adds
   .no-furigana, which keeps the kanji and hides the readings in place. */
.sq-sentence rt, .sp-sentence rt, .cq-missed-row rt { font-size: 0.5em; font-weight: 400; color: var(--text-muted); }
.sq-sentence:has(ruby), .sp-sentence:has(ruby) { line-height: 2; }
/* Hidden, not removed, so the sentence and buttons keep their size. */
.no-furigana rt { visibility: hidden; }
/* "Auto hide furigana when near mastering" (pageSettings.js). */
.auto-hide-kana .furigana-near rt { visibility: hidden; }
.kana-hidden-word { text-align: center; font-size: 2.2rem; font-weight: 700; line-height: 1.6; }
.kana-hidden-word rt { font-size: 0.4em; font-weight: 400; color: var(--text-muted); }
.kana-hidden-text { margin: 10px 0 14px; text-align: center; color: var(--text-muted); font-size: 0.92rem; line-height: 1.45; }
.kana-hidden-mute { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; font-size: 0.9rem; cursor: pointer; }
.kana-hidden-keep { width: 100%; margin-top: 8px; }
.kana-hidden-mute input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent, #4a7cf7); }
#sp-furigana, #sq-furigana { min-width: 10em; }
