/* Живой фон, переходы, отклик кнопок и новые блоки */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--page); transition: background-color 400ms ease; }
.aurora i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: .2; will-change: transform; }
.aurora i:nth-child(1) { left: -20vmax; top: -30vmax; background: radial-gradient(closest-side, var(--a), transparent); }
.aurora i:nth-child(2) { right: -25vmax; bottom: -35vmax; background: radial-gradient(closest-side, var(--b), transparent); }

/* Переходы между страницами */
.nav { view-transition-name: nav; }
::view-transition-group(root) { animation-duration: 520ms; }
::view-transition-old(root) { animation: vt-out 260ms cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in 520ms var(--ease) both; }
html[data-dir="back"]::view-transition-old(root) { animation-name: vt-out-back; }
html[data-dir="back"]::view-transition-new(root) { animation-name: vt-in-back; }
::view-transition-group(shared) { animation-duration: 520ms; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; transform: translateX(-3%) scale(.985); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(5%) scale(.985); filter: blur(8px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(3%) scale(.985); filter: blur(6px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-5%) scale(.985); filter: blur(8px); } }

/* Кнопки сразу показывают, что на них можно нажать */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px;
  transition: transform 160ms var(--ease), background-color 180ms ease, box-shadow 220ms ease, color 180ms ease;
}
.btn::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  background: radial-gradient(90px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--ink), .34), transparent 70%);
}
.btn .go, .textlink .go, .tile-open .go { display: inline-block; transition: transform 220ms var(--ease); }
.btn:active { transform: scale(.96); transition-duration: 60ms; }
.btn.quiet, .tool .btn.ghost { background: rgba(var(--ink), .1); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .14); }
.textlink { display: inline-flex; align-items: center; gap: 4px; padding: 6px 2px; position: relative; }
.textlink::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 3px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease); }
.nav nav a { position: relative; padding: 13px 0; opacity: .78; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 1px; background: var(--grad); transform: scaleX(0); transition: transform 240ms var(--ease); }
.nav nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-search, .nav-sound {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(var(--ink), .08); color: var(--text); transition: transform 140ms var(--ease), background-color 160ms ease;
}
.nav-search:active, .nav-sound:active { transform: scale(.9); }
.nav-sound[aria-pressed="false"] { color: var(--sub); }
.nav-tools { display: flex; gap: 6px; flex: none; }
.choice, .group a, .links3 a, .pager a, .resume, .mods a, .lab-card, .word { position: relative; cursor: pointer; }
.group .chev { transition: transform 200ms var(--ease); }
.tile-open { margin-top: 10px; color: var(--link); font-size: .9375rem; font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: scale(1.035); box-shadow: 0 8px 30px -8px var(--blue); }
  .btn:hover::after { opacity: 1; }
  .btn:hover .go, .textlink:hover .go, .tile:hover .go { transform: translateX(4px); }
  .btn.quiet:hover, .tool .btn.ghost:hover { background: rgba(var(--ink), .2); box-shadow: inset 0 0 0 1px rgba(var(--ink), .28); }
  .textlink:hover::after { transform: scaleX(1); }
  .nav nav a:hover::after { transform: scaleX(1); }
  .nav-search:hover, .nav-sound:hover { background: rgba(var(--ink), .2); }
  .group a:hover { background: rgba(var(--ink), .08); }
  .group a:hover .chev { transform: translateX(4px); opacity: 1; }
  .choice:hover:not([disabled]) { background: rgba(var(--ink), .15); transform: translateX(4px); }
  .links3 a:hover, .pager a:hover, .resume:hover, .lab-card:hover { background: rgba(var(--ink), .13); transform: translateY(-3px); }
}
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Стекло для всех карточек */
.tile, .links3 a, .pager a, .group, .facts li, .tool, .quiz, .checks, .resume, .overall, .flash, .search, .note-card, .lab-card {
  box-shadow: inset 0 0 0 1px rgba(var(--ink), .09);
}
.tile { background: rgba(var(--ink), .055); transform-style: preserve-3d; transition: none; will-change: transform; }
.spot::before {
  content: ""; position: absolute; inset: 0; opacity: 0; border-radius: inherit; pointer-events: none; transition: opacity 260ms ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--ink), .13), transparent 65%);
}
.spot:hover::before { opacity: 1; }
.tile canvas.pt { position: absolute; right: 10px; top: 10px; width: 170px; height: 170px; pointer-events: none; }
.tile svg.src { position: absolute; width: 24px; height: 24px; visibility: hidden; }
.tile h3 { margin-top: 130px; }
.tile canvas.pt { width: 130px; height: 130px; right: 20px; top: 20px; }
.tile.w4 canvas.pt, .tile.w3 canvas.pt { width: 150px; height: 150px; }

/* Закреплённый рассказ на главной */
.pin { height: 340vh; position: relative; }
.pin-in { position: sticky; top: 48px; height: calc(100vh - 48px); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; max-width: var(--wide); margin: 0 auto; padding: 0 22px; }
.pin-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.pin-steps li { opacity: .3; transition: opacity 320ms ease, transform 420ms var(--ease); transform-origin: left; }
.pin-steps li.on { opacity: 1; transform: scale(1.03); }
.pin-steps b { display: block; font-size: 1.5rem; letter-spacing: -.024em; }
.pin-steps span { color: var(--sub); }
.mock { position: relative; height: 430px; }
.mock > div {
  position: absolute; inset: 0; border-radius: 28px; padding: 28px; background: rgba(var(--ink), .07); box-shadow: inset 0 0 0 1px rgba(var(--ink), .1);
  opacity: 0; transform: translateY(24px) scale(.96); filter: blur(6px);
  transition: opacity 420ms ease, transform 620ms var(--ease), filter 420ms ease; overflow: hidden;
}
.mock > div.on { opacity: 1; transform: none; filter: none; }
.mock h4 { font-size: 1.625rem; letter-spacing: -.024em; margin: 0 0 14px; }
.mock p, .mock li { font-size: 1.0625rem; line-height: 1.42; }
.mock ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mock li { background: rgba(var(--ink), .08); padding: 10px 14px; border-radius: 12px; }
.mock li.ok { background: var(--green-bg); color: var(--green); }

/* Слова, которые загораются при прокрутке */
.lit span { color: rgba(var(--ink), .2); transition: color 240ms ease; }
.lit span.on { color: var(--text); }

/* Отдельный курс */
.track-card {
  --ink: 255, 255, 255;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding: clamp(28px, 5vw, 56px); border-radius: 32px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(130deg, #b3001b, #3a0a4f 70%); transition: transform 300ms var(--ease);
}
.track-card h2 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 12px; }
.track-card p { margin: 0 0 16px; font-size: 1.1875rem; color: rgba(var(--ink), .84); }
.track-card svg { width: 100%; max-width: 260px; justify-self: center; }
.track-card .play { transform-origin: 44px 40px; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }
@media (hover: hover) and (pointer: fine) { .track-card:hover { transform: scale(1.012); } }

/* Плеер */
.player { position: relative; border-radius: 24px; overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px var(--a); }
.player video { display: block; width: 100%; }
.player button {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border: 0; border-radius: 50%; color: #fff; cursor: pointer;
  background: rgba(var(--ink), .2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: transform 200ms var(--ease), opacity 200ms ease;
}
.player button:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .player button:hover { transform: scale(1.1); } }
.player.playing button { opacity: 0; pointer-events: none; }

/* Озвучка урока */
.l-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 20px; }
.listen { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 980px; border: 0; color: var(--text); font: 500 1rem/1 var(--font); cursor: pointer; background: rgba(var(--ink), .11); box-shadow: inset 0 0 0 1px rgba(var(--ink), .14); transition: transform 160ms var(--ease), background-color 180ms ease; }
.listen:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .listen:hover { background: rgba(var(--ink), .2); transform: scale(1.03); } }
.listen i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); font-style: normal; }
.wave { display: inline-flex; gap: 2px; height: 14px; align-items: center; }
.wave b { width: 2px; height: 4px; background: var(--text); border-radius: 1px; }
.listen.on .wave b { animation: wave 800ms ease-in-out infinite; }
.listen.on .wave b:nth-child(2) { animation-delay: 120ms; }
.listen.on .wave b:nth-child(3) { animation-delay: 240ms; }
.listen.on .wave b:nth-child(4) { animation-delay: 360ms; }
@keyframes wave { 50% { height: 14px; } }

/* Навигация по уроку */
.dots { position: fixed; right: 18px; top: 50%; translate: 0 -50%; z-index: 6; display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.dots a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; height: 22px; color: var(--text); font-size: .8125rem; }
.dots span { opacity: 0; transform: translateX(6px); transition: opacity 160ms ease, transform 200ms var(--ease); white-space: nowrap; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--ink), .3); transition: transform 200ms var(--ease), background-color 200ms ease; }
.dots a.on i { background: var(--text); transform: scale(1.5); }
.dots a:hover span, .dots a:focus-visible span { opacity: 1; transform: none; }
@media (max-width: 1040px) { .dots { display: none; } }

/* Диалоги */
dialog { color: var(--text); border: 0; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.palette { width: min(620px, calc(100vw - 32px)); margin: 12vh auto auto; border-radius: 22px; background: var(--pop); box-shadow: 0 40px 100px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(var(--ink), .12); overflow: hidden; }
.palette[open], .sheet[open] { animation: pop 240ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.palette input { width: 100%; border: 0; background: transparent; color: var(--text); font: 400 1.25rem/1.3 var(--font); padding: 18px 20px; box-shadow: inset 0 -1px 0 var(--line); }
.palette input:focus { outline: 0; }
#palList { max-height: 50vh; overflow: auto; padding: 8px; }
#palList a { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 12px; color: var(--text); }
#palList a small { color: var(--sub); white-space: nowrap; }
#palList a.on, #palList a:hover { background: var(--blue); color: #fff; }
#palList a.on small, #palList a:hover small { color: rgba(var(--ink), .8); }
#palList p { color: var(--sub); padding: 12px; margin: 0; }
.sheet { width: min(760px, calc(100vw - 24px)); max-height: 88vh; margin: auto; border-radius: 28px; background: var(--pop); box-shadow: 0 40px 100px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(var(--ink), .12); }
.sheet-x { position: absolute; right: 14px; top: 14px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(var(--ink), .12); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; transition: transform 140ms var(--ease), background-color 160ms ease; }
.sheet-x:hover { background: rgba(var(--ink), .24); transform: scale(1.08); }
.sheet .tool { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 0; z-index: 41; padding: 12px 20px; border-radius: 980px; background: var(--pop); color: var(--text); font-weight: 500; animation: pop 280ms var(--ease); box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }

/* Лаборатория */
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lab-card { display: block; width: 100%; text-align: left; min-height: 200px; padding: 26px; border: 0; border-radius: 24px; background: rgba(var(--ink), .06); color: var(--text); font: inherit; transition: transform 200ms var(--ease), background-color 180ms ease; }
.lab-card:active { transform: scale(.98); }
.lab-card b { display: block; font-size: 1.375rem; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 8px; }
.lab-card span { color: var(--sub); line-height: 1.42; display: block; }
.lab-card em { display: block; margin-top: 14px; font-style: normal; color: var(--link); font-weight: 500; }

/* Конспект */
.note-card { border-radius: 24px; background: rgba(var(--ink), .055); padding: 28px; margin-bottom: 16px; }
.note-card h2 { background: var(--iri); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Словарь: карточки-перевёртыши */
.words-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.word { height: 176px; border: 0; padding: 0; background: none; color: var(--text); perspective: 900px; font: inherit; border-radius: 20px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.word > div { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 560ms var(--ease); }
.word.open > div { transform: rotateY(180deg); }
.word span { color: var(--text); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: rgba(var(--ink), .07); box-shadow: inset 0 0 0 1px rgba(var(--ink), .1); }
.word .f { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; }
.word .b { transform: rotateY(180deg); font-size: .9688rem; line-height: 1.38; color: #fff !important; background: linear-gradient(135deg, color-mix(in srgb, var(--a) 62%, #000), color-mix(in srgb, var(--b) 62%, #000)); }
.deck { position: relative; height: 340px; max-width: 520px; margin: 30px auto 16px; touch-action: pan-y; user-select: none; }
.deck .flash { position: absolute; inset: 0; max-width: none; min-height: 0; margin: 0; cursor: grab; will-change: transform; background: var(--pop); }
.deck .flash:active { cursor: grabbing; }
.deck-hint { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--sub); }

/* Прогресс */
.rings { position: relative; width: 220px; height: 220px; flex: none; }
.rings svg { position: absolute; inset: 0; }
.legend { display: grid; gap: 8px; }
.legend b { font-size: 1.375rem; }
.legend span { color: var(--sub); display: block; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 36px; }
.badge { padding: 18px 10px; border-radius: 20px; text-align: center; background: rgba(var(--ink), .05); opacity: .42; filter: grayscale(1); transition: transform 240ms var(--ease); }
.badge.on { opacity: 1; filter: none; box-shadow: inset 0 0 0 1px rgba(var(--ink), .2); }
.badge.on:hover { transform: translateY(-3px) rotate(-1deg); }
.badge i { display: block; width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 50%; background: var(--iri); }
.badge b { display: block; font-size: .9375rem; line-height: 1.2; }

@media (max-width: 900px) {
  .pin-in { grid-template-columns: 1fr; gap: 18px; align-content: center; }
  .mock { height: 280px; }
  .pin-steps { display: none; }
  .lab-grid, .words-grid { grid-template-columns: repeat(2, 1fr); }
  .track-card { grid-template-columns: 1fr; }
  .track-card svg { display: none; }
}
@media (max-width: 640px) {
  .lab-grid, .words-grid { grid-template-columns: 1fr; }
  .tile canvas.pt, .tile.w4 canvas.pt, .tile.w3 canvas.pt { width: 104px; height: 104px; }
  .tile h3 { margin-top: 112px; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .nav nav { min-width: 0; flex: 1; }
  .rings { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .track-card .play, .listen.on .wave b { animation: none; }
  .mock > div, .word > div, .pin-steps li { transition-duration: 1ms; }
}

/* Выбор языка */
.nav-lang { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 980px; cursor: pointer; background: rgba(var(--ink), .08); color: var(--text); font: 500 .8125rem/1 var(--font); transition: transform 140ms var(--ease), background-color 160ms ease; }
.nav-lang:active { transform: scale(.92); }
.nav-lang:hover { background: rgba(var(--ink), .2); }
.flag { display: block; flex: none; width: 24px; height: 16px; border-radius: 3px; overflow: hidden; }
.flag-text { display: grid; place-items: center; background: rgba(var(--ink), .16); font-size: 9px; font-weight: 600; letter-spacing: 0; color: #fff; }
.langs { width: min(380px, calc(100vw - 32px)); margin: 12vh auto auto; border-radius: 22px; background: var(--pop); box-shadow: 0 40px 100px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(var(--ink), .12); }
.langs[open] { animation: pop 240ms var(--ease); }
#langList { display: grid; padding: 8px; }
#langList button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: 400 1.0625rem/1.2 var(--font); text-align: start; cursor: pointer; transition: background-color 140ms ease, transform 140ms var(--ease); }
#langList button:hover { background: rgba(var(--ink), .12); transform: translateX(3px); }
#langList button.on { background: var(--blue); color: #fff; }
html[dir="rtl"] .group .chev, html[dir="rtl"] .go { display: inline-block; transform: scaleX(-1); }

/* Видеоурок на сайте */
.th-host { --ink: 255, 255, 255; --text: #f5f5f7; --sub: #a1a1a6; --pop: rgba(38, 38, 42, .97); container-type: inline-size; position: relative; aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; background: #050507; color: #f5f5f7; color-scheme: dark; box-shadow: 0 30px 80px -30px var(--a); }
.th-host.th-fs { position: fixed; inset: 0; z-index: 60; aspect-ratio: auto; border-radius: 0; }
body.th-lock { overflow: hidden; }
.th-big { position: absolute; inset: 0; margin: auto; width: 92px; height: 92px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; cursor: pointer; background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform 220ms var(--ease), background-color 180ms ease; animation: pulseBtn 2.6s var(--ease) infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 16px rgba(255, 255, 255, .08); } }
.th-big:hover { transform: scale(1.12); background: rgba(255, 255, 255, .34); }
.th-big:active { transform: scale(.94); }
.th-poster { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 5cqw 4cqw; pointer-events: none; }
.th-poster h2 { margin: 0; font-size: clamp(1.25rem, 5cqw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.th-full { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .13); color: #fff; cursor: pointer; transition: background-color 160ms ease, transform 140ms var(--ease); }
.th-full:hover { background: rgba(255, 255, 255, .26); transform: scale(1.08); }
.th-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.th-x { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 4; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: transform 140ms var(--ease), background-color 160ms ease; }
.th-x:hover { background: rgba(255, 255, 255, .28); transform: scale(1.08); }
.th-stage { position: absolute; inset: 0 0 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px clamp(20px, 8vw, 120px); }
.th-title { margin: 0 0 auto; padding-top: 16cqw; font-size: clamp(1.75rem, 7.5cqw, 6rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; background: var(--iri); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 800ms var(--ease) both; }
.th-para, .th-rem { margin: 0; max-width: 20em; font-size: clamp(1.25rem, 4cqw, 3rem); line-height: 1.16; letter-spacing: -.028em; font-weight: 700; animation: rise 420ms var(--ease) both; }
.th-rem { max-width: 16em; font-size: clamp(1.25rem, 5cqw, 4rem); }
.th-para span, .th-rem span, .th-points .cur span { color: rgba(255, 255, 255, .24); transition: color 200ms ease; }
.th-para span.on, .th-rem span.on, .th-points .cur span.on { color: #fff; }
.th-small { display: block; color: var(--sub); font-size: 1.125rem; margin-bottom: 12px; letter-spacing: -.01em; }
.th-points { list-style: none; margin: 0; padding: 0; width: min(900px, 100%); display: grid; gap: 14px; text-align: start; }
.th-points li { padding: 18px 24px; border-radius: 20px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .42); font-size: clamp(1.125rem, 2.3vw, 1.625rem); line-height: 1.3; letter-spacing: -.018em; }
.th-points .cur { background: rgba(255, 255, 255, .13); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); animation: rise 420ms var(--ease) both; }
.th-over { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; overflow: auto; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: rise 300ms var(--ease) both; }
.th-over[hidden] { display: none; }
.th-card { width: min(620px, 100%); padding: 28px; border-radius: 26px; background: rgba(38, 38, 42, .94); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 40px 100px rgba(0, 0, 0, .6); }
.th-card.wide { width: min(780px, 100%); max-height: 86vh; overflow: auto; }
.th-card h3 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.18; letter-spacing: -.024em; margin: 0 0 18px; font-weight: 700; }
.th-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.th-play { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: #000; font-size: 15px; cursor: pointer; transition: transform 140ms var(--ease); }
.th-play:hover { transform: scale(1.08); }
.th-play:active { transform: scale(.92); }
.th-seek { flex: 1; min-width: 0; accent-color: var(--blue); cursor: pointer; }
.th-time { color: var(--sub); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.th-speed { flex: none; height: 34px; padding: 0 12px; border: 0; border-radius: 980px; background: rgba(255, 255, 255, .13); color: #fff; font: 500 .875rem/1 var(--font); cursor: pointer; transition: background-color 160ms ease; }
.th-speed:hover { background: rgba(255, 255, 255, .26); }
#langList button[disabled] { opacity: .45; cursor: default; }
#langList button[disabled]:hover { background: none; transform: none; }
#langList small { margin-inline-start: auto; color: var(--sub); }

/* Темы */
html[data-resolved="light"] { color-scheme: light; --page: #f5f5f7; --pop: #fff; --ink: 0, 0, 0; --bg2: rgba(0, 0, 0, .045); --tile: rgba(255, 255, 255, .82); --text: #1d1d1f; --sub: #6e6e73; --line: rgba(0, 0, 0, .13); --blue: #0071e3; --link: #0066cc; --green: #1a7f37; --green-bg: #e3f6e8; --red: #d70015; --red-bg: #fdecee; --glass: rgba(250, 250, 252, .74); }
html[data-resolved="light"] .tile { background: rgba(255, 255, 255, .78); }
html[data-resolved="light"] .aurora i { opacity: .13; }
html[data-resolved="ocean"] { --page: #03141f; --pop: #0b2636; --sub: #9db8c6; --glass: rgba(3, 20, 31, .7); --a: #30d1c8; }
html[data-resolved="sunset"] { --page: #1b0b12; --pop: #2d1521; --sub: #c4a9b2; --glass: rgba(27, 11, 18, .7); }
html[data-resolved="forest"] { --page: #06140d; --pop: #10291c; --sub: #a3bfae; --glass: rgba(6, 20, 13, .7); }
.nav-theme { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: rgba(var(--ink), .08); color: var(--text); transition: transform 140ms var(--ease), background-color 160ms ease; }
.nav-theme:hover { background: rgba(var(--ink), .2); }
.nav-theme:active { transform: scale(.9); }
.nav-theme i { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(from 90deg, var(--text) 50%, transparent 0); box-shadow: inset 0 0 0 1.6px var(--text); }
#themeList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }
#themeList button { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 0; border-radius: 16px; background: rgba(var(--ink), .06); color: var(--text); font: 500 .9375rem/1.2 var(--font); text-align: start; cursor: pointer; transition: transform 160ms var(--ease), background-color 160ms ease; }
#themeList button:hover { transform: translateY(-2px); background: rgba(var(--ink), .12); }
#themeList button.on { box-shadow: inset 0 0 0 2px var(--blue); }
#themeList i { display: block; height: 58px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .3); }

/* 3D */
.map3d { position: relative; height: calc(100dvh - 48px); overflow: hidden; }
.map3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-head { position: absolute; left: 16px; bottom: 16px; max-width: 340px; padding: 14px 18px; border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); pointer-events: none; z-index: 120; }
.map-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.05; letter-spacing: -.032em; margin: 0 0 6px; }
.map-head p { color: var(--sub); margin: 0; font-size: .9375rem; line-height: 1.35; }
.map-head a { pointer-events: auto; }
#mapLabels { position: absolute; inset: 0; pointer-events: none; }
.map-label { position: absolute; left: 0; top: 0; pointer-events: auto; padding: 3px 10px; border-radius: 980px; white-space: nowrap; color: var(--text); font-size: .8125rem; font-weight: 500; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background-color 150ms ease, color 150ms ease; }
.map-label:hover { background: var(--blue); color: #fff; }
.obj3d { display: block; width: 100%; border-radius: 16px; background: rgba(var(--ink), .03); margin-bottom: 12px; }
.tl { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 12px; cursor: grab; scrollbar-width: none; user-select: none; }
.tl::-webkit-scrollbar { display: none; }
.tl.drag { cursor: grabbing; scroll-snap-type: none; }
.tl-c { flex: 0 0 min(300px, 78%); scroll-snap-align: start; }
.tl-c strong { display: block; margin-top: 10px; font-size: 1.75rem; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-c h4 { margin: 2px 0 4px; font-size: 1.125rem; letter-spacing: -.02em; }
.tl-c span { color: var(--sub); font-size: .9375rem; line-height: 1.4; display: block; }
.tl-i { height: 190px; border-radius: 16px; overflow: hidden; background: rgba(var(--ink), .08); }
.tl-i img { width: 100%; height: 100%; object-fit: cover; display: block; will-change: transform; }
.tl-e { display: grid; place-items: center; background: var(--grad); color: #fff; }
.tl-e b { font-size: 1.75rem; letter-spacing: -.03em; }

/* Программа: разворачивающиеся разделы */
.prog-list { display: grid; gap: 10px; }
.prog { border-radius: 22px; background: var(--bg2); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); transition: background-color 240ms ease, opacity 800ms var(--ease), translate 800ms var(--ease), scale 800ms var(--ease); overflow: hidden; }
.prog.open { background: rgba(var(--ink), .1); }
.prog-h { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: transform 160ms var(--ease); }
.prog-h:active { transform: scale(.985); }
.prog-t { flex: 1; min-width: 0; }
.prog-t b { display: block; font-size: 1.1875rem; letter-spacing: -.02em; line-height: 1.2; }
.prog-t small { display: block; color: var(--sub); font-size: .9375rem; line-height: 1.3; margin-top: 2px; }
.prog-c { color: var(--sub); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.prog-ring { flex: none; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 360deg), rgba(var(--ink), .12) 0); -webkit-mask: radial-gradient(closest-side, transparent 72%, #000 74%); mask: radial-gradient(closest-side, transparent 72%, #000 74%); }
.prog-x { position: relative; flex: none; width: 16px; height: 16px; transition: transform 340ms var(--ease); }
.prog-x::before, .prog-x::after { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; border-radius: 1px; background: var(--text); }
.prog-x::after { transform: rotate(90deg); transition: transform 340ms var(--ease); }
.prog.open .prog-x { transform: rotate(180deg); }
.prog.open .prog-x::after { transform: rotate(0); }
.prog-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 420ms var(--ease); }
.prog.open .prog-b { grid-template-rows: 1fr; }
.prog-row { list-style: none; margin: 0; padding: 0 8px; min-height: 0; overflow: hidden; }
.prog.open .prog-row { padding-bottom: 8px; }
.prog-row li { opacity: 0; transform: translateY(-8px); transition: opacity 300ms ease, transform 340ms var(--ease); }
.prog.open .prog-row li { opacity: 1; transform: none; }
.prog.open .prog-row li:nth-child(2) { transition-delay: 40ms; } .prog.open .prog-row li:nth-child(3) { transition-delay: 80ms; } .prog.open .prog-row li:nth-child(4) { transition-delay: 120ms; } .prog.open .prog-row li:nth-child(5) { transition-delay: 160ms; } .prog.open .prog-row li:nth-child(6) { transition-delay: 200ms; }
.prog-row a { display: flex; align-items: center; gap: 12px; padding: 11px 10px; min-height: 44px; border-radius: 12px; color: var(--text); }
.prog-row a:hover { background: rgba(var(--ink), .09); }
.prog-row .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgba(var(--ink), .2); }
.prog-row .dot.on { background: var(--green); }
.prog-row .t { flex: 1; min-width: 0; line-height: 1.25; }
.prog-row .s { color: var(--sub); font-size: .875rem; white-space: nowrap; }

/* Тесты */
.tests-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.test-card { position: relative; display: block; padding: 22px; min-height: 130px; border-radius: 22px; background: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); overflow: hidden; transition: transform 200ms var(--ease), background-color 180ms ease, opacity 800ms var(--ease), translate 800ms var(--ease), scale 800ms var(--ease); }
.test-card b { display: block; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 6px; }
.test-card span { color: var(--sub); font-size: .9375rem; }
.test-card:active { transform: scale(.98); }
.test-card.big { grid-column: span 3; min-height: 150px; background: var(--grad); color: #fff; }
.test-card.big span { color: rgba(255, 255, 255, .85); }
.test-card.big b { font-size: 2rem; }
.test-card.warn { background: linear-gradient(120deg, #ff453a, #ff8a3d); }
@media (hover: hover) and (pointer: fine) { .test-card:hover { transform: translateY(-4px); } }

/* Разбор кода */
.walk { display: grid; gap: 6px; }
.walk-l { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: #1c1c1e; color: #f5f5f7; text-align: start; font: inherit; cursor: pointer; transition: background-color 150ms ease, transform 120ms var(--ease); }
.walk-l:hover { background: #2c2c30; }
.walk-l:active { transform: scale(.99); }
.walk-l code { background: none; padding: 0; color: #f5f5f7; white-space: pre-wrap; word-break: break-word; font-size: .875rem; }
.walk-l span { display: grid; grid-template-rows: 0fr; margin-top: 0; color: #8fd0ff; font-size: .9688rem; line-height: 1.35; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 300ms var(--ease), opacity 220ms ease, margin-top 240ms ease; }
.walk-l.open span { max-height: 90px; opacity: 1; margin-top: 8px; }

/* Наставник */
.mentor-btn { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 56px; height: 56px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: var(--grad); box-shadow: 0 12px 34px -8px var(--a); transition: transform 180ms var(--ease); }
.mentor-btn:hover { transform: scale(1.08); }
.mentor-btn:active { transform: scale(.92); }
.mentor { position: fixed; right: 20px; bottom: 88px; z-index: 31; width: min(400px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 130px)); display: flex; flex-direction: column; border-radius: 24px; background: var(--pop); color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(var(--ink), .1); opacity: 0; visibility: hidden; transform: translateY(16px) scale(.96); transform-origin: bottom right; transition: opacity 200ms ease, transform 300ms var(--ease), visibility 200ms; }
.mentor.open { opacity: 1; visibility: visible; transform: none; }
.mentor header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
.mentor header b { font-size: 1.125rem; }
.mentor header button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(var(--ink), .1); color: var(--text); font-size: 18px; cursor: pointer; }
#mList { flex: 1; overflow: auto; padding: 0 14px; display: grid; gap: 8px; align-content: start; }
.m-msg { max-width: 92%; padding: 10px 14px; border-radius: 18px; background: rgba(var(--ink), .08); font-size: .9688rem; line-height: 1.38; animation: rise 260ms var(--ease) both; }
.m-msg.me { justify-self: end; background: var(--blue); color: #fff; }
.m-msg p { margin: 0 0 6px; }
.m-msg p:last-child { margin: 0; }
.m-go, .m-more { display: block; margin: 2px 0 8px; font-weight: 500; }
.m-more { color: var(--sub); font-weight: 400; font-size: .875rem; margin: 6px 0 0; }
.m-hide { color: var(--link); cursor: pointer; }
#mChips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 4px; scrollbar-width: none; }
#mChips button { flex: none; padding: 8px 12px; border: 0; border-radius: 980px; background: rgba(var(--ink), .1); color: var(--text); font: 500 .875rem/1 var(--font); cursor: pointer; }
#mChips button:hover { background: rgba(var(--ink), .2); }
#mForm { display: flex; gap: 8px; padding: 10px 14px 14px; }
#mForm input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: 12px; background: rgba(var(--ink), .08); color: var(--text); font: 400 1rem/1.3 var(--font); }

/* Сцены видеоурока */
.th-shade { position: absolute; inset: auto 0 0 0; height: 46%; background: linear-gradient(transparent, rgba(0, 0, 0, .86)); pointer-events: none; }
.th-stage { inset: 0 0 58px !important; justify-content: flex-end !important; padding: 8px 4cqw !important; pointer-events: none; }
.th-cap { margin: 0; max-width: 34em; font-size: clamp(.875rem, 2.5cqw, 2rem); line-height: 1.24; letter-spacing: -.02em; font-weight: 600; animation: rise 300ms var(--ease) both; text-shadow: 0 2px 16px rgba(0, 0, 0, .8); }
.th-cap.pt { padding: 12px 22px; border-radius: 18px; background: rgba(0, 0, 0, .5); }
.th-cap span { color: rgba(255, 255, 255, .4); transition: color 160ms ease; }
.th-cap span.on { color: #fff; }
.th-rem-wrap { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; background: rgba(0, 0, 0, .62); }

/* Нижнее меню для телефонов */
.tabs { display: none; }
@media (max-width: 760px) {
  .nav nav { display: none; }
  .nav-brand { display: block !important; }
  .nav-in { justify-content: space-between; padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .nav-sound, .nav-search { width: 40px; height: 40px; } .nav-theme { width: 40px; height: 40px; } .nav-lang { height: 40px; }
  .nav-in { gap: 6px; } .nav-brand { flex: 1; font-size: 1.0625rem; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: inset 0 1px 0 rgba(var(--ink), .1); }
  .tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 48px; color: var(--sub); font-size: .625rem; letter-spacing: 0; transition: transform 120ms var(--ease), color 150ms ease; }
  .tabs a:active { transform: scale(.9); }
  .tabs a[aria-current="page"] { color: var(--blue); }
  .tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .mentor-btn { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .mentor { left: 8px; right: 8px; width: auto; bottom: calc(68px + env(safe-area-inset-bottom)); height: min(72dvh, calc(100dvh - 140px)); }
  .tests-grid { grid-template-columns: 1fr; }
  .test-card.big { grid-column: auto; }
  .choice, .btn { min-height: 44px; }
  .pin { height: 280vh; }
  .th-host { border-radius: 18px; }
  .th-big { width: 68px; height: 68px; }
  .th-time, .th-speed { font-size: .75rem; }
  .th-speed { height: 30px; padding: 0 8px; }
}
@media (max-width: 400px) { .nav-brand { display: none !important; } }
html[dir="rtl"] .mentor-btn { right: auto; left: 20px; }

/* 3D-объекты в шапках */
.head, .l-head { position: relative; }
.orb-3d { display: block; width: 240px; height: 240px; margin: 0 auto -16px; }
.head .orb-3d { position: absolute; right: 10px; top: 24px; width: min(300px, 34vw); height: min(300px, 34vw); margin: 0; }
.head h1, .head p, .head .crumb, .head .btn-row { position: relative; z-index: 1; }
.head p { max-width: 58%; }
.rise { rotate: 1 0 0 9deg; transform-origin: 50% 100%; transition: opacity 800ms var(--ease), translate 800ms var(--ease), scale 800ms var(--ease), rotate 800ms var(--ease); }
.rise.in { rotate: 1 0 0 0deg; }
.bento, .facts, .prog-list, .tests-grid, .lab-grid, .notes, .links3 { perspective: 1400px; }

/* Интерактивная форма на главной */
.play3d { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.play3d canvas { width: 100%; aspect-ratio: 1; }
.shape-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Страница прогресса */
.me { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; margin-bottom: 28px; }
.me-net { position: relative; aspect-ratio: 1; }
.me-net canvas { width: 100%; height: 100%; display: block; }
.me-tip { position: absolute; left: 50%; bottom: 6px; translate: -50% 8px; max-width: 92%; padding: 7px 14px; border-radius: 980px; background: var(--pop); color: var(--text); font-size: .9375rem; font-weight: 500; opacity: 0; transition: opacity 160ms ease, translate 200ms var(--ease); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 1px rgba(var(--ink), .14); }
.me-tip.on { opacity: 1; translate: -50% 0; pointer-events: auto; }
.me small { color: var(--sub); }
.me h2 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.034em; margin: 2px 0 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.xp { height: 10px; border-radius: 5px; background: rgba(var(--ink), .1); overflow: hidden; margin: 6px 0 8px; }
.xp i { display: block; height: 100%; border-radius: 5px; background: var(--grad); transform-origin: left; transform: scaleX(0); transition: transform 1100ms var(--ease) 200ms; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stats3 div { padding: 12px 14px; border-radius: 16px; background: var(--bg2); }
.stats3 b { display: block; font-size: 1.5rem; letter-spacing: -.03em; }
.stats3 span { color: var(--sub); font-size: .8125rem; line-height: 1.2; display: block; }
@media (max-width: 760px) {
  .me, .play3d { grid-template-columns: 1fr; }
  .head .orb-3d { position: relative; right: auto; top: auto; width: 180px; height: 180px; margin: -10px auto 0; }
  .head p { max-width: none; }
  .orb-3d { width: 170px; height: 170px; }
}

/* Урок по шагам */
.stepper { position: sticky; top: 50px; z-index: 7; display: flex; gap: 6px; justify-content: safe center; max-width: 100%; margin: 0 auto 8px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 5px 13px 5px 6px; border: 0; border-radius: 980px; background: rgba(var(--ink), .07); color: var(--sub); font: 500 .875rem/1 var(--font); cursor: pointer; transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease); }
.stepper button:active { transform: scale(.95); }
.stepper button:hover { background: rgba(var(--ink), .15); color: var(--text); }
.stepper i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(var(--ink), .12); font-style: normal; font-size: .75rem; }
.stepper .on { background: var(--blue); color: #fff; }
.stepper .on i { background: rgba(255, 255, 255, .25); }
.stepper .done i { background: var(--green); color: #fff; }
.step { display: none; }
.step.on { display: block; animation: step-in 420ms var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(20px); } }
html[dir="rtl"] .step.on { animation-name: rise; }
.step.on .facts li { animation: rise 460ms var(--ease) both; }
.step.on .notes li { animation: rise 460ms var(--ease) both; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; max-width: calc(var(--read) + 44px); margin: 0 auto; padding: 8px 22px 64px; }
.stmt { margin: 8px 0 34px; font-size: clamp(1.75rem, 5vw, 3rem); line-height: 1.12; font-weight: 700; letter-spacing: -.03em; }
.l-head { padding-top: 12px !important; padding-bottom: 8px !important; }
.l-head h1 { font-size: clamp(2rem, 5.4vw, 3.5rem) !important; }
.l-head .orb-3d { width: 130px; height: 130px; margin-bottom: -4px; }

/* Следующий шаг на главной */
.next-step { text-align: center; }
.next-card { position: relative; display: block; max-width: 620px; margin: 0 auto; padding: 30px; border-radius: 28px; background: var(--grad); color: #fff; overflow: hidden; transition: transform 220ms var(--ease), box-shadow 220ms ease; }
.next-card small { display: block; opacity: .85; font-size: 1rem; }
.next-card b { display: block; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.1; letter-spacing: -.03em; margin: 4px 0; }
.next-card:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .next-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 24px 60px -18px var(--a); } }

/* Карточки сравнения */
.cmp { display: grid; gap: 10px; }
.cmp-c { display: block; width: 100%; padding: 16px 18px; border: 0; border-radius: 18px; background: var(--bg2); color: var(--text); font: inherit; text-align: start; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); transition: background-color 180ms ease, transform 140ms var(--ease); }
.cmp-c:hover { background: rgba(var(--ink), .12); }
.cmp-c:active { transform: scale(.99); }
.cmp-c > b { font-size: 1.1875rem; letter-spacing: -.02em; }
.cmp-b { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 340ms var(--ease), opacity 220ms ease, margin-top 240ms ease; }
.cmp-c.open .cmp-b { max-height: 220px; opacity: 1; margin-top: 12px; }
.cmp-b small { display: block; color: var(--sub); font-size: .8125rem; margin-bottom: 2px; }
.cmp-b span { font-size: .9688rem; line-height: 1.32; }

/* Терминал */
.term { padding: 14px; border-radius: 14px; background: #0c0c0f; color: #e8e8ee; font: 400 .9375rem/1.45 var(--mono); }
#tOut { max-height: 180px; overflow: auto; margin-bottom: 4px; }
#tOut .cmdl { color: #8fd0ff; } #tOut .err { color: #ff6961; }
#tForm { display: flex; gap: 8px; align-items: center; }
#tForm span { color: #30d158; }
.tool #tForm input { flex: 1; margin: 0; padding: 4px 0; border: 0; border-radius: 0; background: none; color: #fff; font: inherit; outline: none; }
.term-steps { display: flex; gap: 6px; margin-top: 12px; }
.term-steps i { flex: 1; height: 5px; border-radius: 3px; background: rgba(var(--ink), .14); transition: background-color 240ms ease; }
.term-steps i.on { background: var(--green); }

/* Игра */
.game-wrap { padding-top: 22px; padding-bottom: 40px; }
.game-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; margin-bottom: 12px; }
.game-head h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.03em; }
.game-hud { display: flex; gap: 18px; color: var(--sub); }
.game-hud b { color: var(--text); font-variant-numeric: tabular-nums; }
#gLives { color: #ff453a; letter-spacing: 2px; }
.game-box { --ink: 255, 255, 255; --text: #f5f5f7; --sub: #a1a1a6; position: relative; height: min(68vh, 620px); border-radius: 24px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #15152a, #050507); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); color: #f5f5f7; user-select: none; -webkit-user-select: none; }
.game-box canvas { width: 100%; height: 100%; display: block; }
.game-ctx { position: absolute; left: 14px; right: 126px; top: 14px; height: 18px; border-radius: 9px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.game-ctx i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); transition: transform 180ms ease; }
.game-ctx span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .6875rem; font-weight: 600; }
.game-compact { position: absolute; right: 12px; top: 8px; min-height: 30px !important; padding: 6px 12px !important; font-size: .8125rem !important; }
.game-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: rgba(0, 0, 0, .66); transition: opacity 260ms ease, visibility 260ms; }
.game-over.off { opacity: 0; visibility: hidden; }
.game-over h2 { margin: 0; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.03em; }
.game-over p { margin: 0 0 8px; max-width: 30em; color: #d6d6db; }
.game-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: start; }
.game-rules li { display: flex; align-items: center; gap: 10px; }
.game-rules i { flex: none; width: 14px; height: 14px; border-radius: 4px; }
@media (max-width: 760px) {
  .stepper { top: 48px; justify-content: flex-start; padding: 6px 12px; }
  .stepper button span { display: none; }
  .stepper button { padding: 5px; }
  .stepper .on span { display: inline; padding-inline-end: 8px; }
  .step-nav { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 6; padding: 8px 16px; background: linear-gradient(transparent, var(--page) 40%); }
  .step-nav .btn { flex: 1; justify-content: center; }
  .cmp-b { grid-template-columns: 1fr; }
  .cmp-c.open .cmp-b { max-height: 300px; }
  .game-box { height: calc(100dvh - 210px); }
  .mentor-btn { bottom: calc(138px + env(safe-area-inset-bottom)); }
}

/* Выпадающие списки читаются во всех темах */
:root { --menu: #2c2c30; }
html[data-resolved="light"] { --menu: #fff; }
html[data-resolved="ocean"] { --menu: #0f2f42; }
html[data-resolved="sunset"] { --menu: #38192a; }
html[data-resolved="forest"] { --menu: #143524; }
.tool select { background-color: var(--menu); color: var(--text); }
.tool select option, .tool select optgroup { background-color: var(--menu); color: var(--text); }
.th-host .tool select, .th-host .tool select option { background-color: #2c2c30; color: #f5f5f7; }
@media (max-width: 760px) {
  .tabs { padding-left: 2px; padding-right: 2px; }
  .tabs a { font-size: .5625rem; }
  .tabs svg { width: 22px; height: 22px; }
}
.lab-card em .go { display: inline-block; color: inherit; }

/* Значок Netlify на компьютере не должен закрывать Джарвиса */
@media (min-width: 761px) {
  html.has-badge .mentor-btn { bottom: 78px; }
  html.has-badge .mentor { bottom: 146px; }
}

/* Четыре шага на главной */
.four { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: st; }
.four li { counter-increment: st; padding: 20px; border-radius: 20px; background: var(--bg2); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); }
.four li::before { content: counter(st); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 600; font-size: .9375rem; }
.four b { display: block; font-size: 1.25rem; letter-spacing: -.02em; margin-bottom: 4px; }
.four span { color: var(--sub); font-size: .9688rem; line-height: 1.35; }
@media (max-width: 760px) { .four { grid-template-columns: 1fr 1fr; } }
.mentor header b small { display: block; color: var(--sub); font-size: .75rem; font-weight: 400; }
.mentor header b small[hidden] { display: none; }

/* На телефоне переход только мягко проявляется: так нет рывка и задержки */
@media (max-width: 760px), (hover: none) {
  ::view-transition-group(root), ::view-transition-group(shared) { animation-duration: 220ms; }
  ::view-transition-old(root) { animation: vt-fade-out 120ms ease both; }
  ::view-transition-new(root) { animation: vt-fade-in 220ms ease both; }
  html[data-dir="back"]::view-transition-old(root) { animation-name: vt-fade-out; }
  html[data-dir="back"]::view-transition-new(root) { animation-name: vt-fade-in; }
  .step.on { animation-duration: 240ms; }
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
.m-note { margin: 2px 14px 0; color: var(--sub); font-size: .75rem; line-height: 1.3; }

/* Новости */
.news-tags { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.news-tags::-webkit-scrollbar { display: none; }
.news-tags button { flex: none; min-height: 38px; padding: 8px 14px; border: 0; border-radius: 980px; background: rgba(var(--ink), .08); color: var(--text); font: 500 .9375rem/1 var(--font); cursor: pointer; transition: background-color 160ms ease, transform 140ms var(--ease); }
.news-tags button:active { transform: scale(.95); }
.news-tags button:hover { background: rgba(var(--ink), .16); }
.news-tags button.on { background: var(--blue); color: #fff; }
.news-list { display: grid; gap: 12px; }
.news-card { position: relative; display: block; padding: 18px 20px; border-radius: 20px; background: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); overflow: hidden; animation: rise 420ms var(--ease) both; transition: transform 180ms var(--ease), background-color 160ms ease; }
.news-card:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .news-card:hover { transform: translateY(-3px); background: rgba(var(--ink), .11); } }
.news-card small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--sub); font-size: .8125rem; margin-bottom: 6px; }
.news-card small i { padding: 2px 8px; border-radius: 980px; font-style: normal; font-weight: 600; color: #fff; background: var(--blue); }
.news-card small i.t-released { background: #1a9e4b; }
.news-card small i.t-closed { background: #d70015; }
.news-card small i.t-money { background: #b25000; }
.news-card b { display: block; font-size: 1.1875rem; line-height: 1.25; letter-spacing: -.02em; }
.news-card span { display: block; margin-top: 6px; color: var(--sub); line-height: 1.4; }
.news-card.skel { height: 118px; animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .45; } }
.news-empty { color: var(--sub); padding: 24px 0; }
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 0 0 62px; }
}

.news-time { margin-top: 6px !important; font-size: .875rem !important; font-weight: 400 !important; color: var(--sub); }

/* Выбор игры */
.games { display: grid; gap: 14px; max-width: calc(var(--read) + 44px); }
.game-pick { position: relative; display: block; padding: 24px; border-radius: 24px; background: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); overflow: hidden; transition: transform 200ms var(--ease); }
.game-pick.main { padding: 32px 24px; background: var(--grad); color: #fff; }
.game-pick b { display: block; font-size: 1.625rem; letter-spacing: -.025em; margin-bottom: 4px; }
.game-pick span { color: var(--sub); line-height: 1.4; }
.game-pick.main span { color: rgba(255, 255, 255, .88); }
.game-pick:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .game-pick:hover { transform: translateY(-3px); } }

/* Оператор агентов */
.op { padding-top: 18px; max-width: 860px; }
.op-intro { text-align: center; padding: 11vh 0; }
.op-intro h1 { font-size: clamp(2.5rem, 7vw, 4rem); line-height: 1.05; letter-spacing: -.034em; margin: 0 0 12px; }
.op-intro p { max-width: 32em; margin: 0 auto 24px; color: var(--sub); font-size: 1.125rem; }
.op-intro small { display: block; margin-top: 18px; color: var(--sub); }
.op-hud { position: sticky; top: 50px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--sub); font-size: .9375rem; }
.op-hud b { color: var(--text); font-variant-numeric: tabular-nums; }
.op-rep { color: #ff453a; letter-spacing: 2px; }
.op-rep i { color: rgba(var(--ink), .18); font-style: normal; }
.op-job h1, .op-run h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 6px; }
.op-job p { margin: 0 0 12px; color: var(--sub); font-size: 1.0625rem; }
.op-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.op-tags i { padding: 5px 10px; border-radius: 980px; background: rgba(var(--ink), .09); font-style: normal; font-size: .8125rem; font-weight: 500; }
.op-tags .pay { background: var(--green-bg); color: var(--green); }
.op h2 { font-size: 1.125rem; letter-spacing: -.02em; margin: 22px 0 8px; }
.op-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.op-grid.tools { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.op-card { position: relative; display: block; width: 100%; min-height: 100px; padding: 12px; border: 0; border-radius: 16px; background: var(--bg2); color: var(--text); font: inherit; text-align: start; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(var(--ink), .08); transition: transform 140ms var(--ease), box-shadow 160ms ease, background-color 160ms ease, opacity 160ms ease; }
.op-card:active:not([disabled]) { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .op-card:hover:not([disabled]) { background: rgba(var(--ink), .12); } }
.op-card[disabled] { opacity: .4; cursor: default; }
.op-card.on { box-shadow: inset 0 0 0 2px var(--blue); background: rgba(41, 151, 255, .14); }
.op-card b { display: block; font-size: 1rem; letter-spacing: -.015em; line-height: 1.2; padding-inline-end: 34px; }
.op-card span { display: block; margin-top: 3px; color: var(--sub); font-size: .8125rem; line-height: 1.3; }
.op-card em { position: absolute; top: 12px; inset-inline-end: 12px; font-style: normal; font-size: .8125rem; font-weight: 600; color: var(--sub); }
.op-panel { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; padding: 16px; border-radius: 20px; background: var(--pop); box-shadow: 0 16px 50px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(var(--ink), .1); }
.op-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.op-stats small { display: block; color: var(--sub); font-size: .75rem; }
.op-stats b { font-size: 1.5rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.op-stats .g { color: var(--green); } .op-stats .y { color: #ff9f0a; } .op-stats .r { color: var(--red); }
.op-risks { display: grid; gap: 4px; margin-bottom: 12px; }
.op-risks div { display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; gap: 8px; align-items: center; font-size: .8125rem; color: var(--sub); }
.op-risks i { display: block; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(var(--ink), .1); }
.op-risks u { display: block; height: 100%; background: var(--red); transform-origin: left; transition: transform 220ms var(--ease); }
.op-risks b { text-align: end; font-weight: 500; }
.op-panel .btn { width: 100%; justify-content: center; }
.op-log { list-style: none; margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: #0c0c0f; color: #d6d6db; font: 400 .9375rem/1.7 var(--mono); }
.op-log li { animation: rise 280ms var(--ease) both; }
.op-log li::before { content: "› "; color: #30d158; }
.op-log .bad { color: #ff6961; font-weight: 600; }
.op-log .bad::before { color: #ff6961; }
.op-result { padding: 18px; border-radius: 20px; animation: rise 340ms var(--ease) both; }
.op-result.ok { background: var(--green-bg); }
.op-result.bad { background: var(--red-bg); }
.op-result h2 { margin: 0 0 6px; font-size: 1.5rem; }
.op-result p { margin: 0 0 14px; }
@media (max-width: 760px) {
  .op-grid { grid-template-columns: repeat(2, 1fr); }
  .op-grid.tools { grid-template-columns: repeat(2, 1fr); }
  .op-card { min-height: 92px; }
  .op-panel { bottom: calc(74px + env(safe-area-inset-bottom)); padding: 12px; }
  .op-stats b { font-size: 1.25rem; }
  .op-hud { top: 48px; }
}
