/* Блоки заданий внутри миссии: единый каркас шага и новые виды «Распредели», «Посчитай цель», «Найди признаки», «Разложи», «Правило».
   Отдельный файл — чтобы не пересекаться с правками style.css в других сессиях. */

/* --- каркас: шапка шага, вопрос, зона действия у нижнего края --- */
.step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.step-head .sh-ic { width: 38px; height: 38px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c, var(--teal)); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }
.step-head b { display: block; font-family: var(--font-title); font-size: 1.2em; line-height: 1.1; }
.step-head span:not(.sh-ic) { display: block; font-size: .8em; font-weight: 700; color: rgba(42, 51, 82, .68); margin-top: 1px; }
.step-q { font-weight: 800; font-size: 1.08em; margin: 0 0 10px; text-wrap: balance; }
.act-bar { position: fixed; z-index: 24; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--cream) 70%, rgba(255, 244, 224, 0)); }
.act-bar.off { display: none; }
.act-in { max-width: 398px; margin: 0 auto; }
.act-in > button { width: 100%; }
/* то, что нажимается — с жёсткой рамкой; то, что читается — мягко */
.mission .card.soft { border: 2px solid var(--soft-line); box-shadow: none; }
.mission .opt { border-width: 3px; }

/* --- «Распредели»: монеты по конвертам --- */
.bud { display: flex; flex-direction: column; gap: 10px; }
.bud-pocket { background: #fff; border: 2px solid var(--soft-line); border-radius: 22px; padding: 12px 14px; }
.bud-coins { display: flex; flex-wrap: wrap; gap: 4px; min-height: 26px; margin: 6px 0 4px; align-items: center; }
.bc { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe28a, var(--sun) 60%); border: 3px solid var(--navy); box-shadow: 0 2px 0 var(--navy); animation: bc-in .22s cubic-bezier(.2, 1.6, .4, 1) backwards; }
@keyframes bc-in { from { transform: scale(.3) translateY(-10px); opacity: 0; } }
.bud-env { display: flex; align-items: center; gap: 8px; }
.bud-body { flex: 1; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; padding: 8px 12px; background: #fff; color: var(--navy); border: 3px solid var(--navy); border-radius: 18px 18px 18px 6px; box-shadow: 0 4px 0 var(--navy); font: inherit; position: relative; overflow: hidden; }
.bud-body::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: linear-gradient(135deg, transparent 49%, rgba(42, 51, 82, .12) 50%) 0 0 / 50% 100% no-repeat, linear-gradient(225deg, transparent 49%, rgba(42, 51, 82, .12) 50%) 100% 0 / 50% 100% no-repeat; }
.bud-body.full-env { border-color: rgba(42, 51, 82, .3); box-shadow: 0 4px 0 rgba(42, 51, 82, .2); }
.bud-t { font-weight: 800; font-size: .95em; }
.bud-body .bud-coins { margin: 0; min-height: 0; } .bud-body .bc { width: 18px; height: 18px; border-width: 2px; box-shadow: none; margin-right: -8px; }
.bud-minus { width: 40px; height: 40px; min-height: 0; flex: none; padding: 0; border-radius: 50%; background: #fff; color: var(--navy); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); font-size: 1.3em; }
.bud-minus:disabled { opacity: .25; box-shadow: none; }
.bud-sum { width: 64px; text-align: right; flex: none; }
.bud-reserve { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 20px; border: 3px dashed var(--teal); background: rgba(43, 179, 163, .1); }
.shake-no { animation: shake-no .3s ease; }
@keyframes shake-no { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- «Посчитай цель»: банка и дорожка недель --- */
.goal-scene { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.goal-jar { position: relative; width: 66px; height: 84px; flex: none; border: 4px solid var(--navy); border-radius: 12px 12px 20px 20px; background: rgba(255, 255, 255, .7); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.goal-jar::before { content: ""; position: absolute; top: -4px; left: 12px; right: 12px; height: 9px; background: var(--grape); border: 3px solid var(--navy); border-radius: 6px; z-index: 2; }
.goal-jar i { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(0deg, var(--sun) 0 7px, #f0b51e 7px 9px); transition: height .6s cubic-bezier(.2, 1, .3, 1); }
.goal-jar span { position: relative; z-index: 1; font-size: .95em; text-shadow: 0 0 6px #fff, 0 0 6px #fff; }
.goal-road { position: relative; height: 66px; margin: 6px 6px 14px; }
.gr-line { position: absolute; left: 0; right: 0; top: 46px; height: 0; border-top: 4px dashed rgba(42, 51, 82, .3); }
.gr-now { position: absolute; left: 0; top: 52px; font-size: .68em; font-weight: 800; color: rgba(42, 51, 82, .6); }
.gr-now::before { content: ""; position: absolute; left: 0; top: -13px; width: 14px; height: 14px; border-radius: 50%; background: var(--navy); }
.gr-flag { position: absolute; top: 0; transform: translateX(-100%); display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px 12px 2px 12px; background: var(--sun); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); font-size: .82em; white-space: nowrap; transition: left .7s cubic-bezier(.2, 1.1, .3, 1); }
.gr-flag::after { content: ""; position: absolute; right: -3px; top: 100%; width: 3px; height: 18px; background: var(--navy); }
.goal-opt { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; padding: 10px 4px; margin: 0; }
.goal-opt b { font-size: 1.15em; } .goal-opt.on { border-color: var(--teal); background: var(--good-soft); box-shadow: 0 5px 0 var(--teal); }

/* --- «Найди признаки»: маркер, счётчик, зоны на предмете --- */
.flag-opt { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.flag-mark { width: 24px; height: 24px; flex: none; margin-top: 1px; border-radius: 8px; border: 3px solid rgba(42, 51, 82, .3); display: flex; align-items: center; justify-content: center; color: transparent; }
.flag-opt.on { background: linear-gradient(100deg, rgba(255, 201, 60, .55), rgba(255, 201, 60, .3)); border-color: var(--navy); }
.flag-opt.on .flag-mark { background: var(--navy); border-color: var(--navy); color: #fff; }
.flag-art .art { margin-top: 0; }
.flag-zone { cursor: pointer; border-radius: 8px; outline: 3px dashed transparent; outline-offset: 4px; transition: outline-color .15s, background .15s; }
.flag-zone.marked { outline-color: var(--tang); background: rgba(255, 201, 60, .45); }
.flag-zone.real { outline: 3px solid var(--teal); } .flag-zone.fake { outline: 3px dashed rgba(42, 51, 82, .3); }
.flag-art .sale-timer.flag-zone { animation: none; }

/* --- «Разложи»: карточка и две корзины --- */
.sort-stage { min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.sort-card { background: #fff; border: 3px solid var(--navy); border-radius: 22px; box-shadow: 0 6px 0 var(--navy); padding: 28px 18px; text-align: center; font-family: var(--font-title); font-weight: 800; font-size: 1.3em; line-height: 1.2; animation: bc-in .25s cubic-bezier(.2, 1.4, .4, 1) backwards; transition: transform .25s ease-in, opacity .25s ease-in; }
.sort-card.fly-l { transform: translate(-60%, 120%) rotate(-18deg) scale(.4); opacity: 0; }
.sort-card.fly-r { transform: translate(60%, 120%) rotate(18deg) scale(.4); opacity: 0; }
.sort-bins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sort-bin { position: relative; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: 12px 12px 24px 24px; border: 3px solid var(--navy); box-shadow: 0 5px 0 var(--navy); color: var(--navy); font-size: 1.05em; }
.sort-bin.b0 { background: color-mix(in srgb, var(--teal) 30%, #fff); } .sort-bin.b1 { background: color-mix(in srgb, var(--sun) 45%, #fff); }
.sort-bin::before { content: ""; position: absolute; left: 14%; right: 14%; top: -12px; height: 14px; border: 3px solid var(--navy); border-bottom: 0; border-radius: 40px 40px 0 0; }
.sort-cnt { font-family: var(--font-title); font-weight: 800; font-size: 1.3em; line-height: 1; }
.sort-bin.got { animation: bin-got .3s ease-out; }
@keyframes bin-got { 40% { transform: translateY(5px) scale(1.04, .94); } }
.sort-result { align-items: start; gap: 10px; }
.sort-col { border-radius: 18px; padding: 10px; border: 2px solid var(--soft-line); background: #fff; }
.sort-col.b0 { background: color-mix(in srgb, var(--teal) 10%, #fff); } .sort-col.b1 { background: color-mix(in srgb, var(--sun) 16%, #fff); }
.sort-item { margin-top: 8px; font-size: .86em; } .sort-item b { display: block; } .sort-item span { display: block; color: rgba(42, 51, 82, .7); font-weight: 700; font-size: .92em; margin-top: 2px; }
.sort-item.argue b::after { content: " · спорно"; color: var(--tang); font-size: .85em; }

/* --- «Правило»: карточка-трофей со штампом --- */
.rule-card { position: relative; margin-top: 16px; padding: 22px 18px 26px; border-radius: 26px; background: linear-gradient(160deg, #fff6d6, #ffe28a); border: 3px solid var(--navy); box-shadow: 0 6px 0 var(--navy); cursor: pointer; animation: rule-flip .6s cubic-bezier(.2, 1.1, .3, 1) backwards; transform-origin: 50% 100%; }
@keyframes rule-flip { from { transform: perspective(700px) rotateX(70deg); opacity: 0; } }
.rule-art { position: absolute; right: -6px; top: -26px; width: 86px; height: 86px; transform: rotate(10deg); pointer-events: none; }
.rule-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(42, 51, 82, .15)); }
.rule-card h2 { padding-right: 64px; text-wrap: balance; }
.rule-stamp { position: absolute; right: 14px; bottom: -14px; padding: 4px 14px; border: 4px solid var(--berry); border-radius: 12px; color: var(--berry); background: rgba(255, 255, 255, .85); font-family: var(--font-title); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .9em; transform: rotate(-8deg) scale(2.4); opacity: 0; }
.rule-card.stamped .rule-stamp { animation: stamp-hit .38s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes stamp-hit { 0% { transform: rotate(-8deg) scale(2.4); opacity: 0; } 60% { transform: rotate(-8deg) scale(.92); opacity: 1; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
.rule-card:not(.stamped) { animation: rule-flip .6s cubic-bezier(.2, 1.1, .3, 1) backwards, rule-nudge 2.4s ease-in-out 1.2s infinite; }
@keyframes rule-nudge { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-1.2deg) scale(1.015); } 95% { transform: rotate(1.2deg) scale(1.015); } }

/* --- «На глаз»: предмет над ползунком и крупный бегунок; «Блиц»: кнопки к нижнему краю --- */
.est-art .art { margin-top: 0; margin-bottom: 12px; animation: none; }
.mission input[type=range] { height: 34px; }
.mission input[type=range]::-webkit-slider-thumb { width: 34px; height: 34px; border-width: 4px; }
.mission input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-width: 4px; }
.mission .deck-btns { position: sticky; bottom: 12px; z-index: 5; margin-top: 14px; }
.mission .deck-btns button { min-height: 60px; border: 3px solid var(--navy); box-shadow: 0 5px 0 var(--navy); font-size: 1.05em; }

@media (min-width: 1000px) { .act-in { max-width: 398px; } }
@media (prefers-reduced-motion: reduce) { .bc, .sort-card, .rule-card, .rule-card:not(.stamped), .gr-flag { animation: none; transition: none; } .rule-card.stamped .rule-stamp { animation: none; opacity: 1; transform: rotate(-8deg); } }
.flag-art .sale-timer.flag-zone.marked { background: var(--berry); outline-color: var(--sun); }
.flag-art .tag-badge { pointer-events: none; }

/* меню разделов на первой странице: на широком экране — в строку между логотипом и входом, на телефоне — лентой под шапкой */
.land-top { flex-wrap: wrap; gap: 6px 18px; }
.land-nav { display: flex; align-items: center; gap: 4px 18px; margin-left: auto; font-weight: 800; font-size: .92em; }
.land-nav a { color: var(--navy); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 3px solid transparent; }
.land-nav a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.land-top #login { margin-left: 8px; }
@media (max-width: 899px) {
  .land-top .land-logo { margin-right: auto; }
  .land-nav { order: 3; width: calc(100% + 32px); margin: 2px -16px 0; padding: 4px 16px 8px; overflow-x: auto; scrollbar-width: none; gap: 8px; font-size: .86em; }
  .land-nav::-webkit-scrollbar { display: none; }
  .land-nav a { padding: 6px 12px; border: 2px solid var(--soft-line); border-radius: 999px; background: rgba(255, 255, 255, .7); }
  .land-nav a:hover { border-color: var(--teal); }
}

/* ---------- знакомство: сцена с ведущими (реплика сверху, персонаж в полный рост, кнопка прижата к низу) ---------- */
.onb-stage { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.onb-say { position: relative; width: 100%; min-height: 96px; border-radius: 20px; font-size: 1.02em; line-height: 1.4; }
.onb-say::after { content: ""; position: absolute; left: 50%; bottom: -13px; width: 20px; height: 20px; margin-left: -10px; background: #fff; border-right: 3px solid var(--grape); border-bottom: 3px solid var(--grape); border-radius: 0 0 6px 0; transform: rotate(45deg); }
.onb-cast { display: flex; justify-content: center; align-items: flex-end; margin-top: 8px; height: min(44vh, 380px); }
.onb-fig { position: relative; display: block; height: 100%; width: calc(min(44vh, 380px) * .42); animation: none; }
.onb-fig img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%); filter: drop-shadow(0 6px 0 rgba(42, 51, 82, .08)); }
.onb-stage.pair .onb-fig.f { animation: onb-in-l .55s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.onb-stage.pair .onb-fig.m { animation: onb-in-r .55s cubic-bezier(.2, 1.2, .4, 1) .12s backwards; }
.onb-stage.solo .onb-fig { animation: onb-in-up .5s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.onb-fig.talking img { animation: onb-bob .5s ease-in-out infinite; }
.onb-stage.pair .onb-fig.m.talking img { animation-delay: .25s; }
.onb-tip { margin-top: 6px; }
@keyframes onb-in-l { from { opacity: 0; transform: translateX(-40px); } }
@keyframes onb-in-r { from { opacity: 0; transform: translateX(40px); } }
@keyframes onb-in-up { from { opacity: 0; transform: translateY(30px); } }
@keyframes onb-bob { 50% { transform: translateX(-50%) translateY(-5px) rotate(-.6deg); } }

.onb-ask { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; }
.onb-faces { display: flex; flex: none; }
.onb-faces .host-img + .host-img { margin-left: -14px; }
.onb-ask .bubble { border-radius: 6px 18px 18px 18px; font-size: 1.05em; }

/* Жорик выглядывает из-за правого края экрана, когда про него сказали */
.onb-jorik { position: fixed; z-index: 23; right: 0; bottom: 84px; width: 150px; height: auto; pointer-events: none; transform: translateX(102%) rotate(4deg); transition: transform .7s cubic-bezier(.2, 1.2, .4, 1); }
.onb-jorik.on { transform: translateX(28%) rotate(-3deg); }
@media (min-width: 760px) { .onb-jorik { width: 240px; bottom: 60px; } .onb-jorik.on { transform: translateX(18%) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .onb-fig, .onb-fig img { animation: none !important; } .onb-jorik { transition: none; } }
.onb-fig.hero-img { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }

/* сцена знакомства занимает всё место до прижатой кнопки: ведущие растут под высоту окна, дыры под ними нет */
.onb-stage { min-height: calc(100dvh - 124px - var(--dock, 76px)); justify-content: center; }
.onb-cast { flex: 1 1 0; height: auto; min-height: 240px; max-height: 640px; width: 100%; margin-top: 14px; }
.onb-fig { width: auto; aspect-ratio: 42 / 100; }
.onb-tip { margin: 8px 0 0; }
.onb-stage { min-height: calc(100dvh - 114px - var(--dock, 76px)); }
.onb-tip { margin-top: -6px; }

/* шаги-вопросы знакомства: содержимое чуть ниже шапки, кнопка — сразу под ним; плитки выбора крупнее (нажал — и дальше) */
.onb-body.inline, .onb-body.pick { margin-top: clamp(0px, 7vh, 80px); }
.onb-body.pick .grid2 .opt { padding-top: 22px; padding-bottom: 22px; font-size: 1.08em; }
.onb-body.pick .opt:active { transform: scale(.97); }

/* герой в рамке: картинка занимает ровно внутренность рамки (раньше была на толщину обводки больше и вылезала вправо-вниз) */
span.hero-img:not(.onb-fig) > span:first-child, span.hero-img:not(.onb-fig) > img:first-child, span.hero-img:not(.onb-fig) > svg:first-child { width: 100% !important; height: 100% !important; border-radius: inherit !important; }

/* конструктор героя: переключатель «Мальчик / Девочка» под карточкой героя */
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 14px 14px; border: 3px solid var(--navy); border-radius: 16px; overflow: hidden; background: #fff; }
.kind-pick button { min-height: 44px; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--navy); font-weight: 800; transform: none; }
.kind-pick button + button { border-left: 3px solid var(--navy); }
.kind-pick button.on { background: var(--teal); color: #fff; }

/* ---------- конструктор героя: «примерочная» (герой крупно → вид → категории одной строкой → плитки), на широком экране две колонки ---------- */
.bld-h { margin-top: 10px; text-align: center; }
.bld-stage { position: relative; display: flex; justify-content: center; margin: 14px auto 0; width: min(62vw, 220px); }
.bld-stage.sm { width: min(46vw, 160px); margin-bottom: 22px; }
span.hero-img.bld-hero { width: 100%; height: auto; aspect-ratio: 1; border-radius: 34px; border-width: 4px; box-shadow: 0 6px 0 var(--navy); position: relative; overflow: visible; }
.bld-dice { position: absolute; right: -14px; top: -10px; width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.bld-dice:active { transform: rotate(40deg) scale(.94); }
.kind-pick.three { grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; }
.bld-cats { display: flex; gap: 6px; margin: 14px -16px 0; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.bld-cats::-webkit-scrollbar { display: none; }
.bld-cats button { flex: none; min-height: 38px; padding: 4px 14px; font-size: .85em; white-space: nowrap; scroll-snap-align: center; }
.bld-note { margin: 14px 0 0; }
.bld-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 8px; }
.bld-opt { width: auto; height: auto; min-height: 0; padding: 5px 4px 6px; flex-direction: column; gap: 3px; border-radius: 16px; }
.bld-opt > span:first-child, .bld-opt img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; display: block; }
.bld-opt .tiny { font-family: var(--font-body); font-weight: 800; }
.bld-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); border-radius: 12px; color: var(--navy); }
.bld-sw { width: 100%; aspect-ratio: 1; height: auto; min-height: 0; padding: 0; border-radius: 18px; }
.bld-input { margin-top: 4px; text-align: center; font-family: var(--font-title); font-weight: 800; font-size: 1.15em; }
.bld-next { margin-top: 16px; }
@media (min-width: 900px) {
  html:has(.bld) .wrap { max-width: 880px; }
  .bld { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: start; }
  .bld-left { position: sticky; top: 16px; }
  .bld-stage { width: 240px; }
  .bld-cats { flex-wrap: wrap; overflow: visible; margin: 52px 0 0; padding: 0; }
  .bld-opts { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); margin-top: 14px; }
  .bld-name { max-width: 430px; margin: 0 auto; }
}
.kind-pick.three button { padding: 0 4px; font-size: .92em; min-width: 0; }

/* плитки выбора крупнее: картинка во всю ширину плитки; на телефоне три в ряд, на широком экране — по ~120 px */
.bld-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bld-opt { padding: 6px 6px 8px; border-radius: 20px; gap: 5px; }
.bld-opt > span:first-child, .bld-opt img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; }
.bld-opt > span:first-child > span:first-child { width: 100% !important; height: 100% !important; border-radius: 14px !important; }
.bld-opt .tiny { font-size: .82em; }
.bld-lock { border-radius: 14px; }
.bld-opts:has(.bld-sw) { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
@media (min-width: 900px) {
  .bld-opts { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
  .bld-opts:has(.bld-sw) { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  html:has(.bld) .wrap { max-width: 980px; }
  .bld { grid-template-columns: 320px minmax(0, 1fr); }
}

/* шаг «Как зовут героя?»: та же раскладка, что у примерочной — герой, имя и кнопка слева, позывные ровной сеткой справа */
.bld-top { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.bld-top .bld-h { flex: 1; margin: 0; }
.bld-top-pad { width: 44px; flex: none; }
.bld-name .bld-stage { margin-bottom: 26px; }
.bld-name .bld-input { margin-top: 0; }
.bld-h2 { font-size: 1.15em; margin: 22px 0 0; }
.bld-cs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.bld-cs button { min-height: 48px; padding: 6px 8px; font-size: .88em; line-height: 1.15; white-space: normal; }
@media (min-width: 900px) {
  .bld-name { max-width: none; margin: 0; }
  .bld-h2 { margin-top: 12px; font-size: 1.3em; }
  .bld-cs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
  .bld-cs button { min-height: 60px; font-size: 1em; }
}
.bld-top .bld-h { font-size: 1.4em; white-space: nowrap; }
@media (min-width: 900px) { .bld-top-pad { display: none; } .bld-top .bld-h { text-align: left; } }

/* сундук: выпавшая редкая деталь героя */
.chest-part { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; text-align: left; background: #fff; border: 3px solid var(--navy); border-radius: 18px; box-shadow: 0 4px 0 var(--navy); animation: bounce-in .5s cubic-bezier(.2, 1.3, .4, 1) .15s backwards; }
.chest-part img { width: 72px; height: 72px; flex: none; object-fit: cover; border-radius: 14px; background: var(--cream-2); }
.chest-part.rare { border-color: var(--grape); box-shadow: 0 4px 0 var(--grape); }
.chest-part.legend { border-color: var(--sun); box-shadow: 0 4px 0 #e0a800; background: #fffaf0; }

/* ---------- комикс-завязка эпизода: три кадра друг под другом, текст в пузырях — наш, поверх картинки ---------- */
.comic { display: grid; gap: 12px; margin-top: 12px; }
.comic-fr { margin: 0; animation: bounce-in .5s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.comic-pic { position: relative; container-type: inline-size; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 0 var(--navy); }
.comic-pic img { display: block; width: 100%; height: auto; }
.comic-tx { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.2cqw; font-family: var(--font-body); font-weight: 800; font-size: 3.5cqw; line-height: 1.12; color: var(--navy); overflow: hidden; }
.comic-tx > span { display: block; max-width: 100%; }
.comic-tx.shout { font-size: 4cqw; color: #c0392b; text-transform: uppercase; letter-spacing: .01em; }
.comic-tx.think { font-style: italic; }
.comic-fr figcaption { margin: 7px 4px 0; font-weight: 700; font-size: .95em; line-height: 1.3; color: var(--navy); }
@media (min-width: 900px) {
  html:has(.comic-page) .wrap { max-width: 1080px; }
  .comic { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
  .comic-page #next { max-width: 398px; margin-left: auto; margin-right: auto; display: block; }
}

/* ---------- шкафчик на вкладке «Моё» (холст 1200×1600, проценты — из coords.txt) ---------- */
.locker { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 3 / 4; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lk-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .25s; filter: drop-shadow(0 8px 0 rgba(42, 51, 82, .08)); }
.lk-open, .locker.open .lk-closed { opacity: 0; }
.locker.open .lk-open { opacity: 1; }
.lk-door, .lk-jar { opacity: 0; pointer-events: none; transition: opacity .25s .1s; }
.locker.open .lk-door, .locker.open .lk-jar { opacity: 1; pointer-events: auto; }
.lk-door { position: absolute; left: 18.4%; top: 12%; width: 24.6%; height: 76%; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 3%; transform: perspective(600px) rotateY(9deg); transform-origin: right center; }
.lk-st { width: 46%; aspect-ratio: 1; object-fit: contain; transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 2px 0 rgba(42, 51, 82, .18)); }
.lk-st.gold { filter: drop-shadow(0 0 5px rgba(255, 201, 60, .95)) drop-shadow(0 2px 0 rgba(42, 51, 82, .18)); }
.lk-empty { align-self: center; margin-top: 60%; font-size: .68em; font-weight: 800; line-height: 1.2; text-align: center; color: rgba(42, 51, 82, .45); }
.lk-jar { position: absolute; left: 58.6%; top: 15.2%; width: 13.2%; aspect-ratio: 3 / 4; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; }
.lk-jar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lk-jar:active { transform: scale(.94); }
.lk-hint { position: absolute; left: 0; right: 0; bottom: -4px; text-align: center; font-size: .72em; font-weight: 800; color: rgba(42, 51, 82, .5); }
.locker:not(.open):hover .lk-closed { transform: rotate(-.6deg); }
@media (prefers-reduced-motion: reduce) { .lk-img, .lk-door, .lk-jar { transition: none; } }

/* «Что перед тобой» — ситуация остаётся на экране, пока ребёнок решает */
.again { margin: 0 0 12px; border: 3px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; }
.again > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: .85em; font-weight: 800; color: var(--navy-2); }
.again > summary::-webkit-details-marker { display: none; }
.again > summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.again[open] > summary::after { transform: rotate(180deg); }
.again[open] > summary { border-bottom: 3px solid var(--line); }
.again-body { padding: 10px 12px 12px; }
.again-body .art { margin-top: 0; }
.again-from { font-size: .78em; font-weight: 800; color: var(--navy-2); opacity: .7; }
.again-text { margin: 0 0 8px; font-weight: 700; line-height: 1.35; }

/* выход из эпизода — подписанная кнопка вместо безымянной стрелки */
.icon.wide { width: auto; min-width: 0; padding: 0 12px; gap: 4px; font-size: .86em; font-weight: 800; white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- эпизод на широком экране: ситуация слева, ход справа (на телефоне всё как было, одной колонкой) ---------- */
@media (min-width: 1000px) {
  html:has(.mission) .wrap { max-width: 880px; }
  .mission { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px 34px; align-items: start; }
  .mission > * { grid-column: 2; }
  /* шапка, точки шага и заголовок — во всю ширину */
  .mission > .season-wash, .mission > .row:first-of-type, .mission > .progress-dots, .mission > .nerves, .mission > .step-tag { grid-column: 1 / -1; }
  /* то, на что ребёнок смотрит, пока решает, — в левую колонку и не уезжает при прокрутке */
  .mission > .again, .mission > .card.img, .mission > .flag-art, .mission > .art, .mission > .messenger, .mission > .comic {
    grid-column: 1; grid-row: 4 / span 40; position: sticky; top: 16px; align-self: start; margin-top: 0;
  }
  .mission > .again { border-width: 3px; }
  .mission > .again[open] > summary { cursor: default; }
  .mission > .step-head { margin-top: 0; }
  .mission #next { max-width: 398px; }
}

/* шторка с разбором: когда шаг помещается на экран — сразу под ответами, без провала до нижнего края */
.sheet.inflow { position: static; transform: none; margin-top: 14px; }
.sheet.inflow .sheet-in { max-height: none; border-bottom: 3px solid var(--navy); border-radius: 24px; box-shadow: 0 5px 0 var(--navy); }

/* ---------- главная: видно, кому что (роли в шапке, две двери на первом экране) ---------- */
.land-nav a.role { font-weight: 800; color: var(--navy); border-radius: 12px; padding: 6px 12px; background: rgba(255, 255, 255, .7); border: 2px solid var(--line); }
.land-nav a.role:hover { border-color: var(--navy); }
.land-top #login { min-height: 38px; padding: 4px 16px; font-size: .88em; flex: none; }
.land-kicker { margin: 0 0 6px; font-size: .82em; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--navy-2); opacity: .75; }
.land-doors { display: grid; gap: 8px; margin-top: 4px; }
.land-doors .full { margin: 0; }
.land-sticky a.role { margin-right: 8px; text-decoration: none; }
@media (min-width: 760px) { .land-doors { grid-template-columns: 1fr 1fr; } }

/* знак продукта: монета-компас */
.logo-mark { display: block; flex: none; }
.land-logo, .side-logo { display: inline-flex; align-items: center; gap: 8px; }

/* карточка правила: видно, что на неё надо нажать — иначе шаг кажется тупиком */
.rule-card { cursor: pointer; }
.rule-card:not(.stamped) { animation: rule-invite 2.6s ease-in-out infinite; }
.rule-card:not(.stamped):active { transform: scale(.985); }
@keyframes rule-invite { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-.5deg) scale(1.012); } 96% { transform: rotate(.4deg) scale(1.008); } }
.rule-hint-big { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px 0 0; padding: 9px 14px; border-radius: 14px; background: var(--sun); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); font-size: .9em; font-weight: 800; color: var(--navy); text-align: center; }
.rule-card.stamped ~ .rule-hint-big, #ruleHint.hide { display: none; }
@media (prefers-reduced-motion: reduce) { .rule-card:not(.stamped) { animation: none; } }
