/* =========================================================
   Физлинго — мультяшный стиль
   ========================================================= */

:root {
  --ink: #3C3C4A;
  --ink-2: #4B4B5C;
  --muted: #8B8BA0;
  --line: #E5E5EF;
  --soft: #F7F7FB;
  --white: #FFFFFF;
  --surface: #FFFFFF;

  --violet: #7C5CFF;
  --violet-d: #5B3FE0;
  --violet-l: #EFEAFF;
  --sky: #36A9FF;
  --sky-d: #1E88E0;
  --sky-l: #E3F3FF;
  --mint: #22C98A;
  --mint-d: #13A06B;
  --mint-l: #D9F8EA;
  --coral: #FF5C7A;
  --coral-d: #E03A5A;
  --coral-l: #FFE2E8;
  --sun: #FFC530;
  --sun-d: #E5A800;
  --orange: #FF9600;

  --r: 16px;
  --r-lg: 22px;
  /* Rubik — мягкий скруглённый гротеск с полноценной кириллицей, по духу близок к шрифтам Duolingo */
  --font: 'Rubik', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-logo: 'Nunito', 'Rubik', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; font-weight: 900; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
a { color: var(--sky); text-decoration: none; }
button { font-family: inherit; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 900; }
.accent-red { color: var(--coral); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 10px; }

/* ---------- Кнопки ---------- */

.btn {
  --bg: var(--violet);
  --edge: var(--violet-d);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  font: 900 15px/1 var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: var(--r);
  box-shadow: 0 4px 0 var(--edge);
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s, box-shadow .06s, filter .15s;
  user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled, .btn-disabled { --bg: #E5E5EF; --edge: #D2D2DE; --fg: #A9A9BC; cursor: not-allowed; }
.btn-primary { --bg: var(--violet); --edge: var(--violet-d); --fg: #fff; }
.btn-outline { --bg: var(--surface); --edge: var(--line); --fg: var(--sky); }
.btn-ghost { --bg: transparent; --edge: transparent; --fg: var(--sky); box-shadow: none; }
.btn-gold { --bg: var(--sun); --edge: var(--sun-d); --fg: #7A4B00; }
.btn-white { --bg: #fff; --edge: rgba(0, 0, 0, .15); --fg: var(--c, var(--violet)); border-color: #fff; }
.btn-price { --bg: var(--surface); --edge: var(--line); --fg: var(--sky); min-width: 120px; }
.btn-lg { min-height: 56px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-wide { min-width: 170px; }
.btn .ic { flex: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #AFAFC2;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); }

/* ---------- Каркас приложения ---------- */

.sidenav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  padding: 24px 16px;
  border-right: 2px solid var(--line);
  background: var(--surface);
  z-index: 30;
  overflow-y: auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 28px;
  font: 900 31px/1 var(--font-logo);
  color: var(--violet);
  letter-spacing: -.035em;
  text-transform: lowercase;
}
.nav { display: grid; gap: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 7px 14px;
  font: 800 15px/1.2 var(--font);
  color: var(--ink-2);
  text-align: left;
  background: none;
  border: 2px solid transparent;
  border-radius: 14px;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-item:hover { background: var(--soft); }
.nav-item[aria-current="page"], .nav-item.is-active { color: var(--violet); background: var(--violet-l); border-color: #C9BCFF; }
.nav-ic { display: grid; place-items: center; width: 34px; height: 34px; }
.nav-ic .ic { transition: transform .2s cubic-bezier(.2, 1.4, .4, 1); }
.nav-item:hover .nav-ic .ic, .nav-item[aria-current="page"] .nav-ic .ic { transform: scale(1.08) rotate(-4deg); }
.nav-more { position: relative; }
/* Меню «Ещё» открывается справа от кнопки, поверх страницы */
.sidenav:has(.more-menu:not([hidden])) { overflow: visible; }
.nav-more .more-menu { top: auto; bottom: -8px; left: calc(100% + 14px); }
.more-menu form { margin: 0; }
.cm-logout { color: var(--coral-d); }

.shell {
  margin-left: 256px;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px 24px 60px;
}
.center { width: 100%; max-width: 600px; min-width: 0; }
.rightbar {
  position: sticky;
  top: 24px;
  width: 368px;
  flex: none;
  align-self: flex-start;
  display: grid;
  gap: 24px;
}
.mobile-stats { display: none; }

/* ---------- Верхняя статистика ---------- */

.statsbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; }
.sb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 900;
}
.sb-item:hover { background: var(--soft); }
.sb-streak { color: var(--orange); }
.sb-streak.is-off { color: #C4C4D4; }
.sb-streak.is-off .ic, .ic.is-off { filter: grayscale(1); opacity: .45; }
.sb-gems { color: var(--sky); }
.sb-hearts { color: var(--coral); }
.course-badge { border-radius: 9px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.ic { flex: none; overflow: visible; }
.reward-gems { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- Карточки правой колонки ---------- */

.card {
  padding: 20px 22px;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 19px; margin: 0; }
.card-link { font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--sky); }
.league-row { display: flex; align-items: center; gap: 16px; }
.league-row p { margin: 0 0 4px; }

.quest-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.quest-mini li { display: flex; align-items: center; gap: 14px; }
.qm-body { flex: 1; min-width: 0; }
.qm-body p { margin: 0 0 6px; font-weight: 900; font-size: 16px; }
.qm-bar { display: flex; align-items: center; gap: 4px; }
.qm-bar .bar { flex: 1; }

.bar {
  position: relative;
  display: block;
  height: 18px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--sun);
  border-radius: 999px;
  transition: width .5s;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08);
}
.bar > em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  color: #8B8BA0;
}
.bar-lg { height: 22px; }
.bar-lg > em { font-size: 13px; }
.bar-gold > span { background: var(--sun); }

.mini-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.mini-foot a { color: #B4B4C6; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Аватар ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  background: var(--a);
  border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15);
}
.avatar.xs { width: 32px; height: 32px; font-size: 15px; }
.avatar.xl { width: 150px; height: 150px; font-size: 64px; border: 6px solid #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .12), inset 0 -10px 0 rgba(0, 0, 0, .15); }

/* ---------- Сова ---------- */

.owl { display: block; overflow: visible; flex: none; }
.owl .brow, .owl .pupil, .owl .lid, .owl .wing, .owl .hat {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .25s ease, opacity .2s;
}
.owl .lid { opacity: 0; }
.owl.is-idle .lid { animation: blink 5s infinite; }
.owl.is-idle .owl-bob { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.owl.is-happy .owl-bob { animation: hop .6s ease; transform-origin: 50% 100%; }
.owl.is-happy .brow { transform: translateY(-5px); }
.owl.is-happy .wing-l { transform: rotate(22deg); }
.owl.is-happy .wing-r { transform: rotate(-22deg); }
.owl.is-sad .brow-l { transform: rotate(-16deg) translateY(4px); }
.owl.is-sad .brow-r { transform: rotate(16deg) translateY(4px); }
.owl.is-sad .lid { opacity: 1; }
.owl.is-sad .pupil { transform: translateY(5px); }
.owl.is-think .pupil { transform: translate(-5px, -6px); }
.owl.is-think .brow-r { transform: translateY(-6px); }
.owl.is-wave .wing-r { transform-origin: 30% 0; animation: wave 1.4s ease-in-out infinite; }
.owl.is-wave .brow { transform: translateY(-3px); }

/* Живая сова: app.js в случайные моменты добавляет класс act-* */
.owl .wing-l { transform-origin: 85% 8%; }
.owl .wing-r { transform-origin: 15% 8%; }
.owl.act-look .pupil { animation: owlLook 1.6s ease-in-out; }
.owl.act-blink .lid { animation: owlBlink 1s linear; }
.owl.act-tilt .owl-bob { animation: owlTilt 1.6s ease-in-out; transform-origin: 50% 100%; }
.owl.act-flap .wing-l { animation: owlFlapL 1.2s ease-in-out; }
.owl.act-flap .wing-r { animation: owlFlapR 1.2s ease-in-out; }
.owl.act-hop .owl-bob { animation: hop .7s ease 2; transform-origin: 50% 100%; }
.owl.act-turn .owl-bob { animation: owlTurn 1.6s ease-in-out; transform-origin: 50% 100%; }
.owl.act-dance .owl-bob { animation: owlDance 1.6s ease-in-out; transform-origin: 50% 100%; }
.owl.act-dance .wing-l { animation: owlFlapL .8s ease-in-out 2; }
.owl.act-dance .wing-r { animation: owlFlapR .8s ease-in-out 2; }
.owl.act-surprise .brow { animation: owlBrow 1.4s ease-in-out; }
.owl.act-surprise .pupil { animation: owlPupil 1.4s ease-in-out; }
@keyframes owlLook { 0%, 100% { transform: none; } 20%, 45% { transform: translate(-5px, 0); } 60%, 85% { transform: translate(5px, -1px); } }
@keyframes owlBlink { 0%, 100%, 30%, 60% { opacity: 0; } 10%, 20%, 40%, 50% { opacity: 1; } }
@keyframes owlTilt { 0%, 100% { transform: rotate(0); } 25%, 70% { transform: rotate(-9deg); } }
@keyframes owlFlapL { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(30deg); } 40%, 80% { transform: rotate(6deg); } }
@keyframes owlFlapR { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(-30deg); } 40%, 80% { transform: rotate(-6deg); } }
@keyframes owlTurn { 0%, 100% { transform: scaleX(1); } 25%, 70% { transform: scaleX(-1); } }
@keyframes owlDance { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-7deg) translateY(-3px); } 35% { transform: rotate(7deg); } 55% { transform: rotate(-7deg) translateY(-3px); } 75% { transform: rotate(5deg); } }
@keyframes owlBrow { 0%, 100% { transform: none; } 20%, 70% { transform: translateY(-8px); } }
@keyframes owlPupil { 0%, 100% { transform: none; } 20%, 70% { transform: scale(.65); } }

@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(0) scale(1.06, .92); }
  60% { transform: translateY(-18px) scale(.96, 1.05); }
}
@keyframes breathe { 50% { transform: scale(1.015, .985); } }
@keyframes blink { 0%, 94%, 100% { opacity: 0; } 96% { opacity: 1; } }
@keyframes wave { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(-55deg); } }

/* ---------- Шапка раздела ---------- */

.unit-banner {
  position: sticky;
  top: 16px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 16px 20px;
  color: #fff;
  background: var(--c);
  border-radius: var(--r);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 72%, black);
  transition: background .3s, box-shadow .3s;
}
.unit-banner::before {
  content: '';
  position: absolute;
  inset: -16px 0 auto;
  height: 16px;
  background: var(--surface);
}
.ub-text { min-width: 0; }
.ub-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .8);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ub-kicker:hover { color: #fff; }
.unit-banner h1 { margin: 2px 0 0; font-size: 22px; }
.ub-guide {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 2px solid rgba(0, 0, 0, .15);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .15);
}
.ub-guide:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Дорожка ---------- */

.path-wrap { padding-bottom: 60px; }
.unit { padding-top: 12px; }
.unit-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 24px;
  color: #AFAFC2;
  font-size: 18px;
  font-weight: 900;
}
.unit-divider::before, .unit-divider::after { content: ''; flex: 1; height: 2px; background: var(--line); }

.path {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  padding: 64px 0 20px;
}
.node-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; transform: translateX(var(--x)); }
.node-wrap.is-open, .node-wrap:has(> .node-pop:not([hidden])) { z-index: 40; }

.node {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 66px;
  padding: 0;
  color: #fff;
  background: var(--c);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 68%, black), inset 0 -3px 0 rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: transform .06s, box-shadow .06s;
}
.node:active { transform: translateY(6px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 68%, black); }
.node .ic { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
.node.is-review { width: 82px; height: 74px; }
.node.is-gold { background: var(--sun); box-shadow: 0 8px 0 var(--sun-d); }
.node.is-locked { color: #C2C2D2; background: #E5E5EF; box-shadow: 0 8px 0 #CACAD8; }
.node.is-locked .ic { filter: none; }
/* Кольцо вокруг текущего урока заполняется по шагам: --p — процент пройденных шагов */
.node.is-current::before {
  content: '';
  position: absolute;
  inset: -14px -14px -20px;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--c) 20%, var(--surface)) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  pointer-events: none;
}
.node.is-jump { --c: #CE82FF; }
.node-pop.is-jump-pop { --c: #CE82FF; }
.jump-wrap { margin-bottom: 18px; }
.jump-label {
  margin-bottom: 12px;
  padding: 6px 14px;
  color: #B66DF0;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}
.np-steps { display: flex; gap: 6px; margin: 8px 0 12px; }
.np-steps span { flex: 1; height: 8px; background: rgba(255, 255, 255, .35); border-radius: 999px; }
.np-steps span.is-done { background: var(--surface); }

.start-bubble {
  position: absolute;
  top: -60px;
  padding: 9px 16px;
  color: var(--c);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: bob 1.2s ease-in-out infinite;
  z-index: 2;
}
.start-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
@keyframes bob { 50% { transform: translateY(-6px); } }

.node-pop {
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  z-index: 25;
  width: 300px;
  padding: 16px;
  color: #fff;
  background: var(--c);
  border-radius: var(--r);
  transform: translateX(-50%);
  animation: pop .18s ease-out;
}
.node-pop::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: inherit;
  border-radius: 3px;
  transform: translateX(-50%) rotate(45deg);
}
.node-pop.is-grey { color: var(--muted); background: var(--soft); border: 2px solid var(--line); }
.node-pop.is-grey::before { border-left: 2px solid var(--line); border-top: 2px solid var(--line); top: -10px; }
.np-title { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.node-pop.is-grey .np-title { color: var(--ink); }
.np-sub { margin: 0 0 14px; font-size: 15px; opacity: .9; }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.9); } }

.node-chest {
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.node-chest .ic { filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .12)); }
.node-chest.is-locked .ic { filter: grayscale(1) opacity(.45); }
.node-chest.is-ready { animation: wiggle 2s ease-in-out infinite; }
.node-chest.is-opening { animation: wiggle .25s linear infinite; }
.ic.wiggle { animation: wiggle 2s ease-in-out infinite; }
@keyframes wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-8deg) scale(1.05); }
  80% { transform: rotate(8deg) scale(1.05); }
  90% { transform: rotate(-4deg); }
}

.path-owl { position: absolute; top: 150px; pointer-events: none; }
.path-owl.on-right { left: calc(50% + 100px); }
.path-owl.on-left { right: calc(50% + 100px); }

.course-finished { display: grid; justify-items: center; gap: 8px; margin-top: 40px; padding: 28px; text-align: center; border: 2px solid var(--line); border-radius: var(--r-lg); }

/* ---------- Модальное окно и уведомление ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(40, 30, 90, .45);
  animation: fade .2s;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  text-align: center;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .12);
  animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.modal-art { display: grid; place-items: center; margin-bottom: 8px; }
.pop-in { animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes popIn { from { transform: scale(.5); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 14px 22px;
  color: #fff;
  background: var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .2);
  transform: translateX(-50%);
  animation: slideDown .35s cubic-bezier(.2, 1.3, .4, 1);
  transition: opacity .4s, transform .4s;
}
.toast.is-hiding { opacity: 0; transform: translate(-50%, -20px); pointer-events: none; }
@keyframes slideDown { from { transform: translate(-50%, -40px); opacity: 0; } }

/* ---------- Общие блоки страниц ---------- */

.page-title { font-size: 30px; margin-bottom: 6px; }
.page-sub { margin-bottom: 24px; }
.section-title { font-size: 24px; margin: 0 0 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.section-head h2 { margin: 0; }
.section-head span { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.chip {
  display: inline-block;
  padding: 4px 10px;
  color: #fff;
  background: var(--c, var(--violet));
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.page-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 22px 24px;
  color: #fff;
  background: var(--c);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 72%, black);
}
.page-banner h1 { font-size: 26px; margin: 2px 0 6px; }
.page-banner p { margin: 0; opacity: .92; }
.page-banner .ub-kicker { color: rgba(255, 255, 255, .85); }

.empty-state { max-width: 460px; margin: 60px auto; padding: 0 20px; text-align: center; }
.empty-state .owl { margin: 0 auto 16px; }
.stack-actions { display: grid; gap: 12px; margin-top: 20px; }

/* ---------- Справочник ---------- */

.guide-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; }
.guide-item { display: flex; gap: 16px; padding: 20px; border: 2px solid var(--line); border-radius: var(--r); }
.guide-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 40px;
  color: #fff;
  background: var(--c);
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 68%, black);
}
.guide-item h2 { font-size: 20px; }
.guide-item p { font-size: 18px; color: var(--ink-2); }
.guide-item summary { cursor: pointer; color: var(--sky); font-weight: 900; }
.guide-item ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.guide-item em { display: block; font-style: normal; color: var(--muted); }

/* ---------- Курсы ---------- */

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.course-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
}
.course-card.is-current { border-color: var(--c); box-shadow: 0 4px 0 var(--c); }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.course-card h2 { margin: 4px 0 0; }
.course-card p { margin: 0; }
.cc-meta { font-size: 15px; font-weight: 900; }
.course-card .bar > span { background: var(--c); }
.course-card form { margin-top: auto; padding-top: 8px; }

.btn-danger { --bg: var(--coral); --edge: var(--coral-d); --fg: #fff; }

.my-courses { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 12px; }
.my-course {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
}
.my-course.is-current { border-color: var(--c); box-shadow: 0 4px 0 var(--c); }
.my-course .course-badge { flex: none; }
.mc-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.mc-body h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 19px; }
.mc-body .chip { background: var(--c); }
.mc-body .bar > span { background: var(--c); }
.mc-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.mc-remove { color: #B5B5C8; }
.mc-remove:hover { color: var(--coral); }

.picker-title { margin: 8px 0 16px; font-size: 28px; text-align: center; }
.cat-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font: 700 15px var(--font);
  color: var(--ink-2);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--line);
  cursor: pointer;
}
.cat-chip span { padding: 1px 7px; color: var(--muted); background: var(--soft); border-radius: 999px; font-size: 12px; }
.cat-chip:hover { background: var(--soft); }
.cat-chip.is-active { color: var(--violet); background: var(--violet-l); border-color: #C9BCFF; box-shadow: 0 3px 0 #C9BCFF; }
.cat-chip.is-active span { color: #fff; background: var(--violet); }
.pt-level { color: var(--c); font-size: 13px; font-weight: 700; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.picker-grid form { display: contents; }
.picker-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 210px;
  padding: 36px 12px 20px;
  font: inherit;
  color: var(--ink);
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
  cursor: pointer;
  transition: background .15s;
}
.picker-tile:hover { background: var(--soft); }
.picker-tile:active { transform: translateY(4px); box-shadow: none; }
.picker-tile:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.picker-tile .course-badge { margin-bottom: 14px; }
.picker-tile b { font-size: 16px; }
.picker-tile .muted { font-size: 14px; }
.picker-tile.is-added { border-color: var(--c); }
.pt-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--c);
  border-radius: 50%;
}

/* Меню курсов в шапке */
.sb-course-wrap { position: relative; }
button.sb-item { font: inherit; background: none; border: 0; cursor: pointer; }
.course-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  z-index: 60;
  width: 270px;
  padding: 8px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 5px 0 var(--line);
  animation: fade .15s;
}
.course-menu form { margin: 0; }
.cm-head { margin: 6px 10px 8px; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.cm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.cm-item:hover { background: var(--soft); }
.cm-item.is-current { background: var(--sky-l); border-color: var(--sky); }
.cm-plus {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  border: 2px dashed #C4C4D4;
  border-radius: 9px;
}
.cm-add { color: var(--ink-2); }
.cm-manage { display: block; margin-top: 4px; padding: 10px; border-top: 2px solid var(--line); color: var(--sky); font-size: 14px; font-weight: 900; text-align: center; }

/* ---------- Задания ---------- */

.quest-list { list-style: none; margin: 0; padding: 0; border: 2px solid var(--line); border-radius: var(--r); }
.quest { display: flex; align-items: center; gap: 18px; padding: 20px; }
.quest + .quest { border-top: 2px solid var(--line); }
.quest-body { flex: 1; min-width: 0; }
.quest-body h3 { margin-bottom: 10px; }
.quest-reward { display: grid; justify-items: center; gap: 2px; min-width: 110px; }
.quest.is-claimed .bar > span { background: var(--mint); }

/* ---------- Магазин ---------- */

.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gem-balance { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--sky); border: 2px solid var(--line); border-radius: 14px; font-size: 20px; font-weight: 900; }
.shop-section { margin: 28px 0 8px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.shop-item { display: flex; align-items: center; gap: 18px; padding: 18px 4px; }
.shop-item + .shop-item { border-top: 2px solid var(--line); }
.si-body { flex: 1; }
.si-body p { margin: 0; }
.hat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 16px; }
.hat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 16px;
  text-align: center;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
}
.hat-card { position: relative; transition: transform .15s; }
.hat-card:hover { transform: translateY(-2px); }
.hat-card.is-worn { border-color: var(--violet); box-shadow: 0 4px 0 var(--violet); background: var(--violet-l); }
.hat-card h4 { font-size: 16px; margin: 0; min-height: 2.4em; display: grid; place-items: center; }
.hat-card form { width: 100%; }
.hc-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  color: #fff;
  background: var(--violet);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hc-flag.is-muted { color: var(--muted); background: var(--soft); border: 2px solid var(--line); }
.btn[data-poor] { opacity: .55; }

.wardrobe {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--violet-l), var(--sky-l));
  border-radius: var(--r-lg);
}
.wardrobe-stage { display: grid; justify-items: center; gap: 4px; flex: none; }
.wardrobe-stage p { margin: 0; max-width: 200px; text-align: center; }
.wardrobe-stage form { margin: 0; }
.wardrobe-tip { margin: 0; color: var(--ink-2); font-size: 16px; }
.wardrobe-slot { margin: 26px 0 0; font-size: 18px; color: var(--ink-2); }

/* ---------- Рейтинг ---------- */

.league-head { text-align: center; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.league-shields { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ls { position: relative; display: grid; place-items: center; animation: nodePop .5s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(var(--i) * 70ms); }
.ls.is-me .league-badge { animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .1)); }
.ls.is-locked .league-badge, .league-badge.is-dim { filter: grayscale(1); opacity: .35; }
.ls-spark { position: absolute; top: -4px; right: -8px; animation: beat 1.8s ease-in-out infinite; }
.league-head h1 { font-size: 30px; }
.league-head .accent { color: var(--violet); }
.league-progress { max-width: 360px; margin: 10px auto 0; }
.league-progress .bar > span { background: linear-gradient(90deg, var(--sun), var(--orange)); }
.bob-slow { animation: bob 3s ease-in-out infinite; }

/* Закрытые рейтинги */
.rank-locked { display: grid; justify-items: center; gap: 8px; text-align: center; }
.rank-locked h1 { margin: 12px 0 0; font-size: 28px; }
.rank-locked p { margin: 0 0 12px; }
.rl-badges { position: relative; display: flex; align-items: flex-end; justify-content: center; margin-top: 10px; }
.rl-side { margin: 0 -14px 6px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .08)); }
.rl-main { position: relative; z-index: 1; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .1)); }
.rl-spark { position: absolute; animation: beat 2s ease-in-out infinite; }
.rl-spark.rl-s1 { top: -6px; left: 8px; }
.rl-spark.rl-s2 { bottom: 4px; right: 4px; animation-delay: .7s; }
.board-skeleton { width: 100%; margin-top: 20px; }
.board-skeleton li { gap: 18px; }
.board-skeleton span { display: block; background: linear-gradient(90deg, #EEEEF4 25%, #F8F8FC 50%, #EEEEF4 75%); background-size: 200% 100%; animation: skeleton 1.4s linear infinite; border-radius: 999px; }
.sk-dot { width: 14px; height: 14px; }
.sk-ava { width: 46px; height: 46px; }
.sk-line { height: 12px; }
.sk-score { width: 46px; height: 12px; margin-left: auto; }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.rank-info { position: relative; padding-right: 110px; overflow: hidden; }
.rank-info h2 { margin: 4px 0 8px; font-size: 18px; }
.rank-info p { margin: 0; font-size: 14px; }
.ri-kicker { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ri-owl { position: absolute; right: 8px; top: 50%; margin-top: -50px; }

/* Зоны и призовые места */
.board-list li.zone { justify-content: center; padding: 4px; color: var(--mint-d); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.board-list li.zone::before, .board-list li.zone::after { content: ''; flex: 1; height: 2px; background: #BDF0D8; }
.board-list li.is-top .place { background: none; box-shadow: none; }
.place.p2 .ic { filter: grayscale(1) brightness(1.15); }
.place.p3 .ic { filter: sepia(.7) saturate(1.6) hue-rotate(-18deg) brightness(.92); }
.tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 16px; background: var(--soft); border: 2px solid var(--line); border-radius: 16px; }
.tabs a {
  flex: 1;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tabs a[aria-current="page"] { color: var(--sky); background: var(--surface); box-shadow: 0 3px 0 var(--line); }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; }
.board-list li:hover { background: var(--soft); }
.board-list li.is-me { background: var(--violet-l); }
.place { width: 32px; height: 32px; display: grid; place-items: center; font-weight: 900; color: var(--mint-d); }
.place.p1, .place.p2, .place.p3 { color: #fff; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.place.p1 { background: var(--sun); }
.place.p2 { background: #B4BFD2; }
.place.p3 { background: #D08A4E; }
.who { flex: 1; min-width: 0; display: grid; font-weight: 900; }
.who small { color: var(--muted); font-weight: 700; }
.board-list .score { color: var(--muted); font-weight: 900; white-space: nowrap; }

/* ---------- Профиль ---------- */

.profile-banner {
  position: relative;
  display: grid;
  place-items: center;
  height: 230px;
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--a) 22%, var(--surface));
  border-radius: var(--r-lg);
  overflow: hidden;
}
.profile-banner::before, .profile-banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: color-mix(in srgb, var(--a) 14%, var(--surface));
}
.profile-banner::before { width: 220px; height: 220px; left: -60px; bottom: -90px; }
.profile-banner::after { width: 160px; height: 160px; right: 40px; top: -70px; }
.pb-art { position: relative; z-index: 1; display: flex; align-items: flex-end; }
.pb-owl { margin-left: -30px; margin-bottom: -8px; }
.pb-edit { position: absolute; top: 16px; right: 16px; z-index: 2; }

.profile-info { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 2px solid var(--line); }
.profile-info h1 { margin: 0; }
.profile-info p { margin: 0 0 4px; }
.pi-courses { display: flex; gap: 8px; align-self: flex-end; }
.level-line { display: flex; align-items: center; gap: 10px; margin-top: 10px !important; }
.level-line b { color: var(--violet); white-space: nowrap; }
.level-line .bar { width: 160px; height: 14px; }
.level-line .bar > span { background: var(--violet); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 32px; }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r); }
.stat-card b { display: block; font-size: 20px; font-weight: 900; }
.stat-card span { display: block; font-size: 15px; color: var(--muted); }

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 210px;
  margin-bottom: 32px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--r);
}
.week-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; min-height: 0; }
.week-bar { align-self: end; width: 100%; max-width: 40px; min-height: 6px; background: #D9D0FF; border-radius: 10px 10px 6px 6px; }
.week-col.is-today .week-bar { background: var(--violet); box-shadow: inset 0 -5px 0 var(--violet-d); }
.week-val { font-size: 13px; font-weight: 900; color: var(--muted); min-height: 1.2em; }
.week-day { font-size: 14px; font-weight: 900; color: #AFAFC2; }
.week-col.is-today .week-day { color: var(--violet); }

.ach-list { list-style: none; margin: 0 0 32px; padding: 0; border: 2px solid var(--line); border-radius: var(--r); }
.ach { display: flex; gap: 20px; padding: 20px; }
.ach + .ach { border-top: 2px solid var(--line); }
.ach-badge {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 84px;
  height: 96px;
  padding-bottom: 18px;
  background: var(--b);
  border-radius: 16px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--b) 68%, black), inset 0 -4px 0 rgba(0, 0, 0, .1);
}
.ach-badge .ic { width: 50px; height: 50px; padding: 4px; background: var(--surface); border-radius: 50%; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.ach-badge span {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ach.is-locked .ach-badge { filter: grayscale(1); opacity: .5; }
.ach-body { flex: 1; min-width: 0; }
.ach-top { display: flex; justify-content: space-between; gap: 12px; }
.ach-top h3 { margin-bottom: 10px; }
.ach-body .bar { margin-bottom: 10px; }
.ach-body p { margin: 0; }

.settings { margin-bottom: 20px; }
.form { display: grid; gap: 14px; margin: 12px 0 16px; }
.field { display: grid; gap: 6px; font-weight: 900; }
.form input:not([type="radio"]):not([type="hidden"]) {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font: 700 17px var(--font);
  color: var(--ink);
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 14px;
}
.form input:focus { outline: none; border-color: var(--sky); background: var(--surface); }
.form-error { padding: 12px 16px; color: var(--coral-d); background: var(--coral-l); border-radius: 14px; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; border: 0; }
.swatches legend { margin-bottom: 8px; font-weight: 900; }
.swatch { position: relative; width: 44px; height: 44px; background: var(--a); border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15); cursor: pointer; }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 4px solid var(--a); outline-offset: 3px; }
.swatch:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--sky); }

/* ---------- Лендинг ---------- */

.bare-main { min-height: 100vh; }
.land-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 20px;
}
.land-top .logo { padding: 0; }
.land-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.hero-art { position: relative; display: grid; place-items: center; min-height: 380px; }
.hero-owl { position: relative; z-index: 1; }
.sticker {
  position: absolute;
  padding: 10px 16px;
  color: #fff;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
  animation: floaty 4s ease-in-out infinite;
}
.s1 { top: 6%; left: 2%; background: var(--sky); transform: rotate(-8deg); }
.s2 { top: 2%; right: 6%; background: var(--mint); transform: rotate(6deg); animation-delay: -1s; }
.s3 { bottom: 16%; left: -2%; background: var(--coral); transform: rotate(5deg); animation-delay: -2s; }
.s4 { bottom: 6%; right: 4%; background: var(--sun); color: #7A4B00; transform: rotate(-6deg); animation-delay: -3s; }
.s5 { top: 44%; right: -4%; background: var(--violet); transform: rotate(10deg); animation-delay: -1.5s; }
.s6 { top: 40%; left: -6%; color: var(--ink-2); background: var(--surface); border: 2px solid var(--line); transform: rotate(-4deg); animation-delay: -2.5s; }
@keyframes floaty { 50% { translate: 0 -10px; } }

.hero-copy h1 { max-width: 16ch; font-size: clamp(28px, 3.6vw, 36px); color: var(--ink-2); text-align: center; margin: 0 auto 28px; }
.hero-actions { display: grid; gap: 14px; max-width: 340px; margin: 0 auto; }

.land-courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.land-course { display: flex; gap: 16px; padding: 22px; border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--line); }
.land-course p { margin: 0; color: var(--muted); }

.land-demo { padding: 40px 20px; background: var(--violet-l); }
.demo-card { max-width: 620px; margin: 0 auto; padding: 28px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 6px 0 #D9D0FF; }
.demo-kicker { color: var(--violet); font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.demo-result { margin: 16px 0 0; min-height: 1.4em; }

.land-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 28px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 50px 20px 70px;
  text-align: center;
}
.feature .ic { margin: 0 auto 10px; }
.feature p { color: var(--muted); }

/* ---------- Вход и регистрация ---------- */

.auth .bare-main { display: grid; place-items: center; padding: 60px 20px; }
.auth-close { position: fixed; top: 20px; left: 20px; color: #AFAFC2; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card .owl { margin: 0 auto 10px; }
/* ---------- Регистрация: выбор курсов и профиль ---------- */

.onb { max-width: 980px; margin: 0 auto; padding: 20px 20px 150px; }
.onb-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.onb-top .progress { flex: 1; }
.onb-top .progress-fill { width: 50%; }
.onb-back { color: #AFAFC2; }
/* С JS показываем один шаг; без JS видны оба и форма всё равно работает */
.onb[data-js] .onb-step { display: none; }
.onb[data-js][data-step="1"] .onb-step[data-step="1"],
.onb[data-js][data-step="2"] .onb-step[data-step="2"] { display: block; animation: stepIn .35s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } }
.onb-hello { display: flex; align-items: flex-end; gap: 10px; max-width: 560px; margin: 0 auto; }
.onb-hello .bubble { margin-bottom: 34px; font-size: 17px; }
.onb-title { margin: 14px 0 28px; text-align: center; font-size: 32px; }
.onb-grid { max-width: 840px; margin: 0 auto; grid-template-columns: repeat(auto-fit, minmax(160px, 190px)); justify-content: center; }
.onb-tile input { position: absolute; opacity: 0; pointer-events: none; }
.onb-tile .pt-check { opacity: 0; transform: scale(.4); transition: opacity .15s, transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.onb-tile:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); box-shadow: 0 4px 0 var(--c); }
.onb-tile:has(input:checked) .pt-check { opacity: 1; transform: none; }
.onb-tile:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 3px; }
.onb-chosen { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -12px 0 20px; }
.onb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  font-size: 15px;
  font-weight: 900;
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 2px solid var(--c);
  border-radius: 999px;
}
.onb-chip .course-badge { box-shadow: none; border-radius: 7px; }
.onb-form { max-width: 420px; margin: 0 auto; }
.onb-foot {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 2px solid var(--line);
}
.onb-foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 980px; margin: 0 auto; }
.onb-login { margin: 0; }

/* ---------- Урок ---------- */

/* Урок занимает ровно экран: шапка и подвал на месте, прокручивается только середина,
   поэтому подвал никогда не закрывает варианты ответа */
.lesson { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lesson-top {
  display: flex;
  flex: none;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 10px;
}
.lesson-hearts.is-super { color: var(--violet); }
.lesson-hearts.is-super .ic { filter: hue-rotate(250deg) saturate(1.3); }
.lesson-close { border: 0; }
.progress-wrap { position: relative; flex: 1; }
.progress { height: 18px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill {
  position: relative;
  width: 0;
  height: 100%;
  background: var(--mint);
  border-radius: 999px;
  transition: width .45s cubic-bezier(.2, .9, .3, 1.2);
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 10px;
  right: 10px;
  height: 5px;
  background: rgba(255, 255, 255, .35);
  border-radius: 999px;
}
.combo {
  position: absolute;
  top: -30px;
  left: 0;
  color: var(--orange);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.combo.bump { animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.lesson-hearts { display: inline-flex; align-items: center; gap: 6px; color: var(--coral); font-size: 19px; font-weight: 900; }
.lesson-hearts.shake { animation: shake .45s; }
.icon-btn .ic-mute { display: none; }
.icon-btn.is-muted .ic-mute { display: block; }
.icon-btn.is-muted .ic-sound { display: none; }

.lesson-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 28px;
  overflow-y: auto;
}

/* Шаги кружка урока */
.step-dots { display: flex; justify-content: center; gap: 10px; margin: 6px 0 8px; }
.step-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #AFAFC2;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
}
.step-dot.is-done { color: #fff; background: var(--c, var(--violet)); border-color: transparent; }
.step-dot.is-now { color: var(--c, var(--violet)); border-color: var(--c, var(--violet)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--violet)) 18%, transparent); }
.step-name { margin: 0; text-align: center; color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Карточка теории */
.theory-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 24px;
  text-align: center;
  background: color-mix(in srgb, var(--c, var(--violet)) 7%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--c, var(--violet)) 35%, var(--surface));
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c, var(--violet)) 35%, var(--surface));
  animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.tc-title { margin: 0; font-size: 24px; color: var(--c, var(--violet)); }
.tc-text { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.theory-card.is-example { justify-items: stretch; text-align: left; }
.tc-q { margin: 0; font-size: 19px; font-weight: 700; }
.tc-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; padding: 10px 14px; background: var(--surface); border-radius: 12px; font-size: 18px; }
.tc-answer b { color: var(--mint-d); }
.tc-tag { padding: 2px 8px; color: #fff; background: var(--mint); border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Сложные задачи */
.q-label.is-hard { color: var(--orange); }
.hard-badge {
  justify-self: start;
  padding: 3px 10px;
  color: #fff;
  background: linear-gradient(90deg, #FF9600, #FF4B4B);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.theory-card.is-hard { background: #FFF6EC; border-color: #FFD2A0; box-shadow: 0 4px 0 #FFD2A0; }

/* Окно «Выйти из урока?» */
.quit-modal .modal-card { max-width: 400px; }
.quit-modal h2 { margin-top: 4px; font-size: 26px; }
.btn-danger-text { --fg: var(--coral-d); }
.q-label { font-size: 28px; font-weight: 900; color: var(--ink-2); margin: 0 0 18px; }
.q-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 28px; }
.bubble {
  position: relative;
  flex: 1;
  margin-bottom: 36px;
  padding: 16px 20px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.4;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
}
.bubble::before {
  content: '';
  position: absolute;
  left: -11px;
  bottom: 20px;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}
.intro-title { margin: 20px 0 4px; text-align: center; font-size: 34px; font-weight: 900; color: var(--c); }
.intro-sub { text-align: center; color: var(--muted); }

.options { display: grid; gap: 12px; }
.options-2 { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  font: 800 18px/1.3 var(--font);
  color: var(--ink-2);
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 4px 0 var(--line);
  cursor: pointer;
  transition: transform .06s, box-shadow .06s;
}
.opt:hover:not(:disabled) { background: var(--soft); }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #AFAFC2;
  border: 2px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 900;
}
.opt.is-selected { color: var(--sky-d); background: var(--sky-l); border-color: #9CD3FF; box-shadow: 0 4px 0 #9CD3FF; }
.opt.is-selected .opt-key { color: var(--sky-d); border-color: #9CD3FF; }
.opt.is-ok { color: var(--mint-d); background: var(--mint-l); border-color: #8FE3C1; box-shadow: 0 4px 0 #8FE3C1; }
.opt.is-ok .opt-key { color: var(--mint-d); border-color: #8FE3C1; }
.opt.is-bad { color: var(--coral-d); background: var(--coral-l); border-color: #FFB0BF; box-shadow: 0 4px 0 #FFB0BF; }
.opt.is-bad .opt-key { color: var(--coral-d); border-color: #FFB0BF; }
.opt:disabled { cursor: default; }
.opt-match { justify-content: center; text-align: center; }
.opt-match.is-ok { opacity: .55; }
.opt.is-shake { color: var(--coral-d); border-color: #FFB0BF; background: var(--coral-l); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.num-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 4px 0 var(--line);
}
.num-input:focus-within { border-color: var(--sky); background: var(--surface); }
.num-input input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  font: 900 32px var(--font);
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}
.num-input .unit { font-size: 24px; font-weight: 900; color: var(--muted); }
.num-input.is-ok { border-color: var(--mint); background: var(--mint-l); }
.num-input.is-bad { border-color: var(--coral); background: var(--coral-l); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.match-col { display: grid; gap: 12px; align-content: start; }

.lesson-foot {
  flex: none;
  background: var(--surface);
  border-top: 2px solid var(--line);
}
.foot-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1040px;
  min-height: 120px;
  margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
.foot-inner #action-btn { margin-left: auto; }
.fb { display: flex; align-items: center; gap: 16px; min-width: 0; }
.fb[hidden] { display: none; }
.fb-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  font-size: 32px;
  font-weight: 900;
  background: var(--surface);
  border-radius: 50%;
}
.fb strong { display: block; font-size: 22px; font-weight: 900; }
.fb p { margin: 2px 0 0; font-size: 16px; }
.lesson-foot.is-ok { background: var(--mint-l); border-color: transparent; }
.lesson-foot.is-ok .fb { color: var(--mint-d); }
.lesson-foot.is-ok .fb-icon { color: var(--mint); }
.lesson-foot.is-ok #action-btn { --bg: var(--mint); --edge: var(--mint-d); }
.lesson-foot.is-bad { background: var(--coral-l); border-color: transparent; }
.lesson-foot.is-bad .fb { color: var(--coral-d); }
.lesson-foot.is-bad .fb-icon { color: var(--coral); }
.lesson-foot.is-bad #action-btn { --bg: var(--coral); --edge: var(--coral-d); }
/* Пропуск — без красного: сердце не тратится */
.lesson-foot.is-skip { background: #FFF6DB; border-color: transparent; }
.lesson-foot.is-skip .fb { color: #9A6A00; }
.lesson-foot.is-skip .fb-icon { color: var(--sun-d); }
.lesson-foot.is-skip #action-btn { --bg: var(--sun); --edge: var(--sun-d); --fg: #6B4A00; }

/* ---------- Подписка «Супер» ---------- */
.super-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 20px;
  margin: 8px 0 12px;
  padding: 24px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 90% 10%, #9E7BFF 0, transparent 45%), linear-gradient(135deg, #5B3FE0, #7C5CFF 45%, #C04CF0);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 0 #4A2FC8;
}
.super-card h2 { margin: 8px 0 10px; font-size: 26px; }
.sc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  color: #fff;
  background: rgba(255, 255, 255, .2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sc-perks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.sc-perks li { display: flex; align-items: center; gap: 10px; }
.sc-until { margin: 12px 0 0; padding: 8px 12px; background: rgba(0, 0, 0, .15); border-radius: 12px; font-size: 15px; }
.sc-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.sc-actions form { flex: 1 1 180px; margin: 0; }
.sc-art { grid-row: 1; grid-column: 2; align-self: center; }
.btn-white-super { --bg: #fff; --edge: #3A22A8; --fg: #6A45F0; }
.btn-glass { --bg: rgba(255, 255, 255, .16); --edge: rgba(0, 0, 0, .18); --fg: #fff; border-color: rgba(255, 255, 255, .35); }
.super-card.is-active { background: linear-gradient(135deg, #22C98A, #17B8B8 55%, #36A9FF); box-shadow: 0 6px 0 #0E8F7F; }
.sb-hearts.is-super { color: var(--violet); }
.sb-hearts.is-super .ic { filter: hue-rotate(250deg) saturate(1.3); }

.super-promo {
  position: relative;
  display: grid;
  gap: 4px;
  padding-right: 96px;
  color: #fff;
  background: linear-gradient(135deg, #6A45F0, #C04CF0);
  border: 0;
  box-shadow: 0 5px 0 #4A2FC8;
  transition: transform .15s;
}
.super-promo:hover { transform: translateY(-2px); }
.super-promo .sc-badge { justify-self: start; }
.super-promo b { font-size: 19px; }
.super-promo span:last-of-type { opacity: .9; font-size: 15px; }
.sp-owl { position: absolute; right: 14px; bottom: 8px; }

.btn-super { --bg: linear-gradient(90deg, #7C5CFF, #C04CF0); --edge: #5B3FE0; --fg: #fff; background: linear-gradient(90deg, #7C5CFF, #C04CF0); }

.result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.result-card {
  overflow: hidden;
  text-align: center;
  border: 2px solid;
  border-radius: var(--r);
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
.result-card:nth-child(2) { animation-delay: .12s; }
.result-card:nth-child(3) { animation-delay: .24s; }
.rc-label { display: block; padding: 6px 4px; color: #fff; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.rc-value { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 6px; font-size: 22px; font-weight: 900; background: var(--surface); }
.rc-xp { border-color: var(--sun); background: var(--sun); color: var(--sun-d); }
.rc-acc { border-color: var(--mint); background: var(--mint); color: var(--mint-d); }
.rc-time { border-color: var(--sky); background: var(--sky); color: var(--sky-d); }
.result-extras { display: grid; justify-items: center; gap: 4px; margin-top: 22px; font-size: 17px; }
.result-extras p { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.quest-ready { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 16px; color: #7A4B00; background: #FFF4CF; border-radius: 14px; font-weight: 900; }

/* ---------- Друзья ---------- */

.btn-green { --bg: #58CC02; --edge: #58A700; --fg: #fff; }
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: #fff;
  background: var(--coral);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
  animation: beat 1.6s ease-in-out infinite;
}
.nav-ic { position: relative; }
.nav-dot {
  position: absolute;
  top: -4px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  color: #fff;
  background: var(--coral);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  animation: beat 1.6s ease-in-out infinite;
}
.friends-banner h1, .friends-banner p { color: #fff; }
.fr-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.fr-search:focus-within { border-color: var(--sky); box-shadow: 0 4px 0 #9CD3FF; }
.fr-search input { flex: 1; min-width: 0; padding: 8px 0; font: 500 17px var(--font); color: var(--ink); background: none; border: 0; outline: none; }
.fr-section { margin-bottom: 28px; }
.fr-section .section-title { display: flex; align-items: center; gap: 8px; }
.fr-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fr-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 3px 0 var(--line);
  animation: slideIn .4s cubic-bezier(.2, .9, .3, 1.2) backwards;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.fr-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 160px; color: var(--ink); }
.fr-who span { display: grid; }
.fr-who small { color: var(--muted); font-weight: 500; }
.fr-stat { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.fr-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: var(--soft); border-radius: 999px; color: var(--ink-2); }
.fr-pill.is-off .ic { filter: grayscale(1); opacity: .5; }
.fr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fr-form { margin: 0; }
.fr-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; color: #58A700; background: #D7FFB8; border-radius: 999px; font-size: 14px; font-weight: 800; }
.fr-tag.is-big { padding: 10px 16px; font-size: 16px; }
.fr-remove { color: #C4C4D4; }
.fr-remove:hover { color: var(--coral); }
.fr-empty-state { display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; background: var(--soft); border: 2px dashed var(--line); border-radius: var(--r-lg); }
.fr-empty-state p { margin: 0; color: var(--ink-2); }
.fr-empty-state .ic { animation: bob 2.4s ease-in-out infinite; }
.fr-invite { margin-top: 10px; text-align: center; }
.copy-login { color: var(--violet); cursor: pointer; }
.user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; align-self: flex-end; }
.user-actions form { margin: 0; }
.user-courses { display: flex; flex-wrap: wrap; gap: 10px; }
.user-course { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 2px solid var(--c); border-radius: 999px; font-weight: 700; }
.profile-friends {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 14px 16px;
  color: var(--ink);
  background: #FFF4E5;
  border: 2px solid #FFD8A8;
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 #FFD8A8;
  transition: transform .15s;
}
.profile-friends:hover { transform: translateY(-2px); }
.profile-friends > span:nth-child(2) { display: grid; flex: 1; }
.profile-friends small { color: var(--muted); font-weight: 500; }
.pf-avatars { display: flex; }
.pf-avatars .avatar { margin-left: -8px; border: 2px solid #fff; }
.friends-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.fc-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fc-list a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: var(--ink); border-radius: 12px; font-weight: 700; }
.fc-list a:hover { background: var(--soft); }
.fc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-list .avatar { flex: none; }
.fc-list em { color: var(--muted); font-style: normal; font-size: 14px; }
.fc-empty { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fc-empty p { margin: 0; color: var(--ink-2); font-size: 15px; }
.board-who { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: var(--ink); }
.board-list li { animation: slideIn .4s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(min(var(--i, 0), 12) * 40ms); }

/* ---------- Настройки ---------- */

.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
.set-group { margin-bottom: 26px; }
.set-title { margin: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--ink);
  border: 2px solid var(--line);
  border-bottom-width: 0;
  font-weight: 700;
  cursor: pointer;
}
.set-group > .set-row:first-of-type, .set-group > .goal-grid + p + .set-row { border-radius: var(--r) var(--r) 0 0; }
.set-group > .set-row:last-of-type { border-bottom-width: 2px; border-radius: 0 0 var(--r) var(--r); }
.set-row > span, .set-details summary > span { display: inline-flex; align-items: center; gap: 12px; }
.set-row:hover { background: var(--soft); }
.chev { color: #AFAFC2; font-size: 24px; }
.set-details { display: block; }
.set-details summary { display: flex; justify-content: space-between; align-items: center; list-style: none; }
.set-details summary::-webkit-details-marker { display: none; }
.set-details[open] .chev { transform: rotate(90deg); }
.set-details .form { margin: 14px 0 4px; cursor: default; }
.switch { appearance: none; position: relative; width: 50px; height: 30px; margin: 0; background: #E5E5EF; border-radius: 999px; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.switch:checked { background: #58CC02; }
.switch:checked::after { transform: translateX(20px); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 8px; }
.goal-opt {
  display: grid;
  gap: 2px;
  padding: 12px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 3px 0 var(--line);
  cursor: pointer;
}
.goal-opt span { color: var(--muted); font-size: 13px; }
.goal-opt em { color: var(--orange); font-style: normal; font-weight: 800; }
.goal-opt.is-on { background: #FFF4E5; border-color: #FFB84D; box-shadow: 0 3px 0 #FFB84D; }
.danger-zone { margin-top: 16px; text-align: center; }
.danger-zone summary { color: var(--coral-d); font-weight: 700; cursor: pointer; }
.danger-zone .form { text-align: left; }
.stm-goal { display: grid; gap: 6px; margin: 0 16px 12px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.stm-goal .bar > span { background: linear-gradient(90deg, var(--sun), var(--orange)); }

/* ---------- Меню огонька ---------- */

.btn-sky { --bg: #1CB0F6; --edge: #1899D6; --fg: #fff; }
.sb-streak-wrap { position: relative; }
.streak-menu { left: 50%; width: 340px; margin-left: -170px; padding: 0; overflow: hidden; }
.stm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 14px; background: #FFF4D6; }
.streak-menu:not(.is-on) .stm-head { background: #F7F7FB; }
.stm-title { margin: 0 0 4px; color: var(--orange); font-size: 24px; font-weight: 800; }
.streak-menu:not(.is-on) .stm-title { color: #AFAFC2; }
.stm-sub { margin: 0; color: var(--ink-2); font-size: 14px; }
.stm-fire { flex: none; animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.streak-menu:not(.is-on) .stm-fire { filter: grayscale(1); opacity: .45; animation: none; }
.stm-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 14px; padding: 12px 8px; background: var(--surface); border-radius: 0 0 14px 14px; }
.streak-menu .stm-week { margin-top: -6px; }
.stm-day { display: grid; justify-items: center; gap: 6px; animation: nodePop .4s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(var(--i) * 40ms); }
.stm-day em { color: #AFAFC2; font-style: normal; font-size: 13px; font-weight: 700; }
.stm-day i { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: #E5E5EF; border-radius: 50%; }
.stm-day.is-done i { background: linear-gradient(180deg, #FFB84D, #FF9600); box-shadow: 0 3px 0 #E07B00; }
.stm-day.is-done em, .stm-day.is-today em { color: var(--orange); }
.stm-day.is-today i { background: var(--surface); border: 3px dashed #FFB84D; }
.stm-day.is-future i { background: #F2F2F7; }
.stm-card { display: flex; align-items: center; gap: 12px; margin: 14px; padding: 14px; border: 2px solid var(--line); border-radius: var(--r); }
.stm-card b { display: block; margin-bottom: 4px; }
.stm-card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.stm-card .bar > span { background: var(--orange); }
.stm-card.is-open { background: #FFF8E1; border-color: #FFD66B; }
.stm-freeze { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; color: var(--ink-2); font-size: 14px; }
.streak-menu > .btn { width: calc(100% - 28px); margin: 0 14px 14px; }

.calendar-card { margin-bottom: 28px; padding: 18px 20px; border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--line); }
.cal-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cal-head .section-title { margin: 0; }
.cal-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--orange); font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; text-align: center; }
.cal-w { color: var(--muted); font-size: 13px; font-weight: 700; }
.cal-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 44px;
  margin: 0 auto;
  width: 100%;
  color: var(--ink-2);
  background: var(--soft);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  animation: nodePop .35s ease backwards;
  animation-delay: calc(var(--i) * 12ms);
}
.cal-day.is-on { color: #fff; background: linear-gradient(180deg, #FFB84D, #FF9600); box-shadow: 0 3px 0 #E07B00; }
.cal-day.is-today { outline: 3px solid var(--sky); outline-offset: 2px; }
.cal-day.is-future { color: #C4C4D4; background: transparent; }

/* ---------- Анимации и игривые детали ---------- */

@keyframes riseIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } }
@keyframes jelly { 30% { transform: scale(1.18, .86); } 55% { transform: scale(.92, 1.08); } 75% { transform: scale(1.04, .97); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.06, .95) rotate(-3deg); } 50% { transform: scale(.97, 1.05) rotate(2deg); } 75% { transform: scale(1.03) rotate(-1deg); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.08); } }
@keyframes pulseRing { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .85; } }
@keyframes menuPop { from { opacity: 0; transform: scale(.85) translateY(-6px); } }
@keyframes confettiFall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)); opacity: 0; }
}
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }

/* Страница появляется волной */
.center > :not(.mobile-stats):not(.toast):not(.unit-banner),
.rightbar > * { animation: riseIn .5s cubic-bezier(.2, .9, .3, 1.15) backwards; }
.center > :nth-child(2), .rightbar > :nth-child(2) { animation-delay: .05s; }
.center > :nth-child(3), .rightbar > :nth-child(3) { animation-delay: .1s; }
.center > :nth-child(4), .rightbar > :nth-child(4) { animation-delay: .15s; }
.center > :nth-child(5), .rightbar > :nth-child(5) { animation-delay: .2s; }
.center > :nth-child(n+6), .rightbar > :nth-child(n+6) { animation-delay: .25s; }
.unit-banner { animation: menuPop .45s cubic-bezier(.2, 1.3, .4, 1) backwards; }

/* Меню: иконки подпрыгивают, пункты нажимаются */
.nav-item { transition: background .15s, color .15s, transform .1s; }
.nav-item:active { transform: scale(.97); }
.nav-item:hover .nav-ic .ic, .nav-item:hover .nav-ic .avatar { animation: jelly .6s ease; }
.nav-item[aria-current="page"] .nav-ic .ic { transform: scale(1.1) rotate(-4deg); }
.course-menu:not([hidden]) { animation: menuPop .22s cubic-bezier(.2, 1.3, .4, 1); transform-origin: top left; }
.nav-more .more-menu:not([hidden]) { transform-origin: bottom left; }

/* Верхняя панель: огонёк мерцает, сердце бьётся, кристалл блестит */
.sb-streak:not(.is-off) .ic { animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.sb-hearts:hover .ic { animation: beat 1.4s ease-in-out infinite; }
.sb-gems:hover .ic { animation: jelly .6s ease; }
.sb-item { transition: transform .15s; }
.sb-item:active { transform: scale(.94); }

/* Карточки слегка приподнимаются */
.card, .my-course, .shop-item, .quest { transition: transform .18s, box-shadow .18s; }
.card:hover, .my-course:hover { transform: translateY(-2px); }

/* Кружки дорожки выпрыгивают при прокрутке */
@keyframes nodePop { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
.reveal-ready [data-reveal]:not(.is-seen) { opacity: 0; }
.reveal-ready [data-reveal].is-seen { animation: nodePop .5s cubic-bezier(.2, .9, .3, 1.2); }
.node.is-current::before { animation: pulseRing 2s ease-in-out infinite; }
.node:not(.is-locked):hover { filter: brightness(1.05); }

/* Кнопки: блик на главных */
.btn-primary, .btn-super, .btn-green { position: relative; overflow: hidden; }
.btn-primary::after, .btn-super::after, .btn-green::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
}
.btn-primary:hover::after, .btn-super:hover::after, .btn-green:hover::after { animation: shine .7s ease; }

/* Урок: верный вариант подпрыгивает, подвал выезжает, полоса блестит */
.opt.is-ok { animation: jelly .5s ease; }
.lesson-foot.is-ok .fb, .lesson-foot.is-bad .fb, .lesson-foot.is-skip .fb { animation: riseIn .3s cubic-bezier(.2, 1.3, .4, 1); }
.progress-fill { overflow: hidden; }
.progress-fill::before { content: ''; position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: shine 2.6s ease-in-out infinite; }
.result-card .ic { animation: jelly .7s .4s ease backwards; }

/* Конфетти */
.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: confettiFall var(--t, 1.6s) cubic-bezier(.2, .6, .4, 1) forwards;
}
.confetti i.is-round { width: 10px; height: 10px; border-radius: 50%; }

/* Игривые заголовки */
.page-title, .section-title, .picker-title { position: relative; }
.page-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 6px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--violet), var(--sky));
  border-radius: 999px;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1160px) {
  .rightbar { display: none; }
  .mobile-stats { display: block; margin-bottom: 14px; }
  .shell { padding-top: 16px; }
  .unit-banner { top: 12px; }
}

@media (max-width: 800px) {
  .sidenav {
    inset: auto 0 0 0;
    width: auto;
    height: auto;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 2px solid var(--line);
    overflow: visible;
  }
  .sidenav .logo { display: none; }
  .nav { display: flex; justify-content: space-around; gap: 0; }
  .nav-item { padding: 6px; gap: 0; border-radius: 12px; }
  .nav-label { display: none; }
  .nav-item { width: auto; padding: 6px 4px; }
  .nav-ic { width: 32px; height: 32px; }
  .nav-ic .ic { width: 28px; height: 28px; }
  .streak-menu { position: fixed; top: 58px; left: 10px; right: 10px; width: auto; margin-left: 0; }
  .nav-more .more-menu { position: fixed; inset: auto 10px calc(72px + env(safe-area-inset-bottom)) auto; top: auto; left: auto; }
  .shell { margin-left: 0; padding: 12px 14px 100px; }
  .mobile-stats { position: sticky; top: 0; z-index: 16; margin: -12px -14px 10px; padding: 6px 8px; background: var(--surface); border-bottom: 2px solid var(--line); }
  .unit-banner { top: 60px; }
  .unit-banner::before { display: none; }
  .ub-guide span { display: none; }
  .path-owl { display: none; }
  .node-wrap { transform: translateX(calc(var(--x) * .8)); }
  .node-pop { width: min(300px, calc(100vw - 40px)); }

  .land-hero { grid-template-columns: 1fr; gap: 10px; padding-top: 10px; }
  .hero-art { min-height: 300px; }
  .hero-owl { width: 190px; height: 209px; }
  .sticker { font-size: 17px; }

  /* Урок на телефоне: компактнее, чтобы все варианты помещались без прокрутки */
  .lesson-top { gap: 10px; padding: 12px 12px 4px; }
  .lesson-sound { display: none; }
  .lesson-main { padding: 10px 14px 16px; }
  .q-label { font-size: 19px; margin-bottom: 8px; }
  .q-head { gap: 6px; margin-bottom: 12px; }
  .q-head .owl { width: 60px; height: 66px; }
  .bubble { margin-bottom: 14px; padding: 10px 12px; font-size: 15px; border-radius: 14px; }
  .bubble::before { bottom: 12px; }
  .options { gap: 8px; }
  .opt { min-height: 46px; padding: 8px 12px; gap: 10px; font-size: 15px; }
  .opt-key { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
  .match, .match-col { gap: 8px; }
  .num-input { padding: 2px 14px; }
  .num-input input { font-size: 24px; }
  .intro-title { font-size: 26px; margin-top: 10px; }
  .theory-card { padding: 18px 16px; }
  .tc-text, .tc-q, .tc-answer { font-size: 16px; }
  .foot-inner { flex-wrap: wrap; gap: 10px; min-height: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .fb { width: 100%; gap: 10px; }
  .fb-icon { width: 36px; height: 36px; font-size: 20px; }
  .fb strong { font-size: 16px; }
  .fb p { font-size: 13px; }
  #skip-btn { flex: 1; }
  .foot-inner #action-btn { flex: 2; margin-left: 0; min-width: 0; }
  .result-cards { grid-template-columns: 1fr; }
  .options-2 { grid-template-columns: 1fr; }

  .onb { padding: 14px 14px 170px; }
  .onb-title { font-size: 26px; margin-bottom: 20px; }
  .onb-hello .owl { width: 80px; height: 88px; }
  .onb-hello .bubble { font-size: 15px; padding: 12px 14px; }
  .onb-grid { grid-template-columns: repeat(2, 1fr); }
  .onb-foot-inner { flex-direction: column-reverse; gap: 10px; }
  .onb-foot-inner .btn { width: 100%; }
  .wardrobe { flex-direction: column; text-align: center; }
  .super-card { grid-template-columns: 1fr; padding: 20px 18px; }
  .shop-item { gap: 12px; }
  .shop-item > .ic { width: 44px; height: 44px; }
  .sc-art { display: none; }

  .my-course { flex-wrap: wrap; }
  .mc-body { flex-basis: calc(100% - 72px); }
  .mc-actions { width: 100%; justify-content: flex-end; }
  .picker-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .picker-tile { min-height: 180px; padding-top: 26px; }

  .profile-info { flex-direction: column; }
  .pi-courses { align-self: flex-start; }
  .avatar.xl { width: 120px; height: 120px; font-size: 50px; }
  .pb-owl { width: 90px; height: 99px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 12px; }
  .ach { gap: 14px; padding: 16px; }
  .ach-badge { width: 70px; height: 82px; }
  .ach-badge .ic { width: 40px; height: 40px; }
  .week-chart { gap: 4px; padding: 12px; }
  .quest { flex-wrap: wrap; }
  .quest-reward { min-width: 0; margin-left: auto; }
  .page-banner .owl { display: none; }
}

/* Невысокие экраны (ноутбуки, телефоны в альбомной ориентации) */
@media (max-height: 760px) {
  .lesson-top { padding-top: 12px; }
  .lesson-main { padding-top: 8px; }
  .q-label { margin-bottom: 8px; }
  .q-head { margin-bottom: 12px; }
  .q-head .owl { width: 70px; height: 77px; }
  .bubble { margin-bottom: 16px; }
  .foot-inner { min-height: 0; padding-top: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.node-wrap:has(> .start-bubble) { margin-top: 28px; }

/* =========================================================
   Темы оформления: светлая (по умолчанию), тёмная, неон
   ========================================================= */

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ECECF8;
  --ink-2: #D2D2E6;
  --muted: #9A9AB8;
  --line: #34345A;
  --soft: #242446;
  --white: #14142A;
  --surface: #1D1D3A;
  --violet: #8E72FF;
  --violet-l: #2C2660;
  --sky-l: #16324C;
  --mint-l: #123B2E;
  --coral-l: #4A2233;
}
[data-theme="neon"] {
  color-scheme: dark;
  --ink: #F4F0FF;
  --ink-2: #DDD5FF;
  --muted: #A69CDB;
  --line: #3D2D80;
  --soft: #1A1340;
  --white: #0B0720;
  --surface: #140E32;
  --violet: #B24BFF;
  --violet-d: #7A1FD0;
  --violet-l: #2A1460;
  --sky: #00E5FF;
  --sky-d: #00A8C4;
  --sky-l: #0A2E4A;
  --mint: #39FF88;
  --mint-d: #17C765;
  --mint-l: #0B3A28;
  --coral: #FF3D9A;
  --coral-d: #E0207F;
  --coral-l: #4A1240;
  --sun: #FFE600;
  --sun-d: #C9B400;
  --orange: #FF8A00;
}
html:is([data-theme="dark"], [data-theme="neon"]) .btn:disabled,
html:is([data-theme="dark"], [data-theme="neon"]) .btn-disabled { --bg: #2A2A4C; --edge: #20203C; --fg: #6C6C94; }
html:is([data-theme="dark"], [data-theme="neon"]) .node.is-locked { color: #5A5A84; background: #2A2A4C; box-shadow: 0 8px 0 #1F1F3A; }
html:is([data-theme="dark"], [data-theme="neon"]) .board-skeleton span { background: linear-gradient(90deg, #26264A 25%, #33335C 50%, #26264A 75%); background-size: 200% 100%; }
html:is([data-theme="dark"], [data-theme="neon"]) .theory-card.is-hard { background: #2E2417; border-color: #7A5225; box-shadow: 0 4px 0 #7A5225; }
html:is([data-theme="dark"], [data-theme="neon"]) .lesson-foot.is-skip { background: #3A3115; }
html:is([data-theme="dark"], [data-theme="neon"]) .profile-friends { background: #2E2417; border-color: #6B4A1F; box-shadow: 0 4px 0 #6B4A1F; }
html:is([data-theme="dark"], [data-theme="neon"]) .switch { background: #3A3A62; }
html:is([data-theme="dark"], [data-theme="neon"]) .goal-opt.is-on { background: #2E2417; border-color: #B8721F; box-shadow: 0 3px 0 #B8721F; }
html:is([data-theme="dark"], [data-theme="neon"]) .stm-head { background: #3A2E14; }
html:is([data-theme="dark"], [data-theme="neon"]) .streak-menu:not(.is-on) .stm-head { background: var(--soft); }
html:is([data-theme="dark"], [data-theme="neon"]) .stm-day i { background: #33335C; }
html:is([data-theme="dark"], [data-theme="neon"]) .stm-day.is-future i { background: #282850; }
html:is([data-theme="dark"], [data-theme="neon"]) .stm-card.is-open { background: #3A2E14; border-color: #8A6A20; }
html:is([data-theme="dark"], [data-theme="neon"]) .nav-item[aria-current="page"],
html:is([data-theme="dark"], [data-theme="neon"]) .nav-item.is-active { border-color: #5A47B8; }
html:is([data-theme="dark"], [data-theme="neon"]) .cat-chip.is-active { border-color: #5A47B8; box-shadow: 0 3px 0 #5A47B8; }
html:is([data-theme="dark"], [data-theme="neon"]) .nav-dot { border-color: var(--surface); }
html:is([data-theme="dark"], [data-theme="neon"]) .avatar.xl { border-color: var(--surface); }
html:is([data-theme="dark"], [data-theme="neon"]) .week-bar { background: #4A3FA0; }
html:is([data-theme="dark"], [data-theme="neon"]) .fr-remove { color: #6C6C94; }
html:is([data-theme="dark"], [data-theme="neon"]) .mini-foot a { color: #6C6C94; }
html:is([data-theme="dark"], [data-theme="neon"]) .bar > em { color: var(--ink-2); }
html:is([data-theme="dark"], [data-theme="neon"]) .board-list li.zone::before,
html:is([data-theme="dark"], [data-theme="neon"]) .board-list li.zone::after { background: #1F5A44; }

/* Неон: свечение вокруг кнопок, карточек и логотипа */
html[data-theme="neon"] .logo { text-shadow: 0 0 14px rgba(178, 75, 255, .8); }
html[data-theme="neon"] .btn { box-shadow: 0 4px 0 var(--edge), 0 0 18px color-mix(in srgb, var(--bg) 45%, transparent); }
html[data-theme="neon"] .btn:disabled { box-shadow: 0 4px 0 var(--edge); }
html[data-theme="neon"] .btn:active:not(:disabled) { box-shadow: 0 0 12px color-mix(in srgb, var(--bg) 55%, transparent); }
html[data-theme="neon"] .card, html[data-theme="neon"] .fr-row, html[data-theme="neon"] .hat-card,
html[data-theme="neon"] .theme-card, html[data-theme="neon"] .lab-card, html[data-theme="neon"] .lab-panel {
  border-color: #4B35A8;
  box-shadow: 0 0 0 1px rgba(178, 75, 255, .18), 0 0 22px rgba(120, 60, 255, .18);
}
html[data-theme="neon"] .sidenav { border-right-color: #4B35A8; box-shadow: 6px 0 30px rgba(120, 60, 255, .12); }
html[data-theme="neon"] .bar > span { box-shadow: 0 0 10px rgba(255, 230, 0, .6); }
html[data-theme="neon"] .node:not(.is-locked) { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 60%, transparent)); }
html[data-theme="neon"] h1, html[data-theme="neon"] .page-title { text-shadow: 0 0 18px rgba(178, 75, 255, .45); }

/* Плитки выбора темы в магазине */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 16px; }
.theme-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--line);
}
.theme-card.is-current { border-color: var(--violet); box-shadow: 0 4px 0 var(--violet); }
.theme-card h4 { margin: 0; font-size: 17px; }
.theme-card p { margin: 0; min-height: 2.6em; }
.theme-card form { margin: 0; }
.theme-swatch {
  position: relative;
  display: grid;
  grid-template-rows: 14px 1fr 16px;
  gap: 6px;
  height: 96px;
  padding: 8px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 14px;
}
.ts-bar { background: var(--violet); border-radius: 6px; }
.ts-card { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--surface); border: 2px solid var(--line); border-radius: 8px; }
.ts-card i { background: var(--soft); border-radius: 4px; }
.ts-card i:first-child { background: var(--sky); }
.ts-btn { width: 60%; justify-self: center; background: var(--mint); border-radius: 6px; }

/* Удвоитель опыта */
.sb-boost { color: var(--orange); }
.sb-boost .ic { animation: flicker 1.6s ease-in-out infinite; }
.shop-boost.is-on { background: linear-gradient(90deg, color-mix(in srgb, var(--sun) 16%, transparent), transparent); border-radius: var(--r); }
.boost-plans { display: grid; gap: 8px; justify-items: stretch; }
.boost-plans form { margin: 0; }
.boost-plans .btn { width: 100%; white-space: nowrap; }

/* =========================================================
   Лиги: зоны, таймер, итоги прошлой недели
   ========================================================= */

.board-list li.zone-down { color: var(--coral-d); }
.board-list li.zone-down::before, .board-list li.zone-down::after { background: #FFC2CE; }
.board-list li.zone-stay { color: var(--muted); }
.board-list li.zone-stay::before, .board-list li.zone-stay::after { background: var(--line); }
html:is([data-theme="dark"], [data-theme="neon"]) .board-list li.zone-down::before,
html:is([data-theme="dark"], [data-theme="neon"]) .board-list li.zone-down::after { background: #6A2A44; }
.league-timer { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; color: var(--ink-2); background: var(--soft); border-radius: 999px; font-size: 15px; }
.league-result { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 18px; background: var(--soft); border: 2px solid var(--line); border-radius: var(--r); }
.league-result div { display: grid; }
.league-result.is-up { background: var(--mint-l); border-color: #8FE3C1; }
.league-result.is-down { background: var(--coral-l); border-color: #FFB0BF; }
.league-note { margin-top: 12px; text-align: center; }
.league-up { color: var(--mint-d) !important; font-weight: 800; }
.league-down { color: var(--coral-d) !important; font-weight: 800; }

/* =========================================================
   Лаборатория
   ========================================================= */

.lab-banner .owl { flex: none; }
.lab-hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.lab-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 45%, var(--line));
  transition: transform .15s, box-shadow .15s;
}
.lab-card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 55%, var(--line)); }
.lab-card:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 55%, var(--line)); }
.lab-card h3 { margin: 0; font-size: 19px; }
.lab-card p { margin: 0; color: var(--muted); font-size: 15px; }
.lab-card .lc-ic { width: 56px; height: 56px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-radius: 16px; }
.lab-card .lc-stat { margin-top: 4px; color: var(--c); font-size: 14px; font-weight: 800; }
.lab-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.lab-back:hover { color: var(--sky); }
.lab-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.lab-head h1 { margin: 0; }
.lab-panel { margin: 16px 0; padding: 18px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); }
.lab-panel h3 { margin: 0 0 10px; }
.lab-sub { margin: 0 0 14px; color: var(--muted); }
.lab-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lab-tab {
  padding: 8px 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  font: 800 14px/1 var(--font);
  cursor: pointer;
}
.lab-tab.is-active { color: var(--violet); background: var(--violet-l); border-color: var(--violet); }
.lab-tab.is-done::after { content: ' ✓'; color: var(--mint-d); }
.lab-msg { display: none; margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; font-weight: 700; }
.lab-msg.is-shown { display: block; }
.lab-msg.is-ok { color: var(--mint-d); background: var(--mint-l); border: 2px solid #8FE3C1; }
.lab-msg.is-bad { color: var(--coral-d); background: var(--coral-l); border: 2px solid #FFB0BF; }
.lab-msg.is-info { color: var(--sky-d); background: var(--sky-l); border: 2px solid #9CD3FF; }
.lab-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.lab-reward { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-weight: 900; }
.lab-title { margin: 0 0 4px; font-size: 22px; }

/* Перетаскиваемые формулы и атомы */
.chip-f, .atom-btn { touch-action: none; user-select: none; -webkit-user-select: none; }
.chip-f {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--line);
  font: 800 19px/1.1 var(--font);
  cursor: grab;
}
.chip-f sub { font-size: .65em; }
.chip-f.is-selected { color: var(--sky-d); background: var(--sky-l); border-color: #9CD3FF; box-shadow: 0 3px 0 #9CD3FF; }
.chip-f.is-used { opacity: .35; }
.drag-ghost { position: fixed; z-index: 200; pointer-events: none; transform: translate(-50%, -50%) scale(1.08) rotate(-3deg); opacity: .92; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25)); }

.rx-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 14px; background: var(--soft); border-radius: var(--r); }
.rx-eq { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 8px 6px; margin: 8px 0 18px; }
.rx-arrow, .rx-plus { align-self: center; padding: 0 4px; color: var(--muted); font-size: 28px; font-weight: 900; }
.rx-cell { display: grid; justify-items: center; gap: 6px; }
.rx-slot {
  display: grid;
  place-items: center;
  width: 96px;
  min-height: 62px;
  padding: 6px;
  background: var(--soft);
  border: 3px dashed var(--line);
  border-radius: 16px;
  transition: border-color .15s, background .15s;
}
.rx-slot.is-over { border-color: var(--violet); background: var(--violet-l); }
.rx-slot.is-filled { border-style: solid; background: var(--surface); }
.rx-slot .chip-f { width: 100%; justify-content: center; padding: 8px 6px; }
.rx-coef { display: inline-flex; align-items: center; gap: 4px; }
.rx-coef button {
  width: 28px;
  height: 28px;
  color: var(--ink-2);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 9px;
  font: 900 16px/1 var(--font);
  cursor: pointer;
}
.rx-coef button:hover { color: var(--violet); border-color: var(--violet); }
.rx-coef b { min-width: 22px; text-align: center; font-size: 20px; }
.rx-slot.is-wrong { border-color: var(--coral); background: var(--coral-l); animation: shake .4s; }

.mol-atoms { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 8px 0 14px; }
.atom-btn {
  width: 66px;
  height: 66px;
  color: #fff;
  background: var(--el, #7C5CFF);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .22), inset 0 -6px 0 rgba(0, 0, 0, .12);
  font: 900 24px/1 var(--font);
  cursor: grab;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.atom-btn.is-light { color: #3C3C4A; text-shadow: none; }
.atom-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.mol-bowl {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  min-height: 130px;
  padding: 16px;
  background: var(--soft);
  border: 3px dashed var(--line);
  border-radius: 26px;
  transition: border-color .15s, background .15s;
}
.mol-bowl.is-over { border-color: var(--violet); background: var(--violet-l); }
.mol-bowl .empty { color: var(--muted); }
.atom {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--el, #7C5CFF);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
  font: 900 16px/1 var(--font);
  cursor: pointer;
  animation: jelly .35s ease;
}
.atom.is-light { color: #3C3C4A; }
.mol-formula { margin: 0 0 8px; color: var(--muted); }
.mol-formula b { color: var(--ink); font-size: 22px; }
.mol-count { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; color: var(--muted); font-weight: 800; }

/* Качественные реакции */
.q-shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 12px; background: var(--soft); border-radius: var(--r); }
.q-bottle {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 92px;
  padding: 8px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--line);
  font: 800 12px/1.15 var(--font);
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.q-bottle.is-selected { border-color: var(--sky); background: var(--sky-l); box-shadow: 0 3px 0 #9CD3FF; }
.q-bottle small { color: var(--muted); font-weight: 600; }
.q-bottle .qb-glass {
  position: relative;
  width: 28px;
  height: 38px;
  background: color-mix(in srgb, var(--liq) 70%, #fff);
  border: 2px solid rgba(0, 0, 0, .18);
  border-radius: 6px 6px 10px 10px;
}
.q-bottle .qb-glass::before { content: ''; position: absolute; left: 6px; top: -9px; width: 12px; height: 9px; background: color-mix(in srgb, var(--liq) 50%, #888); border-radius: 3px 3px 0 0; }
.q-tubes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin: 18px 0 8px; }
.q-tube { display: grid; justify-items: center; gap: 8px; width: 108px; }
.q-tube-name { font-weight: 900; }
.tube {
  position: relative;
  width: 64px;
  height: 172px;
  border: 4px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-top: 0;
  border-radius: 0 0 34px 34px;
  background: color-mix(in srgb, var(--surface) 60%, #DDF4FF);
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.tube-zone { padding: 0 0 6px; border-radius: 12px 12px 34px 34px; transition: background .15s; }
.tube-zone.is-over .tube { border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 30%, transparent); }
.tube::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 24px;
  width: 6px;
  background: rgba(255, 255, 255, .55);
  border-radius: 6px;
  z-index: 3;
}
.tube-liquid { position: absolute; inset: auto 0 0 0; height: 66%; background: var(--liq, #E6F4FF); opacity: .9; transition: background 1s ease; }
.tube-ppt { position: absolute; inset: auto 0 0 0; height: 0; background: var(--ppt, #fff); border-radius: 0 0 28px 28px; transition: height 1.2s ease; }
.tube-cloud { position: absolute; inset: 0; background: var(--ppt, #fff); opacity: 0; transition: opacity 1s ease; }
.tube.is-ppt .tube-ppt { height: 30%; }
.tube.is-ppt .tube-liquid::after, .tube.is-cloud .tube-cloud { opacity: .28; }
.tube.is-cloud .tube-cloud { opacity: .3; }
.tube.is-gas .tube-liquid { animation: qFizz .5s ease-in-out infinite alternate; }
.tube-bubbles { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.tube.is-gas .tube-bubbles { opacity: 1; }
.tube-bubbles i { position: absolute; bottom: 8px; width: 8px; height: 8px; background: rgba(255, 255, 255, .85); border-radius: 50%; animation: qRise 1.6s linear infinite; }
.tube-bubbles i:nth-child(1) { left: 14px; animation-delay: 0s; }
.tube-bubbles i:nth-child(2) { left: 28px; width: 6px; height: 6px; animation-delay: .35s; }
.tube-bubbles i:nth-child(3) { left: 40px; width: 10px; height: 10px; animation-delay: .8s; }
.tube-bubbles i:nth-child(4) { left: 22px; width: 5px; height: 5px; animation-delay: 1.1s; }
.tube-bubbles i:nth-child(5) { left: 34px; width: 7px; height: 7px; animation-delay: .55s; }
.tube.is-drop .tube-liquid { animation: qDrop .6s ease; }
@keyframes qRise { from { transform: translateY(0); opacity: .9; } to { transform: translateY(-110px); opacity: 0; } }
@keyframes qFizz { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes qDrop { 0% { filter: brightness(1.5); } 100% { filter: none; } }
.q-tube-log { min-height: 3.2em; margin: 0; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.3; text-align: center; list-style: none; }
.q-tube-log li { margin: 0 0 2px; }
.q-tube-log li.is-last { color: var(--ink); font-weight: 800; }
.q-tube select {
  width: 100%;
  padding: 8px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  font: 700 13px var(--font);
}
.q-rinse { padding: 4px 10px; color: var(--muted); background: none; border: 0; font: 800 12px var(--font); cursor: pointer; }
.q-rinse:hover { color: var(--coral); }
.q-uses { text-align: center; }

/* Таблица Менделеева */
.pt-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pt-progress .bar { flex: 1; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  color: var(--ink-2);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 700 12px var(--font);
  cursor: pointer;
}
.pt-chip i { width: 12px; height: 12px; background: var(--cat); border-radius: 4px; }
.pt-chip.is-active { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, var(--surface)); }
.pt-scroll { overflow-x: auto; padding-bottom: 6px; }
.pt-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(30px, 1fr));
  grid-template-rows: repeat(7, auto) 10px repeat(2, auto);
  gap: 3px;
  min-width: 620px;
}
.pt-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  color: #fff;
  background: var(--cat);
  border: 0;
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
  font: 900 13px/1 var(--font);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
  cursor: pointer;
  transition: transform .12s, opacity .2s, filter .2s;
}
.pt-cell small { position: absolute; top: 2px; left: 3px; font-size: 8px; font-weight: 700; opacity: .85; }
.pt-cell:hover { z-index: 2; transform: scale(1.25); }
.pt-cell.is-locked { color: var(--muted); background: var(--soft); box-shadow: inset 0 0 0 2px var(--line); text-shadow: none; }
.pt-cell.is-locked:hover { transform: none; }
.pt-cell.is-locked .ic { width: 12px; height: 12px; opacity: .55; }
.pt-cell.is-dim { opacity: .18; }
.pt-cell.is-selected { z-index: 3; transform: scale(1.3); outline: 3px solid var(--ink); }
.pt-gap { display: grid; place-items: center; color: var(--muted); font-size: 9px; font-weight: 800; border: 2px dashed var(--line); border-radius: 6px; }
.pt-detail { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin-top: 16px; }
.pt-big {
  display: grid;
  place-items: center;
  align-content: center;
  width: 96px;
  height: 96px;
  color: #fff;
  background: var(--cat, var(--soft));
  border-radius: 20px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .16);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.pt-big small { font-size: 12px; font-weight: 700; opacity: .9; }
.pt-big b { font-size: 38px; line-height: 1; }
.pt-detail h3 { margin: 0 0 2px; font-size: 22px; }
.pt-props { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pt-props span { padding: 3px 10px; background: var(--soft); border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.pt-fact { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.pt-hint { margin: 0; color: var(--muted); font-size: 15px; }

/* Тренажёр формул */
.fx-progress { display: flex; gap: 6px; margin-bottom: 14px; }
.fx-progress i { flex: 1; height: 10px; background: var(--line); border-radius: 999px; transition: background .2s; }
.fx-progress i.is-ok { background: var(--mint); }
.fx-progress i.is-bad { background: var(--coral); }
.fx-progress i.is-now { background: var(--sky); }
.fx-law { margin: 0; color: var(--muted); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.fx-eq { margin: 6px 0 4px; font: 900 34px/1.2 var(--font); text-align: center; letter-spacing: .01em; }
.fx-vars { margin: 0 0 12px; color: var(--muted); font-size: 14px; text-align: center; }
.fx-ask { margin: 0 0 12px; font-size: 19px; font-weight: 800; text-align: center; }
.fx-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fx-opt {
  min-height: 62px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--line);
  font: 800 20px/1.2 var(--font);
  cursor: pointer;
  transition: transform .06s, box-shadow .06s, background .15s;
}
.fx-opt:hover:not(:disabled) { background: var(--soft); }
.fx-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.fx-opt.is-ok { color: var(--mint-d); background: var(--mint-l); border-color: #8FE3C1; box-shadow: 0 4px 0 #8FE3C1; }
.fx-opt.is-bad { color: var(--coral-d); background: var(--coral-l); border-color: #FFB0BF; box-shadow: 0 4px 0 #FFB0BF; animation: shake .4s; }
.fx-opt:disabled { cursor: default; }
.fx-result { display: grid; justify-items: center; gap: 8px; text-align: center; }
.fx-score { margin: 0; font-size: 44px; font-weight: 900; color: var(--violet); }

/* =========================================================
   Лента друзей, «пятёрки», дуэли
   ========================================================= */

.feed { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feed-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 3px 0 var(--line);
}
.feed-item.is-mine { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.feed-body { min-width: 0; }
.feed-body p { margin: 0; }
.feed-who { color: var(--ink); font-weight: 900; }
.feed-time { color: var(--muted); font-size: 13px; }
.feed-ic { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.feed-stickers { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.feed-stickers form { margin: 0; }
.st-btn {
  padding: 5px 11px;
  color: var(--ink-2);
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 800 13px var(--font);
  cursor: pointer;
  transition: transform .1s, background .15s;
}
.st-btn:hover { background: var(--violet-l); border-color: var(--violet); transform: translateY(-1px); }
.st-sent { padding: 5px 11px; color: var(--mint-d); background: var(--mint-l); border-radius: 999px; font-size: 13px; font-weight: 800; }
.st-got { padding: 3px 10px; background: var(--sun); color: #5A3A00; border-radius: 999px; font-size: 13px; font-weight: 800; }
.feed-empty { padding: 18px; text-align: center; background: var(--soft); border: 2px dashed var(--line); border-radius: var(--r-lg); }

.duel-list { display: grid; gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; }
.duel-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 3px 0 var(--line);
}
.duel-row.is-todo { border-color: var(--coral); box-shadow: 0 3px 0 var(--coral); }
.duel-row .fr-who { flex: 1; }
.duel-tag { padding: 3px 10px; color: var(--muted); background: var(--soft); border-radius: 999px; font-size: 13px; font-weight: 800; }
.duel-tag.is-win { color: var(--mint-d); background: var(--mint-l); }
.duel-tag.is-lose { color: var(--coral-d); background: var(--coral-l); }
.duel-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.duel-form select {
  max-width: 150px;
  padding: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  font: 700 13px var(--font);
}

.duel-arena { display: grid; gap: 14px; }
.duel-vs { display: flex; align-items: center; justify-content: center; gap: 14px; }
.duel-vs .vs { color: var(--coral); font-size: 26px; font-weight: 900; }
.duel-vs .who { display: grid; justify-items: center; gap: 4px; font-weight: 900; }
.duel-timer { margin: 0; text-align: center; color: var(--muted); font-weight: 800; }
.duel-timer b { color: var(--ink); font-size: 22px; font-variant-numeric: tabular-nums; }
.duel-q { margin: 6px 0 4px; font-size: 21px; font-weight: 800; text-align: center; }
.duel-options { display: grid; gap: 10px; }
.duel-result { display: grid; justify-items: center; gap: 10px; text-align: center; }
.duel-score { display: flex; justify-content: center; gap: 30px; font-size: 20px; }
.duel-score b { display: block; font-size: 34px; }
.duel-score small { color: var(--muted); font-weight: 700; }

@media (max-width: 800px) {
  .nav-lab { display: none; }
  .lab-hub { grid-template-columns: 1fr; }
  .fx-options { grid-template-columns: 1fr; }
  .fx-eq { font-size: 28px; }
  .rx-slot { width: 82px; }
  .pt-detail { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pt-props { justify-content: center; }
  .boost-plans { width: 100%; }
  .shop-boost { flex-wrap: wrap; }
}

/* =========================================================
   Аватарки, рамки, карта активности, точность
   ========================================================= */

.avatar.has-emoji { color: inherit; background: color-mix(in srgb, var(--a) 22%, var(--surface)); text-shadow: none; }

.avatar.frame-gold { box-shadow: 0 0 0 3px #FFC530, 0 0 0 5px #B98600, 0 3px 8px rgba(255, 197, 48, .5); }
.avatar.frame-neon { box-shadow: 0 0 0 3px #00E5FF, 0 0 12px 3px #B24BFF, 0 0 24px #00E5FF; }
.avatar.frame-rainbow { box-shadow: 0 0 0 3px #FF4B4B, 0 0 0 6px #FFC530, 0 0 0 9px #36A9FF, 0 0 14px 6px rgba(178, 75, 255, .35); }
.avatar.frame-fire { box-shadow: 0 0 0 3px #FF9600, 0 0 0 5px #E03A1E, 0 0 16px 4px rgba(255, 120, 0, .65); animation: flicker 1.8s ease-in-out infinite; }
.frame-stage { display: grid; place-items: center; min-height: 120px; }
.frame-stage .avatar.xl { width: 96px; height: 96px; font-size: 42px; border-width: 4px; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; }
.avatar-picker legend { margin-bottom: 8px; font-weight: 800; }
.ap-opt { position: relative; cursor: pointer; }
.ap-opt input { position: absolute; opacity: 0; }
.ap-opt .avatar { width: 46px; height: 46px; font-size: 24px; transition: transform .12s, box-shadow .12s; }
.ap-opt input:checked + .avatar { outline: 3px solid var(--violet); outline-offset: 3px; transform: scale(1.08); }
.ap-opt input:focus-visible + .avatar { outline: 3px solid var(--sky); outline-offset: 3px; }

.heat-card { margin: 24px 0; padding: 18px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); }
.heat-card .cal-head { margin-bottom: 10px; }
.heat-scroll { overflow-x: auto; padding-bottom: 8px; }
.heat-months, .heat-grid { display: grid; grid-auto-flow: column; gap: 3px; width: max-content; }
.heat-months { grid-template-rows: 14px; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.heat-months span { width: 13px; white-space: nowrap; overflow: visible; }
.heat-grid { grid-template-rows: repeat(7, 13px); }
.heat { display: block; width: 13px; height: 13px; background: #EBEDF3; border-radius: 3px; }
.heat.l1 { background: #B6EFCB; }
.heat.l2 { background: #6FD99A; }
.heat.l3 { background: #2FBF6E; }
.heat.l4 { background: #14813F; }
.heat.is-future { visibility: hidden; }
html:is([data-theme="dark"], [data-theme="neon"]) .heat { background: #2A2A4C; }
html:is([data-theme="dark"], [data-theme="neon"]) .heat.l1 { background: #1E5A3C; }
html:is([data-theme="dark"], [data-theme="neon"]) .heat.l2 { background: #23884F; }
html:is([data-theme="dark"], [data-theme="neon"]) .heat.l3 { background: #2FBF6E; }
html:is([data-theme="dark"], [data-theme="neon"]) .heat.l4 { background: #6FF5A2; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.heat-legend .heat { display: inline-block; }

.acc-list { display: grid; gap: 14px; margin: 0 0 24px; padding: 0; list-style: none; }
.acc-list li { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); }
.acc-body { flex: 1; min-width: 0; }
.acc-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; }
.acc-top span { color: var(--ink-2); font-weight: 800; }
.acc-bar > span { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }

/* =========================================================
   Календарь входа и вопрос дня
   ========================================================= */

.ci-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 14px 0; }
.ci-day {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  min-height: 104px;
  padding: 8px 2px;
  overflow: hidden;
  text-align: center;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 14px;
}
.ci-day b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ci-day span { font-size: 24px; line-height: 1.4; }
.ci-day small { max-width: 100%; color: var(--ink-2); font-size: 10.5px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; hyphens: auto; }
.ci-day.is-done { background: var(--mint-l); border-color: #8FE3C1; }
.ci-day.is-done span { color: var(--mint-d); font-weight: 900; }
.ci-day.is-next { background: color-mix(in srgb, var(--sun) 25%, var(--surface)); border-color: var(--sun); animation: bob 1.8s ease-in-out infinite; }
.ci-day.is-rare { border-color: #C04CF0; background: color-mix(in srgb, #C04CF0 12%, var(--surface)); }
.checkin-card { margin-bottom: 20px; }
.daily-card { max-width: 560px; }
.daily-card h2 { margin-bottom: 4px; }
.daily-q { font-size: 20px; font-weight: 800; margin: 12px 0; }
.daily-options { display: grid; gap: 10px; margin-bottom: 12px; }
.daily-msg { min-height: 1.4em; margin: 10px 0; }

@media (max-width: 800px) {
  .ci-grid { grid-template-columns: repeat(4, 1fr); }
  .ci-day { min-height: 92px; }
}

/* =========================================================
   Админ-панель
   ========================================================= */

.admin-page { background: var(--soft); }
.adm-wrap { max-width: 900px; margin: 0 auto; padding: 18px 16px 120px; }
.adm-login { display: grid; justify-items: center; gap: 8px; max-width: 380px; padding-top: 60px; text-align: center; }
.adm-login .form { width: 100%; text-align: left; }
.adm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); }
.adm-top form { margin: 0; }
.adm-brand { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); font-size: 18px; }
.adm-crumbs { margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.adm-crumbs b { color: var(--ink); }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.adm-card { display: grid; gap: 6px; padding: 16px; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 40%, var(--line)); }
.adm-card:hover { transform: translateY(-2px); }
.adm-list { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.adm-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); }
.adm-n { display: grid; place-items: center; flex: none; width: 34px; height: 34px; color: #fff; background: var(--violet); border-radius: 50%; font-weight: 900; }
.adm-main { display: grid; flex: 1; min-width: 0; }
.adm-tag { padding: 1px 8px; color: var(--sky-d); background: var(--sky-l); border-radius: 999px; font-size: 12px; font-weight: 800; }
.adm-tag.is-new { color: var(--mint-d); background: var(--mint-l); }
.adm-note { margin-top: 10px; }
.adm-section { margin: 0 0 22px; padding: 18px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); }
.adm-section h2 { margin: 0 0 4px; }
.adm-field { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.adm-field input, .adm-field textarea, .adm-field select, .adm-section select, .adm-opt input[type="text"], .adm-pair input {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 12px;
  font: 500 16px var(--font);
}
.adm-field textarea { resize: vertical; }
.adm-field input:focus, .adm-field textarea:focus, .adm-opt input:focus, .adm-pair input:focus { outline: none; border-color: var(--sky); background: var(--surface); }
.adm-q { margin: 0 0 14px; padding: 14px; background: var(--soft); border: 2px solid var(--line); border-radius: var(--r); }
.adm-q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.adm-q-tools { display: flex; gap: 6px; }
.adm-mini { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
.adm-mini:disabled { opacity: .35; cursor: default; }
.adm-options, .adm-pairs { display: grid; gap: 8px; margin-bottom: 12px; }
.adm-hint { color: var(--muted); font-size: 13px; }
.adm-opt, .adm-pair { display: flex; align-items: center; gap: 8px; }
.adm-opt input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--mint); }
.adm-opt input[type="text"], .adm-pair input { flex: 1; }
.adm-options .btn, .adm-pairs .btn { justify-self: start; }
.adm-tf { display: flex; gap: 18px; }
.adm-radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.adm-inline { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.adm-addbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-addbar select { width: auto; }
.adm-empty { padding: 12px; }
.adm-savebar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 2px solid var(--line);
}
.adm-status { margin-right: auto; color: var(--muted); font-weight: 800; }
.adm-status.is-dirty { color: var(--orange); }
.adm-status.is-ok { color: var(--mint-d); }
.adm-status.is-bad { color: var(--coral-d); }
@media (max-width: 800px) {
  .adm-inline { grid-template-columns: 1fr; }
}

/* =========================================================
   Значки меню в кружках, формулы KaTeX
   ========================================================= */

.nav-ic { width: 42px; height: 42px; }
.nav-ic .ic { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.nav-item { padding: 5px 12px; }
.nav-profile .avatar { box-shadow: 0 0 0 2px #23232B, 0 0 0 4px #B24BFF; }
.sb-item .ic { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)); }
@media (max-width: 800px) {
  .nav-ic { width: 38px; height: 38px; }
  .nav-ic .ic { width: 34px; height: 34px; }
}

.fl-math { display: inline; }
.fl-math .katex { font-size: 1.14em; }
.katex-display { margin: .4em 0; }
.fx-eq .katex { font-size: 1.15em; }
.fx-opt .katex { font-size: 1.1em; }
.opt-text .katex, .bubble .katex { font-size: 1.05em; }
.katex-html { white-space: nowrap; }
.katex .base { white-space: nowrap; }

/* Низкополигональные значки: аватарки, стикеры, календарь */
.avatar .av-ic { width: 76%; height: 76%; filter: none; }
.avatar.has-emoji { display: inline-grid; place-items: center; }
.st-btn .ic, .st-got .ic, .st-sent .ic { vertical-align: -5px; }
.ci-day span { display: grid; place-items: center; min-height: 32px; }
.ci-day span .ic { width: 30px; height: 30px; }
.league-badge { filter: drop-shadow(0 3px 0 rgba(0,0,0,.14)); }
