:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2430;
  --text: #f1f4f8;
  --muted: #aab3c2;
  --line: #2a3140;
  --accent: #7aa2ff;
  --accent-2: #91d7a3;
  --danger: #ff7a7a;
  --warning: #ffd166;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top left, rgba(122,162,255,.16), transparent 36%), var(--bg); color: var(--text); min-height: 100vh; }
button, select, input { font: inherit; }
.topbar { max-width: 1240px; margin: 0 auto; padding: 34px 20px 18px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); line-height: 1; }
.subtitle { color: var(--muted); max-width: 710px; margin: 14px 0 0; line-height: 1.55; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.layout { max-width: 1240px; margin: 0 auto; padding: 18px 20px 34px; display: grid; grid-template-columns: 330px 1fr; gap: 22px; }
.sidebar, .trainer { display: flex; flex-direction: column; gap: 18px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.035), transparent), var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin: 0 0 16px; font-size: 20px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; cursor: pointer; transition: transform .12s ease, opacity .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #09111f; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,122,122,.13); color: var(--danger); border: 1px solid rgba(255,122,122,.32); }
.progress-ring { width: 150px; height: 150px; border-radius: 50%; margin: 8px auto 20px; display: grid; place-items: center; background: conic-gradient(var(--accent) 0%, rgba(255,255,255,.08) 0%); position: relative; }
.progress-ring::after { content: ""; position: absolute; width: 116px; height: 116px; border-radius: 50%; background: var(--panel); }
.progress-percent { position: relative; z-index: 1; font-size: 30px; font-weight: 900; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat-grid span { display: block; font-size: 24px; font-weight: 900; }
.stat-grid small { color: var(--muted); }
.select-label { color: var(--muted); display: block; margin-bottom: 8px; }
.type-label { margin-top: 14px; }
select { width: 100%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 14px; padding: 12px; outline: none; }
.check-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; color: var(--text); }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.lecture-progress { display: flex; flex-direction: column; gap: 12px; }
.lecture-row { display: grid; grid-template-columns: 76px 1fr 52px; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.bar { height: 9px; background: rgba(255,255,255,.08); border-radius: 100px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent-2); width: 0%; transition: width .2s ease; }
.question-card { min-height: 560px; display: flex; flex-direction: column; }
.question-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.question-meta span { padding: 7px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
#questionText { font-size: clamp(22px, 3vw, 32px); line-height: 1.22; margin-bottom: 22px; }
.options { display: grid; gap: 12px; }
.option { width: 100%; text-align: left; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer; line-height: 1.45; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.option:hover { border-color: rgba(122,162,255,.75); }
.option.selected { border-color: rgba(255,209,102,.9); background: rgba(255,209,102,.10); }
.letter { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.08); font-weight: 900; }
.option.correct { border-color: rgba(145,215,163,.9); background: rgba(145,215,163,.12); }
.option.wrong { border-color: rgba(255,122,122,.9); background: rgba(255,122,122,.12); }
.option.missed { border-color: rgba(255,209,102,.9); background: rgba(255,209,102,.10); }
.option.locked { cursor: default; }
.answer-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.feedback { margin-top: 16px; border-radius: 18px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.05); line-height: 1.5; }
.feedback.ok { border-color: rgba(145,215,163,.8); }
.feedback.bad { border-color: rgba(255,122,122,.8); }
.hidden { display: none; }
.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  position: sticky;
  bottom: 14px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(23,26,33,0), var(--panel) 34%, var(--panel));
}
.nav-row .btn { min-width: 130px; }
.mistake-list { display: grid; gap: 10px; }
.mistake-list.empty { color: var(--muted); }
.mistake-item { border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); padding: 12px; }
.mistake-item button { margin-top: 8px; background: transparent; border: 0; color: var(--accent); cursor: pointer; font-weight: 800; padding: 0; }
.footer { max-width: 1240px; margin: 0 auto; color: var(--muted); padding: 0 20px 28px; }
@media (max-width: 900px) { .topbar { align-items: flex-start; flex-direction: column; } .top-actions { justify-content: flex-start; } .layout { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .topbar { padding-top: 24px; } .card { border-radius: 18px; padding: 16px; } .option { grid-template-columns: 1fr; } .nav-row, .answer-row { flex-direction: column; } .nav-row { bottom: 10px; } .nav-row .btn, .answer-row .btn { width: 100%; } }

.why { margin-top: 10px; line-height: 1.55; }
.option-breakdown { margin-top: 12px; }
.option-breakdown ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.option-breakdown li { line-height: 1.45; }
.option-breakdown span { color: var(--muted); }
.oral { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); line-height: 1.55; }
.topbar h1 a {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;

  background: linear-gradient(135deg, #7c3aed, #2563eb);
  padding: 0.12em 0.45em;
  border-radius: 0.45em;

  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.topbar h1 a:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(37, 99, 235, 0.38);
  filter: brightness(1.08);
}

.topbar h1 a:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
