/* ===== PyQuest — профессиональная тёмная тема ===== */
:root {
  --bg: #0b0f17;
  --surface: #111726;
  --surface-2: #16203297;
  --card: #121a2b;
  --card-2: #1a2438;
  --border: #1f2a3e;
  --border-light: #2a3752;
  --text: #e6ebf4;
  --muted: #8b98ac;
  --faint: #5c6b80;
  --primary: #38bdf8;
  --primary-2: #6366f1;
  --success: #34d399;
  --danger: #f87171;
  --gold: #fbbf24;
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 70% -10%, rgba(56, 189, 248, .07), transparent 60%),
    radial-gradient(900px 400px at 10% 0%, rgba(99, 102, 241, .06), transparent 60%);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
b, strong { color: #fff; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.015em; }

/* Иконки */
.ic {
  width: 1.05em; height: 1.05em;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.16em; display: inline-block; flex-shrink: 0;
}
.ic.flip { transform: rotate(180deg); }
.ic.ok { color: var(--success); }
.ic.muted { color: var(--faint); }
.gold-text { color: var(--gold); }
.muted-text { color: var(--muted); }

/* ===== Топбар ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 22px;
  background: rgba(11, 15, 23, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.brand-name { font-size: 1.12rem; font-weight: 700; line-height: 1.1; display: flex; flex-direction: column; }
.brand-name b { color: var(--primary); font-weight: 800; display: inline; }
.brand-name small { font-size: .66rem; font-weight: 500; color: var(--faint); letter-spacing: .02em; }
.topnav { display: flex; gap: 4px; margin-left: 6px; }
.topnav-link {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  padding: 7px 13px; border-radius: 9px; transition: color .15s, background .15s;
}
.topnav-link:hover { color: var(--text); background: var(--surface); }
.topbar-stats { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.stat {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 10px; font-size: .88rem;
  white-space: nowrap; font-weight: 600;
}
.stat.streak .ic { color: #fb923c; }
.stat.xp .ic { color: var(--gold); }
.stat b { color: var(--text); font-weight: 700; }
.stat-unit { color: var(--faint); font-size: .74rem; font-weight: 600; }
.rank-chip {
  background: linear-gradient(135deg, rgba(56,189,248,.12), rgba(99,102,241,.12));
  border-color: rgba(56,189,248,.35); color: var(--primary); font-weight: 700;
}

main { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 28px 18px 70px; }
.footer { text-align: center; padding: 20px; color: var(--faint); font-size: .84rem; border-top: 1px solid var(--border); }

/* ===== Герой ===== */
.hero {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px;
  margin-bottom: 34px;
}
.hero-main {
  background: linear-gradient(140deg, #101a2e 0%, #0e1626 55%, #0d1422 100%);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 30px 32px;
}
.hero-kicker {
  color: var(--primary); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 10px;
}
.hero h1 { font-size: 1.85rem; margin-bottom: 10px; }
.hero p.sub { color: var(--muted); margin-bottom: 20px; max-width: 520px; }
.xp-bar-wrap { max-width: 460px; margin-bottom: 22px; }
.xp-bar-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); margin-bottom: 7px; }
.xp-bar-label .ic { color: var(--gold); }
.xp-bar { height: 9px; background: #0a1120; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.xp-bar > div {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .6s ease;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-side {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px;
}
.hero-side h3 { font-size: .95rem; margin-bottom: 12px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.hero-side ul { list-style: none; }
.hero-side li {
  font-size: .88rem; color: var(--text); padding: 7px 0 7px 20px; position: relative;
  border-bottom: 1px dashed var(--border);
}
.hero-side li:last-child { border-bottom: none; }
.hero-side li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 600; font-size: .92rem; font-family: var(--font);
  padding: 10px 20px; border-radius: 10px;
  transition: transform .13s, box-shadow .13s, filter .13s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(56, 189, 248, .28); filter: brightness(1.06); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--border-light); }
.btn.secondary:hover { box-shadow: none; border-color: var(--primary); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border-light); }
.btn.ghost:hover { color: var(--text); border-color: var(--primary); box-shadow: none; }
.btn.blue { background: var(--card-2); color: var(--primary); border: 1px solid rgba(56,189,248,.4); }
.btn.blue:hover { box-shadow: 0 4px 14px rgba(56,189,248,.15); }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.btn.danger:hover { box-shadow: 0 8px 22px rgba(244, 63, 94, .3); }
.btn.small { padding: 6px 14px; font-size: .84rem; }

/* ===== Секции ===== */
.section-title {
  font-size: 1.2rem; margin: 40px 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .ic { color: var(--primary); }
.section-title small { color: var(--faint); font-weight: 500; font-size: .82rem; margin-left: 2px; }

/* ===== Треки ===== */
.track {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 22px;
  border-top: 2px solid var(--tc, var(--primary));
}
.track-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.track-glyph {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tc) 14%, transparent);
  color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent);
}
.track-glyph .ic { width: 22px; height: 22px; }
.track-title { flex: 1; min-width: 220px; }
.track-title h2 { font-size: 1.15rem; }
.track-title p { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.track-progress { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.pbar { width: 130px; height: 7px; background: #0a1120; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.pbar > div { height: 100%; background: var(--tc, var(--primary)); border-radius: 6px; transition: width .5s; }
.track-locked {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .87rem; padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px dashed var(--border-light); border-radius: 10px;
}

.mod-list { display: flex; flex-direction: column; gap: 8px; }
.mod-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 16px; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.mod-row:hover { border-color: var(--tc, var(--primary)); transform: translateX(3px); }
.mod-row.locked { opacity: .48; cursor: not-allowed; }
.mod-row.locked:hover { border-color: var(--border); transform: none; }
.mod-row.completed { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.mod-num {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: .92rem;
  background: color-mix(in srgb, var(--tc, #38bdf8) 12%, transparent);
  color: var(--tc, var(--primary));
  border: 1px solid color-mix(in srgb, var(--tc, #38bdf8) 30%, transparent);
}
.mod-row.completed .mod-num { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.35); }
.mod-num.big { width: 54px; height: 54px; font-size: 1.15rem; }
.mod-info { flex: 1; min-width: 0; }
.mod-info h4 { font-size: .97rem; font-weight: 600; }
.mod-info p { color: var(--muted); font-size: .8rem; margin-top: 1px; }
.mod-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .71rem; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--border); color: var(--faint);
}
.chip .ic { width: .85em; height: .85em; }
.chip.ok { color: var(--success); border-color: rgba(52,211,153,.35); }
.mod-state { color: var(--muted); display: flex; }
.final-row .mod-num { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: var(--gold); }

/* ===== План по неделям ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.plan-week {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; font-size: .87rem;
}
.plan-week.current { border-color: var(--gold); box-shadow: 0 0 18px rgba(251,191,36,.12); }
.plan-week.past { opacity: .55; }
.pw-head { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-num {
  color: var(--gold); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.pw-now {
  background: rgba(251,191,36,.14); color: var(--gold); font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(251,191,36,.3);
}
.pw-head b { width: 100%; font-size: .95rem; }
.plan-week ul { list-style: none; }
.plan-week li { color: var(--muted); padding: 4px 0 4px 16px; position: relative; }
.plan-week li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* ===== Ачивки ===== */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 12px; text-align: center; font-size: .8rem;
}
.ach .ico { font-size: 1.7rem; display: block; margin-bottom: 7px; }
.ach.locked { opacity: .32; filter: grayscale(1); }
.ach.unlocked { border-color: rgba(251,191,36,.4); }
.ach b { display: block; margin-bottom: 2px; font-size: .84rem; }
.ach span.desc { color: var(--muted); font-size: .74rem; }

/* ===== Роадмап ===== */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 1.6rem; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-head h1 .ic { color: var(--primary); }
.page-head p { color: var(--muted); max-width: 640px; }
.rm-section { margin-bottom: 28px; }
.rm-section h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--primary); }
.rm-list { display: flex; flex-direction: column; gap: 7px; }
.rm-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; cursor: pointer; font-size: .9rem;
  transition: border-color .15s;
}
.rm-item:hover { border-color: var(--primary); }
.rm-item.static { cursor: default; }
.rm-item.static:hover { border-color: var(--border); }
.rm-item.done { border-color: rgba(52,211,153,.4); }
.rm-item.done .rm-text, .rm-item.done > span:last-child { color: var(--muted); text-decoration: line-through; }
.rm-item.done .rm-link { text-decoration: none; }
.rm-check {
  width: 21px; height: 21px; border-radius: 6px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--border-light); display: flex; align-items: center; justify-content: center;
  color: var(--success);
}
.rm-item.done .rm-check { background: rgba(52,211,153,.14); border-color: var(--success); }
.rm-link { font-size: .82rem; white-space: nowrap; margin-left: 6px; }
.rm-note { color: var(--faint); font-size: .84rem; margin-top: 12px; }

/* ===== Страница модуля ===== */
.mod-header {
  display: flex; align-items: center; gap: 18px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--tc, var(--primary));
  border-radius: var(--radius); padding: 20px 22px;
}
.mod-track { color: var(--tc, var(--primary)); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.mod-header h1 { font-size: 1.3rem; }
.mod-tagline { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 14px; color: var(--muted); font-size: .87rem; font-weight: 500;
}
.back-link:hover { color: var(--primary); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: .89rem; font-weight: 500;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--card-2); color: var(--text); border-color: var(--primary); }
.tab .done-mark { color: var(--success); display: inline-flex; }

/* ===== Теория ===== */
.theory-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; line-height: 1.68; animation: fadeIn .3s;
}
.theory-card h2 { margin-bottom: 14px; font-size: 1.2rem; color: var(--primary); }
.theory-card p { margin-bottom: 12px; }
.theory-card ul, .theory-card ol { margin: 0 0 12px 22px; }
.theory-card li { margin-bottom: 6px; }
.theory-card code, .quiz-q code, .task-desc code {
  background: #0a1120; padding: 2px 7px; border-radius: 6px;
  font-family: var(--mono); font-size: .85em; color: #7dd3fc;
}
pre.code {
  background: #0a1120; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 17px; overflow-x: auto; margin: 12px 0;
  font-family: var(--mono); font-size: .86rem; line-height: 1.6;
}
pre.code code { background: none; padding: 0; color: var(--text); font-size: 1em; }
.py-kw { color: #c084fc; } .py-str { color: #86efac; } .py-num { color: #fbbf24; }
.py-com { color: #64748b; font-style: italic; } .py-fn { color: #7dd3fc; }
.theory-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.theory-progress { color: var(--faint); font-size: .86rem; font-family: var(--mono); }
.try-box { margin-top: 10px; margin-bottom: 12px; }
.try-out {
  background: #070e1a; border: 1px dashed var(--border-light); border-radius: 8px;
  padding: 10px 14px; margin-top: 8px; font-family: var(--mono); font-size: .84rem;
  white-space: pre-wrap; color: #a5f3fc; min-height: 20px; overflow-x: auto;
}

/* ===== Квиз ===== */
.quiz-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; animation: fadeIn .3s; }
.quiz-progress { display: flex; gap: 5px; margin-bottom: 20px; }
.quiz-progress i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.quiz-progress i.done { background: var(--success); border-color: var(--success); }
.quiz-progress i.wrong { background: var(--danger); border-color: var(--danger); }
.quiz-q { font-size: 1.06rem; margin-bottom: 18px; line-height: 1.5; font-weight: 500; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; cursor: pointer; font-size: .93rem; text-align: left;
  color: var(--text); font-family: var(--font); transition: border-color .12s, transform .12s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--primary); transform: translateX(3px); }
.quiz-opt.correct { border-color: var(--success); background: rgba(52,211,153,.09); }
.quiz-opt.wrong { border-color: var(--danger); background: rgba(248,113,113,.09); }
.quiz-opt:disabled { cursor: default; }
.quiz-explain {
  margin-top: 14px; padding: 13px 16px; border-radius: 10px; font-size: .89rem; line-height: 1.55;
  background: rgba(56,189,248,.07); border: 1px solid rgba(56,189,248,.25);
}
.quiz-result { text-align: center; padding: 26px 20px; }
.quiz-result h2 { margin-bottom: 8px; }
.quiz-result p { color: var(--muted); margin-bottom: 20px; }
.score-ring {
  width: 110px; height: 110px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid var(--danger); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; font-family: var(--mono);
  color: var(--danger); background: rgba(248,113,113,.06);
}
.score-ring.pass { border-color: var(--success); color: var(--success); background: rgba(52,211,153,.06); }

/* ===== Задачи ===== */
.tasks-note { color: var(--muted); margin-bottom: 14px; font-size: .89rem; }
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 11px;
  padding: 14px 18px; cursor: pointer; transition: border-color .13s;
}
.task-item:hover { border-color: var(--primary); }
.task-item.solved { border-color: rgba(52,211,153,.4); }
.t-ico { display: flex; color: var(--muted); }
.task-item h4 { font-size: .95rem; font-weight: 600; }
.task-item p { color: var(--muted); font-size: .8rem; }
.t-xp { margin-left: auto; color: var(--gold); font-size: .8rem; font-weight: 700; font-family: var(--mono); }
.task-view { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; animation: fadeIn .3s; }
.task-view h2 { margin-bottom: 10px; font-size: 1.15rem; }
.task-desc { line-height: 1.6; margin-bottom: 14px; }
.editor {
  width: 100%; min-height: 220px; resize: vertical;
  background: #0a1120; color: var(--text); border: 1px solid var(--border-light); border-radius: 10px;
  font-family: var(--mono); font-size: .9rem; line-height: 1.65; padding: 14px 16px;
  outline: none; tab-size: 4;
}
.editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.task-actions { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.run-out {
  background: #070e1a; border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; margin-top: 12px; font-family: var(--mono); font-size: .85rem;
  white-space: pre-wrap; min-height: 24px; max-height: 340px; overflow-y: auto;
}
.run-out .err, .err { color: var(--danger); }
.run-out .ok, .ok { color: var(--success); }
.run-out p { font-family: var(--font); margin-top: 8px; font-weight: 600; }
.hint-box {
  margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: .88rem;
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25); line-height: 1.55;
}
.py-loading { color: var(--faint); font-size: .82rem; }

/* ===== SQL-таблицы ===== */
.sql-table-wrap { overflow-x: auto; margin: 4px 0; }
.sql-table {
  border-collapse: collapse; font-size: .84rem; font-family: var(--mono);
  min-width: 280px;
}
.sql-table th {
  text-align: left; padding: 7px 14px; color: var(--primary);
  border-bottom: 2px solid var(--border-light); font-weight: 600; white-space: nowrap;
}
.sql-table td { padding: 6px 14px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.sql-table td.null { color: var(--faint); font-style: italic; }
.sql-table tr:hover td { background: rgba(56,189,248,.04); }
.sql-empty { color: var(--faint); font-size: .84rem; font-family: var(--font); margin-top: 6px; }

/* ===== Экзамен ===== */
.exam-intro {
  text-align: center; padding: 44px 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.exam-glyph {
  width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 20px;
  background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3);
  display: flex; align-items: center; justify-content: center; color: #fb7185;
}
.exam-glyph .ic { width: 34px; height: 34px; }
.exam-intro h2 { margin-bottom: 12px; font-size: 1.3rem; }
.exam-intro p { color: var(--muted); margin-bottom: 8px; }
.exam-intro .btn { margin-top: 14px; }
.exam-timer { position: sticky; top: 62px; z-index: 10; text-align: center; margin-bottom: 14px; }
.exam-timer span {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card-2); border: 1px solid var(--gold); color: var(--gold);
  padding: 7px 16px; border-radius: 20px; font-weight: 700; font-family: var(--mono); font-size: .92rem;
}
.exam-timer.low span { border-color: var(--danger); color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ===== Сертификат ===== */
.cert-wrap { text-align: center; }
.cert-wrap h1 { margin-bottom: 10px; }
.cert-wrap canvas { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); margin: 16px 0; }
.name-input {
  background: #0a1120; border: 1px solid var(--border-light); border-radius: 10px;
  color: var(--text); padding: 10px 16px; font-size: .95rem; font-family: var(--font);
  outline: none; width: 260px; max-width: 100%;
}
.name-input:focus { border-color: var(--primary); }

/* ===== Тосты и конфетти ===== */
#toast-layer { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card-2); border: 1px solid var(--primary); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: .9rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.5); animation: slideIn .3s;
}
.toast.gold { border-color: var(--gold); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 9px; top: -20px; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translateY(105vh) rotate(720deg); opacity: .2; } }

/* ===== Адаптив ===== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .mod-chips { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 10px; gap: 10px; }
  .brand-name small { display: none; }
  .topnav-link span { display: none; }
  .topnav-link { padding: 7px 9px; }
  .stat { font-size: .78rem; padding: 5px 8px; }
  .stat-unit { display: none; }
  main { padding: 18px 10px 50px; }
  .hero-main { padding: 22px 20px; }
  .hero h1 { font-size: 1.45rem; }
  .theory-card, .quiz-box, .task-view { padding: 18px 16px; }
}
