/* Practice sections: sets, vocab, games, listening, tests, exams, settings, onboarding. */

/* ---------- Sets & vocab table ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.set-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--border); transition: border-color var(--fast), transform var(--normal) var(--ease); }
a.set-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.set-card.complete { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.set-card .faint { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.set-card .chip { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.vocab-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; }
.vocab-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.2fr) auto 20px; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--border); }
.vocab-w { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vocab-ar { color: var(--text-muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vocab-pos { font-size: 12px; }
.vocab-row .status-done .icon { width: 16px; height: 16px; }

/* ---------- Games (challenge / know) ---------- */
.game-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: var(--container); margin: 0 auto; }
.game { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding-block: 24px 64px; max-width: 34rem; }
.game-title { font-size: clamp(30px, 5vw, 44px); }
.game-sub { font-size: 17px; }
.example-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 220px; }
.game-ar { font-family: var(--font-display); font-size: 30px; }
.game-ar.big { font-size: clamp(34px, 6vw, 48px); }
.hint-mono { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.06em; color: var(--text-muted); }
.game-hud { display: flex; justify-content: space-between; width: 100%; font-size: 18px; }
.game-hud b { font-size: 24px; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 600; }
.timer.low { color: var(--error); }
.timer .icon { width: 18px; height: 18px; }
.game-card { width: 100%; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.game-input { text-align: center; font-family: var(--font-en); font-size: 24px; font-weight: 600; max-width: 320px; }
.shake { animation: shake 280ms; }
.chip[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Listening ---------- */
.listen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.listen-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; transition: border-color var(--fast); }
.listen-card:hover { border-color: var(--accent); }
.listen-card b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen-card .muted { font-size: 14px; }
.listen-num { font-family: var(--font-mono); font-size: 14px; color: var(--text-faint); min-width: 26px; }
.score-badge { font-family: var(--font-mono); font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--text-muted); }
.score-badge.full { background: var(--accent-soft); color: var(--accent); }
.listen-player { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 16px; }
.big-play { height: 56px; padding-inline-end: 22px; font-size: 16px; font-weight: 700; }
.big-play > .icon { width: 44px; height: 44px; padding: 12px; }
.transcript { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--border); transition: filter var(--normal); }
.transcript.veiled { filter: blur(6px); user-select: none; }
.tx-line { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: var(--r-md); transition: background-color var(--fast); }
.tx-line .en { text-align: left; font-size: 17px; }
.tx-line.speaking { background: var(--accent-soft); }
.tx-speaker { color: var(--accent); font-family: var(--font-en); font-size: 13px; }
.tx-ar { color: var(--text-muted); font-size: 14px; }

/* ---------- Questions ---------- */
.q-list { display: flex; flex-direction: column; gap: 14px; }
.q-block { padding: 18px; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--border); }
.q-text { font-weight: 700; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.q-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--surface); font-size: 13px; font-family: var(--font-mono); }
.option.small { min-height: 46px; font-size: 16px; justify-content: flex-start; text-align: start; }
.option.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt-letter { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.q-why { margin-top: 10px; color: var(--text-muted); font-size: 15px; }
.result-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 20px; }
.result-score { font-family: var(--font-en); font-size: 48px; line-height: 1; }
.error-text { color: var(--error); margin-top: 12px; }

/* ---------- STEP / exams ---------- */
.exam-hero { display: flex; gap: 18px; align-items: flex-start; padding: 28px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-elev) 55%); }
.exam-hero .section-icon { width: 52px; height: 52px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.unit-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; transition: border-color var(--fast); }
.unit-card:hover { border-color: var(--accent); }
.unit-num { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.unit-card .faint { font-size: 13px; text-align: right; }
.lesson { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.rules { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; }
.rules li b { display: block; }
.rule-ex { display: block; color: var(--accent); font-family: var(--font-en); cursor: pointer; text-align: left; }
.test-bar { position: sticky; top: 64px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg-elev) 90%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); }
.test-section { margin-bottom: 12px; }
.passage { line-height: 1.8; font-size: 17px; display: flex; flex-direction: column; gap: 12px; margin: 16px 0; text-align: left; }
.prompt-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.prompt-en { font-family: var(--font-en); font-size: 18px; font-weight: 500; text-align: left; line-height: 1.6; }
.prompt-data { font-family: var(--font-mono); font-size: 13px; padding: 14px; border-radius: var(--r-md); background: var(--surface); overflow-x: auto; text-align: left; white-space: pre; }
.writing-area { min-height: 320px; font-family: var(--font-en); font-size: 17px; text-align: left; }
.tips { margin-bottom: 16px; padding: 14px 18px; border-radius: var(--r-lg); background: var(--surface); }
.tips summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tips ul { margin: 10px 0 0; padding-inline-start: 20px; color: var(--text-muted); }
.feedback { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.band { display: flex; justify-content: space-between; align-items: baseline; }
.band b { font-family: var(--font-en); font-size: 36px; color: var(--accent); }
.criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.criterion { padding: 12px 14px; }
.criterion .muted { font-size: 14px; margin-top: 4px; }
@media (max-width: 600px) { .criteria { grid-template-columns: 1fr; } }
.sub-h { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.corrections { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.corrections li { padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); }
.corrections p[dir='ltr'] { text-align: left; font-family: var(--font-en); }
del { color: var(--error); text-decoration-thickness: 2px; }
ins { color: var(--success); text-decoration: none; font-weight: 600; }
.improved { font-family: var(--font-en); text-align: left; line-height: 1.8; white-space: pre-wrap; margin-top: 10px; }
.speak-card { display: flex; flex-direction: column; gap: 14px; }
.btn.recording { background: var(--error); color: #fff; border-color: transparent; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--error-soft); } }
.setup-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.setup-card > div { flex: 1; min-width: 220px; }
.tile-remove { position: absolute; top: 8px; inset-inline-start: 8px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); }

/* ---------- Settings ---------- */
.settings section { margin-top: 16px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-of-type { border-bottom: 0; }
.setting-row .faint { font-size: 13px; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-hover); position: relative; cursor: pointer; transition: background-color var(--fast); }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start var(--fast) var(--ease); box-shadow: 0 1px 3px #0004; }
.switch:checked { background: var(--accent); }
.switch:checked::after { inset-inline-start: 21px; }
.steps { margin: 0; padding-inline-start: 20px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
code { font-family: var(--font-mono); font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface); }
.btn.danger { color: var(--error); }
.credits { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text-muted); }
.credits b { color: var(--text); }

/* ---------- Onboarding ---------- */
.onboard { min-height: calc(100dvh - 80px); display: grid; place-items: center; padding: 24px 16px 64px; }
.onboard-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 18px; text-align: center; }
.onboard-card.wide { width: min(720px, 100%); text-align: start; }
.onboard-card h1 { font-size: clamp(28px, 5vw, 38px); }
.input-lg { font-size: 20px; padding: 16px 20px; text-align: center; }
.goal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal-option { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r-lg); background: var(--bg-elev); border: 2px solid var(--border); transition: border-color var(--fast); }
.goal-option.on { border-color: var(--accent); background: var(--accent-soft); }
.goal-option small { color: var(--text-faint); }
.level-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
