:root {
  --ink: #1f2440;
  --muted: #6b7190;
  --paper: #ffffff;
  --panel: #fbfbff;
  --line: #e2e5f3;
  --accent: #4f6bff;
  --accent-ink: #ffffff;
  --good: #1fae74;
  --warn: #d9822b;
  --star: #ffb400;
  --key: #f3f4fa;
  --key-edge: #c9cde0;
  --bar: rgba(22, 26, 52, 0.88);
  --radius: 14px;
  --shadow: 0 18px 40px rgba(20, 24, 60, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #2a3a8f;
  user-select: none;
}

button { font: inherit; cursor: pointer; }
h1, h2 { margin: 0; }

#app { height: 100%; }

/* ------------------------------------------------------------ обои */
.start, .map, .desk {
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 110%, #3fb58a 0 40%, transparent 41%),
    radial-gradient(ellipse 70% 45% at 85% 115%, #2f9d78 0 40%, transparent 41%),
    radial-gradient(circle at 80% 18%, #ffe7a3 0 6%, transparent 6.5%),
    linear-gradient(180deg, #5a7dff 0%, #8fb2ff 60%, #c7dcff 100%);
}

/* ------------------------------------------------------------ кнопки */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn--big { font-size: 24px; padding: 16px 34px; border-radius: 16px; box-shadow: 0 6px 0 #3448c4; }
.btn--big:active { box-shadow: 0 3px 0 #3448c4; transform: translateY(3px); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ink); filter: none; }
.btn--small { font-size: 15px; padding: 6px 10px; }
.btn--hint { background: #fff4d6; color: #8a5a00; margin-top: 12px; align-self: flex-start; }

/* ------------------------------------------------------------ старт */
.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  color: #fff;
}
.start__logo { font-size: 96px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)); }
.start h1 { font-size: 56px; text-shadow: 0 4px 16px rgba(20,24,60,.35); }
.start__sub { font-size: 22px; margin: 0 0 12px; max-width: 640px; }
.start .muted { color: rgba(255,255,255,.85); }
.start .btn--ghost { color: #fff; text-decoration: underline; }
.warn { background: #fff4e5; color: #8a4b00; padding: 10px 16px; border-radius: 10px; max-width: 560px; margin: 0; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------ карта уровней */
.map { display: flex; flex-direction: column; align-items: center; padding: 32px 24px 48px; gap: 24px; overflow-y: auto; }
.map__head { text-align: center; color: #fff; }
.map__head h1 { font-size: 44px; text-shadow: 0 4px 16px rgba(20,24,60,.35); }
.map__head p { font-size: 22px; margin: 6px 0 0; }
.map__levels { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; max-width: 1240px; }
.map__foot .btn--ghost { color: #fff; }

.lvl {
  width: 220px;
  min-height: 230px;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow), 0 8px 0 #d6daf0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  color: var(--ink);
  transition: transform 0.12s;
}
.lvl:hover:not(:disabled) { transform: translateY(-4px); }
.lvl__n {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 700;
}
.lvl--done .lvl__n { background: var(--good); }
.lvl--locked { opacity: 0.6; cursor: default; }
.lvl--locked .lvl__n { background: #c9cde0; }
.lvl__title { font-size: 22px; font-weight: 700; text-align: center; }
.lvl__keys { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lvl__stars { color: var(--star); font-weight: 700; font-size: 18px; margin-top: auto; }

/* ------------------------------------------------------------ клавиши */
kbd {
  display: inline-block;
  min-width: 2em;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--key);
  border: 1px solid var(--key-edge);
  border-bottom-width: 4px;
  font: 700 0.95em 'Segoe UI', sans-serif;
  color: var(--ink);
  text-align: center;
}
.combo { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.plus { color: var(--muted); font-weight: 700; }
.then { color: var(--muted); margin: 0 8px; font-size: 0.85em; }

/* ------------------------------------------------------------ рабочий стол */
.desk {
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: 1fr 56px;
}

.panel {
  grid-row: 1;
  margin: 20px 0 20px 20px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.panel__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px -10px 10px; }
.panel__lvl { color: var(--muted); font-size: 14px; }
.panel__title { font-size: 28px; margin-bottom: 6px; }
.panel__story { font-size: 18px; line-height: 1.45; color: #3a4060; margin: 0 0 16px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 19px;
  line-height: 1.4;
  transition: background 0.2s, opacity 0.2s;
}
.step__mark {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  background: #e6e9f6; color: var(--muted);
}
.step__body { display: flex; flex-direction: column; gap: 8px; }
.step__keys { font-size: 18px; }
.step--now { background: #eef1ff; box-shadow: inset 0 0 0 2px var(--accent); }
.step--now .step__mark { background: var(--accent); color: #fff; }
.step--done { opacity: 0.6; }
.step--done .step__mark { background: var(--good); color: #fff; }
.step--next { opacity: 0.45; }
.step__keys.hit kbd { animation: keyhit 0.45s ease-out; }
@keyframes keyhit {
  0% { background: var(--good); color: #fff; transform: translateY(2px) scale(1.1); }
  100% { background: var(--key); }
}

.windows {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 28px;
  min-width: 0;
}

.win {
  position: relative;
  flex: 1 1 0;
  max-width: 600px;
  height: min(62vh, 420px);
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: 3px solid transparent;
  transition: outline-color 0.15s, transform 0.2s;
}
.win--active { outline-color: var(--accent); }
.win__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #eef0f8;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  cursor: default;
}
.win__title { font-weight: 600; flex: 1; }
.win__btns { display: flex; gap: 14px; color: var(--muted); font-style: normal; }
.win__btns i { font-style: normal; font-size: 13px; }
.win textarea {
  flex: 1;
  border: 0;
  resize: none;
  outline: none;
  padding: 18px 20px;
  font: 26px/1.5 'Segoe UI', sans-serif;
  color: var(--ink);
  background: transparent;
  user-select: text;
}
.win textarea::selection { background: #b8c6ff; }
.win--letter { background: #fffaf0; }
.win--letter .win__bar { background: #fbefd6; }
.win--letter textarea { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; }

.win--happy { animation: happy 0.6s ease-out; }
@keyframes happy {
  30% { transform: scale(1.03); box-shadow: 0 0 0 6px var(--good), var(--shadow); }
  100% { transform: scale(1); }
}
.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* кот, который ходит по клавиатуре */
.cat {
  position: absolute;
  bottom: 18px;
  left: -80px;
  font-size: 64px;
  animation: catwalk 1.7s linear forwards;
  pointer-events: none;
}
.cat__say {
  position: absolute;
  top: -26px; left: 10px;
  font-size: 16px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0 6px;
}
@keyframes catwalk {
  from { left: -80px; }
  to { left: calc(100% + 20px); }
}

/* панель задач */
.taskbar {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--bar);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: #fff;
}
.tb__start {
  width: 44px; height: 40px;
  border: 0; border-radius: 8px;
  background: transparent; color: #8fb2ff;
  font-size: 24px;
}
.tb__start.flash { animation: flash 0.7s; }
@keyframes flash { 30% { background: #4f6bff; color: #fff; } }
.tb__app {
  border: 0; border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 8px 14px;
  font-size: 15px;
  border-bottom: 3px solid transparent;
}
.tb__app--active { background: rgba(255,255,255,.18); border-bottom-color: #8fb2ff; }
.tb__clock { margin-left: auto; font-size: 15px; opacity: .9; }

/* ------------------------------------------------------------ всплывашки */
#overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(20, 24, 60, 0.45);
  z-index: 10;
}
#overlay.show { display: grid; }
.card {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  animation: cardin 0.25s ease-out;
}
@keyframes cardin { from { transform: scale(0.9); opacity: 0; } }
.card h2 { font-size: 32px; }
.card p { font-size: 18px; margin: 0; }
.card__kicker { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.learn { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.learn__row {
  display: flex; align-items: center; gap: 16px;
  text-align: left; font-size: 18px; line-height: 1.4;
  background: #f5f6fc; border-radius: 12px; padding: 12px 16px;
}
.learn__keys { flex: none; font-size: 22px; }
.tip { color: #8a5a00; background: #fff4d6; border-radius: 10px; padding: 8px 14px; }
.stars { font-size: 64px; letter-spacing: 6px; }
.star { color: #e1e4f0; display: inline-block; }
.star--on { color: var(--star); animation: starpop 0.5s ease-out backwards; }
.star--on:nth-child(2) { animation-delay: 0.15s; }
.star--on:nth-child(3) { animation-delay: 0.3s; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } }
.big-stars { font-size: 40px; color: var(--star); font-weight: 700; }

/* сочетание крупно посреди экрана */
#pop {
  position: fixed;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 20;
  text-align: center;
  opacity: 0;
}
#pop.pop--go { animation: pop 1.1s ease-out; }
.pop__keys { font-size: 44px; }
.pop__keys kbd { box-shadow: 0 8px 24px rgba(20,24,60,.3); }
.pop__text {
  margin-top: 10px;
  display: inline-block;
  background: var(--good);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 999px;
}
@keyframes pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.08); }
  30% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

#toasts {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
}
.toast {
  background: rgba(22, 26, 52, 0.92);
  color: #fff;
  font-size: 18px;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: cardin 0.2s ease-out;
  white-space: nowrap;
}

/* ------------------------------------------------------------ окна-приложения */
.app { flex: 1; position: relative; outline: none; overflow: hidden; min-height: 0; }

/* Рисовалка */
.board {
  position: absolute;
  inset: 0;
  background-color: #fff;
  background-image: radial-gradient(#e3e6f3 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: default;
}
.shape {
  position: absolute;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 52px;
  line-height: 1;
  border-radius: 10px;
  cursor: grab;
}
.shape--sel { outline: 3px dashed var(--accent); outline-offset: 2px; background: rgba(79, 107, 255, 0.08); }
.shape--blot::before {
  content: '';
  width: 58px;
  height: 46px;
  background: radial-gradient(circle at 35% 40%, #3b2f4a 0 55%, transparent 56%),
    radial-gradient(circle at 70% 60%, #3b2f4a 0 40%, transparent 41%),
    radial-gradient(circle at 20% 75%, #3b2f4a 0 18%, transparent 19%),
    radial-gradient(circle at 88% 22%, #3b2f4a 0 12%, transparent 13%);
}

/* Проводник */
.app--files { display: flex; flex-direction: column; background: #fff; }
.fx__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fc;
}
.fx__up {
  width: 36px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 16px;
}
.fx__up:disabled { opacity: 0.35; cursor: default; }
.fx__path {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
}
.fx__grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 14px;
  overflow: auto;
}
.fx__item {
  width: 128px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 2px solid transparent;
  text-align: center;
  cursor: default;
}
.fx__item:hover { background: #f1f4ff; }
.fx__item--sel { background: #dfe6ff; border-color: #9fb0ff; }
.fx__item--cut .fx__icon { opacity: 0.35; }
.fx__item:has(.fx__rename) { width: 240px; }
.fx__icon { font-size: 46px; line-height: 1.1; }
.fx__name { font-size: 15px; line-height: 1.25; word-break: break-word; margin-top: 4px; }
.fx__rename {
  width: 100%;
  margin-top: 4px;
  font: 15px 'Segoe UI', sans-serif;
  padding: 2px 4px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  text-align: center;
  user-select: text;
}
.fx__empty { color: var(--muted); font-size: 17px; padding: 20px; }

/* ------------------------------------------------------------ Alt+Tab */
#switcher {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 25;
  background: rgba(20, 24, 60, 0.35);
  pointer-events: none;
}
#switcher.show { display: flex; }
.sw {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: rgba(30, 34, 64, 0.94);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.sw__item {
  width: 170px;
  padding: 18px 10px;
  border-radius: 12px;
  border: 3px solid transparent;
  color: #fff;
  text-align: center;
  font-size: 17px;
}
.sw__item--on { border-color: #8fb2ff; background: rgba(255, 255, 255, 0.1); }
.sw__icon { font-size: 54px; margin-bottom: 6px; }
.sw__hint { color: #fff; font-size: 17px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }

#debug {
  position: fixed;
  right: 8px;
  top: 8px;
  z-index: 30;
  font: 12px Consolas, monospace;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
}
#debug:empty { display: none; }

/* ------------------------------------------------------------ выбор задания */
.tnavs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tnav {
  width: 34px; height: 34px;
  border: 2px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--muted);
  font-size: 15px; font-weight: 700;
}
.tnav:hover { border-color: var(--accent); color: var(--accent); }
.tnav--done { background: #e3f6ee; border-color: #9ad9bd; color: var(--good); }
.tnav--cur, .tnav--cur:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.pick { width: 100%; text-align: left; }
.pick summary { cursor: pointer; color: var(--accent); text-align: center; font-size: 17px; }
.pick__list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 260px; overflow: auto; }
.pick__item {
  display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 10px;
  background: #f5f6fc; color: var(--ink);
  padding: 8px 12px; font-size: 17px; text-align: left;
}
.pick__item:hover { background: #e8ecff; }
.pick__n {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none;
}
.pick__title { flex: 1; }
.pick__stars { color: var(--star); }

/* ------------------------------------------------------------ не сохранено, свет мигнул */
.win__dirty { display: none; color: var(--warn); }
.win--dirty .win__dirty { display: inline; }
#blink { position: fixed; inset: 0; background: #0b0d1a; opacity: 0; pointer-events: none; z-index: 40; }
#blink.go { animation: blink 0.9s; }
@keyframes blink { 10%, 30% { opacity: 0.95; } 20% { opacity: 0.4; } 100% { opacity: 0; } }

/* ------------------------------------------------------------ Ctrl+F */
.find {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: #fff8e1;
  border-bottom: 1px solid #f1dfa8;
}
.find__input {
  flex: 1;
  font: 18px 'Segoe UI', sans-serif;
  padding: 4px 8px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  outline: none;
  user-select: text;
}
.find__hint { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ Анкета */
.app--form { background: #fff; overflow: auto; }
.form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.form__row { display: flex; flex-direction: column; gap: 4px; }
.form__label { font-size: 15px; color: var(--muted); }
.form__input {
  font: 22px 'Segoe UI', sans-serif;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  outline: none;
  user-select: text;
}
.form__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.15); }

/* ------------------------------------------------------------ Браузер */
.app--browser { display: flex; flex-direction: column; background: #fff; }
.br__tabs { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 0; background: #e4e7f2; overflow: hidden; }
.br__tab {
  display: flex; align-items: center; gap: 8px;
  max-width: 170px; min-width: 0;
  padding: 7px 10px;
  border-radius: 10px 10px 0 0;
  background: #d3d8ea;
  font-size: 14px;
  cursor: default;
}
.br__tab--on { background: #fff; }
.br__tabtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br__x { color: var(--muted); font-size: 11px; padding: 2px 4px; border-radius: 4px; }
.br__x:hover { background: #f3c2c2; color: #900; }
.br__new { padding: 4px 10px 8px; font-size: 20px; color: var(--muted); cursor: default; }
.br__bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.br__btn { width: 30px; text-align: center; font-size: 18px; color: var(--muted); cursor: default; border-radius: 6px; }
.br__btn:hover { background: #eef0f8; }
.br__addr {
  flex: 1;
  font: 17px 'Segoe UI', sans-serif;
  padding: 5px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: #f5f6fb;
  user-select: text;
}
.br__addr:focus { border-color: var(--accent); background: #fff; }
.br__page {
  flex: 1;
  border: 0;
  resize: none;
  outline: none;
  padding: 16px 20px;
  font: 21px/1.5 'Segoe UI', sans-serif;
  color: var(--ink);
  user-select: text;
}
.br__page--flash { animation: reload 0.5s; }
@keyframes reload { from { opacity: 0.2; } }

/* строчка «на вспоминание» */
.step__recall {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 15px; color: #8a5a00; background: #fff4d6;
  border-radius: 8px; padding: 4px 6px 4px 10px; align-self: flex-start;
}
.step__recall .btn--hint { margin: 0; background: #ffe7a6; }

/* ------------------------------------------------------------ выбор курса */
.courses { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.course {
  width: 340px;
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow), 0 8px 0 #d6daf0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 30px 26px;
  color: var(--ink);
  text-align: center;
  transition: transform 0.12s;
}
.course:hover { transform: translateY(-4px); }
.course__icon { font-size: 72px; line-height: 1; }
.course__title { font-size: 26px; font-weight: 700; }
.course__sub { font-size: 17px; color: #3a4060; line-height: 1.4; }
.course__meta { color: var(--star); font-weight: 700; margin-top: 6px; }
.map__head { position: relative; width: min(1240px, 100%); }
.map__back { position: absolute; left: 0; top: 4px; color: #fff; }
.map__sheet { position: absolute; right: 0; top: 4px; }
.map__foot { display: flex; gap: 12px; align-items: center; }
.btn--sheet { background: #fff4d6; color: #7a4f00; }
.btn--sheet:hover { filter: brightness(1.03); }
.lvl__icon { font-size: 26px; }
.learn__icon { font-size: 30px; display: inline-block; width: 44px; text-align: center; }
.panel__lvl { color: var(--muted); font-size: 14px; margin-bottom: 4px; }

/* ------------------------------------------------------------ карман буфера обмена */
.clipbox {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef6ff;
  border: 2px dashed #9fc2ff;
  font-size: 16px;
  color: #2b4a80;
}
.clipbox b { color: var(--ink); }

/* ------------------------------------------------------------ окна: свернуть / развернуть / закрыть */
.windows { position: relative; }
.windows--icons { padding-left: 130px; }
.win--min, .win--closed { display: none; }
.win--max { position: absolute; inset: 14px; max-width: none; height: auto; z-index: 3; }
.windows--icons .win--max { left: 130px; }
.win__btns i { cursor: default; padding: 2px 6px; border-radius: 4px; }
.win__btns i:hover { background: #dde2f2; color: var(--ink); }
.win__btns i[data-wbtn="close"]:hover { background: #e5484d; color: #fff; }
.tb__app--closed { display: none; }
.tb__app--min { opacity: 0.6; border-bottom-color: transparent; }

.desk-icons {
  position: absolute;
  left: 18px; top: 18px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 1;
}
.dicon {
  width: 96px;
  padding: 8px 4px;
  border-radius: 10px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: default;
  border: 2px solid transparent;
}
.dicon:hover { background: rgba(255, 255, 255, 0.15); }
.dicon--sel { background: rgba(255, 255, 255, 0.28); border-color: rgba(255, 255, 255, 0.6); }
.dicon__img { font-size: 46px; line-height: 1.1; }
.dicon__name { font-size: 15px; margin-top: 2px; }

/* ------------------------------------------------------------ меню по правой кнопке */
.cmenu {
  position: fixed;
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d5d9ea;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 24, 60, 0.25);
  font-size: 16px;
  user-select: none;
}
.cmenu--sub { position: absolute; left: 100%; top: -6px; display: none; }
.cmenu__item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: default; }
.cmenu__item:hover { background: #eef1ff; }
.cmenu__item--sub:hover > .cmenu--sub { display: block; }
.cmenu__item--off { color: #a0a5bd; }
.cmenu__item--off:hover { background: transparent; }
.cmenu__icon { width: 22px; text-align: center; }
.cmenu__label { flex: 1; }
.cmenu__hint { color: var(--muted); font-size: 13px; }
.cmenu__sep { height: 1px; background: #e6e8f2; margin: 4px 6px; }

/* ------------------------------------------------------------ тренажёр мышки */
.app--mouse { background: #fffdf5; }
.mfield { position: absolute; inset: 0; }
.mtarget {
  position: absolute;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  font-size: 58px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.3s;
}
.mtarget:hover { transform: scale(1.12); }
.mtarget--done { cursor: default; }
.mtarget--done:hover { transform: none; }
.mtarget--gone { opacity: 0; transform: scale(1.6); }
.wiggle { animation: wiggle 0.4s; }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* ------------------------------------------------------------ клавиатура */
.app--keyboard { background: #f4f5fb; display: flex; align-items: center; overflow: auto; }
.kb { display: flex; flex-direction: column; gap: 6px; padding: 14px; width: 100%; }
.kb__row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 10px; transition: background 0.2s; }
.kb__row--show { background: #fff1c2; box-shadow: inset 0 0 0 2px #f2c94c; }
.kb__title { width: 86px; flex: none; font-size: 12px; color: var(--muted); text-align: right; line-height: 1.1; }
.kb__row--show .kb__title { color: #8a5a00; font-weight: 700; }
.kb__keys { flex: 1; display: flex; gap: 4px; }
.kb__key {
  flex: 1;
  min-width: 0;
  height: 34px;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--key-edge);
  border-bottom-width: 3px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
}
.kb__key--mark { background: #ffe08a; border-color: #e0b33a; }
.kb__key--was { background: #e3f6ee; }
.kb__key--hit { animation: kbhit 0.45s ease-out; }
@keyframes kbhit { 0% { background: var(--good); color: #fff; transform: translateY(2px); } }

/* ------------------------------------------------------------ шпаргалка */
#sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(20, 24, 60, 0.5);
}
#sheet.show { display: grid; }
.sheet {
  width: min(980px, calc(100% - 32px));
  height: calc(100vh - 40px);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet__tools { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7f8fc; }
.sheet__tab { border: 0; border-radius: 10px; padding: 8px 14px; background: transparent; color: var(--muted); font-size: 16px; }
.sheet__tab--on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); font-weight: 600; }
.sheet__gap { flex: 1; }
.sheet__body { overflow: auto; padding: 18px 28px 28px; user-select: text; }
.sheet__body h2 { font-size: 28px; margin-bottom: 8px; }
.sh__block { margin-top: 18px; }
.sh__block h3 { font-size: 21px; margin: 0 0 10px; }
.sh__block p { font-size: 16px; margin: 8px 0; }
.sh__list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 7px; font-size: 16px; line-height: 1.45; }
.sh__list--keys { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.sh__list--table { list-style: none; padding: 0; gap: 6px; }
.sh__list--table li { display: grid; grid-template-columns: 210px 1fr 56px; gap: 12px; align-items: center; padding: 4px 0; border-bottom: 1px solid #f0f1f7; }
.sh__lvl { color: var(--muted); font-size: 13px; text-align: right; }
.sh__note { background: #eef6ff; border-radius: 12px; padding: 10px 14px; }
.sh__wbtn { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 5px; background: #eef0f8; font-weight: 700; }
.sheet .kb { padding: 6px 0; }
.sheet .kb__key { height: 30px; }

@media print {
  html, body { overflow: visible; height: auto; background: #fff; }
  body:not(.print-cert) > *:not(#sheet) { display: none !important; }
  body.print-cert > *:not(#cert) { display: none !important; }
  body.print-cert #cert { display: block !important; }
  body.print-cert .cert { border-width: 6px; padding: 60px 40px; margin-top: 40px; }
  #sheet { position: static; display: block !important; background: none; }
  .sheet { width: auto; height: auto; box-shadow: none; border-radius: 0; overflow: visible; }
  .sheet__tools { display: none; }
  .sheet__body { overflow: visible; padding: 0; }
  .sh__block { break-inside: avoid; }
}

.win:has(.app--keyboard) { max-width: 1080px; flex-basis: 1080px; height: min(62vh, 430px); }
.win .kb__key { height: 40px; font-size: 14px; }
.win .kb__title { font-size: 13px; }

/* клавиша с двумя буквами: русская крупно, английская мельче (как на настоящей клавиатуре) */
.kb__key--two { display: flex; align-items: center; justify-content: center; gap: 5px; }
.kb__ru { font-size: 1.05em; }
.kb__en { font-size: 0.85em; color: var(--accent); font-weight: 700; }
.sheet .kb__key { height: 34px; font-size: 13px; }

/* ------------------------------------------------------------ карта уровней (переделка 14.10) */
/* солнце — маленькое, в самом углу, чтобы не лезло под карточки */
.start, .map, .desk {
  background:
    radial-gradient(ellipse 80% 50% at 20% 110%, #3fb58a 0 40%, transparent 41%),
    radial-gradient(ellipse 70% 45% at 85% 115%, #2f9d78 0 40%, transparent 41%),
    radial-gradient(circle at 96% 4%, #ffe7a3 0 70px, transparent 72px),
    linear-gradient(180deg, #5a7dff 0%, #8fb2ff 60%, #c7dcff 100%);
}
.topbar {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.topbar__back { justify-self: start; color: #fff; font-size: 17px; }
.topbar .btn--sheet { justify-self: end; }
.topbar__title { text-align: center; color: #fff; }
.topbar__title h1 { font-size: 38px; line-height: 1.15; text-shadow: 0 4px 16px rgba(20, 24, 60, 0.35); }
.topbar__title p { margin: 4px 0 0; font-size: 19px; opacity: 0.95; }

.levels {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.levels .lvl {
  width: auto;
  min-height: 0;
  align-items: stretch;
  text-align: left;
  gap: 10px;
  padding: 18px 20px 16px;
  border-radius: 20px;
}
.levels .lvl:hover:not(:disabled) { transform: translateY(-3px); }
.lvl__top { display: flex; align-items: center; justify-content: space-between; }
.levels .lvl__n { width: 46px; height: 46px; font-size: 22px; }
.levels .lvl__stars { margin: 0; font-size: 16px; }
.levels .lvl__title {
  font-size: 20px;
  text-align: left;
  line-height: 1.25;
  min-height: 2.5em;
}
.levels .lvl__keys {
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-size: 14px;
}
.levels .lvl__keys kbd { font-size: 13px; padding: 2px 7px; }
.levels .lvl__icon { font-size: 24px; }
.lvl__more { color: var(--muted); font-size: 14px; }
.lvl__bar { height: 8px; border-radius: 99px; background: #eceef7; overflow: hidden; margin-top: auto; }
.lvl__bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffc93c, #ffb400); border-radius: 99px; }
.lvl--done .lvl__bar i { background: linear-gradient(90deg, #39c98d, #1fae74); }

/* выбор курса — та же шапка без кнопок по краям */
.map .courses { margin-top: 8px; }

/* цифры: сверху — символ с Shift (английский и, где отличается, русский) */
.kb__key--sym { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 2px; }
.kb__sh { font-size: 0.8em; color: var(--muted); display: flex; gap: 5px; }
.kb__shru { color: var(--accent); }
.kb__main { font-size: 1.05em; }
.sheet .kb__key, .win .kb__key { height: 40px; }

/* ------------------------------------------------------------ заставка уровня: фраза + плитки */
.intro { font-size: 21px; line-height: 1.35; color: #3a4060; margin: 0; }
.tiles { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.tile {
  background: #f5f6fc;
  border-radius: 16px;
  padding: 14px 8px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.tile__head { font-size: 20px; min-height: 40px; display: flex; align-items: center; }
.tile__head .learn__icon { font-size: 38px; width: auto; }
.tile__text { font-size: 16px; font-weight: 600; line-height: 1.25; }
.tiles__more { color: var(--muted); font-size: 15px; margin: -4px 0 0; }

.kb__key--sym .kb__sh { font-size: 12px; font-weight: 700; }
.kb__key--sym .kb__main { font-size: 15px; }

/* плитки: длинное сочетание (Ctrl+Shift+N) переносится и не налезает на соседей */
.card:has(.tiles) { width: min(640px, calc(100% - 32px)); }
.tile { min-width: 0; overflow: hidden; }
.tile__head { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.tile__head .combo { flex-wrap: wrap; justify-content: center; row-gap: 4px; white-space: normal; }
.tile__head kbd { font-size: 15px; padding: 2px 7px; min-width: 1.7em; }

/* язык клавиатуры на панели задач, как в Windows */
.tb__lang {
  margin-left: auto;
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.04em;
}
.tb__lang--en { background: #4f6bff; }
.tb__lang.flash { animation: langflash 0.8s; }
@keyframes langflash { 0%, 40% { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(255, 220, 120, 0.8); } }
.tb__lang + .tb__clock { margin-left: 12px; }

.tb__lang--unknown { background: rgba(255, 255, 255, 0.22); color: #ffe7a3; }

/* ------------------------------------------------------------ меню «Пуск» */
.sm {
  position: fixed;
  left: 12px;
  bottom: 66px;
  z-index: 45;
  width: 440px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(30, 34, 64, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  color: #fff;
  display: none;
  flex-direction: column;
  gap: 14px;
  transform-origin: left bottom;
}
.sm.show { display: flex; animation: smin 0.18s ease-out; }
@keyframes smin { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.sm__user { display: flex; align-items: center; gap: 12px; }
.sm__ava {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, #7c5cff, #4f6bff);
}
.sm__who { display: flex; flex-direction: column; gap: 2px; }
.sm__who b { font-size: 18px; }
.sm__who span { font-size: 13px; color: #c9cff5; }
.sm__label { font-size: 13px; color: #aab2e8; text-transform: uppercase; letter-spacing: 0.06em; }
.sm__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sm__tile {
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 12px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px;
  line-height: 1.2;
}
.sm__tile:hover { background: rgba(255, 255, 255, 0.18); }
.sm__icon { font-size: 28px; }
.sm__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 12px; }
.sm__tip { font-size: 12px; color: #aab2e8; }
.sm__power {
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
}
.sm__power:hover { background: #e5484d; }
.tb__start--on { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* кот, который пробегает по рабочему столу */
.deskcat {
  position: absolute;
  bottom: 10px;
  left: -90px;
  font-size: 70px;
  z-index: 6;
  pointer-events: none;
  animation: deskcat 4s linear forwards;
}
@keyframes deskcat { to { left: calc(100% + 40px); } }

/* конфетти */
.confetti {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  z-index: 70;
  pointer-events: none;
  animation: confetti linear forwards;
}
@keyframes confetti { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

/* ------------------------------------------------------------ обои */
body.wall-sunset .start, body.wall-sunset .map, body.wall-sunset .desk {
  background:
    radial-gradient(ellipse 80% 50% at 20% 110%, #7a3b69 0 40%, transparent 41%),
    radial-gradient(ellipse 70% 45% at 85% 115%, #5c2a5a 0 40%, transparent 41%),
    radial-gradient(circle at 70% 78%, #ffd36b 0 90px, transparent 92px),
    linear-gradient(180deg, #4a3a8f 0%, #c25b8a 45%, #ff9a6b 75%, #ffd8a0 100%);
}
body.wall-night .start, body.wall-night .map, body.wall-night .desk {
  background:
    radial-gradient(ellipse 80% 50% at 20% 110%, #16334a 0 40%, transparent 41%),
    radial-gradient(ellipse 70% 45% at 85% 115%, #0f2638 0 40%, transparent 41%),
    radial-gradient(circle at 92% 9%, #fff6d8 0 46px, transparent 48px),
    radial-gradient(circle at 89% 7%, #1b2357 0 44px, transparent 46px),
    radial-gradient(circle at 20% 15%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 45% 8%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 63% 22%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 78% 35%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 33% 32%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 55% 40%, #fff 0 1px, transparent 1.5px),
    linear-gradient(180deg, #0b1033 0%, #1b2357 60%, #2c3a7a 100%);
}
body.wall-space .start, body.wall-space .map, body.wall-space .desk {
  background:
    radial-gradient(circle at 85% 80%, #ff8a5c 0 70px, #c2410c 71px 90px, transparent 91px),
    radial-gradient(ellipse 50% 35% at 25% 30%, rgba(167, 89, 255, 0.45), transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 20%, rgba(56, 189, 248, 0.35), transparent 70%),
    radial-gradient(circle at 12% 70%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 40% 85%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 60% 55%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 90% 30%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 30% 10%, #fff 0 1.5px, transparent 2px),
    linear-gradient(180deg, #07081a 0%, #141238 100%);
}

/* ------------------------------------------------------------ контрольные */
#cert { display: none; }
.levels .lvl--exam { background: linear-gradient(160deg, #fff8e1, #ffeec2); box-shadow: inset 0 0 0 3px #f2c45a, var(--shadow); }
.levels .lvl--exam .lvl__n { background: #f2b632; }
.panel__nohint { font-size: 14px; color: #7a4f00; background: #fff4d6; border-radius: 10px; padding: 6px 10px; }
.panel--exam .panel__lvl { color: #9a6a00; font-weight: 600; }
.panel--exam .panel__title { font-size: 24px; }
.panel--exam .panel__story { font-size: 16px; margin-bottom: 10px; }
.panel--exam .steps { gap: 4px; }
.goal { padding: 6px 10px; font-size: 17px; line-height: 1.3; }
.goal .step__mark { width: 24px; height: 24px; font-size: 14px; }
.goal .step__mark { background: #fff; box-shadow: inset 0 0 0 2px var(--key-edge); }
.goal--done { opacity: 0.55; }
.goal--done .step__body { text-decoration: line-through; }
.goals__left { list-style: none; margin-top: 4px; color: var(--muted); font-size: 16px; padding-left: 12px; }
.exam-res { font-size: 18px; margin: 0; }
/* четыре окна — сеткой 2 × 2 */
.windows[data-n="4"] { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, 1fr); gap: 16px; padding: 18px; align-items: stretch; }
.windows[data-n="4"].windows--icons { padding-left: 130px; }
.windows[data-n="4"] .win { height: auto; max-width: none; min-height: 0; }
.windows[data-n="4"] .win--max { position: absolute; }
.windows[data-n="4"] .win textarea { font-size: 19px; padding: 12px 14px; }
.cert__input { width: 100%; font: 24px 'Segoe UI', sans-serif; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; outline: none; text-align: center; }
.cert__input:focus { border-color: var(--accent); }
.card--cert { width: min(640px, calc(100% - 32px)); }
.cert {
  width: 100%;
  border: 4px double #d9a520;
  border-radius: 18px;
  padding: 26px 24px;
  background: linear-gradient(180deg, #fffdf5, #fff6dc);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  color: var(--ink);
}
.cert .star { animation: none; }
.cert__seal { font-size: 46px; }
.cert__head { font-size: 44px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: #b8860b; }
.cert__line { font-size: 17px; color: var(--muted); }
.cert__name { font-size: 32px; font-weight: 700; border-bottom: 2px solid #e6c56a; min-width: 60%; padding: 4px 12px; margin: 4px 0 8px; }
.cert__what { font-size: 24px; font-weight: 700; }
.cert__stars { display: flex; align-items: center; gap: 10px; font-size: 30px; margin-top: 8px; }
.cert__stars span:last-child { font-size: 16px; color: var(--muted); }
.cert__date { font-size: 14px; color: var(--muted); margin-top: 8px; }
.cert__btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ «Проверь себя», «Не умею», итог */
.course-wrap { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.course__check { background: #fff4d6; color: #7a4f00; font-size: 17px; }
.course__check:hover { filter: brightness(1.03); }
.goals__group { list-style: none; margin: 10px 0 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
.goals__group:first-child { margin-top: 0; }
.goal .step__body { flex: 1; gap: 3px; }
.goal__skip { align-self: flex-start; border: 0; border-radius: 8px; padding: 2px 8px; font-size: 13px; background: transparent; color: var(--muted); cursor: pointer; }
.goal__skip:hover { background: #ffe2e2; color: #b42318; }
.course-wrap .course { flex: 1; }
.goal--skip { opacity: 0.75; }
.goal--skip .step__mark { background: #ffe2e2; color: #b42318; box-shadow: none; }
.goal--skip .step__body { color: #b42318; }
.card__sub { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.card--res { width: min(640px, calc(100% - 32px)); }
.result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.adv { width: 100%; text-align: left; border-radius: 14px; padding: 12px 16px; }
.adv h3 { margin: 0 0 6px; font-size: 18px; }
.adv ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.adv--know { background: #e7f8ef; }
.adv--need { background: #fff4e5; }
.adv__why { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.card--cert .adv { margin-top: 4px; }
.lvl__mark { display: inline-block; margin-left: 8px; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.lvl__mark--know { background: #e7f8ef; color: #12805a; }
.lvl__mark--pass { background: #fff0d6; color: #9a5b00; }
@media print {
  body.print-cert #cert .adv { break-inside: avoid; margin-top: 16px; }
}

/* ------------------------------------------------------------ вход ученика */
.auth { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.auth__btn { font-size: 20px; padding: 14px 26px; background: #fff; color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; background: rgba(255, 255, 255, 0.9); border-radius: 14px; padding: 8px 14px; color: var(--ink); }
.who__name { font-weight: 700; font-size: 18px; }
.who__st { color: var(--muted); font-size: 15px; }
.card--auth { gap: 12px; }
.auth__row { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 15px; color: var(--muted); }
.auth__row .cert__input { text-align: left; font-size: 22px; }
.auth__show { align-self: flex-start; font-size: 15px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
#authmsg { min-height: 1.2em; margin: 0; }
.who .btn--ghost { color: var(--accent); }
#authmsg:empty { display: none; }
.exam-finish { margin-top: 14px; align-self: stretch; position: sticky; bottom: 0; box-shadow: 0 -10px 12px 2px var(--panel), 0 22px 0 4px var(--panel); flex: none; z-index: 2; background: #fff4d6; color: #7a4f00; font-size: 17px; }
.exam-finish:hover { filter: brightness(1.03); }

/* ------------------------------------------------------------ «Что-то не так?» */
.report-btn { margin-top: 12px; align-self: flex-start; border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.report-btn:hover { background: #eef0f8; color: var(--ink); }
.card--fb { gap: 12px; }
.fb__kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.fb__kind { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 16px; color: var(--ink); cursor: pointer; }
.fb__kind span { font-size: 28px; }
.fb__kind:hover { border-color: #b9c3ff; }
.fb__kind--on { border-color: var(--accent); background: #eef1ff; }
.fb__text { font-size: 18px; text-align: left; }
#fbmsg:empty { display: none; }

/* ------------------------------------------------------------ рейтинг */
.tb__rank { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 14px; margin-left: auto; margin-right: 8px; cursor: pointer; white-space: nowrap; }
.tb__rank:hover { background: rgba(255, 255, 255, 0.22); }
.tb__rank--up { animation: rankglow 1.6s ease-out; }
@keyframes rankglow {
  0% { background: #ffc93c; color: #3a2a00; transform: scale(1.15); box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.8); }
  40% { box-shadow: 0 0 0 10px rgba(255, 201, 60, 0); }
  100% { background: rgba(255, 255, 255, 0.12); color: #fff; transform: none; }
}
.rankup {
  position: fixed; right: 90px; bottom: 64px; z-index: 80; pointer-events: none;
  background: linear-gradient(135deg, #ffd86b, #ffb400); color: #3a2a00; font-weight: 700; font-size: 18px;
  padding: 8px 16px; border-radius: 99px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: rankup 3.6s ease-out forwards;
}
@keyframes rankup {
  0% { opacity: 0; transform: translateY(14px) scale(0.9); }
  12% { opacity: 1; transform: translateY(0) scale(1.05); }
  20% { transform: scale(1); }
  80% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-24px); }
}
.card--board { width: min(620px, calc(100% - 32px)); }
.brd { width: 100%; border-collapse: collapse; font-size: 16px; text-align: left; }
.brd th { font-size: 13px; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.brd td { padding: 6px 8px; border-bottom: 1px solid #f0f1f7; }
.brd__place { width: 54px; text-align: center; font-weight: 700; }
.brd__me td { background: #eef1ff; font-weight: 700; }
.brd__bar { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: #eceef7; margin-left: 8px; vertical-align: middle; overflow: hidden; }
.brd__bar i { display: block; height: 100%; background: linear-gradient(90deg, #39c98d, #1fae74); }
.tb__rank + .tb__lang { margin-left: 0; }
.brd__bot td { color: #5a6080; }

/* ------------------------------------------------------------ версия */
.ver__bump { background: #fff4d6; color: #7a4f00; }
.upd { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; border: 0; border-radius: 99px; padding: 10px 20px; font-size: 17px; font-weight: 600; background: #ffc93c; color: #3a2a00; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); cursor: pointer; animation: cardin 0.3s ease-out; }

/* ------------------------------------------------------------ постоянная панель рейтинга */
.mb { cursor: pointer; border-radius: 14px; padding: 10px 12px; background: linear-gradient(180deg, #1d2560, #141a46); color: #fff; box-shadow: 0 6px 18px rgba(20, 24, 60, 0.25); border: 1px solid rgba(255, 201, 60, 0.45); }
.mb:hover { border-color: #ffc93c; }
.mb__title { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: #ffc93c; margin-bottom: 6px; }
.mb__me { font-size: 12px; color: #fff; background: rgba(255, 255, 255, 0.14); border-radius: 99px; padding: 1px 8px; }
.mb__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mb__row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); font-size: 13px; }
.mb__row--bot .mb__name { color: #c8cdf0; }
.mb__row--me { background: linear-gradient(90deg, #4f6bff, #7c5cff); font-weight: 700; }
.mb__row--up { animation: mbup 1.8s ease-out; }
@keyframes mbup { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.9); transform: scale(1.05); } 60% { box-shadow: 0 0 0 8px rgba(255, 201, 60, 0); } 100% { transform: none; } }
.mb__place { width: 22px; text-align: center; font-weight: 700; color: #c8cdf0; flex: none; }
.mb__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb__done { color: #ffc93c; font-weight: 800; }
.mb__gap { text-align: center; color: #8d94c8; line-height: 0.8; }
.mb__note { margin-top: 6px; font-size: 12px; color: #c8cdf0; text-align: center; }
.mb--panel { margin-top: auto; flex: none; position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -12px 14px 2px var(--panel), 0 22px 0 4px var(--panel), 0 6px 18px rgba(20, 24, 60, 0.25); }
.panel .report-btn { margin-bottom: 10px; }
/* в контрольной снизу ещё кнопка «Я сделал всё, что смог» — панель рейтинга над ней */
.panel--exam .mb--panel { bottom: 62px; }
.panel--exam .exam-finish { z-index: 3; }
.mb--map { position: fixed; left: 16px; top: 50%; transform: translateY(-50%); width: 230px; z-index: 2; }
@media (max-width: 1720px) {
  .mb--map { position: static; transform: none; width: min(420px, 100%); margin: 0 auto 16px; }
}

/* ------------------------------------------------------------ версия везде, профиль */
#appver { position: fixed; right: 14px; bottom: 10px; z-index: 30; font-size: 13px; color: rgba(255, 255, 255, 0.9); display: flex; gap: 10px; align-items: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
#appver.appver--hide { display: none; }
.tb__ver { color: rgba(255, 255, 255, 0.55); font-size: 12px; margin-left: 8px; }
.who__name { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 18px; color: var(--ink); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.who__name:hover { background: #eef1ff; }
.card--prof { width: min(600px, calc(100% - 32px)); gap: 12px; }
.avs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: 100%; }
.av { font-size: 28px; padding: 6px 0; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.av:hover { border-color: #b9c3ff; }
.av--on { border-color: var(--accent); background: #eef1ff; transform: scale(1.06); }
#profmsg:empty { display: none; }
.brd__real { display: block; font-size: 12px; color: #9a6a00; font-weight: 400; }
.mb__real { color: #ffd98a; font-weight: 400; font-size: 11px; }
