/* ============ База ============
   Палитра, типографика и радиусы приходят из общей дизайн-системы
   платформы (shared/theme.css) — она подключена раньше этого файла.
   Здесь остаются только цвета, специфичные для этого курса. */

:root {
  --accent: #ff6a3d;        /* HTML-оранжевый — основной акцент */
  --accent-dim: #b8492a;
  --on-accent: #ffffff;
  --css-blue: #4b8bff;      /* CSS-синий — вторичный акцент */
  --css-blue-dim: #2f5fb0;
}

#app { display: flex; min-height: 100vh; }

/* ============ Сайдбар ============ */
#sidebar {
  width: 290px;
  min-width: 290px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 24px;
  padding: 6px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-html, .logo-css {
  color: #000;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 17px;
}
.logo-html { background: var(--accent); }
.logo-css { background: var(--css-blue); color: #fff; }

.nav-cheatsheet {
  padding: 9px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-cheatsheet:hover { background: var(--bg3); color: var(--text); }
.nav-cheatsheet.active { color: var(--accent); border-color: var(--accent-dim); }

.nav-section { margin-bottom: 6px; }

.nav-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  transition: background .15s;
}
.nav-section-head:hover { background: var(--bg3); }
.nav-section-head .chev { margin-left: auto; transition: transform .2s; font-size: 11px; color: var(--text-dim); }
.nav-section.open .chev { transform: rotate(90deg); }

.nav-num {
  background: var(--bg3);
  color: var(--text-dim);
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.nav-section.done .nav-num { background: var(--green); color: #05320f; }

.nav-lessons { display: none; padding-left: 10px; }
.nav-section.open .nav-lessons { display: block; }

.nav-lesson {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}
.nav-lesson:hover { background: var(--bg3); color: var(--text); }
.nav-lesson.active { background: var(--bg3); color: var(--accent); }
.nav-lesson .dot {
  width: 8px; height: 8px; min-width: 8px;
  border-radius: 50%;
  background: var(--border);
}
.nav-lesson.done .dot { background: var(--green); }
.nav-lesson.partial .dot { background: var(--orange); }
.nav-lesson.quiz-link .dot { border-radius: 2px; }
.nav-score { margin-left: auto; font-size: 11px; font-family: var(--mono); }

.nav-exam {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  color: var(--text-dim);
}
.nav-exam.unlocked { border-color: var(--accent-dim); color: var(--accent); border-style: solid; }
.nav-exam:hover { background: var(--bg3); }

/* ============ Контент ============ */
#main {
  flex: 1 1 auto;
  width: 100%;
  padding: 36px 48px 90px;
  max-width: 1680px;
  min-width: 0;
  margin: 0 auto;   /* центрируем колонку на широких экранах */
}

#main p,
#main ul,
#main ol,
#main .hint-box,
#main .warn-box,
#main .info-box,
#main .try-box {
  max-width: 108ch;
}
#main .card p { max-width: none; }

h1 { font-size: 30px; margin-bottom: 8px; line-height: 1.3; }
h2 { font-size: 22px; margin: 34px 0 12px; padding-top: 8px; }
h3 { font-size: 18px; margin: 24px 0 10px; }
p { margin-bottom: 12px; color: var(--text); }
ul, ol { margin: 0 0 14px 24px; }
li { margin-bottom: 6px; }

.subtitle { color: var(--text-dim); margin-bottom: 24px; font-size: 15px; }

a { color: var(--css-blue); }

code {
  font-family: var(--mono);
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 14px;
  color: var(--accent);
}

pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0 18px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: var(--text); }

.hint-box, .warn-box, .info-box, .try-box {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14.5px;
  border-left: 4px solid;
}
.hint-box { background: rgba(74,222,128,.07); border-color: var(--green); }
.warn-box { background: rgba(248,113,113,.07); border-color: var(--red); }
.info-box { background: rgba(96,165,250,.07); border-color: var(--blue); }
.try-box  { background: rgba(255,106,61,.07); border-color: var(--accent); }
.hint-box b, .warn-box b, .info-box b, .try-box b { display: block; margin-bottom: 4px; }

table { border-collapse: collapse; margin: 14px 0 18px; width: 100%; font-size: 14.5px; }
th, td { border: 1px solid var(--border); padding: 8px 14px; text-align: left; }
th { background: var(--bg2); }
td code { white-space: nowrap; }

/* ============ Карточки дашборда ============ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 16.5px; }
.card .card-desc { color: var(--text-dim); font-size: 13.5px; margin-bottom: 14px; }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-num {
  background: var(--bg3); color: var(--accent);
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--mono);
}

.progress-bar {
  height: 8px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s;
}
.progress-fill.green { background: var(--green); }
.progress-label { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; display: flex; justify-content: space-between; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .stat-val { font-size: 28px; font-weight: 700; font-family: var(--mono); }
.stat .stat-label { font-size: 13px; color: var(--text-dim); }
.stat-val.c-green { color: var(--green); }
.stat-val.c-accent { color: var(--accent); }
.stat-val.c-blue { color: var(--css-blue); }
.stat-val.c-purple { color: var(--purple); }
.stat-val.c-gold { color: var(--gold); }

/* Уровень / XP */
.level-wrap {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin: 22px 0;
}
.level-badge {
  width: 58px; height: 58px; min-width: 58px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--css-blue));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
}
.level-badge .lvl-num { font-size: 22px; line-height: 1; font-family: var(--mono); }
.level-badge .lvl-cap { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: .85; }
.level-info { flex: 1; min-width: 0; }
.level-info .lvl-title { font-weight: 700; font-size: 16px; }
.level-info .lvl-xp { font-size: 13px; color: var(--text-dim); margin: 2px 0 6px; }

/* ============ Задачи / песочница ============ */
.task {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 22px 0;
  overflow: hidden;
}
.task-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.task-head .task-title { font-weight: 600; font-size: 15.5px; }
.task-status { margin-left: auto; font-size: 13px; font-weight: 600; }
.task-status.ok { color: var(--green); }
.task-status.no { color: var(--text-dim); }

.diff {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.diff-1 { background: rgba(74,222,128,.15); color: var(--green); }
.diff-2 { background: rgba(251,146,60,.15); color: var(--orange); }
.diff-3 { background: rgba(248,113,113,.15); color: var(--red); }

.task-body { padding: 18px 20px; }
.task-desc { font-size: 15px; margin-bottom: 14px; }
.task-desc code { font-size: 13.5px; }
.task-desc pre { margin: 10px 0; }

/* Песочница: слева редакторы, справа два предпросмотра */
.playground {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .playground { grid-template-columns: 1fr; } }

.pg-editors { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pg-ed-label {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--text-dim); text-transform: uppercase; margin-bottom: -4px;
  display: flex; align-items: center; gap: 6px;
}
.pg-ed-label .tag { font-family: var(--mono); }
.pg-ed-label.html .tag { color: var(--accent); }
.pg-ed-label.css .tag { color: var(--css-blue); }

.code-editor {
  width: 100%;
  min-height: 150px;
  overflow-y: hidden;
  /* Фон и текст редактора заданы вместе и не зависят от темы:
     код читается на тёмном, как в любой среде разработки. Взять
     цвет текста из темы нельзя — на светлой он слился бы с фоном. */
  background: #0b0d12;
  color: #e2e6f0;
  caret-color: #e2e6f0;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 14px;
  resize: vertical;
  tab-size: 2;
  white-space: pre;
}
.code-editor:focus { outline: none; border-color: var(--accent-dim); }
.code-editor::placeholder { color: #7c8399; }
.code-editor.readonly { opacity: .75; cursor: default; }

.pg-previews { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pg-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.pg-label {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 7px 12px; background: var(--bg3); color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border);
}
.pg-label.target { color: var(--gold); }
.pg-label.result { color: var(--green); }
.pg-frame {
  width: 100%;
  height: 220px;
  border: 0;
  background: #fff;
  display: block;
}
.pg-frame.tall { height: 320px; }
.pg-frame.short { height: 150px; }

.task-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn.big { padding: 12px 28px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.task-result {
  margin-top: 14px;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--mono);
  white-space: pre-wrap;
  display: none;
}
.task-result.show { display: block; }
.task-result.pass { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.35); color: var(--green); }
.task-result.fail { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); color: var(--red); }

.hint-toggle { font-size: 13.5px; color: var(--blue); cursor: pointer; user-select: none; }
.sol-toggle { font-size: 13.5px; color: var(--gold); cursor: pointer; user-select: none; }
.task-hint, .task-sol { display: none; margin-top: 12px; }
.task-hint.show, .task-sol.show { display: block; }
.task-sol pre { margin: 6px 0; }

/* ============ Квиз ============ */
.quiz-q {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
}
.quiz-q .q-text { font-weight: 600; margin-bottom: 14px; font-size: 15.5px; }
.q-text pre { margin-top: 10px; }
.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14.5px;
  transition: border-color .15s, background .15s;
}
.quiz-opt:hover { border-color: var(--accent-dim); }
.quiz-opt.selected { border-color: var(--accent); background: rgba(255,106,61,.06); }
.quiz-opt.correct { border-color: var(--green); background: rgba(74,222,128,.08); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(248,113,113,.08); }
.quiz-opt code { font-size: 13px; }
.q-explain { display: none; margin-top: 12px; font-size: 14px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; }
.q-explain.show { display: block; }

/* ============ Результаты ============ */
.score-banner {
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.score-banner .big-score { font-size: 48px; font-weight: 800; font-family: var(--mono); }
.score-banner.good .big-score { color: var(--green); }
.score-banner.mid .big-score { color: var(--orange); }
.score-banner.bad .big-score { color: var(--red); }
.score-banner p { color: var(--text-dim); margin: 6px 0 0; }

.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  gap: 12px;
}

.breadcrumb { font-size: 13.5px; color: var(--text-dim); margin-bottom: 12px; }
.breadcrumb span { cursor: pointer; }
.breadcrumb span:hover { color: var(--accent); }

.locked-note {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.locked-note .lock-icon { font-size: 52px; margin-bottom: 14px; }

.exam-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
}
.exam-badge.gold { background: rgba(251,191,36,.15); color: var(--gold); }

/* ============ Бейджи-достижения ============ */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.badge {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: transform .15s, border-color .15s;
}
.badge.got { border-color: var(--gold); background: rgba(251,191,36,.05); }
.badge.got:hover { transform: translateY(-2px); }
.badge .b-emoji { font-size: 40px; line-height: 1; filter: grayscale(1) opacity(.35); }
.badge.got .b-emoji { filter: none; }
.badge .b-title { font-weight: 700; margin-top: 8px; font-size: 15px; }
.badge .b-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.badge .b-locked { font-size: 11px; color: var(--text-dim); margin-top: 8px; text-transform: uppercase; letter-spacing: .5px; }
.badge.got .b-locked { color: var(--gold); }

/* Плашка достижений на дашборде */
.badges-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.badges-strip .mini-badge {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--bg3); border: 1px solid var(--border);
  filter: grayscale(1) opacity(.3);
}
.badges-strip .mini-badge.got { filter: none; border-color: var(--gold); background: rgba(251,191,36,.08); }

/* Тост при получении бейджа */
#badge-toast {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 12px 18px 12px 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
  min-width: 260px; max-width: 340px;
  transform: translateX(120%);
  transition: transform .4s cubic-bezier(.3,.8,.4,1);
}
.toast.show { transform: translateX(0); }
.toast .t-emoji { font-size: 30px; line-height: 1; }
.toast .t-text b { display: block; font-size: 14px; }
.toast .t-text span { font-size: 12.5px; color: var(--text-dim); }
.toast .t-cap { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }

/* ============ Шпаргалка: панель ============ */
#cheat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg3);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  transition: background .15s, color .15s, transform .15s;
}
#cheat-fab:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
body.cheat-open #cheat-fab { opacity: 0; pointer-events: none; }

#cheat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
body.cheat-open #cheat-backdrop { opacity: 1; pointer-events: auto; }

#cheat-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  width: min(640px, 94vw);
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .5);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.3, .8, .4, 1);
  display: flex;
  flex-direction: column;
}
body.cheat-open #cheat-panel { transform: translateX(0); }

#cheat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
#cheat-search {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
}
#cheat-search:focus { outline: none; border-color: var(--accent-dim); }
.cheat-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 38px;
  height: 38px;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.cheat-close:hover { background: var(--red); color: #fff; }

#cheat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 60px;
}
#cheat-body h1 { font-size: 22px; }
#cheat-body h2 {
  font-size: 17px;
  margin: 0 0 10px;
  padding: 0;
  color: var(--accent);
}
#cheat-body pre { margin: 0 0 12px; font-size: 13px; }
#cheat-body table { font-size: 13.5px; }
#cheat-body .subtitle { font-size: 13.5px; }

.cheat-block {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.cheat-block:last-child { border-bottom: none; }
.cheat-block.hidden { display: none; }

.cheat-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
}

@media (max-width: 700px) {
  #cheat-fab { right: 14px; bottom: 14px; padding: 11px 16px; }
  #cheat-fab span { display: none; }
}

/* ============ Карточки памяти ============ */
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
}

.fc-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 0 6px;
  padding: 16px 20px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  background: rgba(255, 106, 61, .06);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.fc-banner:hover { transform: translateY(-2px); background: rgba(255, 106, 61, .1); }
.fc-banner-icon { font-size: 34px; line-height: 1; }
.fc-banner-text { display: flex; flex-direction: column; min-width: 0; }
.fc-banner-text b { font-size: 16px; }
.fc-banner-text span { color: var(--text-dim); font-size: 13.5px; }
.fc-banner-go { margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }

.fc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 6px auto 14px;
  color: var(--text-dim);
  font-size: 14px;
  flex-wrap: wrap;
}
.fc-box { font-family: var(--mono); letter-spacing: 2px; color: var(--accent); }

.flashcard {
  perspective: 1600px;
  max-width: 720px;
  margin: 0 auto;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 340px;
  transition: transform .55s cubic-bezier(.3, .8, .4, 1);
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }

.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 30px 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg2);
  overflow: auto;
}
.fc-front { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02); }
.fc-back { transform: rotateY(180deg); background: var(--bg3); border-color: var(--accent-dim); }

.fc-emoji { font-size: 56px; line-height: 1; }
.fc-q { font-size: 21px; line-height: 1.5; font-weight: 600; max-width: 560px; }
.fc-q code, .fc-a code { font-size: 16px; }
.fc-tap { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.fc-a { font-size: 24px; font-weight: 700; color: var(--accent); max-width: 580px; line-height: 1.45; }
.fc-a code { color: var(--accent); font-size: 18px; }
.fc-assoc {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  max-width: 580px;
  background: rgba(74, 222, 128, .08);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
}
.fc-assoc-emoji { font-size: 24px; line-height: 1; flex-shrink: 0; }

.fc-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 22px auto 0;
  max-width: 720px;
  flex-wrap: wrap;
}
.fc-yes { background: var(--green); color: #05320f; }
.fc-no { background: var(--red); color: #3a0a0a; }
.fc-yes, .fc-no { min-width: 160px; padding: 12px 22px; font-size: 16px; }
.fc-hint { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 14px; }

@media (max-width: 700px) {
  .flashcard-inner { min-height: 300px; }
  .fc-emoji { font-size: 46px; }
  .fc-q { font-size: 18px; }
  .fc-a { font-size: 20px; }
  .fc-yes, .fc-no { min-width: 130px; flex: 1; }
}

/* ============ Скроллбар ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; min-width: 0; height: auto; position: static; }
  #main { padding: 24px 18px 70px; }
}
