/* Решатели — экраны приложения. Цвета и шрифты — токены из design.css (DESIGN.md). */

.wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 0 56px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--hairline); margin-bottom: 24px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--canvas); z-index: 5; }
.top a { display: flex; align-items: center; }
.logo { height: 64px; width: calc(64px * 520 / 216); }
@media (max-width: 480px) { .logo { height: 50px; width: calc(50px * 520 / 216); } }
.top-right { display: flex; gap: 8px; align-items: center; }
.chip-btn { font: 500 13px/1.3 var(--font); padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: transparent; color: var(--steel); cursor: pointer; text-decoration: none; }
.chip-btn:hover { color: var(--ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--steel); margin-bottom: 8px; }
.crumbs a { color: var(--steel); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.stack { display: grid; gap: 16px; }
.screen-title { margin-bottom: 4px; }
a { color: inherit; }

/* Профили */
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
@media (max-width: 520px) { .profiles { grid-template-columns: minmax(0, 1fr); } }
.profile { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 24px; border-radius: var(--r-12); text-decoration: none; color: var(--charcoal); border: 0; cursor: pointer; font: inherit; }
.profile .stage { width: 150px; }
.profile:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Приветствие */
.hello { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px; border-radius: var(--r-12); background: var(--surface); }
.hello .stage { width: 140px; }
.bubble { position: relative; background: var(--card); border-radius: var(--r-12); padding: 16px 18px; box-shadow: var(--shadow-1); }
.bubble::before { content: ""; position: absolute; left: -8px; top: 50%; width: 16px; height: 16px; background: var(--card); transform: translateY(-50%) rotate(45deg); border-radius: 3px; }
.bubble .who { font-size: 13px; color: var(--steel); margin: 0 0 4px; }
.bubble .t-h4 { position: relative; }
@media (max-width: 520px) { .hello { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 16px; } .hello .stage { width: 96px; } }

.nav-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .nav-grid { grid-template-columns: minmax(0, 1fr); } }
.nav-card { display: grid; gap: 6px; padding: 20px; border-radius: var(--r-12); text-decoration: none; color: var(--charcoal); min-height: 112px; align-content: start; }
.nav-card .t-h5 { display: flex; justify-content: space-between; gap: 8px; }
.nav-card.off { opacity: 0.6; }
.nav-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Рубрикатор */
.subject { display: grid; gap: 8px; }
.subject-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topic-list { border: 1px solid var(--hairline); border-radius: var(--r-12); overflow: hidden; }
.topic-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hairline-soft); text-decoration: none; color: var(--ink); background: var(--card); }
.topic-row:last-child { border-bottom: 0; }
.topic-row.soon { color: var(--muted); cursor: default; }
a.topic-row:hover { background: var(--surface-soft); }
.status { font: 600 12px/1.4 var(--font); padding: 2px 8px; border-radius: var(--r-6); white-space: nowrap; }
.st-new { background: var(--surface); color: var(--steel); }
.st-work { background: var(--tint-lavender); color: var(--tint-lavender-ink); }
.st-trainer { background: var(--tint-peach); color: var(--tint-peach-ink); }
.st-done { background: var(--tint-mint); color: var(--tint-mint-ink); }
.st-check { background: var(--tint-sky); color: var(--charcoal); }
.st-soon { background: transparent; color: var(--muted); border: 1px solid var(--hairline); }
.note-empty { padding: 16px; border-radius: var(--r-12); background: var(--surface); color: var(--slate); font-size: 14px; margin: 0; }

/* Тема: вкладки */
.seg { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin: 16px 0 20px; overflow-x: auto; }
.seg a { padding: 10px 14px; font: 500 14px/1.5 var(--font); color: var(--steel); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.seg a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Эксплейнер */
.ex-sec { display: grid; gap: 12px; padding: 24px; border: 1px solid var(--hairline); border-radius: var(--r-12); background: var(--card); scroll-margin-top: 80px; }
.ex-sec.flash { box-shadow: 0 0 0 3px var(--tint-lavender); }
.ex-body p, .ex-body ol { margin: 0; }
.ex-body { display: grid; gap: 8px; color: var(--charcoal); }
.steps { padding-left: 22px; display: grid; gap: 6px; }
.play { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-12); background: var(--surface-soft); border: 1px solid var(--hairline-soft); }
.play-task { margin: 0; font-weight: 600; color: var(--ink); }
.play-fig { max-width: 440px; width: 100%; }
.play-msg { margin: 0; font-size: 14px; color: var(--steel); min-height: 1.5em; }
.play:has(.play-fig.matched) .play-msg { color: var(--tint-mint-ink); font-weight: 600; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--slate); }
.readout b { color: var(--ink); }
.range { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; color: var(--slate); }
.range input { width: 100%; accent-color: var(--primary); height: 28px; }
.rule { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-12); background: var(--tint-yellow); }
.rule p { margin: 0; color: var(--charcoal); }
.say { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 480px) { .say { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; } }
.say-text { margin: 0; padding: 12px 14px; border-radius: var(--r-12); background: var(--surface); color: var(--charcoal); font-size: 15px; }
.fig { max-width: 420px; }
.proof { display: grid; gap: 4px; }
.proof p { margin: 0; color: var(--charcoal); }
.ex-end { display: grid; gap: 12px; justify-items: start; padding: 24px; border-radius: var(--r-12); background: var(--tint-lavender); }

/* Чертежи */
.geo { display: block; width: 100%; height: auto; max-width: 100%; overflow: visible; }
.g-tri { fill: var(--tint-lavender); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.g-tri-over { fill: var(--tint-sky); fill-opacity: 0.7; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 5 4; stroke-linejoin: round; }
.g-tri-over.hit { fill: var(--tint-mint); stroke: var(--success); stroke-dasharray: none; }
.matched .g-tri { fill: var(--tint-mint); stroke: var(--success); }
.g-ghost { fill: none; stroke: var(--steel); stroke-width: 2; stroke-dasharray: 6 6; }
.g-line { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.g-ray { stroke: var(--steel); stroke-width: 1.5; stroke-dasharray: 3 4; }
.g-arc { fill: none; stroke: var(--accent-line); stroke-width: 2.5; }
.g-mark { stroke: var(--accent-line); stroke-width: 2.5; stroke-linecap: round; }
.g-lab { font-family: var(--font); font-size: 15px; font-weight: 700; fill: var(--ink); }
.g-len { font-family: var(--font-mono); font-size: 12px; fill: var(--steel); }
.g-frame { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.g-joint { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.g-dot { stroke: var(--card); stroke-width: 2; }
.g-dot.v1 { fill: var(--primary); } .g-dot.v2 { fill: var(--warning); } .g-dot.v3 { fill: var(--success); }
/* медиана, биссектриса и высота в объяснении — каждая своим цветом, как точки-пары */
.g-cev { stroke-width: 3; stroke-linecap: round; }
.g-cev.c1 { stroke: var(--primary); } .g-cev.c2 { stroke: var(--warning); } .g-cev.c3 { stroke: var(--success); }
.play .chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Задание */
.task { display: grid; gap: 14px; }
.task-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--hairline-soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .3s; }
.task-text { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ink); white-space: pre-line; font-weight: 500; }
.task-fig { padding: 8px; border-radius: var(--r-12); border: 1px solid var(--hairline); background: var(--card); max-width: 460px; }
.hint { padding: 12px 14px; border-radius: var(--r-12); background: var(--tint-yellow); font-size: 14px; color: var(--charcoal); margin: 0; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; font: 400 16px/1.4 var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--hairline-strong); border-radius: var(--r-8); padding: 12px 14px; min-height: 48px; cursor: pointer; }
.opt:hover:not(:disabled) { background: var(--surface-soft); }
.opt:disabled { cursor: default; }
.opt-k { flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-6); background: var(--tint-lavender); color: var(--tint-lavender-ink); font: 600 13px/1 var(--font-mono); }
.opt.wrong { border: 2px solid var(--error); background: var(--tint-rose); padding: 11px 13px; }
.opt.right { border: 2px solid var(--success); background: var(--tint-mint); padding: 11px 13px; }
.opt:focus-visible, .num input:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.num input { font: 500 18px/1.3 var(--font-mono); width: 140px; height: 48px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-8); background: var(--card); color: var(--ink); }
.num input:focus { border: 2px solid var(--primary); padding: 0 13px; outline: none; }
.num .unit { color: var(--steel); }
.num.wrong input { border: 2px solid var(--error); background: var(--tint-rose); }
.num.right input { border: 2px solid var(--success); background: var(--tint-mint); }
.fb { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px; border-radius: var(--r-12); }
.fb.err { background: var(--tint-rose); }
.fb.ok { background: var(--tint-mint); }
.fb-who { position: relative; }
.fb-who .solid-pill { position: absolute; left: -4px; bottom: -8px; transform: rotate(-6deg); }
.fb-body { display: grid; gap: 6px; min-width: 0; }
.fb-body p { margin: 0; color: var(--charcoal); font-size: 15px; line-height: 1.5; }
.fb-body .t-h5 { color: var(--ink); }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.trap-fig { max-width: 340px; margin-top: 6px; }
@media (max-width: 480px) { .fb { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } }

/* Тренажёр */
.coach { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-sky); }
.coach p { margin: 0; color: var(--charcoal); font-size: 15px; }
.ladder { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--steel); }
.ladder i { width: 22px; height: 6px; border-radius: 99px; background: var(--hairline); }
.ladder i.on { background: var(--primary); }
.toast { padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-lavender); color: var(--tint-lavender-ink); font-weight: 600; font-size: 14px; }
.summary { display: grid; gap: 12px; padding: 24px; border-radius: var(--r-12); background: var(--surface); }
.summary-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }

/* Прогресс */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .stats { grid-template-columns: minmax(0, 1fr); } }
.stat { padding: 16px; border-radius: var(--r-12); background: var(--surface); display: grid; gap: 2px; }
.stat b { font: 800 28px/1.2 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--steel); }
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--hairline-soft); background: var(--card); }
.skill-row:last-child { border-bottom: 0; }
.skill-row .bar { height: 8px; }
.skill-row .m { font: 500 13px/1 var(--font-mono); color: var(--steel); min-width: 28px; text-align: right; }
@media (max-width: 520px) { .skill-row { grid-template-columns: minmax(0, 1fr) 80px auto; } }
.stage { width: 100%; }
.banner { padding: 10px 14px; border-radius: var(--r-8); background: var(--tint-peach); color: var(--tint-peach-ink); font-size: 13px; }

/* ---------- монеты ---------- */
.coin-ico { width: 18px; height: 18px; vertical-align: -4px; display: inline-block; }
.coin-n { white-space: nowrap; }   /* число и монета после него не разрываются переносом */
.coins { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: var(--r-pill); background: var(--tint-yellow);
  color: var(--ink); text-decoration: none; font: 700 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.coins .coin-ico { width: 22px; height: 22px; }
.gain { margin: 4px 0 0; font-weight: 600; color: var(--ink); }
.solid-pill .coin-ico { width: 16px; height: 16px; vertical-align: -3px; margin-left: 3px; }
.solid-pill.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: rotate(-6deg) scale(0.4); } to { transform: rotate(-6deg) scale(1); } }
@media (max-width: 420px) { .who-small { display: none; } }

/* ---------- главная: свой герой ---------- */
.home-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px 20px; border-radius: var(--r-12); background: var(--surface); }
.home-scene { display: block; text-decoration: none; }
@media (max-width: 560px) { .home-hero { grid-template-columns: minmax(0, 1fr); } .home-hero .bubble::before { display: none; } }
.scene { position: relative; display: grid; grid-template-columns: 1fr; align-items: end; justify-items: center; padding-bottom: 4px; }
.scene-hero { width: 150px; max-width: 70%; position: relative; z-index: 2; }
.scene-object { position: absolute; left: 0; bottom: 6px; width: 30%; z-index: 1; }
.scene-pet { position: absolute; right: 0; bottom: 0; width: 26%; z-index: 3; animation: pet 2.4s ease-in-out infinite; }
@keyframes pet { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.item-svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- зеркало ---------- */
.mirror { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; margin-top: 16px; }
@media (max-width: 720px) { .mirror { grid-template-columns: minmax(0, 1fr); } }
.mirror-stage { position: relative; padding: 18px; border-radius: var(--r-12); background: var(--surface); display: grid; justify-items: center; position: sticky; top: 72px; }
@media (max-width: 720px) { .mirror-stage { position: relative; top: 0; padding: 12px; } .mirror-frame { max-width: 210px; } }
.mirror-frame { width: 100%; max-width: 300px; aspect-ratio: 3 / 4; border-radius: 50% / 42%; padding: 14px; background: linear-gradient(145deg, #e8e6e2, #b9b6b0); box-shadow: var(--shadow-2); }
.mirror-glass { width: 100%; height: 100%; border-radius: 50% / 42%; background: linear-gradient(160deg, var(--card) 0%, var(--surface) 60%, var(--hairline) 100%);
  display: grid; align-items: end; padding: 12% 10% 10%; overflow: hidden; }
.mirror-glass .scene-hero { width: 70%; }
.try-label { position: absolute; top: 24px; left: 24px; margin: 0; font: 600 12px/1 var(--font); padding: 5px 10px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); }
.mirror-panel { display: grid; gap: 14px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 4px; justify-items: center; align-content: start; padding: 10px 8px 12px; border-radius: var(--r-12);
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink); font: 500 13px/1.25 var(--font); cursor: pointer; text-align: center; }
.tile:hover { background: var(--surface-soft); }
.tile.on { border: 2px solid var(--primary); padding: 9px 7px 11px; }
.tile.locked .tile-art { opacity: 0.45; filter: grayscale(0.6); }
.tile-art { width: 68px; height: 68px; display: grid; place-items: center; font-size: 22px; color: var(--steel); }
.tile-art .item-svg { width: 68px; height: 68px; }
.hero-art { width: 76px; height: 76px; }
.tile-name { min-height: 2.5em; }
.tile-price { display: inline-flex; align-items: center; gap: 3px; font: 700 13px/1 var(--font); color: var(--ink); }
.tile-tag { font: 600 11px/1.3 var(--font); padding: 1px 7px; border-radius: var(--r-6); background: var(--surface); color: var(--steel); }
.tile-tag.on { background: var(--tint-lavender); color: var(--tint-lavender-ink); }
.tile-tag.rare { background: var(--tint-peach); color: var(--tint-peach-ink); }
.tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.deal:empty { display: none; }
.deal { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r-12); background: var(--tint-yellow); }
.deal p { margin: 0; }

/* ---------- награды ---------- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.award { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-12); border: 1px solid var(--hairline); background: var(--card); }
.award.got { background: var(--tint-mint); border-color: transparent; }
.award:not(.got) .award-art { opacity: 0.55; filter: grayscale(0.7); }
.award-art { width: 64px; height: 64px; display: grid; place-items: center; }
.award-art img { width: 40px; }
.award-info { display: grid; gap: 4px; min-width: 0; }
.award-info p { margin: 0; }
.award-reward { font: 600 13px/1.3 var(--font); color: var(--charcoal); }
.award-reward .coin-ico { width: 16px; height: 16px; vertical-align: -3px; }
.award .bar { height: 6px; margin-top: 4px; }
.award-pop { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; justify-items: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.award-card { pointer-events: auto; width: min(560px, 100%); display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px; border-radius: var(--r-16);
  background: var(--card); box-shadow: rgba(15, 15, 15, 0.2) 0 24px 48px -8px; border: 1px solid var(--hairline); animation: rise .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.award-body { display: grid; gap: 6px; min-width: 0; }
.award-body p { margin: 0; }
.award-gift { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 700; color: var(--ink); }
.gift-coins { display: inline-flex; gap: 4px; align-items: center; }
.gift-item { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: var(--r-pill); background: var(--tint-peach); color: var(--tint-peach-ink); font-size: 14px; }
.gift-item .item-svg { width: 34px; height: 34px; }
@media (max-width: 480px) { .award-card { grid-template-columns: 76px minmax(0, 1fr); } }

/* ---------- извилистый путь ---------- */
/* карта «Извилистого пути»: светлая сцена в обеих темах, герои и линии — как на светлом фоне */
.path-card { position: relative; overflow: hidden; padding: 0; border-radius: 24px; --char-line: #1a1a1a; --char-shadow: rgba(20, 50, 100, 0.2);
  background: radial-gradient(120% 90% at 50% 0%, #e9f6ff 0%, #c7e6fb 60%, #a9d6f6 100%); }
.path-map { position: relative; }
.path-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pm-out circle { fill: #1a1a1a; }
.pm-fill circle { fill: url(#pm-pink); }
.pm-fold { fill: none; stroke: #e8609c; stroke-width: 5; stroke-linecap: round; }
.pm-shine { fill: #ffffff; opacity: 0.6; }
.pm-bolt { fill: #f5d75e; stroke: #1a1a1a; stroke-width: 3; stroke-linejoin: round; animation: pm-zap 1.6s steps(1) infinite; }
@keyframes pm-zap { 0%, 100% { opacity: 1; } 42% { opacity: 0.25; } 50% { opacity: 1; } 58% { opacity: 0.4; } }
/* слизь: полупрозрачная зелёная, без чёрного контура — сквозь неё видно мозг */
.pm-ooze, .pm-strand, .pm-puddle, .pm-fall { fill: rgba(111, 217, 79, 0.72); stroke: rgba(40, 150, 40, 0.7); stroke-width: 2; stroke-linejoin: round; }
.pm-ooze { fill: url(#pm-slime); stroke: none; }
.pm-strand { transform-box: fill-box; transform-origin: 50% 0; animation: pm-stretch 3.4s ease-in-out infinite; }
.pm-strand:nth-of-type(2n) { animation-duration: 4.1s; animation-delay: -1.3s; }
@keyframes pm-stretch { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.12) scaleX(0.92); } }
.pm-fall { animation: pm-fall 2.6s ease-in infinite; }
@keyframes pm-fall { 0%, 25% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(36px); opacity: 0; } }
.pm-gloss { fill: #ffffff; opacity: 0.55; }
.pm-gloss-line { fill: none; stroke: #ffffff; stroke-width: 3; stroke-linecap: round; opacity: 0.55; }
.pm-bubble { fill: rgba(220, 255, 200, 0.85); stroke: rgba(40, 140, 40, 0.5); stroke-width: 1; }
.pm-road-out { fill: none; stroke: #1a1a1a; stroke-width: 27; stroke-linecap: round; stroke-linejoin: round; }
.pm-road { fill: none; stroke: #fff8ec; stroke-width: 20; stroke-linecap: round; stroke-linejoin: round; }
.pm-road-mid { fill: none; stroke: #f3b6cf; stroke-width: 2.5; stroke-dasharray: 2 10; stroke-linecap: round; }
.pm-done { fill: none; stroke: #5645d4; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.pm-stop circle { fill: #ffffff; stroke: #1a1a1a; stroke-width: 3; }
.pm-stop.on circle { fill: #f5d75e; }
.pm-stop text { font: 700 10px var(--font-mono); fill: #1a1a1a; pointer-events: none; }
.pm-stop .pm-ring { fill: none; stroke: #5645d4; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: pm-ring 1.6s ease-out infinite; }
@keyframes pm-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
.path-hero { position: absolute; width: 74px; transform: translate(-50%, -92%); pointer-events: none; z-index: 2; }
.path-guide { position: absolute; left: 1.5%; bottom: 1.5%; width: 48%; display: grid; grid-template-columns: 34% minmax(0, 1fr); align-items: end; gap: 6px; z-index: 3; }
.path-guide-art { display: block; position: relative; }
.path-guide-art .crew-art { display: block; }
.path-say { position: relative; margin: 0 0 22%; padding: 10px 12px; border-radius: 14px; background: #ffffff; color: #1a1a1a; font-size: 14px; line-height: 1.35;
  box-shadow: rgba(10, 30, 70, 0.18) 0 8px 20px -8px; }
.path-say::after { content: ""; position: absolute; left: -6px; bottom: 16px; width: 12px; height: 12px; background: #ffffff; transform: rotate(45deg); border-radius: 2px; }
.zach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.zach-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-12); background: var(--surface); }
.zach-card .zach-art { width: 72px; }
.zach-card p { margin: 0 0 4px; }
.zach-card.preview { opacity: 0.75; }
@media (prefers-reduced-motion: reduce) { .pm-bolt, .pm-strand, .pm-fall, .pm-ring { animation: none; } .pm-fall { opacity: 0; } }
@media (max-width: 560px) {
  .path-hero { width: 46px; }
  .pm-stop circle { r: 19px; }
  .pm-stop .pm-ring { r: 20px; }
  .pm-stop text { font-size: 15px; transform: translateY(1.5px); }
  .path-guide { position: static; width: auto; grid-template-columns: 84px minmax(0, 1fr); padding: 0 12px 12px; margin-top: -8px; }
  .path-say { margin: 0 0 18px; font-size: 13px; }
}

/* ---------- зеркало: руки, покупка, каталог, тест ---------- */
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.hands { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--r-12); background: var(--surface); }
.hands[hidden] { display: none; }
.mirror-stage .deal { width: 100%; margin-top: 12px; background: var(--card); border: 1px solid var(--hairline); }
.deal-title { margin: 0; font: 800 17px/1.4 var(--font-display); color: var(--ink); }
.deal-title .coin-ico { width: 18px; height: 18px; }
.btn:disabled { background: var(--hairline); color: var(--muted); cursor: default; }
.tile.trying { border: 2px dashed var(--primary); padding: 9px 7px 11px; }
.cat-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--hairline-soft); background: var(--card); color: var(--ink); }
.cat-row:last-child { border-bottom: 0; }
.cat-art { width: 48px; height: 48px; display: grid; place-items: center; }
.cat-art .item-svg { width: 48px; height: 48px; }
.cat-price { display: inline-flex; align-items: center; gap: 4px; font: 700 14px/1.3 var(--font); text-align: right; flex-wrap: wrap; justify-content: flex-end; max-width: 52vw; }
.cat-price .t-small { font-weight: 400; }
.test-card { grid-template-columns: minmax(0, 1fr); border: 2px dashed var(--warning); }
.test-msg { min-height: 1.4em; }

/* ---------- зеркало по эскизу: серебряная рама, постамент, блёстки ---------- */
.mirror { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .mirror { grid-template-columns: minmax(0, 1fr); } }
.mirror-stage { background: linear-gradient(160deg, #fdfdfd 0%, #ececec 55%, #dcdcdc 100%); padding: 18px 18px 16px; }
/* зеркало одинаковое в обеих темах: светлое стекло, на нём персонаж с тёмным контуром */
.mirror-stage { --m-glass-0: #ffffff; --m-glass-1: #ececec; --m-glass-2: #d4d4d4;
  --m-frame-0: #eeeeee; --m-frame-1: #d6d6d6; --m-edge: #c6c6c6; --m-ped: #ffffff; --m-ped-edge: #a8a8a8; --m-ped-line: #cfcfcf; }
.mirror-box { position: relative; width: min(100%, 400px); aspect-ratio: 300 / 380; margin: 0 auto; }
.mirror-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.m-hero { position: absolute; left: 12%; width: 76%; top: 29%; z-index: 2; }
.m-pedestal { display: none; }
.mirror-box[data-hero="glue"] .m-pedestal { display: inline; }
.mirror-box[data-hero="glue"] .m-hero { left: 17%; width: 66%; top: 15.6%; }
.m-pet { position: absolute; right: -2%; bottom: 3%; width: 24%; z-index: 3; animation: pet 2.4s ease-in-out infinite; }
.m-object { position: absolute; left: -6%; bottom: 5%; width: 28%; z-index: 1; }
.m-arrow { position: absolute; top: 47%; z-index: 4; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--card);
  box-shadow: var(--shadow-2); color: var(--steel); font: 600 26px/1 var(--font); cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.m-arrow.prev { left: -10px; }
.m-arrow.next { right: -10px; }
.m-arrow:hover { color: var(--ink); }
.m-arrow:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mirror-box .try-label { position: absolute; top: 2%; left: 0; z-index: 4; }
.sparkle { position: absolute; width: calc(26px * var(--k, 1)); height: calc(26px * var(--k, 1)); z-index: 3; pointer-events: none; animation: twinkle 2.7s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; transform: scale(0.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
.btn .coin-ico { width: 18px; height: 18px; margin: 0 3px 0 5px; vertical-align: -4px; }
@media (max-width: 760px) { .mirror-box { width: min(100%, 300px); } .m-arrow.prev { left: -4px; } .m-arrow.next { right: -4px; } }

/* крупнее герои на главной */
.home-hero { grid-template-columns: 260px minmax(0, 1fr); }
.home-hero .scene-hero { width: 190px; max-width: 76%; }
@media (max-width: 560px) { .home-hero { grid-template-columns: minmax(0, 1fr); } }

/* ---------- заглавный экран: сцена с командой (hero-band-dark) и выбор игрока ---------- */
/* заглавный экран помещается в окно без прокрутки: сцена тянется по высоте окна, команда вписывается в неё,
   логотип, заголовок и карточки игроков уменьшаются на невысоких экранах (просьба Алексея 11.10.2026) */
.wrap-intro { padding-block: 12px 4px; min-height: min(100dvh, 1000px); display: flex; flex-direction: column; }
.wrap-intro > .intro { flex: 1 1 auto; min-height: 0; }
.intro { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2dvh, 12px);
  padding: clamp(14px, 3dvh, 32px) 24px 0; border-radius: 24px; text-align: center; color: #ffffff;
  background: radial-gradient(120% 70% at 50% 0%, #1a2a52 0%, #0a1530 62%, #070f24 100%);
  --char-line: #1a1a1a; --char-shadow: rgba(20, 50, 100, 0.2); }   /* герои как на светлом фоне: стоят на светло-голубом низе сцены */
.intro-wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.intro-wires path { fill: none; stroke: rgba(255, 255, 255, 0.13); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.intro-logo { flex: none; width: min(360px, 80%, 34dvh); }
@keyframes logo-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
.intro-title { margin: 0; max-width: 640px; font: 900 clamp(24px, 4.6dvh, 44px)/1.08 var(--font-display); letter-spacing: -0.5px; }
.intro-title span { color: #ffffff; }
.intro-title .nowrap { white-space: nowrap; }
.intro-sub { margin: 0; max-width: 460px; font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, 0.72); }
.crew { position: relative; flex: 1 1 0; min-height: 140px; align-self: stretch; margin: 4px -24px 0; container: crew / size;
  background: linear-gradient(180deg, rgba(80, 140, 215, 0) 0%, rgba(80, 140, 215, 0.6) 20%, #9ccff2 52%, #cbe8fb 78%, #e4f3fd 100%); }
.crew-ground { position: absolute; left: 0; bottom: 0; width: 100%; height: 34%; }
/* команда стоит в рамке 760×330, вписанной в сцену по высоте и ширине; холмы — по всей ширине сцены */
.crew-stage { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: min(100cqw, 100cqh * 760 / 330); aspect-ratio: 760 / 330; }
.crew > .crew-ground { height: calc(min(100cqh, 100cqw * 330 / 760) * 0.34); }
@container crew (max-aspect-ratio: 6 / 5) {   /* узкая высокая сцена (телефон): команда в 2 ряда, задний ряд — на дальнем холме */
  .crew-stage { width: min(100cqw, 100cqh * 343 / 330); aspect-ratio: 343 / 330; }
  .crew > .crew-ground { height: calc(min(100cqh, 100cqw * 330 / 343) * 0.56); }
  .crew-hero { left: var(--mx); bottom: var(--my); width: var(--mw); }
  .crew-hero[data-hero="glue"], .crew-hero[data-hero="zoyd"], .crew-hero[data-hero="soft"] { z-index: 2; }
}
.crew-ground .far { fill: #b7dcf6; }
.crew-ground .near { fill: #f3f9fe; }
.crew-hero { position: absolute; left: var(--x); bottom: var(--y); width: var(--w); z-index: 1; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.crew-hero.talking { z-index: 6; }
.crew-hero:hover, .crew-hero:focus-visible { z-index: 7; }
.crew-hero:focus-visible { outline: 2px solid #f5d75e; outline-offset: 2px; border-radius: 12px; }
.crew-art { display: block; transition: transform .2s; }
.crew-hero:hover .crew-art { transform: translateY(-5px); }
.crew-shadow { position: absolute; left: 22%; right: 22%; bottom: 1%; height: 7%; border-radius: 50%; background: rgba(30, 70, 130, 0.22); filter: blur(2px); }
.crew-hero[data-hero="spug"] .crew-shadow, .crew-hero[data-hero="soft"] .crew-shadow { display: none; }
.crew-say { position: absolute; bottom: 98%; left: 50%; z-index: 6; width: max-content; max-width: 230px; padding: 10px 13px;
  transform: translateX(calc(-50% + var(--dx, 0px))); border-radius: 12px; background: #ffffff; color: #1a1a1a;
  font: 500 14px/1.35 var(--font); text-align: left; box-shadow: rgba(0, 0, 0, 0.35) 0 10px 24px -8px; animation: say-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.crew-say::after { content: ""; position: absolute; left: calc(50% - var(--dx, 0px)); bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: #ffffff; transform: rotate(45deg); border-radius: 2px; }
@keyframes say-pop { from { opacity: 0; transform: translateX(calc(-50% + var(--dx, 0px))) translateY(8px) scale(.85); } }
/* имя и характеристика героя: тёмная подсказка над головой, при наведении (на телефоне — по нажатию) */
.tip-host { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.tip-host:focus-visible { outline: 2px solid #f5d75e; outline-offset: 2px; border-radius: 12px; }
.who-tip { position: absolute; left: var(--tx, 50%); bottom: calc(100% + 4px); z-index: 8; width: max-content; max-width: 220px; padding: 9px 12px;
  border-radius: 10px; background: #1a1a1a; color: rgba(255, 255, 255, 0.8); font: 400 13px/1.35 var(--font); text-align: left; pointer-events: none; overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: rgba(15, 15, 15, 0.16) 0 16px 48px -8px;
  opacity: 0; visibility: hidden; transform: translateX(calc(-50% + var(--dx, 0px))) translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
.who-tip b { display: block; margin-bottom: 2px; color: #ffffff; font: 800 16px/1.2 var(--font-display); }
.who-tip::after { content: ""; position: absolute; left: calc(50% - var(--dx, 0px)); bottom: -5px; width: 10px; height: 10px; margin-left: -5px;
  background: #1a1a1a; transform: rotate(45deg); border-radius: 2px; }
@media (hover: hover) { :is(.crew-hero, .tip-host):hover > .who-tip { opacity: 1; visibility: visible; transform: translateX(calc(-50% + var(--dx, 0px))); } }
:is(.crew-hero, .tip-host):focus-visible > .who-tip, .tip-on > .who-tip { opacity: 1; visibility: visible; transform: translateX(calc(-50% + var(--dx, 0px))); }
.crew-hero:has(> .crew-say:not([hidden])) > .who-tip { opacity: 0; visibility: hidden; }   /* пока герой говорит, подсказки нет */
.base-hero > .who-tip { --tx: 31%; }   /* над героем, а не над питомцем */
.base-say { transition: opacity .15s, visibility .15s; }
.path-say { transition: opacity .15s, visibility .15s; }
.path-guide:has(.path-guide-art:is(:focus-visible, .tip-on)) .path-say { opacity: 0; visibility: hidden; }
@media (hover: hover) { .path-guide:has(.path-guide-art:hover) .path-say { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .who-tip { transition: none; } }
.pick { display: grid; gap: clamp(8px, 1.5dvh, 16px); margin-top: clamp(12px, 2.5dvh, 32px); }
.pick > .t-h3 { font-size: clamp(20px, 3dvh, 28px); }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.player { display: grid; justify-items: center; gap: clamp(2px, .6dvh, 6px); padding: clamp(12px, 2dvh, 20px) 20px clamp(14px, 2.2dvh, 22px); border-radius: 20px;
  text-align: center; text-decoration: none; color: var(--charcoal); transition: transform .2s, box-shadow .2s; }
/* живой фон как в Brawl Stars: значки рядами, медленно едут по диагонали (карточки игроков, задание дня, плитки) */
.pat { position: relative; overflow: hidden; isolation: isolate; }
.pat::before { content: ""; position: absolute; left: -96px; top: -96px; right: 0; bottom: 0; z-index: -1; pointer-events: none;
  background: var(--pat, transparent); -webkit-mask: var(--pat-tile) 0 0 / 96px 96px repeat; mask: var(--pat-tile) 0 0 / 96px 96px repeat;
  animation: pat-move 16s linear infinite; }
@keyframes pat-move { to { transform: translate(96px, 96px); } }
.pat.tint-peach { --pat: rgba(221, 91, 0, 0.13); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M69 60 h6 v9 h9 v6 h-9 v9 h-6 v-9 h-9 v-6 h9 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-mint { --pat: rgba(26, 174, 57, 0.15); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M72 60 L84 81 L60 81 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-lavender { --pat: rgba(86, 69, 212, 0.13); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M69 60 h6 v9 h9 v6 h-9 v9 h-6 v-9 h-9 v-6 h9 Z' transform='rotate(45 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-sky { --pat: rgba(0, 117, 222, 0.12); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M62 72 a10 10 0 1 0 20 0 a10 10 0 1 0 -20 0 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-rose { --pat: rgba(224, 49, 49, 0.1); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M72 59 L84 72 L72 85 L60 72 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-yellow, .pat.tint-yellow-bold { --pat: rgba(200, 140, 0, 0.16); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M60 64 h24 v6 h-24 Z M60 75 h24 v6 h-24 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
.pat.tint-gray { --pat: rgba(55, 53, 47, 0.07); --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M24.0 12.0 L27.1 19.8 L35.4 20.3 L28.9 25.6 L31.1 33.7 L24.0 29.2 L16.9 33.7 L19.1 25.6 L12.6 20.3 L20.9 19.8 Z' transform='rotate(-12 24 24)'/%3E%3Cpath d='M66 66 h12 v12 h-12 Z' transform='rotate(10 72 72)'/%3E%3C/svg%3E"); }
@media (hover: hover) { .player:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); } }
.player:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.player.go { transform: scale(.97); }
.player .t-micro-up { justify-self: start; }
.player-stage { position: relative; width: clamp(72px, 15dvh, 176px); }
.player-stage .stage { display: block; }
.player-nick { font: 900 clamp(20px, 3dvh, 28px)/1.2 var(--font-display); letter-spacing: -0.3px; color: var(--ink); overflow-wrap: anywhere; }
.player-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 28px; }
.stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.65); font-size: 13px; color: var(--charcoal); }
.stat-chip .coin-ico { width: 16px; height: 16px; vertical-align: 0; }
.player-go { width: 100%; margin-top: 6px; gap: 6px; }
/* на компьютере и планшете карточка игрока низкая: герой слева, ник и плашки справа, кнопка во всю ширину снизу */
@media (min-width: 561px) {
  .player { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto auto auto auto 1fr auto;
    grid-template-areas: "stage ." "stage up" "stage nick" "stage who" "stage stats" "stage ." "go go";
    justify-items: start; text-align: left; column-gap: 16px; row-gap: 2px; }
  .player .t-micro-up { grid-area: up; }
  .player-stage { grid-area: stage; align-self: center; width: clamp(72px, 13dvh, 140px); }
  .player-nick { grid-area: nick; }
  .player > .t-small { grid-area: who; }
  .player-stats { grid-area: stats; justify-content: flex-start; margin-top: 4px; }
  .player-go { grid-area: go; justify-self: stretch; margin-top: clamp(6px, 1.2dvh, 12px); }
}
@media (max-width: 560px) {
  .intro { padding: clamp(12px, 2.4dvh, 24px) 16px 0; border-radius: 20px; }
  .intro-title { font-size: clamp(22px, 3.8dvh, 31px); letter-spacing: -0.5px; }
  .intro-sub { font-size: 16px; }
  .crew { margin: 4px -16px 0; min-height: 120px; }
  .intro-logo { width: min(360px, 80%, 30dvh); }
  .wrap-intro .parent-link { margin-top: 0; padding: 4px 12px; }
  .crew-say { max-width: 200px; font-size: 13px; }
  .players { gap: 10px; }   /* на телефоне карточки остаются рядом, компактные */
  .player { padding: 8px 10px 10px; }
  .player .t-micro-up { display: none; }
  .player-stage { width: clamp(56px, 11dvh, 120px); }
  .player-nick { font-size: clamp(17px, 2.8dvh, 22px); }
  .player-stats { gap: 4px; min-height: 0; }
  .player-stats .stat-chip { font-size: 12px; padding: 2px 8px; }
  .player-go { min-height: 38px; padding: 6px 10px; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .intro-logo, .crew-say, .pat::before { animation: none; } }

/* ---------- главная ребёнка: штаб ---------- */
.base { position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; color: #ffffff;
  background: radial-gradient(120% 80% at 50% 0%, #1a2a52 0%, #0a1530 70%);
  --char-line: #1a1a1a; --char-shadow: rgba(20, 50, 100, 0.2); }
.base-head { display: grid; justify-items: start; gap: 6px; padding: 24px 24px 0; position: relative; z-index: 1; }
.base-tag { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.base-title { margin: 0; font: 900 40px/1.1 var(--font-display); letter-spacing: -0.5px; overflow-wrap: anywhere; }
.base-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.base-chips .stat-chip { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.base-stage { position: relative; aspect-ratio: 760 / 300; margin-top: -28px;
  background: linear-gradient(180deg, rgba(80, 140, 215, 0) 0%, rgba(80, 140, 215, 0.6) 22%, #9ccff2 55%, #cbe8fb 80%, #e4f3fd 100%); }
.base-hero { position: absolute; left: 4%; bottom: 3%; width: 44%; display: block; text-decoration: none; }
.base-hero .scene-hero { width: 62%; max-width: none; }
.base-say { position: absolute; right: 3%; top: 12%; width: min(300px, 46%); margin: 0; padding: 12px 14px; border-radius: 14px; background: #ffffff; color: #1a1a1a;
  font: 500 15px/1.4 var(--font); box-shadow: rgba(10, 30, 70, 0.3) 0 10px 24px -8px; animation: say-pop .4s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
.base-say::after { content: ""; position: absolute; left: 34%; bottom: -6px; width: 12px; height: 12px; background: #ffffff; transform: rotate(45deg); border-radius: 2px; }
.base-stage.solo .base-say { right: auto; left: 46%; top: 16%; }
.base-stage.solo .base-say::after { left: -6px; bottom: auto; top: 60%; }
.mission { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-top: 16px; padding: 18px 22px;
  border-radius: 20px; text-decoration: none; color: var(--charcoal); transition: transform .2s, box-shadow .2s; }
.mission:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.mission:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.mission-art { display: block; width: 120px; }
.mission-body { display: grid; gap: 4px; }
.mission-title { font: 800 22px/1.3 var(--font-display); color: var(--ink); }
.mission-text { font-size: 14px; color: var(--slate); }
.mission-go { display: grid; gap: 8px; justify-items: center; }
.mission-reward { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--charcoal); white-space: nowrap; }
.mission-reward .coin-ico { width: 16px; height: 16px; vertical-align: 0; }
.hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.hub-tile { display: grid; grid-template-rows: auto auto 1fr; gap: 4px; justify-items: start; min-height: 190px; padding: 16px 18px 18px; border-radius: 20px;
  text-decoration: none; color: var(--charcoal); transition: transform .2s, box-shadow .2s; }
.hub-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.hub-tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.hub-tile.off { opacity: 0.6; }
.hub-tile.off:hover { transform: none; box-shadow: none; }
.hub-art { display: block; width: 92px; height: 92px; justify-self: center; margin: 4px 0 6px; }
/* иконки разделов: рисованный контур как у персонажей, покачиваются, при наведении — подпрыгивают */
.ic { display: block; width: 100%; height: 100%; overflow: visible; animation: ic-float 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ic .s { stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.ic .t { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
@keyframes ic-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.hub-tile:hover .ic { animation: ic-jump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ic-jump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-10px) rotate(-6deg) scale(1.08); } 70% { transform: translateY(0) rotate(4deg) scale(1.02); } 100% { transform: translateY(0) rotate(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .ic, .hub-tile:hover .ic { animation: none; } }
.hub-title { font: 800 19px/1.3 var(--font-display); color: var(--ink); }
.hub-sub { font-size: 13px; color: var(--slate); }
.hub-sub .coin-ico { width: 15px; height: 15px; vertical-align: -3px; }
@media (max-width: 560px) {
  .base { border-radius: 20px; }
  .base-head { padding: 20px 16px 0; }
  .base-title { font-size: 32px; }
  .base-stage { aspect-ratio: 343 / 280; margin-top: -10px; }
  .base-hero { left: 0; width: 60%; }
  .base-say { top: 6%; right: 3%; width: 54%; font-size: 13px; padding: 10px 12px; }
  .base-say::after { left: 60%; }
  .base-stage.solo .base-say { left: 42%; width: 55%; }
  .mission { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .mission-art { width: 84px; }
  .mission-title { font-size: 18px; }
  .mission-go { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }
  .mission-go .btn { width: 100%; }
  .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-tile { min-height: 170px; padding: 14px; }
  .hub-art { width: 76px; height: 76px; }
}

/* штаб помещается в окно без прокрутки (просьба Алексея 11.10.2026): сцена с героем тянется по высоте окна,
   герой вписывается в неё (рамка 760×300, на телефоне 343×280); шапка, задание дня и плитки на невысоких экранах ниже */
.wrap-base { padding-block: 0 8px; min-height: min(100dvh, 1000px); display: flex; flex-direction: column; }
.wrap-base > .top { padding-block: clamp(6px, 1.4dvh, 14px); margin-bottom: clamp(8px, 1.6dvh, 24px); }
.wrap-base .logo { height: clamp(44px, 7dvh, 64px); width: calc(clamp(44px, 7dvh, 64px) * 520 / 216); }
.wrap-base > .base { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wrap-base .base-head { padding-top: clamp(12px, 2.4dvh, 24px); gap: clamp(2px, .6dvh, 6px); }
.wrap-base .base-title { font-size: clamp(26px, 4.4dvh, 40px); }
.wrap-base .base-stage { flex: 1 1 0; min-height: 130px; aspect-ratio: auto; container: stage / size; }
.wrap-base .base-stage > * { --F: min(100cqw, 100cqh * 760 / 300); }
.wrap-base .base-stage > .crew-ground { height: calc(var(--F) * 300 / 760 * 0.34); }
.wrap-base .base-hero { left: calc(var(--F) * 0.04); width: calc(var(--F) * 0.44); }
.wrap-base .base-stage.solo .base-say { left: calc(var(--F) * 0.46); width: min(300px, 100cqw - var(--F) * 0.46 - 16px); }
.wrap-base > .mission { margin-top: clamp(8px, 1.5dvh, 16px); padding-block: clamp(8px, 1.6dvh, 18px); grid-template-columns: clamp(64px, 10dvh, 120px) minmax(0, 1fr) auto; }
.wrap-base .mission-art { width: clamp(64px, 10dvh, 120px); }
.wrap-base .mission-title { font-size: clamp(18px, 2.6dvh, 22px); }
.wrap-base > .hub { margin-top: clamp(8px, 1.5dvh, 16px); }
@media (max-height: 1100px) {   /* кроме очень высоких экранов: в плитке разделов иконка слева, название и подпись справа */
  .wrap-base .hub-tile { min-height: 0; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
    align-content: center; padding: clamp(8px, 1.4dvh, 14px) 14px; }
  .wrap-base .hub-art { grid-row: 1 / 3; width: clamp(40px, 7dvh, 64px); height: clamp(40px, 7dvh, 64px); margin: 0; align-self: center; }
  .wrap-base .hub-title { align-self: end; }
  .wrap-base .hub-sub { align-self: start; }
}
@media (max-width: 560px) {
  .wrap-base .logo { height: clamp(40px, 6dvh, 50px); width: calc(clamp(40px, 6dvh, 50px) * 520 / 216); }
  .wrap-base .base-title { font-size: clamp(24px, 4dvh, 32px); }
  .wrap-base .base-stage > * { --F: min(100cqw, 100cqh * 343 / 280); }
  .wrap-base .base-stage > .crew-ground { height: calc(var(--F) * 280 / 343 * 0.34); }
  .wrap-base .base-hero { left: 0; width: calc(var(--F) * 0.6); }
  .wrap-base .base-stage.solo .base-say { left: calc(var(--F) * 0.42); width: min(260px, 100cqw - var(--F) * 0.42 - 8px); top: 6%; }
  .wrap-base > .mission { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .wrap-base .mission-art { width: 56px; }
  .wrap-base .mission-title { font-size: 16px; }
  .wrap-base .mission-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; }
  .wrap-base .mission-go { grid-column: auto; grid-template-columns: none; gap: 4px; }
  .wrap-base .mission-go .btn { width: auto; min-height: 40px; padding: 8px 12px; }
  .wrap-base > .hub { gap: 8px; }
  .wrap-base .hub-tile { padding: 8px 10px; column-gap: 8px; }
  .wrap-base .hub-tile { grid-template-rows: auto; align-items: center; }
  .wrap-base .hub-art { grid-row: auto; width: 40px; height: 40px; }
  .wrap-base .hub-title { font-size: 15px; align-self: center; }
  .wrap-base .hub-sub { display: none; }
}
@media (max-width: 560px) and (max-height: 700px) {   /* маленький телефон: без надзаголовка штаба и пояснения к заданию дня */
  .wrap-base .base-tag, .wrap-base .mission-text { display: none; }
  .wrap-base .base-stage { min-height: 110px; }
}

/* ---------- панель родителя ---------- */
.parent-link { justify-self: center; margin-top: 8px; font-size: 13px; color: var(--steel); text-decoration: none; padding: 8px 12px; }
.parent-link:hover { color: var(--ink); text-decoration: underline; }
.pin { display: grid; justify-items: center; gap: 8px; max-width: 360px; margin: 16px auto 0; padding: 28px 24px; border: 1px solid var(--hairline); border-radius: 20px; background: var(--card); text-align: center; }
.pin.shake { animation: pin-shake .4s; }
@keyframes pin-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-art { display: block; width: 96px; }
.pin h1 { margin: 0; }
.pin .t-small { margin: 0; }
.pin-dots { display: flex; gap: 14px; margin-top: 8px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--hairline-strong); transition: background .15s, border-color .15s; }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); }
.pin-msg { min-height: 20px; margin: 0; font-size: 13px; font-weight: 600; color: var(--error); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pin-pad button { height: 56px; border-radius: 14px; border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--ink); font: 600 22px/1 var(--font); cursor: pointer; }
.pin-pad button:active { background: var(--tint-lavender); }
.pin-pad button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.parent { margin-top: 20px; }
.pstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px; border-radius: var(--r-12); background: var(--surface); }
.pstats div { display: grid; gap: 2px; }
.pstats b { font: 600 20px/1.25 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.pstats span { font-size: 13px; color: var(--steel); }
.psec { display: grid; gap: 10px; }
.psec h2, .psec p { margin: 0; }
.psignal { margin: 0; padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-peach); color: var(--charcoal); font-size: 15px; }
.psignal.ok { background: var(--tint-mint); }
.pchart { display: block; width: 100%; height: auto; max-width: 640px; }
.pc-right { fill: var(--primary); }
.pc-wrong { fill: #f3a5c0; }
.pc-min { font: 600 10px var(--font-mono); fill: var(--steel); text-anchor: middle; }
.pc-day { font: 11px var(--font-mono); fill: var(--steel); text-anchor: middle; }
.pc-base { stroke: var(--hairline-strong); stroke-width: 1; }
.ptable { border: 1px solid var(--hairline); border-radius: var(--r-8); overflow: hidden; }
.prow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--hairline-soft); font-size: 14px; color: var(--ink); }
.prow:last-child { border-bottom: 0; }
.prow small { display: block; margin-top: 2px; font-size: 12px; color: var(--steel); }
.prow.two { grid-template-columns: minmax(0, 1fr) auto; }
.prow.rec { grid-template-columns: 96px minmax(0, 1fr) auto; }
.pt { font: 12px var(--font-mono); color: var(--steel); font-variant-numeric: tabular-nums; }
.pbar { display: flex; align-items: center; gap: 8px; }
.pbar .bar { flex: 1; }
.pbar b { font: 600 13px var(--font-mono); width: 28px; text-align: right; }
.pst { display: grid; gap: 2px; justify-items: start; }
.pok { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-6); }
.pok.yes { background: var(--tint-mint); color: var(--tint-mint-ink); }
.pok.no { background: var(--tint-rose); color: var(--error); }
.prules { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--charcoal); }
.ptest { padding: 16px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-12); }
@media (max-width: 560px) {
  .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .prow { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .prow .pst { grid-column: 1 / -1; }
  .prow.rec { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .pin-pad { grid-template-columns: repeat(3, 64px); }
}

/* ---------- домашка ---------- */
.hw { display: grid; gap: 16px; }
.hw-field { display: grid; gap: 6px; }
.hw-field.grow { flex: 1; }
.hw-books { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hw-row .hw-field:first-child { width: 140px; }
.hw-go { align-self: end; }
.hw-card { display: grid; gap: 14px; }
.hw-cond { display: grid; gap: 4px; }
.hw-cond p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); }
.hw-note { margin: 0; }
.hw-none { margin: 0; padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-sky); color: var(--charcoal); font-size: 15px; }
.prow.hw-rec { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.hw-acts { display: flex; gap: 6px; }
@media (max-width: 560px) { .prow.hw-rec { grid-template-columns: 48px minmax(0, 1fr) auto; } .hw-acts { grid-column: 2 / -1; } }
.hw-ans { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.hw-fields { gap: 10px 18px; }
.hw-fld { display: flex; align-items: center; gap: 8px; }
.hw-fld-name { font: 700 18px/1 var(--font-mono); color: var(--ink); }
.hw-fld .hw-in { width: 96px; }
.hw-in.right { border: 2px solid var(--success); background: var(--tint-mint); padding: 0 13px; }
.hw-in.wrong { border: 2px solid var(--error); background: var(--tint-rose); padding: 0 13px; }
.hw-steps { display: grid; gap: 18px; }
.hw-step { display: grid; gap: 10px; }
.hw-step .t-h5 { margin: 0; }
.hw-why { margin: 0; padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-rose); color: var(--charcoal); font-size: 15px; }
.hw-say > div:last-child { display: grid; gap: 10px; }
.hw-write { display: grid; gap: 2px; }
.hw-write p { font-size: 15px; }
.hw-row .hw-field.grow { min-width: 200px; }
.hw-in { font: 500 18px/1.3 var(--font-mono); height: 48px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-8); background: var(--card); color: var(--ink); width: 100%; }
.hw-in:focus { border: 2px solid var(--primary); padding: 0 13px; outline: none; }
.hw-say { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--r-12); }
.hw-say p { margin: 0; color: var(--charcoal); font-size: 15px; }
.pok.wait { background: var(--tint-sky); color: var(--charcoal); }

/* ---------- Неприятные Существа: ошибки-каракули ---------- */
.zach-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; margin: 2px 0 4px; }
.zach-row p { margin: 0; font-size: 14px; color: var(--charcoal); }
.zach-art { display: block; width: 56px; }

/* задание: фото страницы и номера */
.hw-new { display: grid; gap: 12px; }
.hw-new p, .hw .t-h5 { margin: 0; }
.hw-photo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hw-photo-btn { cursor: pointer; }
.hw-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-thumb { position: relative; width: 64px; height: 84px; border-radius: var(--r-8); overflow: hidden; border: 1px solid var(--hairline-strong); }
.hw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-thumb button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(26, 26, 26, 0.7); color: #ffffff; font: 600 14px/1 var(--font); cursor: pointer; }
.hw-new-msg { min-height: 1.4em; font-size: 14px; color: var(--slate); }
.hw-nums { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hw-nums .chip-btn { cursor: default; }
.hw-nums .chip-btn.ready { cursor: pointer; background: var(--tint-mint); color: var(--tint-mint-ink); border-color: transparent; font-weight: 600; }
.hw-nums .chip-btn.wait { background: var(--tint-sky); color: var(--charcoal); border-color: transparent; }
.hw-pick { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-12); background: var(--tint-lavender); }
.hw-pick[hidden] { display: none; }
.hw-pick .t-h5 { margin: 0; }
.hw-pick-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-pick-nums .pill-tab { font-size: 15px; padding: 8px 14px; background: var(--card); }
.hw-pick-nums .pill-tab[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.preset { padding: 16px; border: 1px dashed var(--error); border-radius: var(--r-12); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--tint-rose); }

/* экран задачи: сверху только тонкая строка прогресса, задача — крупная карточка */
.task-bar { display: flex; align-items: center; gap: 12px; }
.task-bar .bar { flex: 1; }
.task-count { font: 600 13px/1 var(--font-mono); color: var(--steel); white-space: nowrap; }
.task-mode { font-size: 12px; color: var(--steel); white-space: nowrap; }
.task-bar .ladder i { width: 14px; height: 5px; }
.task-card { display: grid; gap: 18px; padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--hairline); box-shadow: var(--shadow-1); }
.task-card .task-fig { border: 0; padding: 0; background: none; max-width: 520px; width: 100%; justify-self: center; }
.task-card .task-text { font: 600 21px/1.4 var(--font); color: var(--ink); }
.task-data { display: flex; flex-wrap: wrap; gap: 8px; }
.task-data span { font: 600 15px/1.3 var(--font-mono); padding: 6px 10px; border-radius: var(--r-8); background: var(--tint-lavender); color: var(--tint-lavender-ink); }
.opts.short { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.opts.short .opt { justify-content: center; font: 700 20px/1.2 var(--font); min-height: 64px; }
.opts.short .opt-k { display: none; }
.task-card .num input { font-size: 22px; height: 56px; width: 160px; }
.task-card .num .btn { min-height: 56px; }
.task-help { display: flex; gap: 20px; padding-inline: 4px; }
.link-btn { background: none; border: 0; padding: 0; font: 500 14px/1.4 var(--font); color: var(--steel); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.g-ask { stroke: var(--primary); stroke-width: 6; stroke-linecap: round; }
.g-q { font: 800 22px var(--font-display); fill: var(--primary); }
.g-len.big { font-size: 15px; font-weight: 600; fill: var(--charcoal); }
@media (max-width: 560px) { .task-card { padding: 16px; gap: 14px; } .task-card .task-text { font-size: 19px; } }

/* ---------- примерочная вещей ---------- */
.wrap.wrap-wide { max-width: 1040px; }
.fit-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.fit-grid { display: grid; gap: 6px; }
.fit-head, .fit-row { display: grid; grid-template-columns: 150px repeat(var(--n), minmax(0, 1fr)); gap: 6px; align-items: center; }
.fit-head span { font-size: 12px; font-weight: 600; color: var(--steel); text-align: center; }
.fit-name { display: grid; gap: 4px; font-size: 13px; color: var(--ink); }
.fit-cell { aspect-ratio: 200 / 220; padding: 4px; border: 1px solid var(--hairline); border-radius: var(--r-8); background: var(--surface); cursor: pointer; }
.fit-cell:hover { border-color: var(--primary); }
.fit-cell.edited { border: 2px solid var(--primary); padding: 3px; }
.fit-pop .fit-card { width: min(560px, 100%); max-height: 92vh; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; text-align: left; }
.fit-card .range { grid-template-columns: 72px minmax(0, 1fr) 52px; }
.fit-card .range b { font: 600 13px var(--font-mono); text-align: right; }
.fit-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fit-top .t-h4 { margin: 0; }
.fit-stage { width: min(320px, 80vw); justify-self: center; touch-action: none; cursor: grab; background: var(--surface); border-radius: var(--r-12); }
.fit-stage:active { cursor: grabbing; }
.fit-redraw { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.fit-note { height: auto; padding: 10px 12px; font: 400 15px/1.4 var(--font); resize: vertical; }
@media (max-width: 720px) { .fit-head, .fit-row { grid-template-columns: 90px repeat(var(--n), minmax(0, 1fr)); gap: 4px; } .fit-name { font-size: 11px; } }

/* ---------- эскизы в примерочной: карандаш поверх героя ---------- */
.sk-box { display: grid; gap: 12px; margin-top: 16px; padding: 18px; border: 1px solid var(--hairline); border-radius: var(--r-12); background: var(--card); }
.sk-box-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.sk-box-head .t-h4 { margin: 0 0 2px; }
.sk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sk-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border-radius: var(--r-12); background: var(--surface); }
.sk-item img { width: 96px; aspect-ratio: 600 / 660; border-radius: var(--r-8); background: #ffffff; border: 1px solid var(--hairline); object-fit: contain; }
.sk-info { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.sk-info p { margin: 0; overflow-wrap: anywhere; }
.sk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sk-pop { top: 0; align-items: end; background: rgba(15, 15, 15, 0.35); pointer-events: auto; }
.sk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sk-stage { position: relative; width: min(360px, 82vw); aspect-ratio: 200 / 220; justify-self: center; border-radius: var(--r-12); background: var(--surface);
  border: 1px solid var(--hairline); overflow: hidden; }
.sk-hero, .sk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sk-hero .char { width: 100%; height: 100%; }
.sk-canvas { touch-action: none; cursor: crosshair; }
.sk-color { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 3px solid var(--card); background: var(--c);
  box-shadow: 0 0 0 1px var(--hairline-strong); cursor: pointer; }
.sk-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary); }
.sk-name { height: 44px; padding: 0 12px; font: 400 16px var(--font); }

/* смена ника в штабе: карандаш рядом с ником, поле на месте ника */
.base-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nick-edit { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #ffffff; cursor: pointer; }
.nick-edit:hover { background: rgba(255, 255, 255, 0.26); }
.nick-edit:focus-visible { outline: 2px solid #f5d75e; outline-offset: 2px; }
.nick-edit svg { width: 20px; height: 20px; }
.nick-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nick-in { width: min(320px, 100%); height: 52px; padding: 0 14px; border: 2px solid #f5d75e; border-radius: var(--r-8);
  background: #ffffff; color: #1a1a1a; font: 800 26px/1 var(--font-display); }
.nick-cancel { height: 40px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--r-8); background: transparent;
  color: #ffffff; font: 500 14px var(--font); cursor: pointer; }
.nick-msg { flex-basis: 100%; margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.72); }

/* логотип: буквы и фигурки — стопки слоёв в одном пространстве, одна камера на всех (js/logo3d.js).
   Единица --u — 1/520 ширины логотипа; точка схода внизу слева: бока видны снизу и слева */
.logo3d { position: relative; display: block; aspect-ratio: 520 / 216; container-type: inline-size; --u: calc(100cqw / 520); }
.lg-cam { position: absolute; inset: 0; perspective: calc(600 * var(--u)); perspective-origin: -19% 301%; }
.lg-word { position: absolute; inset: 0; transform-style: preserve-3d; }
.lg-ch { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  transform-style: preserve-3d; }
.lg-ch > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: translateZ(calc(var(--z) * var(--u))); }
.lg-glint { display: none; }
.logo3d.glint .lg-glint { display: block; }
.lg-fx { position: absolute; inset: 0; pointer-events: none; }
.lg-fx > i { display: none; }
.l3d { position: absolute; left: calc(var(--x) / 5.2 * 1%); top: calc(var(--y) / 2.16 * 1%); width: calc(var(--w) / 5.2 * 1%);
  aspect-ratio: var(--ar); transform: translate(-50%, -50%) translateZ(calc(6 * var(--u))); perspective: 40cqw; pointer-events: none; }
/* фигурка вращается со своей камерой (тонкие слои при общей камере распадаются на полоски) и висит в общем пространстве чуть перед буквами */
.l3d-spin { position: absolute; inset: 0; transform-style: preserve-3d; animation: l3d-y var(--t) linear var(--d) infinite; }
.l3d-spin.ax-x { animation-name: l3d-x; }
.l3d-spin.ax-xy { animation-name: l3d-xy; }
.l3d-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: translateZ(calc((var(--i) - 4.5) * 0.3cqw)); }
/* кубик — 6 граней: верх и лицо бирюзовые, бока синие, низ и зад фиолетовые */
.l3d-face { position: absolute; inset: 0; border-radius: 12%; }
.l3d-face.front { background: #2ccbc4; transform: translateZ(calc(var(--w) / 10.4 * 1cqw)); }
.l3d-face.back { background: #5a14f4; transform: rotateY(180deg) translateZ(calc(var(--w) / 10.4 * 1cqw)); }
.l3d-face.right { background: #2a3be6; transform: rotateY(90deg) translateZ(calc(var(--w) / 10.4 * 1cqw)); }
.l3d-face.left { background: #3d28ea; transform: rotateY(-90deg) translateZ(calc(var(--w) / 10.4 * 1cqw)); }
.l3d-face.top { background: #4fe0d6; transform: rotateX(90deg) translateZ(calc(var(--w) / 10.4 * 1cqw)); }
.l3d-face.bottom { background: #4a1cf0; transform: rotateX(-90deg) translateZ(calc(var(--w) / 10.4 * 1cqw)); }
@keyframes l3d-y { from { transform: rotateX(-14deg) rotateY(0deg); } to { transform: rotateX(-14deg) rotateY(360deg); } }
@keyframes l3d-x { from { transform: rotateY(24deg) rotateX(0deg); } to { transform: rotateY(24deg) rotateX(360deg); } }
@keyframes l3d-xy { from { transform: rotate3d(1, 1, 0.3, 0deg); } to { transform: rotate3d(1, 1, 0.3, 360deg); } }
@media (prefers-reduced-motion: reduce) { .l3d-spin { animation: none; transform: rotateX(-18deg) rotateY(28deg); } }

/* Биология: рисунки растений (тема bio7-mhi). Ботанический атлас по мотивам «Кодекса Серафини»: без обводки,
   кремовая бумага в обеих темах, подписи — тонкая выноска и надпись на поле.
   Нажать можно в любое место рисунка — откроется ближайшая часть; на частях пульсируют кружки,
   выбранная часть подсвечивается фиолетовым. В задачах на часть указывает стрелка с «?» */
.bio-fig { border-radius: var(--r-12); border: 1px solid #ebe2d0; padding: 10px;
  background: radial-gradient(ellipse at 50% 45%, rgba(251, 247, 238, 0) 55%, rgba(170, 140, 90, 0.12) 100%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .28 0 0 0 0 .17 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"), #fbf7ee; }
.task-card .task-fig.bio-fig { border: 1px solid #ebe2d0; padding: 10px;
  background: radial-gradient(ellipse at 50% 45%, rgba(251, 247, 238, 0) 55%, rgba(170, 140, 90, 0.12) 100%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .28 0 0 0 0 .17 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"), #fbf7ee; }
/* лист атласа — всегда на всю ширину столбца, рисунок по центру; высокие рисунки ограничены по высоте */
.play-fig:has(.bio-fig) { max-width: none; }
.play .bio-fig, .task-card .task-fig.bio-fig { width: 100%; max-width: none; }
.play .bio-fig .bio-svg { max-height: 560px; }
.task-card .bio-fig .bio-svg { max-height: 380px; }
.bio-fig { box-shadow: inset 0 0 0 4px #fbf7ee, inset 0 0 0 5px #d9ccb2, inset 0 0 0 8px #fbf7ee, inset 0 0 0 8.5px #e5dbc6; }
@media (max-width: 480px) { .play:has(> .play-fig.bio-fig), .play:has(> .play-fig .bio-fig) { padding: 10px; } .bio-fig, .task-card .task-fig.bio-fig { padding: 6px; box-shadow: inset 0 0 0 3px #fbf7ee, inset 0 0 0 4px #d9ccb2; } }
.geo.bio-svg { overflow: hidden; }
.bio-svg text { font-family: var(--font); }
.bio-catch { fill: transparent; cursor: pointer; }
.bio-mark { cursor: pointer; outline: none; }
.bio-mark-ring { fill: none; stroke: #5645d4; stroke-width: 2.5; }
.bio-mark-dot { fill: #ffffff; stroke: #5645d4; stroke-width: 2.6; }
.bio-mark.done .bio-mark-ring { display: none; }
.bio-mark.done .bio-mark-dot { fill: #5645d4; stroke: #ffffff; stroke-width: 1.8; r: 3.8; }
.bio-mark:focus-visible .bio-mark-dot { stroke-width: 4.5; }
.bio-tag.on { fill: #ebe6fb; }
.bio-tag-t { font-size: 14px; font-weight: 600; fill: #3d3427; paint-order: stroke; stroke: #fbf7ee; stroke-width: 4px; stroke-linejoin: round; }
.bio-tag-t.on { fill: #5645d4; stroke: #ebe6fb; }
.bio-lead { stroke: #8a7a62; stroke-width: 1; }
.bio-lead.on { stroke: #5645d4; stroke-width: 1.6; }
.bio-sub { font-size: 12.5px; font-weight: 700; fill: #6b5a44; paint-order: stroke; stroke: #fbf7ee; stroke-width: 3px; }
.bio-sub.on { fill: #5645d4; }
.bio-cap { font-size: 13px; font-weight: 500; font-style: italic; fill: #7a6a52; }
.bio-num { font-size: 13px; font-weight: 800; fill: #ffffff; }
.bio-arc { fill: none; stroke: #5645d4; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.bio-ptr { fill: none; stroke: #5645d4; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.bio-q { fill: #5645d4; }
.bio-q-t { fill: #ffffff; font-size: 18px; font-weight: 800; }
.bio-cell { transition: fill .25s; }
.bio-pulse { animation: bioPulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bioPulse { 50% { transform: scale(1.45); opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .bio-pulse { animation: none; } .bio-cell { transition: none; } }
.bio-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.bio-btns:empty { display: none; }
.bio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bio-chips span { padding: 2px 8px; border-radius: var(--r-6); background: var(--tint-lavender); color: var(--tint-lavender-ink); font: 600 13px/1.4 var(--font); }
.bio-cmp { display: grid; border: 1px solid var(--hairline); border-radius: var(--r-8); overflow: hidden; font-size: 14px; }
.bio-cmp [role="row"] { display: grid; grid-template-columns: 96px 1fr 1fr; border-bottom: 1px solid var(--hairline-soft); }
.bio-cmp [role="row"]:last-child { border-bottom: 0; }
.bio-cmp span { padding: 10px 12px; color: var(--charcoal); }
.bio-cmp [role="columnheader"], .bio-cmp [role="rowheader"] { font-weight: 600; color: var(--ink); }
.bio-cmp [role="row"]:first-child { background: var(--surface); }
@media (max-width: 480px) { .bio-cmp { font-size: 13px; } .bio-cmp [role="row"] { grid-template-columns: 78px 1fr 1fr; } .bio-cmp span { padding: 8px; } }

/* Окружающий мир 4: карты России (js/russia-map.js). Лист старого атласа, как рисунки биологии:
   кремовая бумага в обеих темах, вода — частые тонкие линии, у берега — линии прибоя,
   Россия — шалфейно-зелёная, соседи — светлая охра. Подписи — на поле, вода — курсивом.
   Нажать можно в любое место карты — откроется ближайший объект; на объектах пульсируют кружки. */
.map-fig { border-radius: var(--r-12); border: 1px solid #ebe2d0; padding: 4px; background: #fbf7ee; }
.task-card .task-fig.map-fig { border: 1px solid #ebe2d0; padding: 4px; background: #fbf7ee; max-width: 520px; }
.play-fig.map-fig, .play-fig:has(.map-fig) { max-width: 100%; }
.geo.map-svg { overflow: hidden; display: block; width: 100%; height: auto; }
.map-svg text { font-family: var(--font); }
.map-nb { fill: #f1e8d3; stroke: #c9b896; stroke-width: 0.5; }
.map-ru { fill: #d3e0b6; stroke: #7f8f6a; stroke-width: 0.7; stroke-linejoin: round; }
.map-inner { stroke: #7fa8c4; stroke-width: 0.5; }
.map-lake { stroke: #6f9cba; stroke-width: 0.7; }
.map-river { fill: none; stroke: #4f86ad; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.map-river.dim { stroke: #8fb3cb; stroke-width: 0.8; }
.map-river.on { stroke: #5645d4; stroke-width: 2.6; }
.map-flow { fill: none; stroke: #5645d4; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.map-city { fill: #ffffff; stroke: #3d3427; stroke-width: 1.1; }
.map-city.cap { fill: #3d3427; stroke: #ffffff; stroke-width: 1; }
.map-hl { fill: #5645d4; opacity: 0.16; }
.map-lake.on { fill: #c9c1f3; stroke: #5645d4; stroke-width: 1.6; }
.map-t { font-size: 12.5px; font-weight: 600; fill: #3d3427; paint-order: stroke; stroke: #fbf7ee; stroke-width: 3.6px; stroke-linejoin: round; }
.map-t.water { font-style: italic; fill: #2f5f80; stroke: #e6f0f4; }
.map-t.on { fill: #5645d4; }
.map-t.small { font-size: 11px; }
.map-num { font-size: 12px; font-weight: 800; fill: #ffffff; }
.map-numc { fill: #5645d4; stroke: #ffffff; stroke-width: 1.6; }
.map-end { fill: #ffffff; stroke: #5645d4; stroke-width: 2.4; cursor: pointer; }
.map-end.done { fill: #5645d4; }
@media (max-width: 480px) {
  .map-t { font-size: 17px; } .map-t.small { font-size: 15px; } .map-t.ocean { font-size: 12px; letter-spacing: 1px; }
  .play:has(.map-fig) { padding: 8px; } .ex-sec:has(.map-fig) { padding: 18px 14px; } .map-fig { padding: 2px; }
}
.map-t.ocean { font-size: 10.5px; letter-spacing: 1.4px; font-weight: 600; }

/* режим родителя: родитель проходит уроки за ребёнка, прогресс не меняется */
.sandbox-bar { position: sticky; top: 8px; z-index: 45; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 8px 0 12px; padding: 10px 12px 10px 16px; border: 2px dashed var(--warning); border-radius: var(--r-12); background: var(--tint-yellow-bold);
  color: var(--charcoal); font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-2); }
.sandbox-bar b { color: var(--ink); }
.sandbox-bar .btn { min-height: 36px; padding: 6px 14px; background: var(--card); }
/* физическая карта: низменности — зелёные, возвышенности — жёлтые, горы — коричневые со штриховкой, ледники — белые */
.map-svg.relief .map-ru { fill: #cfe0ad; }
.map-up { fill: #ecdca0; stroke: #d8c47c; stroke-width: 0.5; }
.map-mt { stroke: #b98a57; stroke-width: 0.5; stroke-linejoin: round; }
.map-ice { fill: #fbfbf7; stroke: #a9c8d8; stroke-width: 0.6; }
.map-area { fill: #5645d4; fill-opacity: 0.1; stroke: #5645d4; stroke-width: 1.8; stroke-dasharray: 5 3; stroke-linejoin: round; }
/* Окружающий мир 4, «Равнины и горы России»: подписи суши, разрезы, камни, вулкан */
.map-t.land { font-style: normal; fill: #4a3a26; stroke: #fbf7ee; }
.map-t.land.on { fill: #5645d4; }
.map-t.side { font-size: 14px; letter-spacing: 1px; fill: #8a7a62; font-weight: 700; opacity: 0.85; }
.map-t.mono { font-family: ui-monospace, 'SF Mono', monospace; font-variant-numeric: tabular-nums; font-style: normal; fill: #7a6a52; font-weight: 500; }
.map-plume circle { fill: #7d7770; opacity: 0.4; animation: plume 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.map-plume.still circle { animation: none; opacity: 0.55; }
@keyframes plume { 0% { opacity: 0.25; transform: translateY(6px) scale(0.6); } 30% { opacity: 0.85; } 100% { opacity: 0.1; transform: translateY(-10px) scale(1.4); } }
.map-cone { fill: #9c6a3c; }
.hgt { transition: opacity .2s; }
.hgt.on path:first-child { stroke: #5645d4; stroke-width: 2; }
.hgt.on text { fill: #5645d4; }
.play-fig .surf { margin-top: 8px; }
.gems { display: flex; gap: 10px; margin-top: 10px; }
.gem { display: grid; justify-items: center; gap: 4px; padding: 6px 6px 8px; border: 1px solid var(--hairline-strong); border-radius: var(--r-12); background: var(--card); font: 600 14px/1.2 var(--font); color: var(--ink); cursor: pointer; width: 120px; }
.gem > div { width: 100%; }
.gem .map-fig { border: 0; padding: 0; }
.gem.on { border: 2px solid var(--primary); }
.tint-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, 0.15); }
@media (max-width: 480px) { .map-t.side { font-size: 16px; } .gem { width: 104px; } }

/* «Мак не отвечает» — полоса внизу экрана, пока телефон работает без Мака */
.offline-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 560px; margin: 0 auto;
  padding: 12px 16px; border-radius: var(--r-12); background: var(--tint-peach); color: var(--tint-peach-ink);
  font-size: 14px; line-height: 1.4; text-align: center; box-shadow: var(--shadow-2); }

/* Мега-контрольная Зои (js/mega.js): огненная карточка в штабе, шаги подготовки, памятки, таймер */
.fb-body p { white-space: pre-line; }   /* решение столбиком: каждая строка — своя запись */
.mega-card { background: radial-gradient(120% 140% at 8% 110%, #ffcf8a 0%, #ffe8d4 45%, #fff6e8 100%); border: 2px solid #ffb35c; color: var(--ink); text-decoration: none; position: relative; overflow: hidden; isolation: isolate; }
.mega-card::after { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 90%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 20% 100%, rgba(255, 107, 26, 0.28), transparent 70%), radial-gradient(40% 50% at 70% 100%, rgba(255, 176, 0, 0.22), transparent 70%);
  animation: mg-heat 3.2s ease-in-out infinite alternate; }
.mega-card .t-micro-up { color: #b44a00; }
.mg-flame { display: block; width: 100%; height: auto; overflow: visible; }
.mg-flame .f-out, .mg-flame .f-mid, .mg-flame .f-in { transform-box: fill-box; transform-origin: 50% 100%; }
.mg-flame .f-out { animation: mg-flick 1.6s ease-in-out infinite; }
.mg-flame .f-mid { animation: mg-flick 1.1s ease-in-out infinite reverse; }
.mg-flame .f-in { animation: mg-flick 0.8s ease-in-out infinite; }
.mg-flame .ember { animation: mg-ember 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.mg-flame .e2 { animation-delay: 0.7s; } .mg-flame .e3 { animation-delay: 1.4s; }
@keyframes mg-flick { 0%, 100% { transform: scale(1, 1) skewX(0deg); } 30% { transform: scale(0.96, 1.06) skewX(-3deg); } 60% { transform: scale(1.03, 0.95) skewX(2deg); } }
@keyframes mg-ember { 0% { opacity: 0; transform: translateY(14px) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1.2); } }
@keyframes mg-heat { from { opacity: 0.7; transform: translateY(4%); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .mg-flame *, .mega-card::after { animation: none !important; } }
.mg-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.8); overflow: hidden; margin-top: 4px; }
.mg-bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.wrap-base .mega-card .mg-bar { max-width: 320px; }

.mg-hero { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px 24px; border-radius: var(--r-20, 20px); margin: 8px 0 16px; }
.mg-hero h1 { margin: 2px 0 4px; }
.mg-hero .t-small { margin: 0 0 8px; color: var(--charcoal); }
.mg-hero-art { display: block; width: 110px; }
.mg-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.mg-step { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--hairline); border-radius: var(--r-12); background: var(--card); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.mg-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mg-step.now { border: 2px solid var(--primary); background: var(--surface-soft); }
.mg-step .t-small { color: var(--slate); }
.mg-step .btn { justify-self: start; margin-top: 4px; }
.mg-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-lavender); color: var(--tint-lavender-ink); font: 700 14px/1 var(--font-mono); }
.mg-step.now .mg-num { background: var(--primary); color: #fff; }
.mg-grade { font: 500 12px/1 var(--font-mono); color: var(--steel); margin-left: 6px; }
.mg-remind h2 { margin: 2px 0 6px; }
.mg-ex { display: grid; gap: 2px; margin-top: 8px; padding: 12px 14px; border-radius: var(--r-8); background: rgba(255, 255, 255, 0.7); }
.mg-ex .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.mg-timer { margin-left: auto; padding: 4px 10px; border-radius: var(--r-pill, 999px); background: var(--surface); font: 600 15px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.mg-timer.low { background: var(--tint-rose); color: var(--error); }
.mg-skip { display: flex; justify-content: flex-end; margin: -4px 0 4px; }
button.topic-row.mg-err { width: 100%; border: 0; border-bottom: 1px solid var(--hairline-soft); font: inherit; text-align: left; cursor: pointer; }
.mg-err small { display: block; color: var(--steel); font-size: 12px; margin-top: 2px; }
@media (max-width: 720px) {
  .mg-steps { grid-template-columns: minmax(0, 1fr); }
  .mg-hero { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .mg-hero-art { width: 72px; }
  .mg-hero h1 { font-size: 26px; }
}
.mg-peek { margin: 0 0 8px; }
.mg-peek summary { cursor: pointer; font: 500 14px/1.4 var(--font); color: var(--primary); width: max-content; }
.mg-peek .rule { margin-top: 8px; }

/* анимация логотипа на заглавном экране (решение Алексея 12.10.2026): при каждом заходе по очереди «Удар» и «Облёт»,
   сзади всегда медленно вращаются лучи. У букв и слова прозрачность не анимируется: она сплющивает объём; появление — через visibility */
@keyframes cam-hero { from { perspective-origin: 50% 50%; } to { perspective-origin: -19% 301%; } }
@keyframes cam-drift { 0% { perspective-origin: -19% 301%; } 30% { perspective-origin: 60% 340%; } 65% { perspective-origin: -90% 240%; } 100% { perspective-origin: 15% 270%; } }
.lg-burst { position: absolute; left: 50%; top: 50%; width: 120%; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(circle, #ffffff 0 16%, #f5d75e 17% 58%, #f08a3c 59%); }
.lg-burst::after { content: ''; position: absolute; inset: 0; opacity: 0.35;
  background: radial-gradient(circle, #dd5b00 30%, transparent 32%) 0 0 / 6% 6%; mask: radial-gradient(circle, transparent 30%, #000 70%); }
.lg-lines { position: absolute; left: 50%; top: 50%; width: 260%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.55) 0 0.7deg, transparent 0.7deg 9deg);
  mask: radial-gradient(circle, transparent 22%, #000 34%, transparent 62%); }
.lg-rays { position: absolute; left: 50%; top: 50%; width: 300%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(rgba(156, 207, 242, 0.09) 0 7deg, transparent 7deg 20deg);
  mask: radial-gradient(circle, #000 8%, transparent 50%); }

/* ---------- 1. Удар: буквы прилетают от камеры по одной и впечатываются, «бах», камера уходит вниз ---------- */
.v-slam .lg-ch { animation: slam 0.55s cubic-bezier(0.3, 0.6, 0.35, 1) calc(var(--k) * 0.09s) both; }
@keyframes slam { 0% { transform: translateZ(calc(470 * var(--u))); visibility: hidden; } 1% { visibility: visible; }
  75% { transform: translateZ(calc(-8 * var(--u))); } 100% { transform: none; } }
.v-slam .lg-word { animation: shake 0.42s linear 1.05s both; }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translate(calc(-5 * var(--u)), calc(3 * var(--u))); }
  35% { transform: translate(calc(4 * var(--u)), calc(-3 * var(--u))); } 55% { transform: translate(calc(-3 * var(--u)), calc(2 * var(--u))); }
  75% { transform: translate(calc(2 * var(--u)), calc(-1 * var(--u))); } }
.v-slam .lg-burst { display: block; animation: burst 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) 1.02s both; }
@keyframes burst { 0% { transform: scale(0.2) rotate(-12deg); opacity: 0; } 12% { opacity: 1; } 45% { transform: scale(1.05) rotate(3deg); opacity: 1; }
  100% { transform: scale(1.25) rotate(8deg); opacity: 0; } }
.v-slam .lg-lines { display: block; animation: lines 0.8s ease-out 1.02s both; }
@keyframes lines { 0% { opacity: 0; transform: scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
.v-slam .lg-cam { animation: cam-hero 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) 1.25s both, cam-drift 16s ease-in-out 2.15s infinite alternate; }
.v-slam .l3d { animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) calc(1.45s + var(--j) * 0.1s) both; }
@keyframes pop { from { transform: translate(-50%, -50%) translateZ(calc(6 * var(--u))) scale(0); }
  to { transform: translate(-50%, -50%) translateZ(calc(6 * var(--u))) scale(1); } }

/* ---------- 2. Облёт: камера облетает слово сбоку и встаёт в геройский ракурс снизу, блик ---------- */
.v-orbit .lg-word { animation: orbit-in 2.6s cubic-bezier(0.3, 0.55, 0.15, 1) both, orbit-idle 12s ease-in-out 2.6s infinite; }
@keyframes orbit-in { 0% { transform: translateZ(calc(-420 * var(--u))) rotateY(-80deg) rotateX(16deg); visibility: hidden; } 1% { visibility: visible; }
  72% { transform: translateZ(calc(10 * var(--u))) rotateY(6deg) rotateX(-2deg); } 100% { transform: none; } }
@keyframes orbit-idle { 0%, 100% { transform: none; } 25% { transform: rotateY(10deg) rotateX(-3deg); } 75% { transform: rotateY(-10deg) rotateX(4deg); } }
.v-orbit .lg-cam { animation: cam-hero 1.4s ease-in-out 1.3s both; }
.v-orbit .l3d { animation: fig-in 0.9s cubic-bezier(0.2, 0.8, 0.3, 1.25) calc(1.8s + var(--j) * 0.12s) both; }
@keyframes fig-in { from { transform: translate(-50%, -50%) translateZ(calc(380 * var(--u))); opacity: 0; }
  to { transform: translate(-50%, -50%) translateZ(calc(6 * var(--u))); opacity: 1; } }
/* фигурки прилетают голубым лицом к зрителю: вращение начинается с нуля в момент, когда фигурка встала на место */
.v-slam .l3d-spin { animation-delay: calc(2.05s + var(--j) * 0.1s); }
.v-orbit .l3d-spin { animation-delay: calc(2.7s + var(--j) * 0.12s); }
.intro-logo .lg-rays { display: block; animation: rays-in 1s ease-out 0.3s both, spin 48s linear infinite; }
@keyframes rays-in { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }
@keyframes spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .intro-logo, .intro-logo * { animation: none !important; } .intro-logo .lg-burst, .intro-logo .lg-lines { display: none; } }

/* мультик в конце темы (js/cartoon.js): светлая комната штаба, актёры — наши герои и Существа, реплики в белых облачках */
.toon { display: grid; gap: 8px; }
.toon-stage { position: relative; overflow: hidden; aspect-ratio: 760 / 460; border-radius: 20px; border: 1px solid var(--hairline);
  container-type: inline-size; background: #f7f3ff; --char-line: #1a1a1a; }
.toon-cam { position: absolute; inset: 0; transition: transform .6s ease-in-out; }
.toon-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.toon-actors, .toon-says { position: absolute; inset: 0; }
.toon-actor { position: absolute; transition-property: left, bottom, width, transform; transition-timing-function: cubic-bezier(.35, .1, .25, 1); }
.toon-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.toon-tri .tri-body { stroke: #1a1a1a; stroke-width: 3; stroke-linejoin: round; }
.toon-tri .tri-s { fill: none; stroke: transparent; stroke-width: 6; stroke-linecap: round; transition: stroke .3s; }
.toon-tri .tri-s.on { stroke: #5645d4; }
.toon-tri .tri-arc { fill: none; stroke: transparent; stroke-width: 4; stroke-linecap: round; transition: stroke .3s; }
.toon-tri .tri-arc.on { stroke: #dd5b00; }
.toon-say { position: absolute; z-index: 20; translate: -50% 0; margin: 0 0 10px; max-width: 46%; width: max-content; padding: 1.4cqw 1.8cqw;
  border-radius: 14px; background: #ffffff; color: #1a1a1a; font: 600 clamp(13px, 2.3cqw, 18px)/1.35 var(--font);
  box-shadow: rgba(15, 15, 15, 0.16) 0 8px 22px -6px; border: 2px solid #1a1a1a; animation: toon-pop .3s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes toon-pop { from { opacity: 0; transform: translateY(8px) scale(.85); } }
.toon-say::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -8px; width: 12px; height: 12px; margin-left: -6px; background: #ffffff;
  border-right: 2px solid #1a1a1a; border-bottom: 2px solid #1a1a1a; transform: rotate(45deg); }
.toon-title { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 6%; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #1a2a52 0%, #0a1530 70%); color: #ffffff; font: 900 clamp(20px, 4.6cqw, 40px)/1.15 var(--font-display); }
.toon-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; background: #ffffff; opacity: 0; }
.toon-flash.on { animation: toon-flash .5s ease-out; }
@keyframes toon-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.toon-spark { position: absolute; width: 1.4cqw; height: 1.4cqw; background: #f5d75e; z-index: 15; pointer-events: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: toon-spark .9s ease-out forwards; }
@keyframes toon-spark { from { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(-9cqw) scale(.4); opacity: 0; } }
.toon-end { position: absolute; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 6%; text-align: center;
  background: rgba(247, 243, 255, 0.88); }
.toon-end-title { margin: 0; font: 900 clamp(24px, 5cqw, 44px)/1.1 var(--font-display); color: var(--ink); }
.toon-end-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.toon-bar { display: flex; justify-content: flex-end; }
.toon-skip { border: 0; background: none; padding: 6px 4px; font: 500 13px var(--font); color: var(--steel); cursor: pointer; }
.toon-skip:hover { color: var(--ink); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .toon-actor, .toon-cam { transition-duration: 0ms !important; } .toon-spark { display: none; } }
.toon-title[hidden], .toon-end[hidden], .toon-bar[hidden] { display: none; }
.toon-stage { width: min(100%, calc((100dvh - 200px) * 760 / 460)); margin-inline: auto; }   /* сцена целиком в окне */
.toon-bar { width: min(100%, calc((100dvh - 200px) * 760 / 460)); margin-inline: auto; }

/* домашка: своя книга и упражнения с пропусками */
.hw-own { border-style: dashed; }
.hw-own-form { margin-top: 8px; }
.hw-own-form[hidden] { display: none; }
.hw-fill { display: grid; gap: 10px; }
.hw-fill-line { margin: 0; font-size: 19px; line-height: 2.1; color: var(--ink); }
.hw-gap { width: calc(var(--n, 1) * 1.15ch + 18px); min-width: 30px; height: 36px; margin: 0 2px; padding: 0 4px; text-align: center;
  font: 600 19px var(--font-mono); color: var(--primary); background: var(--tint-lavender); border: 0; border-bottom: 2px solid var(--primary);
  border-radius: 6px 6px 0 0; vertical-align: baseline; }
.hw-gap:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.hw-gap.right { color: var(--tint-mint-ink); background: var(--tint-mint); border-bottom-color: var(--success); }
.hw-gap.wrong { color: var(--error); background: var(--tint-rose); border-bottom-color: var(--error); }
.hw-write b { color: var(--primary); }

/* домашка: режим объяснения после 3 неверных попыток */
.hw-explain { display: grid; gap: 8px; margin-top: 12px; background: var(--tint-yellow); border: 0; }
.hw-ex-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.hw-ex-steps li::marker { color: var(--primary); font-weight: 700; }
.hw-ex-end { margin: 0; font-weight: 600; color: var(--ink); }
.hw-msg-big { padding: 10px 12px; border-radius: var(--r-12); background: var(--tint-mint); color: var(--tint-mint-ink); font-weight: 600; }
.hw-pick { padding: 14px; border-radius: var(--r-12); background: var(--tint-lavender); }

/* домашка: проверка по шагам */
.hw-ask { margin: 2px 0 4px; }
.hw-wait { text-align: center; padding: 28px 20px; }
.hw-blink { margin: 0 0 6px; font: 800 22px/1.3 var(--font-display); color: var(--primary); animation: hw-blink 1.4s ease-in-out infinite; }
@keyframes hw-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .hw-blink { animation: none; } }
.hw-parts { display: grid; gap: 12px; }
.hw-part { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: start; }
.hw-part-k { font: 800 20px/44px var(--font-display); color: var(--ink); }
.hw-part-body { display: grid; gap: 4px; }
.hw-part .hw-in.right { border: 2px solid var(--success); background: var(--tint-mint); }
.hw-part .hw-in.wrong { border: 2px solid var(--error); background: var(--tint-rose); }
.hw-sum { display: grid; gap: 14px; }
.hw-sum-num { margin: 10px 0 2px !important; font-weight: 700; color: var(--ink); }
.hw-go-btn { min-height: 36px; padding: 6px 14px; }
.hw-next { margin-top: 12px; }
.hw-books-box { display: grid; gap: 6px; margin-top: 8px; }
.hw-books-box[hidden], .hw-books [hidden] { display: none; }
.hw-own-form { display: grid; gap: 8px; }

/* ---------- проверка дня (12.10.2026) ---------- */
.base-chips a.daily-chip { text-decoration: none; background: #f5d75e; color: #1a1a1a; font-weight: 600; animation: dailyPulse 2.4s ease-in-out infinite; }
.base-chips a.daily-chip.done { background: rgba(255, 255, 255, 0.12); color: #ffffff; font-weight: 400; animation: none; }
@keyframes dailyPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 215, 94, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(245, 215, 94, 0); } }
.daily-card { border: 2px solid var(--primary); }
.daily-intro { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; padding: 24px; border-radius: 20px; }
.daily-intro-art { width: 150px; }
.daily-intro-text { display: grid; gap: 6px; }
.daily-intro-text .t-h3 { margin: 0; }
.daily-intro-text .t-small { margin: 0; color: var(--charcoal); }
.daily-subs { display: grid; gap: 8px; }
.daily-sub { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 14px; }
.daily-sub b { font: 600 13px/1 ui-monospace, 'SF Mono', monospace; text-align: right; color: var(--slate); }
.daily-sub .bar { height: 8px; }
@media (max-width: 560px) {
  .daily-intro { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .daily-intro-art { width: 90px; }
  .daily-sub { grid-template-columns: 110px minmax(0, 1fr) 56px; }
}
@media (prefers-reduced-motion: reduce) { .base-chips a.daily-chip { animation: none; } }

/* ---------- темы: дорожка предмета, как в Duolingo (12.10.2026) ---------- */
.subj-cards { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.subj-card { flex: 0 0 auto; display: grid; grid-template-columns: 56px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  min-width: 200px; padding: 10px 14px 10px 10px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--card); cursor: pointer; font: inherit; color: var(--ink); }
.subj-card[aria-selected="true"] { border: 2px solid var(--primary); padding: 9px 13px 9px 9px; background: var(--surface-soft); }
.subj-ring { grid-row: 1 / 3; position: relative; width: 56px; height: 56px; }
.subj-ring .ring { width: 56px; height: 56px; }
.subj-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 13px/1 ui-monospace, 'SF Mono', monospace; font-variant-numeric: tabular-nums; }
.subj-name { font: 800 16px/1.2 var(--font-display); align-self: end; }
.subj-sub { font-size: 12px; color: var(--steel); align-self: start; }
.ring .ring-bg { fill: none; stroke: var(--hairline-soft); }
.ring .ring-fg { fill: none; stroke: var(--primary); stroke-linecap: round; }

.lesson-path { display: grid; gap: 24px; }
/* тема — полянка: небо сверху, луг ниже, по лугу петляет песочная дорожка */
.unit { position: relative; display: grid; gap: 8px; padding: 14px 14px 36px; border-radius: 24px; overflow: hidden;
  background: radial-gradient(120% 60% at 50% 100%, #d5eec6 0%, rgba(213, 238, 198, 0) 70%), linear-gradient(#dcecfa 0, #eef7fd 120px, #eef8e6 220px, #e3f3d8 100%);
  border: 1px solid #d9ecd0; }
.unit::before { content: ""; position: absolute; left: 0; right: 0; top: 190px; bottom: 0; pointer-events: none; opacity: .75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='120' viewBox='0 0 190 120'%3E%3Cg fill='none' stroke='%237dbf68' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 40 C19 34 17 31 14 29 M22 40 C22 33 23 29 26 26 M24 40 C25 35 28 33 31 32'/%3E%3Cpath d='M120 22 C119 16 117 13 114 11 M122 22 C122 15 123 11 126 8 M124 22 C125 17 128 15 131 14'/%3E%3Cpath d='M78 96 C77 90 75 87 72 85 M80 96 C80 89 81 85 84 82 M82 96 C83 91 86 89 89 88'/%3E%3Cpath d='M160 70 C159 65 157 63 155 62 M162 70 C162 64 163 61 165 59'/%3E%3C/g%3E%3Cg fill='%23a6dc8f'%3E%3Ccircle cx='52' cy='64' r='1.6'/%3E%3Ccircle cx='140' cy='106' r='1.6'/%3E%3Ccircle cx='100' cy='40' r='1.4'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 190px 120px repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='120' viewBox='0 0 190 120'%3E%3Cg fill='none' stroke='%237dbf68' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 40 C19 34 17 31 14 29 M22 40 C22 33 23 29 26 26 M24 40 C25 35 28 33 31 32'/%3E%3Cpath d='M120 22 C119 16 117 13 114 11 M122 22 C122 15 123 11 126 8 M124 22 C125 17 128 15 131 14'/%3E%3Cpath d='M78 96 C77 90 75 87 72 85 M80 96 C80 89 81 85 84 82 M82 96 C83 91 86 89 89 88'/%3E%3Cpath d='M160 70 C159 65 157 63 155 62 M162 70 C162 64 163 61 165 59'/%3E%3C/g%3E%3Cg fill='%23a6dc8f'%3E%3Ccircle cx='52' cy='64' r='1.6'/%3E%3Ccircle cx='140' cy='106' r='1.6'/%3E%3Ccircle cx='100' cy='40' r='1.4'/%3E%3C/g%3E%3C/svg%3E") 70px 50px / 290px 184px repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 60px); mask-image: linear-gradient(transparent, #000 60px); }
.unit-clouds { position: absolute; left: 0; top: 64px; width: 100%; height: 60px; fill: #ffffff; opacity: .9; pointer-events: none; }
.unit-road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.unit-road path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.unit-road .rd-edge { stroke: #e6d6b8; stroke-width: 34; }
.unit-road .rd-sand { stroke: #fff8ec; stroke-width: 28; }
.unit-road .rd-dash { stroke: #f2c9a3; stroke-width: 3.5; stroke-dasharray: 2 12; }
.unit-road .rd-done { stroke: var(--primary); stroke-width: 4; stroke-dasharray: 2 12; }
.unit-band { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 18px; box-shadow: var(--shadow-1); }
.unit-title { margin: 2px 0 0; font: 800 20px/1.25 var(--font-display); color: var(--ink); }
.unit-explain { flex: 0 0 auto; background: #ffffff; }
.unit-nodes { position: relative; z-index: 1; list-style: none; margin: 0; padding: 40px 0 0; display: grid; gap: 34px; justify-items: center; }
.lnode-row { position: relative; display: grid; justify-items: center; gap: 6px; transform: translateX(var(--x)); width: 190px; }
.lnode { position: relative; display: grid; place-items: center; width: 100px; height: 100px; text-decoration: none; }
.lnode::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); z-index: -1; }
.lnode .ring { position: absolute; inset: 0; width: 100px; height: 100px; }
.ring .ring-bg { fill: none; stroke: var(--hairline-soft); }
.lnode .ring .ring-bg { stroke: rgba(255, 255, 255, 0.95); }
.lnode-btn { position: relative; display: grid; place-items: center; width: 72px; height: 66px; border-radius: 50%; overflow: hidden; transition: transform .12s, box-shadow .12s;
  background: radial-gradient(70% 60% at 35% 28%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%), var(--c); color: #ffffff;
  box-shadow: 0 7px 0 var(--c2), 0 12px 16px rgba(40, 70, 40, 0.18); transform: translateY(-4px); --c: var(--primary); --c2: var(--primary-pressed); }
.lnode-btn svg { width: 40px; height: 40px; }
.lnode:hover .lnode-btn { transform: translateY(-7px); box-shadow: 0 10px 0 var(--c2), 0 16px 18px rgba(40, 70, 40, 0.16); }
.lnode:active .lnode-btn { transform: translateY(2px); box-shadow: 0 1px 0 var(--c2); }
.lnode:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 50%; }
.lnode.k-new .lnode-btn { --c: #ffffff; --c2: #d8d4cc; color: #c8c4be; }
.lnode.k-new.next .lnode-btn { --c: var(--primary); --c2: var(--primary-pressed); color: #ffffff; }
.lnode.k-done .lnode-btn { --c: #f5d75e; --c2: #d4ae2a; color: #ffe98a; }
.lnode.k-weak .lnode-btn { --c: #ffa86b; --c2: #e07f3f; }
.lnode.k-weak .ring-fg { stroke: #ffa86b; }
.lnode.k-check .lnode-btn { --c: #5aa9e6; --c2: #2f7fbd; }
.lnode.k-check .ring-fg { stroke: #5aa9e6; }
.lnode.test .lnode-btn { width: 80px; height: 72px; border-radius: 24px; }
.lnode.test.k-new .lnode-btn { --c: #e6e0f5; --c2: #c5b9e8; color: #8b7bd0; }
.lnode.test.k-done .lnode-btn { color: #ffffff; }
.lnode.next::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 3px solid var(--primary); opacity: 0.35; animation: lnodePulse 1.8s ease-out infinite; }
@keyframes lnodePulse { from { transform: scale(0.9); opacity: 0.5; } to { transform: scale(1.25); opacity: 0; } }
.lnode-say { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 12px; background: #ffffff;
  border: 2px solid var(--hairline); font: 800 15px/1 var(--font-display); color: var(--primary); white-space: nowrap; animation: lnodeBob 1.6s ease-in-out infinite; z-index: 1; }
.lnode-say::after { content: ""; position: absolute; left: 50%; top: 100%; width: 10px; height: 10px; background: #ffffff; border: solid var(--hairline); border-width: 0 2px 2px 0;
  transform: translate(-50%, -5px) rotate(45deg); }
@keyframes lnodeBob { 50% { transform: translate(-50%, -4px); } }
.lnode-name { font-size: 13px; line-height: 1.3; text-align: center; color: var(--charcoal); padding: 5px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.88); box-shadow: 0 1px 2px rgba(40, 70, 40, 0.08); }
.lnode-name small { display: block; font-size: 12px; color: var(--steel); }
.lnode-hero { position: absolute; top: -6px; width: 92px; pointer-events: none; }
.lnode-hero.r { left: calc(50% + 62px); }
.lnode-hero.l { right: calc(50% + 62px); }
.lnode-deco { position: absolute; top: 4px; width: 74px; pointer-events: none; }
.lnode-deco svg { display: block; width: 100%; height: auto; }
.lnode-deco.r { left: calc(50% + 110px); }
.lnode-deco.l { right: calc(50% + 110px); }
.lnode-deco.far { top: 30px; width: 62px; opacity: .95; }
.lnode-deco.far.r { left: calc(50% + 200px); }
.lnode-deco.far.l { right: calc(50% + 200px); }
@media (min-width: 700px) { .lnode-row { transform: translateX(calc(var(--x) * 1.25)); } }
@media (max-width: 699px) { .lnode-deco.far { display: none; } }
@media (max-width: 560px) {
  .unit { padding: 12px 10px 30px; }
  .lnode-row { transform: translateX(calc(var(--x) * 0.7)); }
  .unit-band { flex-direction: column; align-items: flex-start; }
  .lnode-hero { width: 72px; }
  .lnode-deco { width: 50px; }
  .lnode-deco.r { left: calc(50% + 98px); }
  .lnode-deco.l { right: calc(50% + 98px); }
}
@media (prefers-reduced-motion: reduce) { .lnode.next::before, .lnode-say { animation: none; } }

/* английский: ответ словами — поле во всю ширину и плашки слов (тема «to be», 12.10.2026) */
.task-card .num.words { flex-wrap: nowrap; }
.task-card .num.words input { flex: 1 1 auto; min-width: 0; width: auto; font: 500 20px/1.3 var(--font); }
@media (max-width: 480px) { .task-card .num.words { flex-wrap: wrap; } .task-card .num.words input { flex-basis: 100%; } .task-card .num.words .btn { width: 100%; } }
.tiles-ans { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 64px; padding: 8px 10px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-12); background: var(--surface-soft); }
.tiles-ans.right { border: 2px solid var(--success); background: var(--tint-mint); padding: 7px 9px; }
.tiles-ans.wrong { border: 2px solid var(--error); background: var(--tint-rose); padding: 7px 9px; }
.tiles-ph { color: var(--muted); font-size: 15px; }
.tiles-end { font: 700 20px/1 var(--font); color: var(--ink); margin-left: -4px; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tile { font: 600 19px/1.2 var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--hairline-strong); border-bottom-width: 3px; border-radius: var(--r-12); padding: 9px 14px 8px; min-height: 46px; cursor: pointer; }
.tile:hover:not(:disabled) { background: var(--surface-soft); }
.tile:disabled { cursor: default; }
.tiles .tile.used { color: transparent; background: var(--surface); border-color: var(--hairline); }
.ex-sec .bio-btns .pill-tab[lang="en"] { font-size: 16px; padding: 8px 14px; }
.tiles-ans .tile.in { background: var(--tint-lavender); color: var(--tint-lavender-ink); border-color: #cfc5ea; }
.tiles-ans .tile.in:disabled { color: var(--tint-lavender-ink); }
.tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tiles-go { margin-top: 14px; }
.tiles-go .btn { min-height: 56px; min-width: 160px; }
/* английский: объяснение */
.en-tbl { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 14px; align-items: baseline; padding: 12px 14px; border-radius: var(--r-12); background: var(--surface); max-width: 460px; }
.en-tbl .en { font-weight: 700; font-size: 18px; color: var(--ink); }
.en-be { color: var(--primary); font-weight: 700; }
.en-not { color: var(--error); font-weight: 700; }
.en-fig { max-width: none; }
.en-stage { min-height: 86px; display: grid; align-content: center; gap: 4px; padding: 10px 4px; }
.en-big { margin: 0; font: 600 26px/1.3 var(--font); color: var(--ink); }
.en-ru { margin: 0; font-size: 15px; color: var(--steel); }
.sq-gone { color: var(--error); text-decoration: line-through; }
.en-jump .en-be { display: inline-block; animation: en-jump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes en-jump { from { transform: translate(120%, -12px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .en-jump .en-be { animation: none; } }
.en-pairs { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-12); background: var(--surface); }
.en-pairs p { margin: 0; }
.en { font-weight: 600; }
@media (max-width: 480px) { .en-big { font-size: 22px; } .en-tbl { grid-template-columns: auto 1fr; } }
/* озвучка английского: кнопка-динамик (js/say.js) */
.say-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; vertical-align: middle; border: 1px solid var(--hairline); border-radius: var(--r-pill); background: var(--tint-lavender); color: var(--primary); cursor: pointer; flex: none; }
.say-btn svg { width: 20px; height: 20px; }
.say-btn:hover { background: #dcd3f2; }
.say-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.say-btn.playing { background: var(--primary); color: #ffffff; border-color: var(--primary); animation: say-pulse 1s ease-in-out infinite; }
@keyframes say-pulse { 50% { box-shadow: 0 0 0 6px rgba(86, 69, 212, 0.18); } }
@media (prefers-reduced-motion: reduce) { .say-btn.playing { animation: none; } }
.say-btn.in-text { width: 30px; height: 30px; margin-left: 2px; position: relative; top: -2px; }
.say-btn.in-text svg { width: 17px; height: 17px; }
.en-word { font: 700 18px/1.2 var(--font); color: var(--primary); background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-8); padding: 4px 10px; cursor: pointer; justify-self: start; }
.en-word:hover, .en-word.playing { background: var(--tint-lavender); }

/* вход по логину и паролю (только в интернете) — карточка как у кода для родителей */
.auth-form { display: grid; gap: 12px; width: 100%; margin-top: 8px; text-align: left; }
.auth-field { display: grid; gap: 6px; }
.auth-in { font: 400 16px/1.3 var(--font); height: 48px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-8); background: var(--card); color: var(--ink); width: 100%; }
.auth-in:focus { outline: none; border: 2px solid var(--primary); padding: 0 13px; }
.auth-form .btn { width: 100%; height: 48px; justify-content: center; }
.auth-form .pin-msg { text-align: center; }
.auth-link { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--tint-lavender); color: var(--tint-lavender-ink, #391c57); font: 500 13px/1.4 var(--font); word-break: break-all; }

/* ---------- панель родителя: компактная сводка (12.10.2026) ---------- */
.pd-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.parent.stack { gap: 22px; }
.pd-kpi { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pk { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-radius: var(--r-12); background: var(--surface); }
.pk > span { font: 600 11px/1.4 var(--font); letter-spacing: 1px; text-transform: uppercase; color: var(--steel); }
.pk b { display: inline-flex; align-items: center; gap: 2px; font: 600 20px/1.25 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk b .coin-ico { width: 18px; height: 18px; }
.pk small { font-size: 12px; color: var(--steel); }
.pd-signals { display: grid; gap: 6px; }
.pd-signals .psignal { padding: 10px 14px; font-size: 14px; }
.pd-subj .prow { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 0.8fr); padding: 10px 14px; }
.pd-subj .pd-head { background: var(--surface-soft); font-size: 12px; color: var(--steel); padding: 8px 14px; }
.pd-name { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.pd-name small { font-weight: 400; }
.pd-name > i, .pd-legend i, .pd-dot { flex: 0 0 auto; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; }
.pd-dot { margin: 0 6px 1px 0; vertical-align: middle; }
.pd-err { display: inline-block; padding: 1px 8px; border-radius: var(--r-6); font: 600 13px/1.5 ui-monospace, 'SF Mono', monospace; }
.pd-err.good { background: var(--tint-mint); color: var(--tint-mint-ink); }
.pd-err.mid { background: var(--tint-peach); color: var(--tint-peach-ink); }
.pd-err.bad { background: var(--tint-rose); color: #a02e6d; }
.pd-chart .pc-track { fill: var(--surface); }
.pd-chart .pc-min { font: 600 11px ui-monospace, 'SF Mono', monospace; fill: var(--slate); text-anchor: middle; }
.pd-chart .pc-day { font: 12px var(--font); fill: var(--steel); text-anchor: middle; }
.pd-chart .pc-day.today { font-weight: 700; fill: var(--ink); }
.pd-chart .pc-coin { font: 600 10px ui-monospace, 'SF Mono', monospace; fill: #b08900; text-anchor: middle; }
.pd-chart { max-width: 720px; }
.pd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0; font-size: 13px; color: var(--charcoal); }
.pd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pd-legend i { margin: 0; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip { padding: 4px 10px; border-radius: var(--r-pill); background: var(--tint-rose); font-size: 13px; color: var(--charcoal); }
.pd-chip b { font-family: ui-monospace, 'SF Mono', monospace; }
.pd-mist .pd-m { width: 100%; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 0.6fr); text-align: left; background: var(--card); border: 0; border-bottom: 1px solid var(--hairline-soft); font: inherit; cursor: pointer; }
.pd-mist .pd-m:hover { background: var(--surface-soft); }
.pd-mist .pd-m[aria-expanded="true"] { background: var(--tint-lavender); }
.pd-ans { color: #a02e6d; font-size: 13px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-q { padding: 12px 14px 16px; border-bottom: 1px solid var(--hairline-soft); background: var(--surface-soft); }
.pd-qcard { display: grid; gap: 8px; }
.pd-qcard p { margin: 0; }
.pd-qtext { font-size: 16px; font-weight: 600; color: var(--ink); }
.pd-opts { display: grid; gap: 6px; }
.pd-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-8); border: 1px solid var(--hairline-strong); background: var(--card); font-size: 14px; }
.pd-opt small { margin-left: auto; font-size: 12px; color: var(--steel); }
.pd-opt.right { border: 2px solid var(--success); background: var(--tint-mint); }
.pd-opt.wrong { border: 2px solid var(--error); background: var(--tint-rose); }
.pd-more > summary { cursor: pointer; list-style: none; padding: 10px 14px; border-radius: var(--r-12); background: var(--surface); }
.pd-more > summary::-webkit-details-marker { display: none; }
.pd-more > summary::after { content: " ▾"; color: var(--steel); }
.pd-more[open] > summary::after { content: " ▴"; }
@media (max-width: 900px) { .pd-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pk b { font-size: 18px; white-space: normal; flex-wrap: wrap; } }
@media (max-width: 640px) {
  .pd-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-subj .pd-head { display: none; }
  .pd-subj .prow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; }
  .pd-subj .prow > span:nth-child(n+3)::before { display: block; font-size: 11px; color: var(--steel); }
  .pd-subj .prow > span:nth-child(3)::before { content: "Ошибок за 7 дней"; }
  .pd-subj .prow > span:nth-child(4)::before { content: "Сегодня"; }
  .pd-subj .prow > span:nth-child(5)::before { content: "За 7 дней"; }
  .pd-mist .pd-m { grid-template-columns: 64px minmax(0, 1fr); }
  .pd-ans { grid-column: 2; text-align: left; }
}
.pin .auth-guest { width: 100%; height: 48px; justify-content: center; margin-top: 4px; }
/* просьба Решателей сфоткать страницы учебника (13.10.2026) */
.hw-ask { display: grid; gap: 8px; background: var(--tint-yellow); border: 0; border-radius: 20px; }
.hw-ask .t-h5, .hw-ask .t-small { margin: 0; }
.hw-ask-ok { margin: 0; padding: 8px 12px; border-radius: var(--r-8); background: var(--tint-mint); color: var(--tint-mint-ink); font: 600 14px/1.4 var(--font); }
