/* Мастерская Бипа — сцена игры. Логические px: мир 1024×768, сцена масштабируется целиком (js/stage.js). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #24150c; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif; }
img { -webkit-user-drag: none; }
img.missing { visibility: hidden; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background: #3a2618; }
#cam { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
#cam.blurred { filter: blur(5px) brightness(.72) saturate(.9); }
#fx { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 40; }
#ui { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
#ui > * { pointer-events: auto; }

/* ---------- Фон по слоям ---------- */
.layer.bg { position: absolute; pointer-events: none; }
.layer.bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* U.1g: стакан с карандашами — отдельный слой, отъезжает по столу с места Леры (main.js placeCup) */
#desk-cup { translate: var(--cup-dx, 0px) 0; transition: translate .45s cubic-bezier(.4,0,.2,1), opacity .35s; }
#desk-cup.away { opacity: 0; }   /* U.1i: рядом с Лерой нет свободного места на столе — стакан тает, пока она на виду */
#desk-cup[hidden], .world-fair #desk-cup { display: none; }   /* на ярмарке стакана нет: прилавок свой */
#bg-back .evening { opacity: 0; transition: opacity 2.4s ease; }
#bg-back.is-evening .evening { opacity: 1; }
#world, #world-front { position: absolute; width: 1024px; height: 768px; pointer-events: none; }   /* сам слой во весь экран не ловит касания — только предметы в нём (иначе #world-front перекрывал цели на афише) */
#world > div, #world-front > div { position: absolute; inset: 0; pointer-events: none; }
#world > div > *, #world-front > div > * { pointer-events: auto; }

/* ---------- Бип ---------- */
.bip { position: absolute; width: 800px; height: 1000px; transform-origin: 0 0; pointer-events: none !important; }
.bip .part, .bip .arm, .bip .gaze, .bip .lenses, .bip .bip-head, .bip .bip-upper, .bip .bip-root, .bip .antenna {
  position: absolute; left: 0; top: 0; width: 800px; height: 1000px; }
.bip .part { pointer-events: none; }
.bip-root { transform-origin: 400px 964px; rotate: var(--lean, 0deg); transition: rotate .5s cubic-bezier(.34,1.56,.64,1); }
.bip-upper { transform-origin: 400px 740px; animation: breathe 3.4s ease-in-out infinite; }
.bip.chest .bip-upper { scale: 1.03; transition: scale .5s; }
.bip.sleepy .bip-upper { animation-duration: 5.2s; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(.994, 1.016); } }
.bip-shadow { position: absolute; left: 230px; top: 930px; width: 340px; height: 70px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70,35,10,.45), rgba(70,35,10,0)); }
.antenna { rotate: var(--ant, 0deg); transition: rotate .6s cubic-bezier(.34,1.56,.64,1); animation: antwob 2.8s ease-in-out infinite; }
.bip.sway .antenna { animation: antsway 1.5s ease-in-out infinite; }
@keyframes antwob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes antsway { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.ant-glow { position: absolute; left: 345px; top: 12px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(120,255,245,.75), rgba(46,196,192,0)); mix-blend-mode: screen; opacity: .45;
  transition: opacity .3s, transform .3s; animation: antpulse 2.4s ease-in-out infinite; }
.bip.glow .ant-glow, .bip.talking .ant-glow { opacity: 1; transform: scale(1.5); }
@keyframes antpulse { 50% { opacity: .75; } }
.gaze { transition: transform .28s cubic-bezier(.3,1.2,.5,1); }
.lenses { transform-origin: 401px 342px; }
.lens-w { position: absolute; transform-origin: 50% 50%; }
.lens { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(60,240,232,.75)); }
.bip.talking .lens { animation: lenstalk .5s ease-in-out infinite alternate; }
@keyframes lenstalk { from { filter: drop-shadow(0 0 8px rgba(60,240,232,.6)) brightness(1); } to { filter: drop-shadow(0 0 18px rgba(90,255,245,.95)) brightness(1.18); } }
.bip.talking .bip-head { animation: talkbob .34s ease-in-out infinite alternate; }
@keyframes talkbob { from { translate: 0 0; } to { translate: 0 -6px; } }
.bip.glow .lens { filter: drop-shadow(0 0 20px rgba(90,255,245,1)) brightness(1.15); }

.bip .a-hold, .bip .a-point, .bip .arm-ear, .bip .arm-wave { display: none; }
.bip.hold-art .a-std { display: none; }
.bip.hold-art .a-hold.ok { display: block; }
.bip.point-art .arm-r .a-std { display: none; }
.bip.point-art .arm-r .a-point.ok { display: block; }
.bip.ear .arm-ear { display: block; }
.bip.ear .arm-r { visibility: hidden; }
/* машет: своя картинка руки, иначе рука «послушай» покачивается */
.bip.waving .arm-r { visibility: hidden; }
.bip.waving:not(.wave-art) .arm-ear { display: block; animation: wave .5s ease-in-out 3 alternate; }
.bip.wave-art .arm-wave { display: block; animation: wave .45s ease-in-out 4 alternate; }
.bip.wave-art .a-wave.ok { display: block; }
@keyframes wave { from { rotate: -6deg; } to { rotate: 10deg; } }
.bip.drawing .arm-r { animation: drawwig .22s ease-in-out infinite alternate; }
@keyframes drawwig { from { rotate: 0deg; } to { rotate: -7deg; } }

.nb-hold { position: absolute; width: 360px; height: 300px; perspective: 900px; display: none; transform: scale(.8); }
.bip.hold .nb-hold { display: block; animation: nbup .5s cubic-bezier(.3,1.4,.5,1); }
@keyframes nbup { from { translate: 0 120px; opacity: 0; } }
.nb-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4,1.5,.5,1); }
.nb-flip.turned { transform: rotateX(180deg); }
.nb-face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.nb-face.back { transform: rotateX(180deg); }
.bip.nb-out .nb-hold { opacity: 0; transition: opacity .2s; }

.bip-hit { position: absolute; left: 170px; top: 20px; width: 460px; height: 960px; pointer-events: auto; cursor: pointer; border-radius: 40%; }
.at-home .bip-shadow::after { content: ""; position: absolute; inset: -10px -30px; border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(127,243,238,.7), 0 0 40px 10px rgba(127,243,238,.5); animation: halo 1.8s ease-out infinite; }
@keyframes halo { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* ---------- Лера ---------- */
.lera { position: absolute; width: 600px; height: 900px; transform-origin: 0 0; pointer-events: none !important; }
.lera.off { display: none; }
/* выбор сбоку: Лера на 110 px левее — между афишей и столбиком карточек */
.lera { transition: margin-left .5s cubic-bezier(.3,.7,.3,1); }
.lera.aside { margin-left: -110px; }
/* U.7: большой блокнот выбора открыт — Лера за ним не выглядывает */
.lera { transition: margin-left .5s cubic-bezier(.3,.7,.3,1), opacity .25s; }
.lera.nb-hide { opacity: 0; }
/* U.7c (кадр u25 14:52 proverka-lera-9, планшет: волосы Леры видны за блокнотом — снимок попал в середину угасания .25s,
   а блокнот при fast=1 открывается мгновенно): на проверочных страницах Лера гаснет сразу */
.hold-still .lera { transition: none !important; }
.lera-body { position: absolute; inset: 0; transform-origin: 300px 880px; animation: lbreathe 3.8s ease-in-out infinite; }
@keyframes lbreathe { 50% { scale: 1.004 1.012; } }
.lp { position: absolute; left: 0; top: 0; width: 600px; height: 900px; opacity: 0; }
.lp.on { opacity: 1; }
.lera.talking .lera-body { animation: ltalk .36s ease-in-out infinite alternate; }
@keyframes ltalk { from { translate: 0 0; rotate: 0deg; } to { translate: 0 -5px; rotate: .6deg; } }

/* ---------- Афиша ---------- */
.poster { position: absolute; width: 720px; height: 960px; transform-origin: 0 0; filter: drop-shadow(0 22px 20px rgba(60,28,8,.38)); transition: opacity .4s; }
.poster.gone { opacity: 0; pointer-events: none; }
.pz { position: absolute; inset: 0; }
.pl { position: absolute; left: 0; top: 0; width: 720px; height: 960px; display: none; }
.pl-sheet2 { width: 1100px; height: 1400px; }
.pl.on { display: block; }
/* N.24 (REVIEW 2205, отчёт касаний proverka-prostoy): слои афиши — картинка, касания принимают только .zones; иначе прямоугольник слоя забирал тап у наклейки на полке */
.pz .pl, .pz .ball { pointer-events: none; }
/* N.25 (REVIEW 2345 п.2, касания proverka-prostoy 01:44: тап наклейки забирал пустой div.pz): вся афиша — картинка без касаний,
   принимает только слой зон; у скрытой афиши (.gone) зоны тоже глухие, как раньше по наследованию */
/* N.27 (REVIEW 2365): `#world > div > *` (1,0,1) перебивал `.poster` (0,1,0) — афиша в #world снова ловила касания через div.pz.
   Селекторы с id-предком (1,1,0) сильнее; .zones — прямой ребёнок .poster (poster.js:35) */
.poster, #world .poster, #world-front .poster, #mini-wall .poster { pointer-events: none; }
.poster > .zones, #world .poster > .zones, #world-front .poster > .zones, #mini-wall .poster > .zones { pointer-events: auto; }
.poster.gone > .zones, #world .poster.gone > .zones, #world-front .poster.gone > .zones, #mini-wall .poster.gone > .zones { pointer-events: none; }
.ball-wrap { position: absolute; transform-origin: 50% 50%; }
.ball { position: absolute; inset: 0; width: 100%; height: 100%; display: none; filter: drop-shadow(0 10px 8px rgba(40,30,10,.25)); }
.ball.on { display: block; }
.dim { position: absolute; left: 56px; top: 64px; width: 608px; height: 834px; background: #0b1235; mix-blend-mode: multiply; opacity: 0; pointer-events: none;
  -webkit-mask-size: 118.42% 115.11%; mask-size: 118.42% 115.11%; -webkit-mask-position: 50% 50.8%; mask-position: 50% 50.8%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* с маской основы тонировка ложится на весь холст: края ленты, солнца, рамки больше не остаются нетронутыми (REVIEW эп.4 п.3) */
.dim.masked { left: 0; top: 0; width: 720px; height: 960px; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-position: 0 0; mask-position: 0 0; }
.sp .dim.masked { left: 0; top: 0; width: 100%; height: 100%; }
.pz > .glow, .sp > .glow { position: absolute; left: 56px; top: 64px; width: 608px; height: 834px; opacity: 0; pointer-events: none; mix-blend-mode: screen; transition: opacity .6s;
  background: radial-gradient(160px 220px at 13% 60%, rgba(255,210,120,.55), rgba(255,210,120,0)), radial-gradient(160px 220px at 87% 60%, rgba(255,210,120,.55), rgba(255,210,120,0)); }
.pz > .glow.on, .sp > .glow.on { opacity: 1; animation: lampflick 3s ease-in-out infinite; }
@keyframes lampflick { 50% { opacity: .82; } }
.zones { position: absolute; inset: 0; display: none; }
.zones.on { display: block; }
.zones.fade { opacity: 0; transition: opacity .5s; }
.zone { position: absolute; background: none; border: 0; padding: 0; cursor: pointer; }
.zone .ring { position: absolute; inset: 0; border-radius: 34px; border: 7px dashed rgba(255,255,255,.75);
  box-shadow: 0 0 24px rgba(127,243,238,.6), inset 0 0 24px rgba(127,243,238,.35); animation: ringp 1.6s ease-in-out infinite; }
.zone.pulse .ring { animation-duration: .7s; border-color: #fff; }
.zone.done .ring { animation: none; border-style: solid; border-color: rgba(127,243,238,.95); opacity: .9; }
@keyframes ringp { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.zone .stamp, .zone .stamp-svg { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; display: none; }
.zone.done.has-stamp .stamp { display: block; animation: stamp .45s cubic-bezier(.3,1.6,.5,1); }
.zone.done:not(.has-stamp) .stamp-svg { display: block; animation: stamp .45s cubic-bezier(.3,1.6,.5,1); }
.stamp-svg circle { fill: rgba(255,253,245,.92); stroke: #2EC4C0; stroke-width: 7; }
.stamp-svg path { fill: none; stroke: #1FA6A2; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .4s .12s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes stamp { from { transform: scale(2.2) rotate(-20deg); opacity: 0; } }

/* ---------- Письмо ---------- */
.letter { position: absolute; left: 445px; top: 230px; width: 220px; height: 220px; }
.letter img { position: absolute; left: 0; top: 0; width: 100%; height: auto; filter: drop-shadow(0 14px 14px rgba(40,20,5,.4)); }
.letter .l-open { display: none; }
.letter.opened .l-closed { display: none; }
.letter.opened .l-open { display: block; }
.letter.bob { animation: lbob 1.6s ease-in-out infinite; }
@keyframes lbob { 50% { translate: 0 -8px; rotate: 2deg; } }

/* ---------- Стена: рамка и наклейка ---------- */
#wall-frame .wf { position: absolute; width: 880px; height: 1120px; transform-origin: 0 0; }
#wall-frame:not(.on) { display: none; }
.wf-win, .cel-win { position: absolute; left: 9.09%; top: 7.14%; width: 81.82%; height: 85.72%; }
.wf-win > *, .cel-win > * { width: 100%; height: 100%; display: block; }
.wf .frame-img, .cel-frame .frame-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.wf { filter: drop-shadow(0 30px 30px rgba(60,28,8,.4)); }
/* мягкая пульсация, пока афишу можно сохранить (до выхода из эпизода, и после того как Бип уснул — тоже) */
#wall-frame.saveable .wf.save-me { cursor: pointer; animation: savepulse 2.4s ease-in-out infinite; }
@keyframes savepulse { 0%, 100% { filter: drop-shadow(0 30px 30px rgba(60,28,8,.4)); }
  50% { filter: drop-shadow(0 0 26px rgba(255,226,140,.9)) drop-shadow(0 0 8px rgba(127,243,238,.6)) brightness(1.05); } }
@media (prefers-reduced-motion: reduce) { #wall-frame.saveable .wf.save-me { animation: none; filter: drop-shadow(0 0 22px rgba(255,226,140,.9)); } }
#wall-sticker:not(.on) { display: none; }
#wall-sticker .sticker { position: absolute; width: 96px; height: 96px; border: 0; padding: 0; background: none; cursor: pointer; }
#wall-sticker .sticker-ghost { position: absolute; pointer-events: none; animation: ghostbreath 5s ease-in-out infinite; }
#wall-sticker .sticker-ghost img { filter: brightness(0) sepia(1) saturate(2.2) hue-rotate(-12deg); opacity: .17; mix-blend-mode: multiply; }
@keyframes ghostbreath { 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { #wall-sticker .sticker-ghost { animation: none; } }
#wall-sticker img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(50,25,5,.35)); }

/* ---------- Блокнот-выбор ---------- */
#choice { position: absolute; inset: 0; pointer-events: none !important; opacity: 0; perspective: 1400px; }
#choice.open { opacity: 1; pointer-events: auto !important; }
.nb { position: absolute; left: 50%; top: 53%; width: 900px; height: 562px; transform: translate(-50%,-50%) scale(var(--nbs, 1)); }
.wide .nb, .wide .map-book { --nbs: calc(1.16 / var(--wz, 1)); }   /* Д7: мир ×--wz — блокнот и карта прежнего размера */
.wide .map-book { top: 53%; }   /* Д7: сцена ниже на 7 % — карта целиком в кадре */
#choice.open .nb { animation: nbopen .85s cubic-bezier(.2,.9,.25,1.08) both; }
#choice.closing .nb { animation: nbclose .5s cubic-bezier(.6,0,.8,.3) both; }
@keyframes nbopen {
  0% { transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(.14) rotateY(-75deg) rotateZ(-12deg); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(var(--nbs, 1)) rotateY(0) rotateZ(0); opacity: 1; } }
@keyframes nbclose {
  to { transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(.12) rotateY(60deg) rotateZ(10deg); opacity: 0; } }
.nb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 34px 30px rgba(20,10,0,.5)); }
.nb-img.fb { object-fit: fill; }
.nb-cards { position: absolute; left: 6%; right: 6%; top: 13%; bottom: 10%; display: flex; align-items: center; justify-content: center; gap: 22px; }
.card { position: relative; width: 248px; height: 226px; flex: none; cursor: pointer; opacity: 0;
  transform: translateY(-60px) rotate(calc(var(--i) * 3deg - 3deg)) scale(.6);
  transition: transform .5s cubic-bezier(.3,1.5,.5,1), opacity .3s, filter .3s; }
.card.in { opacity: 1; transform: rotate(calc(var(--i) * 2.5deg - 2.5deg)); }
.card:nth-child(2) { margin-top: -14px; }
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 10px rgba(50,25,5,.3)); }
.card-bg.fb { object-fit: fill; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); }
.card-icon { position: absolute; left: 50%; top: 52%; width: 168px; height: 168px; transform: translate(-50%,-50%); object-fit: contain; pointer-events: none; }
.card-icon.missing { visibility: hidden; }
.card-ear { position: absolute; inset-inline-end: -22px; top: -26px; width: 92px; height: 92px; border: 0; padding: 0; background: none; cursor: pointer; }
.card-ear img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(40,20,5,.35)); }
.card-ear img.fb { width: 70%; height: 70%; margin: 15%; }
.card.in:active, .card.in:hover { transform: translateY(-10px) rotate(0) scale(1.04); }
.card.reading { transform: translateY(-16px) rotate(0) scale(1.08) !important; filter: drop-shadow(0 0 22px rgba(127,243,238,.95)); z-index: 2; }
.card.reading .card-ear { animation: earp .5s ease-in-out infinite alternate; }
@keyframes earp { to { transform: scale(1.15); } }
.card.picked { transform: translateY(-20px) scale(1.18) rotate(0) !important; filter: drop-shadow(0 0 30px rgba(255,212,92,1)); z-index: 3; }
.card.away { opacity: 0 !important; transform: translateY(80px) rotate(12deg) scale(.8) !important; }
/* проверочный вопрос (choice.side): без размытия, карточки столбиком справа от афиши — сверять можно глазами, а не по памяти */
#choice.side .nb { width: 300px; height: 660px; --nbs: 1; }
#choice.side .nb-img { display: none; }
#choice.side .nb-cards { inset: 0; flex-direction: column; gap: 10px; }
#choice.side .card { width: 210px; height: 192px; }
#choice.side .card:nth-child(2) { margin-top: 0; }
#choice.side .card-icon { width: 142px; height: 142px; }
#choice.side .card-ear { width: 80px; height: 80px; inset-inline-end: -30px; top: -14px; }
/* три карточки сбоку: столбик 3×164 + 2×8 = 508 px, центр на y=424 → наушник верхней карточки ниже кнопки «послушай» (её низ ≈136) */
#choice.instant.open .nb { animation: none; }
#choice.instant .card { transition: none; }
#choice.side.three .nb { height: 540px; }
#choice.side.three .nb-cards { gap: 8px; }
#choice.side.three .card { width: 180px; height: 164px; }
#choice.side.three .card-icon { width: 122px; height: 122px; }
#choice.side.three .card-ear { width: 72px; height: 72px; inset-inline-end: -26px; top: -12px; }

/* ---------- Праздник ---------- */
#celebrate { position: absolute; inset: 0; display: none; pointer-events: none !important; }
#celebrate.on { display: block; }
.cel-veil { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255,200,120,.25), rgba(30,14,4,.7)); transition: opacity .6s; animation: fadein .5s; }
.cel-veil.out { opacity: 0; }
.cel-frame { position: absolute; left: 50%; top: 50%; width: 484px; height: 616px; transform: translate(-50%,-50%); filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)); }
@keyframes fadein { from { opacity: 0; } }
.flash { position: absolute; inset: 0; background: #fff; pointer-events: none; animation: flash .6s ease-out forwards; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

/* ---------- Кнопки, прогресс, подсказки ---------- */
.hud-btn { position: absolute; top: 16px; width: 120px; height: 120px; border: 0; padding: 0; background: none; cursor: pointer; z-index: 4; /* выше карты и чертежа (z 3): дверь закрывает карту, «Повторить» повторяет её реплику */
  transition: transform .35s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 8px 10px rgba(30,14,4,.45)); }
.hud-btn:active { transform: scale(.88); }
.hud-btn img { width: 100%; height: 100%; object-fit: contain; }
#btn-home { inset-inline-start: 18px; }   /* M.4: интерфейс зеркалится в письме справа налево (17-yazyki, п.3) */
#btn-listen { inset-inline-end: 18px; }
#btn-listen img.fb { object-fit: cover; object-position: 50% 24%; transform: scale(1.7); border-radius: 50%; }
/* D.9 (бриф 23, п.5): касание «Повторить», пока реплика звучит, — мордочка коротко кивает «слушай», реплика не обрывается */
#btn-listen.busy { animation: listen-busy .42s ease-in-out; }
@keyframes listen-busy { 0%, 100% { transform: none; } 30% { transform: rotate(-9deg) scale(.94); } 65% { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { #btn-listen.busy { animation: none; opacity: .7; } }
#btn-home.glow { animation: homeglow 1.3s ease-in-out infinite; }
@keyframes homeglow { 50% { transform: scale(1.12); filter: drop-shadow(0 0 26px rgba(255,212,92,1)); } }
/* Q-009: на открытом чертеже дверь трижды мягко подсвечивается — «закрыть здесь» (дверь закрывает чертёж, main.js) */
.bp-open #btn-home:not(.glow) { animation: homeglow 1.3s ease-in-out .9s 3; }
@media (prefers-reduced-motion: reduce) { .bp-open #btn-home:not(.glow) { animation: none; filter: drop-shadow(0 0 18px rgba(255,212,92,.9)); } }
/* U.1f → U.4c (кадры 14:05): столбик у левого края под дверью на ярмарке заходил на Бипа — там Бип стоит левее
   («Афиша», выбор «да / не то»). Теперь — строкой вверху, сразу после кнопки «домой» (x ≥ 150): над головами героев
   и левее афиш (афиши начинаются от x ≈ 355 и ниже y ≈ 75). Прячутся вверх — одинаково при письме слева и справа. */
#tabs { position: absolute; inset-inline-start: 150px; top: 14px; transform: translateY(calc(-100% - 40px)); display: flex; flex-direction: row; gap: 10px; transition: transform .6s cubic-bezier(.3,1.4,.5,1); pointer-events: none !important; }
/* проверочные страницы ?hold=1: стоп-кадр без «призраков» афиши и рамок в середине перехода */
.hold-still #poster-slot, .hold-still #poster-slot *, .hold-still #wall-frame, .hold-still #wall-frame *, .hold-still #tabs,
.hold-still #mini-wall, .hold-still #desk-cup, .hold-still #wall-sticker > * { transition: none !important; }   /* U.1i: стенка мини-игры и стакан — сразу на месте (кадры 14:12) */
#tabs:not(.on) { visibility: hidden; transition: transform .6s cubic-bezier(.3,1.4,.5,1), visibility 0s .6s; }
#tabs.on { transform: none; visibility: visible; }
.tab { position: relative; width: 66px; height: 50px; transition: transform .4s; }
.tab img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(30,14,4,.35)); }
.tab img.fb { object-fit: cover; border-radius: 8px 8px 14px 14px; }
.tab .t-done { opacity: 0; }
.tab.done .t-done { opacity: 1; }
.tab.done .t-done.fb { filter: sepia(1) hue-rotate(130deg) saturate(3.2) brightness(.92) drop-shadow(0 4px 4px rgba(30,14,4,.35)); }
.tab.cur { transform: scale(1.16); }
#tap-hand { position: absolute; width: 130px; height: 130px; pointer-events: none !important; opacity: 0; transition: opacity .3s; z-index: 5; margin: -10px 0 0 -30px; }
#tap-hand.on { opacity: 1; animation: tap 1.1s ease-in-out infinite; }
@keyframes tap { 0%, 100% { translate: 18px 26px; } 50% { translate: 0 0; scale: .92; } }
#caption { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: 820px; padding: 14px 28px; border-radius: 30px;
  background: rgba(36,20,10,.72); color: #fff7e8; font-size: 28px; line-height: 1.25; text-align: center; unicode-bidi: plaintext; display: none; pointer-events: none !important; }
.subs #caption.on, #caption.on.nosnd { display: block; }   /* A.11b: реплика без mp3 — субтитр всегда */
/* сверка с галочкой «всё как было» (s2e5): галочка слева внизу — субтитр сдвигается вправо, чтобы не закрывать её */
.verdict-on #caption { left: auto; right: 2.5%; transform: none; max-width: 56%; padding: 12px 22px; font-size: 25px; }
#logo { position: absolute; left: 50%; top: 18px; width: 560px; transform: translateX(-50%); pointer-events: none !important; transition: transform .7s cubic-bezier(.5,-.4,.5,1), opacity .5s; }
#logo img { width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(40,20,5,.45)); animation: logobob 3.6s ease-in-out infinite; }
@keyframes logobob { 50% { translate: 0 -6px; rotate: -.6deg; } }
/* Q-008: логотип живым текстом (язык без своего рисунка) — цвета и обводка как у рисунка, высота ~196px как у него */
#logo .logo-live { display: flex; flex-direction: column; align-items: center; height: 196px; justify-content: center; gap: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif; font-weight: 900; line-height: .98;
  letter-spacing: -.01em; white-space: nowrap; animation: logobob 3.6s ease-in-out infinite;
  filter: drop-shadow(0 10px 14px rgba(40,20,5,.45)); }
#logo .ll { -webkit-text-stroke: 7px #6b3410; paint-order: stroke fill; text-shadow: 0 5px 0 #6b3410; }
#logo .ll-word { color: #fca629; }
#logo .ll-name { color: #24bfa9; -webkit-text-stroke-color: #0d5550; text-shadow: 0 5px 0 #0d5550; }
.jumping #logo .logo-live { animation: none !important; }
.in-episode #logo { transform: translate(-50%, -160%); opacity: 0; }
#loader { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #5a3a22, #24150c); display: flex; align-items: center; justify-content: center; z-index: 99; transition: opacity .6s; }
#loader.done { opacity: 0; pointer-events: none !important; }
.ld-bar { width: 360px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.12); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
.ld-bar i { display: block; height: 100%; width: 0; border-radius: 11px; background: linear-gradient(#7ff3ee, #2ec4c0); transition: width .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* статичная копия афиши (рамка на стене, праздник) */
.sp { position: relative; width: 100%; height: 100%; }
.sp > * { position: absolute; }
.sp .sp-l { left: 0; top: 0; width: 100%; height: 100%; }
.sp .dim, .sp .glow { left: 7.78%; top: 6.67%; width: 84.44%; height: 86.88%; }

/* =========================================================
   Мастерская — главный экран (js/home.js)
   ========================================================= */
#home-props { position: absolute; inset: 0; pointer-events: none; }
#home-props > * { pointer-events: auto; }
#home-props:not(.on) .prop, #home-props:not(.on) .shelf-hit { display: none; }
.prop { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; transform-origin: 50% 100%; translate: 0 -100%; }
.prop img { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 10px rgba(60,28,8,.4)); }
.prop.nope { display: none; }
.prop::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -10px; height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70,35,10,.4), rgba(70,35,10,0)); z-index: -1; }
.prop-notebook.fb img { transform: rotate(-4deg); }
.prop.glow img { animation: propglow 1.6s ease-in-out infinite; }
@keyframes propglow { 0%, 100% { filter: drop-shadow(0 12px 10px rgba(60,28,8,.4)); translate: 0 0; }
  50% { filter: drop-shadow(0 0 22px rgba(127,243,238,1)) drop-shadow(0 0 6px rgba(255,255,255,.8)); translate: 0 -8px; } }
.prop:active img { scale: .94; }
/* g10d: подсказка в простое — подсветка заметна и в неподвижном кадре (свечение не гаснет до нуля) */
.prop.idle-glow img { animation: idleglow 1.6s ease-in-out infinite; }
@keyframes idleglow { 0%, 100% { filter: drop-shadow(0 0 12px rgba(127,243,238,.85)) drop-shadow(0 0 4px rgba(255,255,255,.6)); translate: 0 0; }
  50% { filter: drop-shadow(0 0 26px rgba(127,243,238,1)) drop-shadow(0 0 8px rgba(255,255,255,.9)); translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .prop.idle-glow img { animation: none; filter: drop-shadow(0 0 18px rgba(127,243,238,1)); } }
/* шар на остров (заявка razvitie/ZAYAVKA-VHOD.md): чуть покачивается, по касанию пружинит */
/* G.4, REVIEW 1853: на телефоне шар давал цель 60,3 px — невидимое поле касания шире картинки на 14 мира с каждой стороны (≈76 px) */
.prop-balloon::before { content: ""; position: absolute; inset: -6px -14px; }
.prop-balloon img { animation: balloonsway 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes balloonsway { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.5deg; } }
.prop-balloon.boing img { animation: balloonboing .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes balloonboing { 0% { scale: 1 1; } 25% { scale: 1.12 .86; } 55% { scale: .92 1.1; translate: 0 -14px; } 100% { scale: 1 1; translate: 0 -6px; } }
/* D.10: шар зовёт на остров (пока остров ни разу не открыт): качается заметнее и светится тёплым ореолом */
.prop-balloon.call img { animation: balloonbob 1.8s ease-in-out infinite; filter: drop-shadow(0 0 3px rgba(255,255,255,.95)) drop-shadow(0 0 12px rgba(255,214,120,1)) drop-shadow(0 0 26px rgba(255,170,60,.8)); }
.prop-balloon.call { isolation: isolate; }
/* D.14 (кадр 28.11: ореол drop-shadow на тёплом дереве почти не виден) — пульсирующий светлый круг за шаром */
/* D.16 (кадр d15, dbg: call=true): круг 150% почти целиком прятался за куполом — снаружи 5–10 px бледного; круг 270%, ярче */
/* D.15: общее .prop::after (тень) задаёт right/bottom/height: 26px — круг ореола сплющивался в полоску; сбрасываем */
.prop-balloon.call::after { content: ""; position: absolute; z-index: -1; left: 50%; top: 34%; right: auto; bottom: auto; height: auto; width: 270%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,235,1) 0%, rgba(255,238,160,.95) 26%, rgba(255,205,95,.6) 44%, rgba(255,185,70,0) 66%); animation: balloonglow 1.8s ease-in-out infinite; }
@keyframes balloonglow { 0%, 100% { opacity: .55; scale: .9; } 50% { opacity: 1; scale: 1.08; } }
.hold-still .prop-balloon.call::after { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .prop-balloon.call::after { animation: none; opacity: .85; } }
@keyframes balloonbob { 0%, 100% { rotate: -5deg; translate: 0 0; } 50% { rotate: 5deg; translate: 0 -12px; } }
.prop-balloon.call.boing img { animation: balloonboing .6s cubic-bezier(.3,1.6,.5,1) both; }
@media (prefers-reduced-motion: reduce) { .prop-balloon img, .prop-balloon.boing img { animation: none; } .prop-balloon.call img { animation: none; } }
.shelf-hit { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 20px; }
.in-episode #home-props { display: none; }

/* сон мастерской после «пока» */
.home-sleep #cam { filter: brightness(.62) saturate(.85); transition: filter 1.6s; }
.home-sleep #logo { opacity: .35; }

/* ---------- Карта сезона ---------- */
#map { position: absolute; inset: 0; pointer-events: none !important; opacity: 0; perspective: 1400px; z-index: 3; }
#map.open { opacity: 1; pointer-events: auto !important; }
.map-book { position: absolute; left: 50%; top: 54%; width: 980px; height: 620px; transform: translate(-50%,-50%) scale(var(--nbs, 1)); }
#map.open .map-book { animation: nbopen .8s cubic-bezier(.2,.9,.25,1.08) both; }
#map.closing .map-book { animation: nbclose .48s cubic-bezier(.6,0,.8,.3) both; }
.map-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 34px 30px rgba(20,10,0,.5)); }
.map-img.fb { object-fit: fill; }
.map-medals { position: absolute; left: 5%; right: 5%; top: 8%; bottom: 8%; }
.medal { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border: 0; padding: 0; background: none; cursor: pointer;
  opacity: 0; transform: scale(.3) rotate(-20deg); transition: transform .5s cubic-bezier(.3,1.6,.5,1), opacity .3s, filter .3s; }
.medal.in { opacity: 1; transform: rotate(calc((var(--i) - 4) * 1.6deg)); }
.medal.m-return { width: 190px; height: 190px; margin: -95px 0 0 -95px; }
/* возвратная задача сезона 2 — посередине левой страницы между медальонами 1–4 (центры в 146 px): 136 px не задевает их */
.medal.m-return.m-ret2 { width: 136px; height: 136px; margin: -68px 0 0 -68px; }
.m-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(50,25,5,.35)); }
.m-bg.fb { object-fit: fill; border-radius: 22px; }
.m-win { position: absolute; left: 16%; top: 14%; width: 68%; height: 72%; overflow: hidden; border-radius: 16px; }
.m-win > img, .m-win > .sp { width: 100%; height: 100%; object-fit: cover; display: block; }
.medal.no-bg .m-win { left: 0; top: 0; width: 100%; height: 100%; border-radius: 22px; box-shadow: 0 8px 14px rgba(50,25,5,.35); }
.m-check { position: absolute; right: -14px; bottom: -10px; width: 64px; height: 64px; display: none; filter: drop-shadow(0 4px 4px rgba(30,14,4,.35)); }
.m-done .m-check { display: block; }
.m-done .m-check.missing { display: none; }
/* будущий заказ — силуэт: тёмный, без цвета, чуть прозрачный */
.m-locked .m-win > * { filter: grayscale(1) brightness(.35) contrast(.8); opacity: .55; }
.m-locked .m-bg { filter: grayscale(.7) brightness(.8) drop-shadow(0 6px 6px rgba(50,25,5,.25)); }
.m-locked.in { transform: scale(.88) rotate(calc((var(--i) - 4) * 1.6deg)); }
.m-blank { filter: grayscale(1) brightness(.6); }
/* доступный — светится и дышит */
.m-open.in { animation: medalp 1.5s ease-in-out infinite; }
@keyframes medalp { 0%, 100% { filter: drop-shadow(0 0 10px rgba(127,243,238,.7)); scale: 1; } 50% { filter: drop-shadow(0 0 30px rgba(127,243,238,1)) brightness(1.08); scale: 1.08; } }
.medal.picked { transform: scale(1.3) !important; filter: drop-shadow(0 0 34px rgba(255,212,92,1)) !important; z-index: 3; animation: none !important; }
.in-map #tabs { display: none; }

/* ---------- Уголок родителя (для взрослых: здесь можно читать) ---------- */
/* D.11 (бриф 23 п.7): видимый вход для взрослых — ⚙ в левом нижнем углу, как на острове (решение 167): белая шестерёнка
   на тёмном полупрозрачном круге; при удержании — круг отсчёта 3 с. Не меньше 44 реальных px (64·ik) */
#btn-parent { position: absolute; inset-inline-start: 22px; bottom: 20px; width: 64px; height: 64px; border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: none; opacity: .9; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); -webkit-touch-callout: none; user-select: none; touch-action: none; }
#btn-parent svg { pointer-events: none; }
#btn-parent .pr-gear { position: absolute; inset: 0; width: 100%; height: 100%; }
#btn-parent .pr-hold { position: absolute; inset: -6%; width: 112%; height: 112%; }
#btn-parent .pr-ring { fill: none; stroke: #fff6c8; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; transform: rotate(-90deg); transform-origin: 24px 24px; opacity: 0; }
#btn-parent.holding .pr-ring { opacity: 1; transition: stroke-dashoffset 3s linear; stroke-dashoffset: 0; }
#btn-parent.holding { opacity: 1; }
.in-episode #btn-parent, .in-map #btn-parent { display: none; }
#parent { position: absolute; inset: 0; display: none; background: rgba(24,12,4,.62); z-index: 60; align-items: center; justify-content: center; }
#parent.on { display: flex; animation: fadein .3s; }
.hold-still #parent.on { animation: none; }   /* D.14: кадр proverka-nastroyki пойман посреди проявления */
.pc-sheet { position: relative; width: 760px; max-height: 700px; overflow: auto; padding: 34px 44px 30px; border-radius: 30px;
  background: linear-gradient(#fffaf0, #f6ead4); color: #3a2618; box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,255,255,.6);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; font-size: 19px; line-height: 1.42; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.pc-sheet h2 { margin: 0 0 8px; padding-inline-end: 60px; font-size: 32px; color: #8a4a12; }   /* M.4: заголовок не заходит под крестик (кадр ugolok-xb 16:36) */
.pc-sheet h3 { margin: 22px 0 8px; font-size: 22px; color: #1f8b88; }
.pc-sheet p { margin: 8px 0; }
.pc-lead { font-size: 20px; }
.pc-skills { list-style: none; margin: 0; padding: 0; }
.pc-skills li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(138,74,18,.15); }
.pc-skills i { flex: none; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; border: 3px solid #d9c3a0; }
.pc-skills li.yes i { border-color: #2ec4c0; background: radial-gradient(circle, #2ec4c0 45%, transparent 48%); }
.pc-skills b { display: block; }
.pc-skills span { display: block; font-size: 17px; color: #6b4a2e; }
.pc-close { position: absolute; inset-inline-end: 18px; top: 14px; width: 54px; height: 54px; border: 0; border-radius: 50%; background: rgba(138,74,18,.12); color: #8a4a12; font-size: 34px; line-height: 1; cursor: pointer; }
/* M.6: крестик на телефоне выходил 42×42 px — невидимое поле касания 86×86 мира (≈67 px на 844×390), сам кружок прежний */
.pc-close::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; }
.pc-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.pc-btn { flex: 1; min-height: 56px; padding: 10px 18px; border: 0; border-radius: 18px; background: #2ec4c0; color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.pc-set { margin-top: 14px; padding: 4px 20px 12px; border-radius: 22px; background: rgba(46,196,192,.09); box-shadow: inset 0 0 0 2px rgba(46,196,192,.25); }   /* N.29: настройки — наверху уголка */
.pc-set .pc-row { margin-top: 12px; }
.pc-set-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pc-set-row > span { font-weight: 700; color: #8a4a12; }
.pc-seg { display: flex; gap: 0; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 3px #2ec4c0; }
.pc-lang { min-width: 130px; min-height: 52px; padding: 8px 18px; border: 0; background: transparent; color: #1f8b88; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.pc-lang.on { background: #2ec4c0; color: #fff; }
.pc-note { font-size: 15px; color: #6b4a2e; }
.pc-row > .pc-pilot { flex: 1 0 100%; margin: 0; }
.pc-btn.danger { background: #e9d9bf; color: #8a4a12; position: relative; overflow: hidden; }
.pc-btn.danger::before { content: ""; position: absolute; inset: 0; background: rgba(214,96,60,.35); transform: scaleX(0); transform-origin: 0 50%; }
.pc-btn.danger.holding::before { transform: scaleX(1); transition: transform 2s linear; }

/* ---------- правки раунда 3: карта без анимации для скриншота, медальоны-рамки, логотип не мешает карте ---------- */
#map.instant .map-book { animation: none; }
#map.instant .medal { transition: none; }
.in-map #logo { opacity: 0; transform: translate(-50%, -120%); }
.m-bg { pointer-events: none; }
/* временная замена медальона: портретная деревянная рамка 880×1120 с миниатюрой внутри */
.medal.framed { width: 132px; height: 168px; margin: -84px 0 0 -66px; }
.medal.framed.m-return { width: 160px; height: 204px; margin: -102px 0 0 -80px; }
.medal.framed .m-bg { object-fit: fill; }
.medal.framed .m-win { left: 9.09%; top: 7.14%; width: 81.82%; height: 85.72%; border-radius: 4px; }
.medal.framed .m-win > img.m-blank { object-fit: cover; }
.m-locked .m-win { background: #3b2a1c; }
.prop-notebook.fb { width: 190px !important; }

/* ---------- раунд 4: цели касания ≥64 реальных px, уголок взрослых в реальных px, iOS-звук ---------- */
.hud-btn { width: calc(120px * var(--tk, 1)); height: calc(120px * var(--tk, 1)); }
/* наушник карточки: невидимое поле касания шире картинки */
.card-ear::before { content: ""; position: absolute; inset: calc(-18px * var(--tk, 1)); border-radius: 50%; }
#btn-parent { width: calc(64px * var(--ik, 1)); height: calc(64px * var(--ik, 1)); }
.pc-sheet { zoom: var(--ik, 1); max-height: calc(700px / var(--ik, 1)); width: min(760px, calc(96% / var(--ik, 1))); }
/* наклейки на полке: поле касания шире */
#wall-sticker .sticker::before { content: ""; position: absolute; inset: -30px -3px -12px; }   /* вверх/вниз шире, вбок — не на соседа */
/* звук заблокирован браузером — кнопка «послушай» зовёт коснуться */
.needs-tap #btn-listen { animation: needtap 1s ease-in-out infinite; }
@keyframes needtap { 50% { transform: scale(1.18); filter: drop-shadow(0 0 26px rgba(127,243,238,1)); } }
/* служебный прыжок к шагу (?jump=) — без анимаций входа, чтобы скриншот был честным */
.jumping #logo, .jumping #logo img { transition: none !important; animation: none !important; }
.booting #logo { transition: none !important; }
/* сохранение картинкой недоступно — рамка мягко качается, Бип говорит «бип» */
.wf.nosave { animation: nosave .5s ease-in-out 2; }
@keyframes nosave { 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
/* сидящий спящий Бип (assets/bip/bip-sleep.png, тот же холст 800×1000) — плавная смена риг ↔ картинка */
/* Замечание пользователя (две позы сразу): смена ПОСЛЕДОВАТЕЛЬНАЯ, а не наплывом — прежняя поза гаснет за .18 с,
   и только потом проявляется новая; в любой момент видна одна поза (не две полупрозрачные) */
.bip-sleep-img { position: absolute; left: 0; top: 0; width: 800px; height: 1000px; opacity: 0; transition: opacity .18s linear; pointer-events: none; transform-origin: 400px 960px; }
.bip .bip-root { transition: rotate .5s cubic-bezier(.34,1.56,.64,1), opacity .3s ease-out .18s; }
.bip.sleep-art .bip-root { opacity: 0; transition: rotate .5s cubic-bezier(.34,1.56,.64,1), opacity .18s linear; }
.bip.sleep-art .bip-sleep-img.ok { opacity: 1; transition: opacity .3s ease-out .18s; animation: sleepbreathe 5.2s ease-in-out infinite; }
@keyframes sleepbreathe { 50% { transform: scale(1.012, .99); } }
.pencil-fx { position: absolute; left: 0; top: 0; width: 150px; height: 150px; margin: -120px 0 0 -20px; pointer-events: none; z-index: 6; filter: drop-shadow(0 8px 6px rgba(40,20,5,.35)); }
.pc-ret { margin: 0; padding-inline-start: 22px; }
.pc-ret li { margin: 6px 0; }

/* ---------- Мини-игры (этап 4, js/mini.js) ---------- */
#mini-wall, #mini-table { position: absolute; inset: 0; pointer-events: none; }
/* U.1f: пока Лера на виду, стенка мини-игры сжимается к Бипу (main.js fitLera, п.3) */
#mini-wall { transform-origin: 0 0; transition: transform .45s cubic-bezier(.4,0,.2,1); }
/* U.1f: рамки галереи, которые задели бы Леру, бледнеют, пока она на виду */
#wall-frame .wf, #wall-frame .wf-link { transition: opacity .4s; }
#wall-frame .yield { opacity: 0; pointer-events: none !important; }
/* U.5: наклейка полки, на которую заходит афиша эпизода, гаснет на время эпизода */
#wall-sticker > * { transition: opacity .35s; }
#wall-sticker > .p-yield { opacity: 0 !important; pointer-events: none !important; }
#wall-frame > .p-yield { opacity: 0 !important; pointer-events: none !important; }   /* U.5b: рамка галереи под афишей/обложкой */
#mini-wall .wf { position: absolute; width: 880px; height: 1120px; transform-origin: 0 0; pointer-events: none; }
/* N.25: #mini-wall .poster больше не ловит касания прямоугольником — только .zones (правило у афиши) */
.in-mini #wall-frame, .in-mini #wall-sticker { opacity: 0; transition: opacity .4s; pointer-events: none; }
/* окошки команды: «что изменить» (карандаш) и «что оставить» (замок) */
#mini-table > .msocks { position: absolute; inset: 0; pointer-events: none; }
.ms-strip { position: absolute; left: 345px; top: 426px; width: 322px; height: auto; filter: drop-shadow(0 10px 10px rgba(60,28,8,.35)); }
.ms-strip.missing { display: none; }
.msock { position: absolute; }
.ms-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .78; filter: drop-shadow(0 8px 8px rgba(60,28,8,.3)) saturate(.7); }
.ms-badge { position: absolute; left: -20px; top: -22px; width: 58px; height: 58px; object-fit: contain; z-index: 3; filter: drop-shadow(0 4px 4px rgba(40,20,6,.4)); transition: transform .3s; }
.ms-ring { position: absolute; inset: 6px; border-radius: 26px; border: 6px solid rgba(255,255,255,.65); box-shadow: inset 0 0 18px rgba(127,243,238,.25); opacity: 0; transition: opacity .3s; }
.msock.active .ms-ring { opacity: 1; border-color: #fff; box-shadow: 0 0 26px rgba(127,243,238,.8), inset 0 0 22px rgba(127,243,238,.5); animation: ringp 1.2s ease-in-out infinite; }
.msock.active .ms-badge { transform: scale(1.18) rotate(-8deg); }
.msock.filled .ms-ring { opacity: 0; animation: none; }
/* кубики-картинки на столе */
.mcube { position: absolute; border: 0; padding: 0; background: none; cursor: grab; pointer-events: auto; touch-action: none; z-index: 2; transform-origin: 50% 80%; }
.mcube .mc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; filter: drop-shadow(0 12px 10px rgba(60,28,8,.42)); }
.mc-icon { position: absolute; inset: 14%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.mc-sprite { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(40,20,6,.3)); }
.mc-crop { width: 100%; max-height: 100%; background-repeat: no-repeat; border-radius: 10px; filter: drop-shadow(0 3px 3px rgba(40,20,6,.25)); }
.mcube.drag { z-index: 5; cursor: grabbing; filter: drop-shadow(0 26px 18px rgba(40,20,6,.35)); }
.mcube.placed { pointer-events: none; z-index: 4; }
/* кубик звучит при чтении вслух — подпрыгивает и светится (REVIEW эт.4 п.4) */
.mcube.reading { z-index: 4; animation: none !important; transform: translateY(-18px) scale(1.12); transition: transform .2s; filter: drop-shadow(0 0 22px rgba(255,212,92,.95)); }
.mcube:not(.placed):not(.drag) { animation: cubeidle 2.6s ease-in-out infinite; }
.mcube:nth-child(2n):not(.placed) { animation-delay: -1.3s; }
@keyframes cubeidle { 50% { translate: 0 -5px; } }
/* «Бип перестарался»: зоны невидимы — найти лишнее и есть задача */
.zones.spot-mode .zone .ring { opacity: 0; animation: none; }
.zones.spot-mode .zone.seen .ring { opacity: .45; border-style: solid; border-color: rgba(255,255,255,.7); box-shadow: none; }
.zones.spot-mode .zone.pulse .ring { opacity: 1; animation: ringp .8s ease-in-out infinite; }
.zones.spot-mode .zone.hit .ring { opacity: 1; border-style: solid; border-color: #ffd45c; box-shadow: 0 0 30px rgba(255,212,92,.9); }
/* жетоны игр из ящика с игрушками */
#toys { position: absolute; inset: 0; pointer-events: none; }
#toys.on { pointer-events: auto; }
.toys-veil { position: absolute; left: -1200px; top: -800px; width: 3424px; height: 2368px; border: 0; padding: 0; background: radial-gradient(closest-side at 50% 50%, rgba(40,20,6,.0), rgba(40,20,6,.25)); opacity: 0; transition: opacity .3s; }
#toys.on .toys-veil { opacity: 1; }
.toy { position: absolute; width: 132px; height: 132px; border: 0; padding: 0; background: none; cursor: pointer; }
.toy-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(60,28,8,.45)); }
.toy-icon { position: absolute; left: 17%; top: 15%; width: 66%; height: 70%; object-fit: contain; border-radius: 50%; }
.toy.open { animation: toyglow 1.6s ease-in-out infinite; }
.toy.locked .toy-icon { filter: brightness(0) opacity(.35); }
.toy.picked { animation: none; transform: scale(1.15); transition: transform .25s; }
@keyframes toyglow { 50% { filter: drop-shadow(0 0 22px rgba(255,212,92,.95)); translate: 0 -6px; } }
.mini-sticker { position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; object-fit: contain; transform: translate(-50%,-50%); z-index: 30; pointer-events: none; filter: drop-shadow(0 20px 20px rgba(40,20,6,.45)); }
/* «Настоящее или нарисованное»: карточка на стене и две коробки на столе */
#mini-wall .scard { position: absolute; pointer-events: auto; touch-action: none; cursor: grab; z-index: 3; transform-origin: 50% 60%; animation: cardidle 3s ease-in-out infinite; }
#mini-wall .scard.drag { animation: none; cursor: grabbing; z-index: 8; filter: drop-shadow(0 30px 22px rgba(40,20,6,.35)); }
@keyframes cardidle { 50% { rotate: -1.2deg; translate: 0 -6px; } }
.sc-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; filter: drop-shadow(0 16px 14px rgba(60,28,8,.45)); }
.sc-win { position: absolute; left: 9%; top: 8%; right: 9%; bottom: 12%; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 40% 35%, #fffaf0, #f1e2c6); box-shadow: inset 0 2px 8px rgba(60,28,8,.25); }
.sc-pic { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-pic.missing { display: none; }
#mini-table > .sboxes { position: absolute; inset: 0; pointer-events: none; }
.sbox { position: absolute; border: 0; padding: 0; background: none; pointer-events: auto; cursor: pointer; transform-origin: 50% 90%; transition: transform .25s; }
.sb-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(60,28,8,.45)); }
.sb-emblem { position: absolute; left: 50%; top: 38%; width: 46%; height: 46%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 6px 6px rgba(40,20,6,.4)); }
.sbox.active { animation: boxready 1.8s ease-in-out infinite; }
.sbox[data-k="draw"].active { animation-delay: -.9s; }
.sbox.pulse .sb-art { filter: drop-shadow(0 0 28px rgba(255,212,92,.95)) drop-shadow(0 14px 12px rgba(60,28,8,.45)); }
.sbox.got { transform: scale(1.12, .9); }
@keyframes boxready { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .mcube, .toy.open, .scard, .sbox.active { animation: none !important; } }

/* ---------- Рост (этап 5, js/grow.js): улучшения Бипа за навыки ---------- */
.bip img.up { opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none; }
.bip img.up.missing { display: none; }
.bip.has-pencil .up-pencil.ok, .bip.has-pencil .up-pencil.fbk, .bip.has-antenna .up-antenna.ok { opacity: 1; }
/* замена до ассета: готовый спрайт карандаша заложен за правый наушник */
.bip .up-pencil.fbk { left: 548px; top: 150px; width: 190px; height: auto; transform: rotate(-38deg); filter: drop-shadow(0 6px 6px rgba(60,28,8,.35)); }
.bip.has-antenna .ant-glow { opacity: .95; transform: scale(1.7); animation: antpulse2 1.8s ease-in-out infinite; }
@keyframes antpulse2 { 50% { opacity: .6; transform: scale(1.45); } }
.bip .up-nbst { opacity: 0; }
.bip.has-nbst .up-nbst.ok { opacity: 1; }
.bip .up-nbst.fbk { left: 34%; top: 30%; width: 32%; height: auto; inset: auto; }
.bip.has-nbst .up-nbst.fbk { opacity: 1; }
.bip.up-pop .up { transition: none; }
@keyframes uppop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.25) rotate(6deg); opacity: 1; } 100% { transform: none; opacity: 1; } }

/* ---------- Чертёж навыков ---------- */
#blueprint { position: absolute; inset: 0; pointer-events: none !important; opacity: 0; perspective: 1400px; z-index: 3; }
#blueprint.open { opacity: 1; pointer-events: auto !important; }
.bp-sheet { position: absolute; left: 50%; top: 53%; width: 980px; height: 640px; transform: translate(-50%,-50%) scale(var(--nbs, 1)); }
.wide .bp-sheet { --nbs: calc(1.12 / var(--wz, 1)); }
#blueprint.open .bp-sheet { animation: bpopen .7s cubic-bezier(.2,.9,.25,1.08) both; }
#blueprint.closing .bp-sheet { animation: nbclose .45s cubic-bezier(.6,0,.8,.3) both; }
#blueprint.instant .bp-sheet { animation: none; }
@keyframes bpopen { 0% { transform: translate(-50%,-50%) scale(.2) rotate(-8deg); opacity: 0; } 100% { transform: translate(-50%,-50%) scale(var(--nbs, 1)); opacity: 1; } }
.bp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 34px 30px rgba(20,10,0,.5)); }
.bp-img.fbk { object-fit: fill; }
.bp-bip { position: absolute; inset: 0; }
.bp-bip .bip { position: absolute; }
.bp-bip .bip-hit { display: none; }
.bp-node { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border: 0; padding: 0; background: none; cursor: pointer; }
.bp-node .bpn-medal { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(20,30,60,.45)); }
.bp-node .bpn-st { position: absolute; left: 19%; top: 17%; width: 62%; height: 64%; object-fit: contain; }
.bp-node.locked .bpn-st { filter: brightness(0) opacity(.3); }
.bp-node.locked .bpn-medal { filter: grayscale(.6) brightness(.85) drop-shadow(0 10px 8px rgba(20,30,60,.35)); }
.bp-node.got { animation: toyglow 2s ease-in-out infinite; }
.bp-node.talk { animation: none; transform: scale(1.18); transition: transform .25s cubic-bezier(.3,1.5,.5,1); }

/* ---------- Этап 5: «было и стало» на стене, стопка наклеек, «Бип устал» ---------- */
/* пара «первая → самая новая»: рамки чуть повёрнуты друг к другу, стрелка роста между ними */
#wall-frame .wf-was { rotate: -2.5deg; }
#wall-frame .wf-now { rotate: 2deg; }
.wf-link { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; z-index: 2; }
.wf-link img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(60,28,8,.4)); animation: linkbob 2.6s ease-in-out infinite; }
.wf-link::before { content: ""; position: absolute; inset: -20px -10px; }
@keyframes linkbob { 50% { transform: translateX(5px) scale(1.06); } }
/* стопка старых наклеек в третьем месте полки — вход в чертёж навыков (там вся коллекция) */
.sticker-pile { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; }
.sticker-pile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(50,25,5,.35)); }
.sticker-pile::before { content: ""; position: absolute; inset: -30px -3px -12px; }
/* ревью мастерской (?demo=): логотип не закрывает стену */
.no-logo #logo { display: none; }
/* в мастерской логотип — заставка: после приветствия улетает вверх и не закрывает работы на стене */
.at-home.logo-away #logo { transform: translate(-50%, -140%); opacity: 0; }

/* свиток чертежа: картинка низкая (400×260) — поле касания выше картинки, чтобы на телефоне было ≥64 реальных px */
.prop-blueprint::before { content: ""; position: absolute; left: -12px; right: -12px; top: -46px; bottom: -14px; }

/* ---------- Сезон 2: «Посмотри, всё ли на месте» (engine.spot) ---------- */
.zones.spotting .zone .ring { opacity: 0; animation: none; }
.zones.spotting .zone.done .ring { opacity: .8; border-style: solid; border-color: rgba(127,243,238,.95); }
.zones.spotting .zone.done .stamp, .zones.spotting .zone.done .stamp-svg { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
.zones.spotting .zone.pulse .ring { opacity: 1; animation: ringp .8s ease-in-out infinite; }
.zones.spotting .zone.found .ring { opacity: 1; animation: foundp 1s ease-in-out infinite; border-style: solid; border-color: #ff9a3c; box-shadow: 0 0 34px rgba(255,154,60,.9), inset 0 0 24px rgba(255,154,60,.5); }
@keyframes foundp { 50% { transform: scale(1.05); } }
.zone.spot-bg { cursor: default; }
/* рамка «как было» живёт в #poster-slot, а не на стене: размеры и якорь — свои (раньше были только у #wall-frame .wf → рамка была 0×0 и невидима) */
/* сверка: афиша и рамка «как было» — над стаканом с карандашами (bg-mid), Бип и передний план — выше */
#cam.spot-up #world { z-index: 2; } #cam.spot-up #world-front { z-index: 3; } #cam.spot-up #bg-front { z-index: 4; }
/* U.7b: Лера при этом остаётся «за верстаком» — подрезана по его верху (--cut считает lera.js place) */
#cam.spot-up .lera { clip-path: inset(-120px -160px var(--cut, 0px) -160px); }
#poster-slot .was-frame { position: absolute; width: 880px; height: 1120px; transform-origin: 0 0; z-index: 1; pointer-events: none; }
#poster-slot .was-frame .wf-win { position: absolute; }
.was-frame.pulse { animation: waspulse 1s ease-in-out infinite; }
@keyframes waspulse { 50% { filter: brightness(1.18) drop-shadow(0 0 40px #ffe08a); } }
.was-frame .wf-win { overflow: hidden; }
.was-ring { position: absolute; border: 30px solid #ff9a3c; border-radius: 44px; box-shadow: 0 0 34px rgba(255,154,60,.9); animation: foundp 1s ease-in-out infinite; box-sizing: border-box; }
.was-badge { position: absolute; left: -70px; top: -70px; width: 260px; height: 260px; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(50,25,5,.4)); }
/* вердикт «всё как было» (s2e5): объёмная зелёная галочка-кнопка под рамкой «как было», без слов */
.verdict-btn { position: absolute; z-index: 2; border: 0; padding: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation;
  background: radial-gradient(circle at 34% 28%, #c9ffd9 0 12%, #5fdc8e 34%, #1f9d5c 72%, #137544 100%);
  box-shadow: inset 0 -10px 16px rgba(10,70,35,.45), inset 0 8px 12px rgba(255,255,255,.55), 0 12px 0 #0f6a3c, 0 20px 26px rgba(40,25,5,.45);
  transition: transform .15s; }
.verdict-btn:active { transform: translateY(6px); box-shadow: inset 0 -8px 14px rgba(10,70,35,.45), inset 0 8px 12px rgba(255,255,255,.55), 0 6px 0 #0f6a3c, 0 12px 18px rgba(40,25,5,.4); }
.verdict-btn img { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: contain; pointer-events: none; }
.verdict-btn svg { position: absolute; inset: 14%; width: 72%; height: 72%; fill: none; stroke: #fff; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 4px 0 rgba(10,80,40,.55)); pointer-events: none; }
.verdict-btn.has-img { background: none; box-shadow: none; } .verdict-btn.has-img svg { display: none; }
.verdict-btn.pulse { animation: verdictp .9s ease-in-out infinite; }
@keyframes verdictp { 50% { transform: scale(1.12); filter: drop-shadow(0 0 26px #b9ffcf); } }
.verdict-btn.done { animation: verdictok .6s ease-out forwards; filter: drop-shadow(0 0 30px #b9ffcf); }
@keyframes verdictok { 40% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1.08); } }
.verdict-btn.gone { opacity: 0; transform: scale(.4); transition: opacity .4s, transform .4s; pointer-events: none; }
/* закладка «сезон 2» на краю карты */
.medal.m-next { width: var(--ms, 180px); height: var(--ms, 180px); margin: calc(var(--ms, 180px) / -2) 0 0 calc(var(--ms, 180px) / -2); }
.medal.m-next.m-open { filter: drop-shadow(0 0 22px rgba(120,230,255,.85)); }

/* ---------- Сезон 3: второй разворот карты (решение 91) ---------- */
/* скриншот proverka-18: при bottom:-1% стрелка на телефоне уходила за низ экрана — теперь внутри разворота, над пружиной */
.map-turn { position: absolute; left: 50%; bottom: 4%; width: 132px; height: 104px; margin-left: -66px; border: 0; padding: 0; background: none;
  cursor: pointer; display: none; z-index: 4; filter: drop-shadow(0 8px 8px rgba(50,25,5,.4)); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.map-turn.on { display: block; }
.map-turn img { width: 100%; height: 100%; object-fit: contain; display: block; }
.map-turn.back img { transform: scaleX(-1); }
/* до рисунка Codex (page-turn.png) — деревянная стрелка arrow-grow.png, она уже смотрит вправо; квадратная, поэтому кнопка квадратная */
.map-turn.fb { width: 120px; height: 120px; margin-left: -60px; }
.map-turn:active { transform: scale(.92); }
.map-turn.glow { animation: turnglow 1.6s ease-in-out infinite; }
@keyframes turnglow { 0%, 100% { filter: drop-shadow(0 8px 8px rgba(50,25,5,.4)); transform: translateX(0); }
  50% { filter: drop-shadow(0 0 22px rgba(255,214,92,1)); transform: translateX(8px); } }
.map-book.turning .map-medals { opacity: 0; transform: perspective(900px) rotateY(-24deg) scaleX(.9); }
.map-medals { transition: opacity .25s, transform .3s cubic-bezier(.4,0,.2,1); transform-origin: 50% 50%; }
/* медальон возврата сезона 2 стоит среди медальонов сезона 1 — светится голубым, как закладки сезона 2 (скриншот proverka-17) */
.medal.m-return.m-ret2.m-open { filter: drop-shadow(0 0 22px rgba(120,230,255,.85)); }
@media (prefers-reduced-motion: reduce) { .map-turn.glow { animation: none; filter: drop-shadow(0 0 18px rgba(255,214,92,1)); } }
/* REVIEW «Пикник» п.3: ободок медальона возврата сезона 2 ложился на галочку эпизода 1 — медальон под соседями */
.medal { z-index: 1; }
.medal.m-ret2 { z-index: 0; }

/* ---------- Сезон 4 «Я так не просил»: вердикт «Оставляем?» (engine.verdict) ---------- */
/* две кнопки под картинкой на верстаке. Стрелка-переделка — тёплая оранжевая, того же объёма, что галочка (решение 114: не красный крест) */
.vd-box { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; }
.verdict-btn.vd-redo { background: radial-gradient(circle at 34% 28%, #ffe6c4 0 12%, #ffad4d 34%, #ee7a1c 72%, #c15a0c 100%);
  box-shadow: inset 0 -10px 16px rgba(110,45,5,.45), inset 0 8px 12px rgba(255,255,255,.55), 0 12px 0 #a44b0a, 0 20px 26px rgba(40,25,5,.45); }
.verdict-btn.vd-redo:active { box-shadow: inset 0 -8px 14px rgba(110,45,5,.45), inset 0 8px 12px rgba(255,255,255,.55), 0 6px 0 #a44b0a, 0 12px 18px rgba(40,25,5,.4); }
.verdict-btn.vd-redo svg { filter: drop-shadow(0 4px 0 rgba(120,50,5,.55)); }
.verdict-btn.vd-redo.has-img { background: none; box-shadow: none; }
.verdict-btn.vd-redo.done { filter: drop-shadow(0 0 30px #ffd09a); }
/* Бип зачитывает кнопку — она приподнимается и светится, как карточка в блокноте */
.verdict-btn.reading { transform: translateY(-14px) scale(1.1); filter: drop-shadow(0 0 24px rgba(127,243,238,.95)); }
/* карточка ЗАКАЗА (choice.show): не выбирается — без «нажми», с тонкой пунктирной рамкой «вот что мы попросили» */
#choice.order .card { cursor: default; }
#choice.order .card::after { content: ""; position: absolute; inset: 6%; border: 6px dashed rgba(63,127,196,.75); border-radius: 26px; pointer-events: none; }
/* карта: на развороте сезона 3 две стрелки сразу — «назад» левее пружины, «вперёд» правее (третий разворот — сезон 4) */
.map-book.two .map-turn.back { margin-left: -150px; }
.map-book.two .map-turn.fwd { margin-left: 18px; }
.map-book.two .map-turn.back.fb { margin-left: -138px; }

/* ---------- Этап 9: доводка (DOVODKA.md) ---------- */
/* Д3: ключик уголка для взрослых — предмет мастерской; кольцо удержания остаётся поверх */
@keyframes keyjig { 50% { rotate: -8deg; } }
@media (prefers-reduced-motion: reduce) { #btn-parent.holding .pr-ring { transition: none; } }
/* Д4: тропинки карты — прозрачные PNG 1960×1240 (как map-book.png) под медальонами, вписаны так же, как разворот */
.map-paths { position: absolute; inset: 0; pointer-events: none; transition: opacity .25s; }
.map-paths img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.map-book.turning .map-paths { opacity: 0; }

/* Д10: солнечный луч из окна и пылинки — слой фона ЗА работой и героями (не меняет цвета афиши, которую оценивает ребёнок).
   Координаты — в процентах фона (окно ≈ x 9–36 %, y 15–55 %), слой масштабируется вместе с фоном. Вечером луч гаснет. */
#bg-light { pointer-events: none; transition: opacity 2.4s ease; }
#bg-back.is-evening ~ #bg-light { opacity: 0; }
#bg-light .sunbeam { position: absolute; inset: 0; mix-blend-mode: soft-light; opacity: .55;
  background: linear-gradient(118deg, rgba(255,246,214,0) 8%, rgba(255,240,200,.95) 22%, rgba(255,226,170,.55) 46%, rgba(255,220,160,0) 74%);
  clip-path: polygon(9% 16%, 36% 14%, 78% 86%, 38% 92%);
  animation: beam 9s ease-in-out infinite alternate; }
@keyframes beam { from { opacity: .42; } to { opacity: .62; } }
#bg-light .motes { position: absolute; inset: 0; }
#bg-light .motes i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,250,228,.95) 0, rgba(255,240,200,.5) 45%, rgba(255,240,200,0) 70%);
  opacity: 0; animation: mote var(--d) linear var(--dl) infinite; }
@keyframes mote {
  0% { opacity: 0; transform: translate(0,0); }
  20% { opacity: .85; }
  80% { opacity: .7; }
  100% { opacity: 0; transform: translate(26px,-38px); } }
.in-episode #bg-light .motes { opacity: .6; }   /* в эпизоде пылинки тише — внимание на работе */
@media (prefers-reduced-motion: reduce) { #bg-light .sunbeam, #bg-light .motes i { animation: none; } #bg-light .motes i { opacity: .5; } }

/* Д6: сцена не должна «раздувать» вьюпорт телефона — переполнение #viewport не попадает в размер страницы */
#viewport { contain: strict; }
html, body { width: 100%; max-width: 100%; overscroll-behavior: none; }

/* ---------- 9.12: блокнот «как 3D-игра» — карточки с объёмом, тенью на бумаге и бликом ---------- */
.card-in { position: absolute; inset: 0; transform-origin: 50% 80%; }
.card.in .card-in { animation: cardfloat 3.8s ease-in-out infinite; animation-delay: calc(var(--i) * -1.27s); }
.card.picked .card-in, .card.away .card-in, .card.reading .card-in, #choice.instant .card-in { animation: none; }
@keyframes cardfloat { 0%, 100% { transform: translateY(0) rotateX(0deg); } 50% { transform: translateY(-5px) rotateX(5deg); } }
/* мягкая контактная тень на листе блокнота: карточка «лежит», а при выборе поднимается — тень уменьшается */
.card::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -16px; height: 28px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(70,36,10,.36), rgba(70,36,10,0) 70%); opacity: 0; transition: opacity .3s, transform .45s; pointer-events: none; }
.card.in::before { opacity: 1; }
.card.in:hover::before, .card.reading::before { transform: translateY(8px) scale(.85); opacity: .7; }
.card.picked::before { transform: translateY(14px) scale(.7); opacity: .5; }
.card.away::before { opacity: 0; }
/* значок — как выпуклая наклейка */
.card-icon { filter: drop-shadow(0 7px 5px rgba(70,36,10,.26)); }
/* блик по карточке: один раз при подлёте и при выборе */
.card-sheen { position: absolute; inset: 5% 6%; border-radius: 24px; overflow: hidden; pointer-events: none; }
.card-sheen::after { content: ""; position: absolute; top: -30%; bottom: -30%; left: -70%; width: 45%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.55) 50%, rgba(255,255,255,0)); transform: skewX(-14deg); }
.card.in .card-sheen::after { animation: cardsheen 1s calc(.15s + var(--i) * .12s) ease-out both; }
.card.picked .card-sheen::after { animation: cardsheen2 .7s ease-out both; }
@keyframes cardsheen { from { left: -70%; } to { left: 140%; } }
@keyframes cardsheen2 { from { left: -70%; } to { left: 140%; } }
#choice.order .card-sheen { display: none; }
/* тёплый свет лампы на развороте блокнота (под карточками) */
.nb::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: -5%; height: 14%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(20,10,0,.42), rgba(20,10,0,0) 70%); pointer-events: none; }
#choice.side .nb::before { display: none; }

/* ---------- 9.13: праздник — лучи, блик по стеклу рамки, звёздочки ---------- */
#celebrate { perspective: 1600px; }
.cel-rays { position: absolute; left: 50%; top: 50%; width: 1500px; height: 1500px; margin: -750px 0 0 -750px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,224,150,.26) 0deg 8deg, rgba(255,224,150,0) 8deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 14%, rgba(0,0,0,0) 60%); mask: radial-gradient(circle, #000 14%, rgba(0,0,0,0) 60%);
  animation: raysin .9s ease-out both, raysspin 46s linear infinite; transition: opacity .5s; }
.cel-rays.out, .cel-tw.out { opacity: 0; }
@keyframes raysin { from { opacity: 0; } }
@keyframes raysspin { to { transform: rotate(360deg); } }
.cel-glint { position: absolute; left: 9.09%; top: 7.14%; width: 81.82%; height: 85.72%; overflow: hidden; pointer-events: none; }
.cel-glint::after { content: ""; position: absolute; top: -40%; bottom: -40%; left: -80%; width: 38%;
  background: linear-gradient(105deg, rgba(255,255,255,0), rgba(255,255,255,.42) 50%, rgba(255,255,255,0)); transform: skewX(-16deg);
  animation: celglint 3.6s .75s ease-in-out infinite; }
@keyframes celglint { 0% { left: -80%; } 35%, 100% { left: 150%; } }
.cel-tw { position: absolute; inset: 0; pointer-events: none; transition: opacity .4s; }
.cel-tw i { position: absolute; width: 34px; height: 34px; margin: -17px; background: #FFE08A;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 8px rgba(255,214,110,.9)); animation: celtw 1.8s ease-in-out infinite; opacity: 0; }
.cel-tw i:nth-child(1) { left: calc(50% - 280px); top: calc(50% - 250px); animation-delay: .6s; }
.cel-tw i:nth-child(2) { left: calc(50% + 285px); top: calc(50% - 200px); animation-delay: .9s; width: 24px; height: 24px; margin: -12px; }
.cel-tw i:nth-child(3) { left: calc(50% - 300px); top: calc(50% + 40px); animation-delay: 1.3s; width: 22px; height: 22px; margin: -11px; }
.cel-tw i:nth-child(4) { left: calc(50% + 300px); top: calc(50% + 90px); animation-delay: .75s; }
.cel-tw i:nth-child(5) { left: calc(50% - 240px); top: calc(50% + 290px); animation-delay: 1.1s; width: 26px; height: 26px; margin: -13px; }
.cel-tw i:nth-child(6) { left: calc(50% + 250px); top: calc(50% + 300px); animation-delay: 1.5s; width: 20px; height: 20px; margin: -10px; }
.cel-tw i:nth-child(7) { left: calc(50% - 60px); top: calc(50% - 345px); animation-delay: 1.7s; width: 24px; height: 24px; margin: -12px; }
.cel-tw i:nth-child(8) { left: calc(50% + 90px); top: calc(50% + 345px); animation-delay: 1s; width: 22px; height: 22px; margin: -11px; }
@keyframes celtw { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) {
  .card.in .card-in, .card-sheen::after, .cel-glint::after { animation: none !important; }
  .cel-rays { animation: raysin .5s ease-out both; }
  .cel-tw i { animation: none; opacity: .8; }
}

/* ---------- 9.15: наклейка в празднике — вспышка в центре, переворот монеткой, полёт на полку ---------- */
.poster.lifted { opacity: 0; }
.stk-show { position: absolute; inset: 0; pointer-events: none; perspective: 1200px; }
.stk-rays { position: absolute; left: 50%; top: 50%; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,226,150,.32) 0deg 7deg, rgba(255,226,150,0) 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 12%, rgba(0,0,0,0) 58%); mask: radial-gradient(circle, #000 12%, rgba(0,0,0,0) 58%);
  animation: raysin .5s ease-out both, raysspin 30s linear infinite; transition: opacity .35s; }
.stk-rays.out { opacity: 0; }
.stk-coin { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); transform-style: preserve-3d;
  filter: drop-shadow(0 18px 18px rgba(40,18,4,.45)) drop-shadow(0 0 26px rgba(255,214,110,.75)); }
.stk-coin img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stk-glint { position: absolute; inset: 8%; border-radius: 50%; overflow: hidden; }
.stk-glint::after { content: ""; position: absolute; top: -30%; bottom: -30%; left: -70%; width: 40%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.6) 50%, rgba(255,255,255,0)); transform: skewX(-14deg);
  animation: cardsheen .8s .85s ease-out both; }

/* ---------- 9.16: медальоны карты — блик по окошку, у нового заказа лучи и искорки ---------- */
.m-shine { position: absolute; left: 16%; top: 14%; width: 68%; height: 72%; border-radius: 16px; overflow: hidden; pointer-events: none; }
.medal.framed .m-shine { left: 9.09%; top: 7.14%; width: 81.82%; height: 85.72%; border-radius: 4px; }
.medal.no-bg .m-shine { left: 0; top: 0; width: 100%; height: 100%; border-radius: 22px; }
.m-shine::after { content: ""; position: absolute; top: -40%; bottom: -40%; left: -90%; width: 42%;
  background: linear-gradient(105deg, rgba(255,255,255,0), rgba(255,255,255,.5) 50%, rgba(255,255,255,0)); transform: skewX(-16deg); }
.medal.in .m-shine::after { animation: mshine 7s calc(1.2s + var(--i) * .45s) ease-in-out infinite; }
.m-open.in .m-shine::after { animation-duration: 3.2s; animation-delay: .9s; }
@keyframes mshine { 0% { left: -90%; } 18%, 100% { left: 160%; } }
.m-halo { position: absolute; left: -42%; top: -42%; width: 184%; height: 184%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(150,240,255,.5) 0deg 9deg, rgba(150,240,255,0) 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 26%, rgba(0,0,0,0) 66%); mask: radial-gradient(circle, #000 26%, rgba(0,0,0,0) 66%);
  transition: opacity .6s .3s; }
.medal.in .m-halo { opacity: 1; animation: raysspin 24s linear infinite; }
.m-spark { position: absolute; width: 22px; height: 22px; margin: -11px; background: #E9FFFD; pointer-events: none; opacity: 0;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 6px rgba(127,243,238,1)); }
.medal.in .m-spark { animation: celtw 2.2s ease-in-out infinite; }
.m-spark:nth-of-type(2) { left: 4%; top: 10%; animation-delay: .2s !important; }
.m-spark:nth-of-type(3) { left: 98%; top: 30%; width: 16px; height: 16px; margin: -8px; animation-delay: .9s !important; }
.m-spark:nth-of-type(4) { left: 86%; top: 96%; width: 18px; height: 18px; margin: -9px; animation-delay: 1.5s !important; }
/* 9.19 (REVIEW 9.16): в плотном столбце закладок сезона 2 и у медальона рядом со стрелками лучи короче —
   вылет 14 % вместо 42 %, маска гаснет раньше, до ободка соседней закладки не достаёт; искорки — у самого ободка */
.medal.m-next .m-halo { left: -14%; top: -14%; width: 128%; height: 128%;
  -webkit-mask: radial-gradient(circle, #000 32%, rgba(0,0,0,0) 56%); mask: radial-gradient(circle, #000 32%, rgba(0,0,0,0) 56%); }
/* 9.23 (REVIEW 9.19): граница маски 56 % — на пике пульсации ×1,08 край ≈ 61,9 px, зазор до ободка соседней закладки ≥ 4,6 px */
.medal.m-next .m-spark:nth-of-type(2) { left: 12%; top: 14%; }
.medal.m-next .m-spark:nth-of-type(3) { left: 90%; top: 32%; }
.medal.m-next .m-spark:nth-of-type(4) { left: 80%; top: 88%; }
.map-book.two .medal:not(.m-next) .m-halo { left: -28%; top: -28%; width: 156%; height: 156%; }
/* 9.21: медальон над стрелками — вылет как у закладок, маска гаснет ещё раньше: край лучей ≈ 0,46 ширины медальона от центра */
.map-book.two .medal.m-near-turn .m-halo { left: -14%; top: -14%; width: 128%; height: 128%;
  -webkit-mask: radial-gradient(circle, #000 30%, rgba(0,0,0,0) 52%); mask: radial-gradient(circle, #000 30%, rgba(0,0,0,0) 52%); }
.map-book.two .medal.m-near-turn .m-spark:nth-of-type(4) { left: 78%; top: 84%; }
/* 9.24 (REVIEW 9.21): у «Большого заказа» над стрелками (190 px) стрелка «Вперёд» заходит на его ободок, поэтому лучи
   оставлены только венцом в верхней половине: линейная маска гаснет к центру, ниже центра лучей нет вовсе — до стрелки не достают */
.map-book.two .medal.m-return.m-near-turn .m-halo {
  -webkit-mask: radial-gradient(circle, #000 30%, rgba(0,0,0,0) 52%), linear-gradient(to bottom, #000 22%, rgba(0,0,0,0) 46%);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle, #000 30%, rgba(0,0,0,0) 52%), linear-gradient(to bottom, #000 22%, rgba(0,0,0,0) 46%);
  mask-composite: intersect; }
.map-book.two .medal.m-return.m-near-turn .m-spark:nth-of-type(4) { left: 92%; top: 14%; }
/* 9.25 (REVIEW 9.24): raysspin поворачивал слой вместе с линейной маской, и венец периодически уходил вниз к стрелке.
   У этого медальона лучи не вращаются — венец всегда сверху, вместо вращения мягко «дышит» яркостью */
.map-book.two .medal.in.m-return.m-near-turn:not(.picked) .m-halo { animation: haloglow 3.2s ease-in-out infinite; }
@keyframes haloglow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .map-book.two .medal.in.m-return.m-near-turn:not(.picked) .m-halo { animation: none; opacity: .7; } }
.medal.picked .m-halo, .medal.picked .m-spark { animation: none; opacity: 0; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) {
  .m-shine::after, .stk-glint::after { animation: none !important; }
  .medal.in:not(.picked) .m-halo { animation: none; opacity: .7; }
  .medal.in:not(.picked) .m-spark { animation: none; opacity: .8; }
  .stk-rays { animation: none; }
}

/* ---------- 9.17. Мини-игры и чертёж «как 3D-игра»: свет, объём, блики (только CSS, касания не перехватывает) ---------- */
/* жетоны в ящике: тёплые лучи за открытыми, блик по окошку — у каждого в свой момент */
.toy::before, .toy::after, .bp-node::before, .bp-node::after, .mcube::before, .msock::after { content: ""; position: absolute; pointer-events: none; }
.toy.open::before, .bp-node.got::before { inset: -28%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,222,140,.42) 0deg 9deg, rgba(255,222,140,0) 9deg 30deg);
  -webkit-mask: radial-gradient(closest-side, #000 38%, transparent 100%); mask: radial-gradient(closest-side, #000 38%, transparent 100%);
  animation: raysin .6s .5s both, raysspin 16s linear infinite; }
.bp-node.got::before { background: repeating-conic-gradient(from 0deg, rgba(150,240,255,.45) 0deg 9deg, rgba(150,240,255,0) 9deg 30deg); }
.toy.open::after, .bp-node.got::after { left: 17%; top: 15%; width: 66%; height: 70%; border-radius: 50%; z-index: 1;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.6) 50%, transparent 62%) no-repeat; background-size: 300% 100%;
  background-position: 130% 0; animation: toysheen 4.4s ease-in-out infinite; }
.bp-node.got::after { left: 19%; top: 17%; width: 62%; height: 64%; }
.toy:nth-of-type(3n)::after, .bp-node:nth-of-type(3n)::after { animation-delay: -1.5s; }
.toy:nth-of-type(3n+1)::after, .bp-node:nth-of-type(3n+1)::after { animation-delay: -2.9s; }
@keyframes toysheen { 0%, 55% { background-position: 130% 0; } 85%, 100% { background-position: -30% 0; } }
/* кубики «Собери просьбу»: тень на столе; поднял — тень сжалась и побледнела, кубик «в воздухе» */
.mcube::before { left: 14%; right: 14%; bottom: -7%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(50,22,6,.42), rgba(50,22,6,0)); transition: transform .2s, opacity .2s; }
/* 9.21 (REVIEW 9.18): тень остаётся на столе — подъём кубика (--lift, в px сцены) вычитается, делим на масштаб 1.1 кубика */
.mcube.drag::before, .mcube.reading::before { transform: translateY(calc(22px + var(--lift, 0px) / var(--sc, 1.1))) scale(.6); opacity: .45; }
.mcube.drag::before { transition: opacity .2s; }
.mcube.placed::before { opacity: .7; }
/* 9.24 (REVIEW 9.21): во время перелёта после отпускания (возврат на лоток, укладка с подскоком) тень не едет за кубиком:
   она сразу стоит в положении покоя и скрыта, а когда кубик сел — проявляется на столе */
.mcube.fly::before { transform: none !important; opacity: 0 !important; transition: none !important; }
/* гнездо заполнено: вспышка-кольцо расходится один раз */
.msock::after { left: 50%; top: 50%; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%; opacity: 0; }
.msock.filled::after { animation: sockring .7s .05s ease-out both; box-shadow: 0 0 0 6px rgba(255,226,140,.9), 0 0 30px rgba(255,212,92,.8); }
@keyframes sockring { 0% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.9); } }
/* коробки «Настоящее или нарисованное»: поймала карточку — тёплое свечение */
.sbox.got .sb-art { filter: drop-shadow(0 0 26px rgba(255,212,92,.9)) drop-shadow(0 14px 12px rgba(60,28,8,.45)); }
@media (prefers-reduced-motion: reduce) {
  .toy::before, .toy::after, .bp-node::before, .bp-node::after, .msock.filled::after { animation: none !important; }
  .toy.open::after, .bp-node.got::after { display: none; }
}

/* ---------- 9.20. Церемонии роста «как 3D-игра»: прожектор, лучи, кольцо света (FX.spot) ---------- */
#spot { position: absolute; inset: 0; z-index: 30; pointer-events: none !important; opacity: 0; transition: opacity .6s ease; }
#spot.on { opacity: 1; }
#spot i { position: absolute; display: block; pointer-events: none; }
/* края темнеют, центр (цель наезда) — в тёплом свете */
#spot .sp-dim { inset: 0; background: radial-gradient(circle at var(--sx) var(--sy), rgba(255,226,160,.18) 0, rgba(255,226,160,0) 220px, rgba(26,12,4,0) 280px, rgba(26,12,4,.46) 620px); }
/* лучи — кольцом вокруг цели, в центре пусто: на Бипа и на рамки свет не ложится пятнами */
#spot .sp-rays { left: var(--sx); top: var(--sy); width: 1500px; height: 1500px; margin: -750px 0 0 -750px; border-radius: 50%; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg, rgba(255,236,170,.42) 0deg 6deg, rgba(255,214,130,0) 6deg 18deg);
  -webkit-mask: radial-gradient(circle, transparent 17%, #000 25%, rgba(0,0,0,0) 50%); mask: radial-gradient(circle, transparent 17%, #000 25%, rgba(0,0,0,0) 50%); }
#spot.on .sp-rays { animation: raysin .9s ease-out both, raysspin 40s linear infinite; }
/* кольцо света расходится один раз в момент появления детали */
#spot .sp-ring { left: var(--sx); top: var(--sy); width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; opacity: 0;
  box-shadow: 0 0 0 5px rgba(255,236,170,.85), 0 0 40px 10px rgba(255,206,100,.6), inset 0 0 30px rgba(255,236,170,.5); }
#spot.on .sp-ring { animation: spring 1.3s .75s cubic-bezier(.2,.7,.3,1) both; }
@keyframes spring { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(2.6); } }
/* у пары «было и стало» лучи бирюзовые и шире — между двумя рамками */
#spot[data-kind="pair"] .sp-rays { background: repeating-conic-gradient(from 0deg, rgba(160,240,255,.24) 0deg 6deg, rgba(160,240,255,0) 6deg 18deg);
  -webkit-mask: radial-gradient(circle, transparent 26%, #000 32%, rgba(0,0,0,0) 52%); mask: radial-gradient(circle, transparent 26%, #000 32%, rgba(0,0,0,0) 52%); }
#spot[data-kind="pair"] .sp-dim { background: radial-gradient(ellipse 620px 420px at var(--sx) var(--sy), rgba(255,236,190,.12) 0, rgba(26,12,4,0) 70%, rgba(26,12,4,.45) 130%); }
#spot[data-kind="pair"] .sp-ring { display: none; }
/* рамки пары во время показа — объёмнее: тень глубже, стекло вспыхивает бликом */
#wall-frame.pair-show .wf-was, #wall-frame.pair-show .wf-now { filter: drop-shadow(0 40px 34px rgba(40,18,4,.5)) drop-shadow(0 0 22px rgba(255,214,120,.45)); transition: filter .6s; }
#wall-frame.pair-show .wf-win { overflow: hidden; }
#wall-frame.pair-show .wf-win::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 36%; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.55) 50%, rgba(255,255,255,0)); transform: skewX(-14deg);
  animation: pairsheen 1.1s .6s ease-out both; }
#wall-frame.pair-show .wf-now .wf-win::after { animation-delay: 1.6s; }
@keyframes pairsheen { from { left: -60%; } to { left: 140%; } }
/* в мини-игре субтитр — сверху: внизу лоток с кубиками и коробки (кадр proverka-37, телефон боком) */
.in-mini #caption { top: 14px; bottom: auto; max-width: 64%; padding: 10px 22px; font-size: 24px; }
/* M.7c: длинная (англ.) реплика в две строки заходила на наклейки прогресса слева (кадр proverka-i18n-en-sobery, планшет) —
   субтитр мини-игры стоит между наклейками и значком Бипа справа; логические свойства — в rtl отражается сам */
/* m7e: проценты не годились — #ui масштабируется по высоте, наклейки на планшете кончаются у 37 % ширины, на телефоне у 24 %.
   Поэтому края — в единицах #ui: начало за наклейками (150 + 3×66 + 2×10, ×1.16 у текущей ≈ 380) с зазором, конец — до значка Бипа справа.
   На планшете две строки по 22px укладываются выше рамки афиши (верх ≈ 80px). */
.in-mini #caption { left: auto; transform: none; inset-inline-start: 396px; inset-inline-end: 140px; max-width: none;
  top: 8px; padding: 8px 18px; font-size: 22px; line-height: 1.2; }
@media (prefers-reduced-motion: reduce) {
  #spot .sp-rays, #spot .sp-ring { animation: none !important; }
  #spot .sp-ring { display: none; }
  #wall-frame.pair-show .wf-win::after { animation: none; display: none; }
}

/* ---------- Ярмарка (часть A): макет лавки на подоконнике — слой стены, как полка (js/story.js) ---------- */
#lavka-slot { position: absolute; left: 0; top: 0; width: 0; height: 0; }
#lavka-slot:not(.on) { display: none; }
#lavka-slot .lavka { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; transform-origin: 50% 95%;
  opacity: 0; pointer-events: none; transition: opacity .4s; }
#lavka-slot .lavka.ok { opacity: 1; pointer-events: auto; }
#lavka-slot .lavka img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 8px 6px rgba(60,28,6,.35)); }
#lavka-slot .lavka::before { content: ""; position: absolute; inset: -6px -4px -2px; }   /* цель касания чуть шире картинки */
#lavka-slot .lavka[data-n="4"] img { filter: drop-shadow(0 8px 6px rgba(60,28,6,.35)) drop-shadow(0 0 14px rgba(255,214,120,.55)); }
html:not(.at-home) #lavka-slot, .in-mini #lavka-slot { opacity: 0; pointer-events: none; }
html:not(.at-home) #lavka-slot .lavka { pointer-events: none; }
.hold-still #lavka-slot .lavka, .hold-still #celebrate, .hold-still #celebrate * { transition: none !important; animation: none !important; }   /* F.1: стоп-кадр — макет и рамка праздника сразу на месте */

/* ---------- A.8: значок-шатёр «ярмарка» на разворотах 0–2 (цель дорожки), разворот сезона 5 ---------- */
/* 112 px в развороте 980 px: на телефоне 844×390 (масштаб карты ≈ 0,59) — ≈ 66 px, не меньше цели касания 64 px.
   Стоит внизу посередине левой страницы: от медальонов 2 и 3 — 83 px до края (радиус медальона 75), левее стрелок листания */
.map-fair { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border: 0; padding: 0; background: none;
  cursor: pointer; display: none; z-index: 2; filter: drop-shadow(0 8px 8px rgba(50,25,5,.35)); transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .25s; }
.map-fair.on.ok { display: block; }
.map-fair img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.map-fair:active { transform: scale(.92); }
/* ярмарка открылась, а её разворот ещё не видели — шатёр мягко зовёт (как стрелка «вперёд») */
.map-fair.glow { animation: fairglow 1.8s ease-in-out infinite; }
@keyframes fairglow { 0%, 100% { filter: drop-shadow(0 8px 8px rgba(50,25,5,.35)); transform: translateY(0); }
  50% { filter: drop-shadow(0 0 22px rgba(255,214,92,1)); transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .map-fair.glow { animation: none; filter: drop-shadow(0 0 18px rgba(255,214,92,1)); } }
.map-book.turning .map-fair { opacity: 0; }

/* B.3: мир ярмарки (ep.bg = "fair", сезон 5) — луч из окна мастерской и «вечер мастерской» не нужны: вечер нарисован в фоне */
.world-fair #bg-light .sunbeam { display: none; }
.world-fair #bg-back .evening { display: none; }
.world-fair #bg-light .motes i { background: radial-gradient(circle, rgba(255,226,150,.95) 0, rgba(255,196,110,.5) 45%, rgba(255,196,110,0) 70%); }   /* пылинки — тёплые искорки огоньков */

/* B.9: «Большой заказ» сезона 5 — лавка в огнях (scene.fairGlow) */
#bg-back .fair-glow { opacity: 0; transition: opacity 1.8s ease; pointer-events: none; }
.fair-lit #bg-back .fair-glow { opacity: 1; animation: fair-twinkle 3.2s ease-in-out 1.8s infinite alternate; }
@keyframes fair-twinkle { from { opacity: 1; } to { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .fair-lit #bg-back .fair-glow { animation: none; transition: none; } }

/* решение 201: заказ «отдыхает» до завтра (1 новый заказ в день) — медальон виден, тише, с месяцем; не силуэт */
.medal.m-rest .m-win > * { filter: saturate(.55) brightness(.85); }
.medal.m-rest::after { content: ''; position: absolute; right: 6%; top: 4%; width: 26%; aspect-ratio: 1; border-radius: 50%;
  background: transparent; box-shadow: inset -.42em -.18em 0 0 #ffd77a; font-size: clamp(14px, 1.6vmin, 22px);
  filter: drop-shadow(0 2px 3px rgba(60,30,5,.45)); pointer-events: none; transform: rotate(-20deg); }

/* Решение 213 (пользователь 27.11): игра только горизонтальная. В портрете вместо сцены — заставка «поверни телефон»
   без букв (17-yazyki.md: никаких надписей, знак понятен на любом языке). Логические свойства — готово к RTL. */
#rotate { display: none; }
@media (orientation: portrait) {
  #rotate { display: grid; place-items: center; position: fixed; inset: 0; z-index: 10000; background: radial-gradient(circle at 50% 45%, #6b4426, #3a2618 70%); touch-action: none; }
  /* U.1i/G.1 (кадр 14:12): со скрытой (visibility) сценой страница на телефоне стоя всё равно «раздувалась» до ~500 px —
     заставка съезжала вправо, стрелку срезал край. Всё, кроме заставки, в портрете не раскладывается вовсе. */
  body > :not(#rotate) { display: none !important; }
  .rot-phone { grid-area: 1 / 1; inline-size: 38vmin; block-size: 64vmin; border: 2.4vmin solid #f3e2c4; border-radius: 6vmin; background: #2a1a10;
    display: grid; place-items: center; box-shadow: 0 2vmin 5vmin rgba(0,0,0,.45); animation: rotphone 2.6s cubic-bezier(.5,0,.3,1) infinite; }
  .rot-bip { inline-size: 80%; aspect-ratio: 538 / 322; animation: rotbip 2.6s cubic-bezier(.5,0,.3,1) infinite;
    /* глаза Бипа — поверх тёмного экрана головы (в head.png их нет: в риге это отдельный слой) */
    background: radial-gradient(7.5% 12.5% at 38.5% 50%, #dffcff 0 30%, #39e4f0 45%, #0f8fa3 68%, transparent 74%),
                radial-gradient(7.5% 12.5% at 61.5% 50%, #dffcff 0 30%, #39e4f0 45%, #0f8fa3 68%, transparent 74%),
                url(../assets/bip/head.png) 43.1% 23% / 148.7% auto no-repeat; }
  /* Вопрос пользователя 27.11 «стрелка не двигается с телефоном»: стрелка теперь появляется, ведёт телефон по дуге
     (вращается вокруг центра экрана вместе с ним — transform-origin смещён в центр телефона) и гаснет, не наезжая на него. */
  .rot-arrow { grid-area: 1 / 1; inline-size: 26vmin; block-size: 26vmin; translate: 8vmin -48vmin;
    /* U.4b: стрелка у верхней середины — при повороте на 30° наконечник на x≈355 из 390 (было ≈413, срез справа) */
    transform-origin: calc(50% - 8vmin) calc(50% + 48vmin); animation: rotarrow 2.6s cubic-bezier(.5,0,.3,1) infinite; }
}
@keyframes rotphone { 0%, 22% { rotate: 0deg; } 55%, 100% { rotate: 90deg; } }
@keyframes rotbip { 0%, 22% { rotate: 0deg; } 55%, 100% { rotate: -90deg; } }
@keyframes rotarrow { 0% { opacity: 0; rotate: 0deg; } 10%, 22% { opacity: 1; rotate: 0deg; } 34% { opacity: .85; } 46%, 100% { opacity: 0; rotate: 30deg; } }
@media (orientation: portrait) and (prefers-reduced-motion: reduce) { .rot-phone, .rot-bip { animation: none; rotate: 90deg; } .rot-bip { rotate: -90deg; } .rot-arrow { animation: none; opacity: .9; } }

/* ---------- M.4 (17-yazyki, п.3): письмо справа налево ----------
   dir документа задаёт язык (I18N.init). Зеркалится только ИНТЕРФЕЙС: кнопки «домой»/«повторить»/уголок,
   ушки карточек, порядок карточек выбора, строка прогресса, уголок взрослых (физические left/right выше заменены
   на inset-inline-*, padding-inline-*). Сцены-картинки (мир, Бип, Лера, стена, предметы, ящик игр) и
   альбом-карта/чертёж (страницы и закладки нарисованы, решение 240) остаются как нарисованы — им direction: ltr. */
#cam, #map, #blueprint, #mini-wall, #mini-table, #toys, #celebrate { direction: ltr; }
[dir="rtl"] .pc-btn.danger::before { transform-origin: 100% 50%; }

/* ---------- G.7: звёзды 1–5 за игру и копилка (ZVEZDY-KONTRAKT.md) ---------- */
/* копилка на полке (координаты фона, внутри #wall-sticker) */
#wall-sticker .kopilka { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; }
#wall-sticker .kopilka::before { content: ""; position: absolute; inset: -16px -6px -10px; }   /* поле касания ≥ 64 px и на телефоне */
#wall-sticker .kopilka .kp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(50,25,5,.35)); }
#wall-sticker .kopilka .kp-num { position: absolute; inset-inline-start: 50%; inset-block-end: 4px; transform: translateX(-50%); min-inline-size: 34px; padding: 1px 8px;
  border-radius: 14px; background: #fff7e3; border: 3px solid #e3b25a; color: #8a4b0c; font: 800 20px/1.15 system-ui, sans-serif; text-align: center;
  box-shadow: 0 2px 4px rgba(60,30,5,.3); pointer-events: none; }
[dir="rtl"] #wall-sticker .kopilka .kp-num { transform: translateX(50%); }

/* экран итогов (#ui внутри #stage: размеры в px сцены, сцена масштабируется сама; кадры Emira 16:53 — в vmin всё сжималось дважды).
   Панель ставит STARS.place() в свободную от Бипа часть сцены; банка на полке на это время прячется (копилка на экране одна). */
.stars-on #wall-sticker .kopilka { visibility: hidden; }
.stars-res { position: absolute; inset: 0; z-index: 60; }
.stars-res .sr-veil { position: absolute; inset: 0; background: rgba(40,22,6,.45); }
/* REVIEW G.7: дверь и «Повторить» видны поверх затемнения — значит, и нажимаются (дверь закрывает итоги через MINI.cancel, «Повторить» — STARS.repeat) */
.stars-on #btn-home, .stars-on #btn-listen { z-index: 61; }
.stars-res .sr-box { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); transform-origin: 50% 50%;
  display: flex; flex-direction: column; align-items: center; gap: 26px; }
.stars-res .sr-nests { position: relative; display: flex; gap: 10px; padding: 14px 22px;
  border-radius: 999px; background: rgba(255,247,227,.94); box-shadow: 0 8px 24px rgba(60,28,8,.35); }
.stars-res .sr-nest { position: relative; inline-size: 96px; block-size: 96px; }
.stars-res .sr-nest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stars-res .sr-nest .sr-full { filter: drop-shadow(0 4px 4px rgba(140,70,0,.35)); }
.stars-res.five .sr-nests { box-shadow: 0 0 0 6px rgba(255,214,90,.6), 0 0 60px 20px rgba(255,214,90,.55), 0 8px 24px rgba(60,28,8,.35); }
.stars-res.five .sr-nests::before { content: ""; position: absolute; inset: -40% -12%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,236,150,.85), rgba(255,214,90,0)); animation: srglow 1.8s ease-in-out infinite; }
@keyframes srglow { 50% { opacity: .55; transform: scale(1.06); } }
.stars-res .sr-btns { display: flex; align-items: center; gap: 30px; padding: 14px 26px; border-radius: 80px;
  background: rgba(255,247,227,.82); box-shadow: 0 8px 24px rgba(60,28,8,.3); }   /* общая подложка: банка не сливается с предметами фона */
.stars-res .sr-btns button { position: relative; inline-size: 120px; block-size: 120px; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 50%; transition: transform .2s; flex: none; }
.stars-res .sr-btns button img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(40,20,4,.4)); }
.stars-res .sr-btns button.main { inline-size: 144px; block-size: 144px; animation: srmain 1.6s ease-in-out infinite; }
@keyframes srmain { 50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(255,226,140,.95)); } }
[dir="rtl"] .stars-res .sr-next img { transform: scaleX(-1); }
/* банка — в конце ряда кнопок, чуть отодвинута: это не третья кнопка, а «куда летят звёзды» */
.stars-res .sr-btns .sr-jar { inline-size: 120px; block-size: 150px; border-radius: 0; margin-inline-start: 10px; }
.stars-res .sr-jar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(40,20,4,.4)); }
.stars-res .sr-num { position: absolute; inset-inline-start: 50%; inset-block-end: -6px; transform: translateX(-50%); min-inline-size: 40px; padding: 2px 10px;
  border-radius: 16px; background: #fff7e3; border: 3px solid #e3b25a; color: #8a4b0c; font: 800 26px/1.15 system-ui, sans-serif; text-align: center; z-index: 1; }
[dir="rtl"] .stars-res .sr-num { transform: translateX(50%); }
.sr-fly { position: fixed; z-index: 80; pointer-events: none; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .stars-res .sr-btns button.main, .stars-res.five .sr-nests::before { animation: none; } }

/* ---------- G.8: свет по времени суток (js/greet.js). Слой фона за работами и героями, касаний не ловит.
   Окно на фоне ≈ x 9–36 %, y 15–55 %. Утро — розовато-солнечное окно; день — как было; вечер — ws-back-evening + тёплая лампа;
   поздно — то же + звёзды за окном и чуть темнее по краям. */
#bg-tod { pointer-events: none; }
#bg-tod > div { position: absolute; inset: 0; opacity: 0; transition: opacity 2.4s ease; }
#bg-tod .tod-morning-glow { mix-blend-mode: soft-light;
  background: radial-gradient(ellipse 22% 30% at 22% 34%, rgba(255,170,190,.95), rgba(255,200,170,.5) 55%, rgba(255,210,180,0) 100%); }
/* g10c: на кадре 18:44 утро не отличалось от дня — розово-персиковый рассвет прямо по стеклу окна (та же арка, что у ночи) */
#bg-tod .tod-morning-sky { clip-path: inset(13.5% 64% 44.5% 9% round 9% 9% 0 0 / 12% 12% 0 0);
  background: linear-gradient(to bottom, rgba(255,175,200,.42), rgba(255,190,170,.5) 55%, rgba(255,214,140,.62));
  box-shadow: inset 0 -4vmin 6vmin rgba(255,226,150,.5); }
html.at-home.tod-morning #bg-tod .tod-morning-glow,
html.at-home.tod-morning #bg-tod .tod-morning-sky { opacity: 1; }
html.at-home.tod-morning #bg-light .sunbeam { filter: hue-rotate(-18deg) saturate(1.3); }
#bg-tod .tod-lamp { mix-blend-mode: screen;
  background: radial-gradient(ellipse 34% 40% at 52% 40%, rgba(255,196,110,.42), rgba(255,170,80,.16) 55%, rgba(255,160,70,0) 100%); }
html.at-home.tod-evening #bg-tod .tod-lamp { opacity: 1; }
html.at-home.tod-late #bg-tod .tod-lamp { opacity: .75; }
/* поздно: ночное небо в окне (закат вечернего фона гасится тёмно-синим), крупнее звёзды и месяц */
#bg-tod .tod-night { mix-blend-mode: multiply; clip-path: inset(13.5% 64% 44.5% 9% round 9% 9% 0 0 / 12% 12% 0 0);   /* REVIEW 1942: по арке окна, без прямого края на раме */
  background: linear-gradient(to bottom, rgba(40,52,120,.92), rgba(55,62,130,.85) 60%, rgba(80,70,140,.8)); }
html.at-home.tod-late #bg-tod .tod-night { opacity: 1; }
#bg-tod .tod-stars { clip-path: inset(13.5% 64% 44.5% 9% round 9% 9% 0 0 / 12% 12% 0 0); }
#bg-tod .tod-moon { position: absolute; left: 28%; top: 40%; width: 3.4%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset -.55em -.2em 0 0 #fff3c4; font-size: clamp(8px, 1.6vmin, 18px); filter: drop-shadow(0 0 8px rgba(255,240,180,.9)); transform: rotate(-20deg); }
#bg-tod .tod-stars i { position: absolute; width: 1.1%; aspect-ratio: 1; border-radius: 50%; background: #fffbe0;
  box-shadow: 0 0 8px 3px rgba(255,240,170,.95); animation: todtwinkle var(--d, 3s) ease-in-out infinite alternate; }
html.at-home.tod-late #bg-tod .tod-stars { opacity: 1; }
@keyframes todtwinkle { from { opacity: .35; transform: scale(.7); } to { opacity: 1; transform: scale(1.15); } }
/* вспышка антенны и линз при приветствии (2,2 с) */
.bip.greet-flash .ant-glow { opacity: 1; transform: scale(1.9); transition: transform .3s, opacity .3s; }
.bip.greet-flash .lens { filter: drop-shadow(0 0 24px rgba(90,255,245,1)) brightness(1.25); }
/* g10c: на планшете (≈4:3) нижнее стекло закрыто головой Бипа — месяц в верхнее правое стекло; на широком телефоне верх окна за краем, там месяц внизу */
@media (max-aspect-ratio: 3/2) { #bg-tod .tod-moon { left: 29.5%; top: 26%; } }
@media (prefers-reduced-motion: reduce) { #bg-tod .tod-stars i { animation: none; opacity: .9; } }

/* ---------- G.1b «Слова для Бипа»: лоток и гнёзда кубиков (js/cubes.js) ----------
   Размеры — в px сцены. Панель справа от Бипа: левый край --cb-l считает cubes.js (мир не зеркалится, Бип всегда слева),
   поэтому left/right здесь физические; ряд гнёзд и лоток — flex, в письме справа налево порядок зеркалится сам.
   Справа сверху над панелью — кнопка «Повторить» (120×120): у картинки заказа отступ, чтобы она её не закрывала. */
#cubes { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none !important; background: rgba(30,16,6,.28); transition: opacity .3s; --cs: 80px; }
#cubes.open { opacity: 1; pointer-events: auto !important; }
.wide #cubes { --cs: 96px; }
.cb-panel { position: absolute; left: var(--cb-l, 372px); right: 14px; top: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; border-radius: 30px; background: linear-gradient(#e9c58f, #d8a865); box-shadow: 0 18px 40px rgba(40,18,4,.5), inset 0 0 0 5px #b9824a, inset 0 0 0 9px rgba(255,240,210,.35); }
.cb-top { position: relative; flex: 1 1 auto; min-height: 150px; display: flex; gap: 14px; align-items: stretch; padding-inline-end: 118px; }
.cb-rank { flex: 0 0 auto; align-self: flex-start; width: 96px; height: 96px; border: 0; padding: 0; background: none; cursor: pointer; }
.cb-board { flex: 1 1 auto; min-width: 0; position: relative; border-radius: 18px; background: #fffaf0; box-shadow: inset 0 0 0 4px #f1dcb6, 0 6px 12px rgba(80,40,10,.25); overflow: hidden; }
.cb-demo { position: absolute; inset: 72px 10px 10px; display: flex;   /* g1c: верхние 72 px — под субтитр фразы, он не ложится на предметы */ align-items: center; justify-content: space-around; }
.cbd-it { width: 30%; height: 100%; display: flex; align-items: center; justify-content: center; container-type: size; }
.cbd-pic { max-width: 100%; max-height: 100%; object-fit: contain; }
.cbd-it .cb-ph.ph-obj { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); flex: 0 0 auto; font-size: calc(min(100cqw, 100cqh) * .62); }   /* g1d: круг, не овал (кадр телефона 19:3x) */
.cb-row { flex: 0 0 auto; display: flex; gap: 14px; align-items: center; justify-content: center; }
.cb-slots { display: flex; gap: 8px; padding: 8px; border-radius: 22px; background: rgba(110,60,20,.28); box-shadow: inset 0 3px 8px rgba(60,28,6,.35); }
.cb-slot { position: relative; width: calc(var(--cs) + 4px); height: calc(var(--cs) + 4px); }
.cb-sock { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .7; }
.cb-sock.missing { display: none; }
.cb-slot:has(.cb-sock.missing) { border-radius: 18px; border: 4px dashed rgba(255,248,230,.6); box-sizing: border-box; }
.cb-slot > .cb-cube { position: absolute; inset: 2px; }
.cb-go { position: relative; width: calc(var(--cs) * 1.25); height: calc(var(--cs) * 1.25); border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 40% 35%, #8ff5ef, #22b2ac 70%); box-shadow: 0 8px 0 #157a76, 0 14px 18px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.45); transition: transform .15s, filter .3s; }
.cb-go i { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -22px 0 0 -12px; border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 2px 2px rgba(0,60,60,.35)); }
.wide .cb-go i { margin: -27px 0 0 -15px; border-width: 27px 0 27px 44px; }
#cubes:not(.has-cmd) .cb-go { filter: saturate(.35) brightness(.95); }
#cubes.has-cmd:not(.reading) .cb-go { animation: cbgo 1.6s ease-in-out infinite; }
@keyframes cbgo { 50% { transform: scale(1.07); } }
.cb-go:active { transform: translateY(5px); box-shadow: 0 3px 0 #157a76, 0 6px 10px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.45); }
.cb-tray { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: flex-start; padding: 10px; border-radius: 22px; background: rgba(255,248,232,.35); }
.cb-cube { position: relative; width: var(--cs); height: var(--cs); border: 0; padding: 0; background: none; cursor: pointer; touch-action: manipulation; }
.cb-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; filter: drop-shadow(0 7px 6px rgba(60,28,8,.4)); }
.cb-obj .cb-base.fbk { filter: drop-shadow(0 7px 6px rgba(60,28,8,.4)) hue-rotate(-12deg) brightness(1.12); }   /* предмет — светлее, пока нет своей основы */
.cb-rule .cb-base.fbk { filter: drop-shadow(0 7px 6px rgba(60,28,8,.4)) hue-rotate(140deg) saturate(.8); }   /* оставь / не трогай / проверь — бирюзовый */
.cb-ic { position: absolute; inset: 17%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cb-pic { max-width: 100%; max-height: 100%; object-fit: contain; }
.cb-pic.missing { display: none; }
.cb-label { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); white-space: nowrap; font: 700 13px/1 system-ui, sans-serif; color: #4a2a10; background: #fff3d6; padding: 2px 6px; border-radius: 8px; pointer-events: none; }
.cb-tray .cb-cube:not(.cb-obj) { animation: none; }
#cubes.reading .cb-slot > .cb-cube { animation: cbread .9s ease-in-out infinite; }
#cubes.reading .cb-slot:nth-child(2n) > .cb-cube { animation-delay: -.45s; }
@keyframes cbread { 50% { transform: translateY(-8px); filter: drop-shadow(0 0 12px rgba(255,212,92,.9)); } }
/* временные знаки (до пиктограмм Codex): без букв и цифр */
.cb-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: calc(var(--cs) * .44); line-height: 1; }
.ph-obj { border-radius: 50%; background: radial-gradient(circle, #fff 55%, var(--c, #ddd) 57%); }
.ph-color { border-radius: 46% 54% 50% 50% / 55% 48% 52% 45%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 35%), var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.15); }
.ph-place { position: relative; border-radius: 8px; border: 4px solid #6b4220; background: #fffaf0; box-sizing: border-box; }
.ph-place b { position: absolute; width: 30%; height: 30%; border-radius: 50%; background: #e5483d; }
.ph-place.at-left b { left: 6%; top: 35%; } .ph-place.at-right b { right: 6%; top: 35%; }
.ph-place.at-top b { top: 6%; left: 35%; } .ph-place.at-bottom b { bottom: 6%; left: 35%; }
.ph-count { gap: 8%; } .ph-count b { width: 26%; aspect-ratio: 1; border-radius: 50%; background: #3c7fe0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.ph-size { gap: 6%; align-items: flex-end; } .ph-size b { border-radius: 50%; background: #f39331; aspect-ratio: 1; }
.ph-size.bigger b:first-child, .ph-size.smaller b:last-child { width: 28%; } .ph-size.bigger b:last-child, .ph-size.smaller b:first-child { width: 56%; }
.ph-glyph { filter: drop-shadow(0 2px 1px rgba(60,28,8,.3)); color: #5a3412; font-weight: 700; }
/* значок звания (пока нет медальонов Codex — круг со звёздочками по числу ступеней) */
.rank-badge { display: block; width: 100%; height: 100%; position: relative; }
.rank-badge .rb-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 6px 6px rgba(60,28,8,.35)); }
.rank-badge.ph { border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff2b8, #e7b63e 62%, #b9822a); box-shadow: inset 0 0 0 5px #fff6d0, 0 6px 10px rgba(60,28,8,.35); display: flex; align-items: center; justify-content: center; }
.rb-ph { font-style: normal; color: #8a4f12; font-size: 22px; letter-spacing: -2px; line-height: 1; }
.rank-fairmaster.ph { background: radial-gradient(circle at 40% 35%, #fff, #ff9fc0 45%, #e7b63e 70%, #b9822a); }
.rank-badge.small { display: inline-block; width: 40px; height: 40px; vertical-align: middle; margin-inline-end: 10px; }
.rank-badge.small .rb-ph { font-size: 10px; }
/* церемония нового слова и звания: крупно в центре на лучах (общие .stk-show / .stk-rays) */
.wn-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 260px; height: 260px; --cs: 260px; }
.wn-box .cb-cube { width: 100%; height: 100%; pointer-events: none; }
.wn-rank { width: 300px; height: 300px; }
.wn-rank .rb-ph { font-size: 64px; }
/* значок на чертеже навыков: над головой Бипа, по центру листа */
.bp-rank { position: absolute; left: 490px; top: 66px; width: 96px; height: 96px; margin: -48px 0 0 -48px; border: 0; padding: 0; background: none; cursor: pointer; }
.pc-words { display: flex; align-items: center; }
@media (prefers-reduced-motion: reduce) { #cubes.reading .cb-slot > .cb-cube, #cubes.has-cmd .cb-go { animation: none !important; } }
/* субтитр при открытом лотке — поверх картинки заказа (над рядом и лотком не ложится), выше панели (z 3) */
.cubes-open #caption { z-index: 6; top: 40px; bottom: auto; left: calc(var(--cb-l, 372px) + 130px); right: 150px; transform: none; max-width: none; font-size: 26px; padding: 12px 22px; }

/* ===== G.2b «Заказы лавки»: два листа в лотке кубиков (js/shop.js) =====
   Размеры — от контейнера .sh-board (container-type: size): листы 3:2, клетки 3×2, предмет — доля клетки (--z).
   Субтитр на экране заказа — под Бипом, на полу (и планшет, и телефон): листам нужна вся высота, длинная реплика их не закрывает. */
#cubes.shop .cb-demo { display: none; }
/* g2c (кадры 19:47): на планшете окно картинки узкое и высокое (~460×470) — листы рядом выходили мелкими (большой ~200 px),
   а образец с портретом вылезал за край. Теперь раскладка выбирается по форме окна (контейнер shb = .cb-board):
   высокое/квадратное (ширина/высота < 1,8) — образец сверху справа, большой лист снизу во всю ширину;
   вытянутое (телефон с полным лотком) — в ряд. Порог 1,8: там, где большой лист в обеих раскладках одинаков
   (0,84·H = 0,46·W). Значок звания в заказе не нужен — его место отдано листам. Кнопки — своё гнездо .sh-acts. */
#cubes.shop .cb-rank { display: none; }
#cubes.shop .cb-board { container: shb / size; }
.sh-board { position: absolute; inset: 12px; display: grid; grid-template-areas: "now wish acts"; grid-template-columns: auto auto auto;
  column-gap: 2.5cqw; justify-content: center; align-content: center; align-items: center; container-type: size; }
.sh-col { position: relative; aspect-ratio: 3 / 2; }
.sh-col-now { grid-area: now; width: min(46cqw, 130cqh); }
.sh-col-wish { grid-area: wish; width: min(27cqw, 75cqh); transform: rotate(2.5deg); margin-block-start: 10cqh; }
.sh-acts { grid-area: acts; position: relative; width: 76px; height: 76px; }
.wide .sh-acts { width: 92px; height: 92px; }
@container shb (aspect-ratio < 1.8) {
  .sh-board { grid-template-areas: "acts wish" "now now"; grid-template-columns: 1fr auto; justify-content: stretch; row-gap: 4cqh; }
  .sh-col-now { width: min(94cqw, 84cqh); justify-self: center; }
  .sh-col-wish { width: min(56cqw, 45cqh); margin-block-start: 7cqh; margin-inline-end: 7cqw; justify-self: end; }
  .sh-acts { justify-self: center; }
  .sh-col-wish .sh-visitor { inset-inline-end: auto; inset-inline-start: -42%; top: 2%; }   /* специфичнее базового правила ниже */
}
.sh-sheet { position: absolute; inset: 0; border-radius: 10px; background: #fffdf5; box-shadow: 0 0 0 3px #ecd7ae, 0 5px 10px rgba(80,40,10,.28); }
.sh-wish { background: #fff6e2; }
.sh-paper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: inherit; }
.sh-paper.missing { display: none; }
.sh-cells { position: absolute; inset: 5%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.sh-cell { position: relative; display: flex; align-items: center; justify-content: center; container-type: size; border-radius: 12px; }
/* едва заметная сетка: слева / посередине / справа, сверху / снизу — чтобы «где» было видно глазами */
.sh-cell:nth-child(3n+2) { box-shadow: inset 1px 0 0 rgba(150,105,55,.14), inset -1px 0 0 rgba(150,105,55,.14); }
.sh-cell:nth-child(-n+3) { border-block-end: 1px dashed rgba(150,105,55,.18); border-radius: 0; }
.sh-it { width: calc(min(100cqw, 100cqh) * var(--z, .8)); height: calc(min(100cqw, 100cqh) * var(--z, .8)); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sh-pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(60,28,8,.25)); }
.sh-it .cb-ph.ph-obj { width: 100%; height: 100%; font-size: calc(min(100cqw, 100cqh) * var(--z, .8) * .6); }
/* отличия: мягкое оранжевое кольцо на обоих листах (без красного «неправильно») */
.sh-cell.sh-diff::after { content: ''; position: absolute; inset: 2%; border-radius: 50%; border: 4px solid #ff9d3a; box-shadow: 0 0 12px rgba(255,157,58,.65); animation: shdiff 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes shdiff { 50% { transform: scale(1.06); opacity: .6; } }
.sh-now.sh-ok { box-shadow: 0 0 0 4px #ffd45c, 0 0 22px rgba(255,212,92,.9), 0 5px 10px rgba(80,40,10,.28); }
/* посетитель — портрет Леры на уголке образца, прищепка сверху */
.sh-wish::before { content: ''; position: absolute; left: 50%; top: -9%; width: 9%; height: 20%; translate: -50% 0; border-radius: 4px; background: linear-gradient(90deg, #c98a4b, #e8b273 50%, #c98a4b); box-shadow: 0 2px 3px rgba(60,28,8,.35); z-index: 2; }
/* N.13 (G.2c, ревью N.6 и Q-006): портрет больше не лежит на углу образца — он закрывал предмет верхней правой клетки.
   В ряд (телефон) — над образцом, у правого края; в высокой раскладке (планшет) — слева от образца, в пустом поле над «Ещё раз».
   Запасная CSS-прищепка — только если лист wish.png не загрузился (в рисунке своя прищепка). */
.sh-wish:has(> .sh-paper:not(.missing))::before { display: none; }
.sh-visitor { position: absolute; inset-inline-end: 0; top: -60%; width: 34%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #ffe6bf; border: 3px solid #fff; box-shadow: 0 4px 8px rgba(60,28,8,.35); z-index: 3; }
.sh-visitor img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.7); transform-origin: 50% 4%; }
.sh-visitor.talk { animation: shtalk .5s ease-in-out infinite alternate; }
@keyframes shtalk { to { transform: translateY(-4%) rotate(-3deg); } }
/* «Ещё раз» и «Новый заказ» — круглые кнопки без букв, в одном гнезде .sh-acts (гнездо держит место, раскладка не прыгает) */
.sh-btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: none; z-index: 4;
  background: radial-gradient(circle at 40% 35%, #8ff0e6, #27b3aa 60%, #178a83); box-shadow: 0 6px 0 #157a76, 0 9px 14px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.45); }
.sh-btn i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 42px/1 system-ui, sans-serif; font-style: normal; color: #fff; text-shadow: 0 2px 2px rgba(0,60,60,.35); }
.wide .sh-btn i { font-size: 52px; }
.sh-again i::before { content: '↻'; }
.sh-next { background: radial-gradient(circle at 40% 35%, #ffe58a, #f6b52c 60%, #d68a12); box-shadow: 0 6px 0 #a8670b, 0 9px 14px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.5); }
.sh-next i::before { content: '➜'; }
[dir="rtl"] .sh-next i::before { content: '⬅'; }
#cubes.sh-can-again .sh-again, #cubes.sh-can-next .sh-next { display: block; animation: cbgo 1.6s ease-in-out infinite; }
.sh-btn:active { transform: translateY(5px); }
@media (prefers-reduced-motion: reduce) { .sh-cell.sh-diff::after, .sh-visitor.talk, #cubes.sh-can-again .sh-again, #cubes.sh-can-next .sh-next { animation: none !important; } }
/* субтитр — под Бипом, на полу: Бип стоит выше (ноги ~y 610), лоток справа не перекрыт */
.cubes-open.shop-open #caption { top: auto; bottom: 14px; left: 14px; right: auto; width: calc(var(--cb-l, 372px) - 42px); font-size: 22px; padding: 10px 16px; }
.wide.cubes-open.shop-open #caption { font-size: 24px; }

/* ===== G.5 «Что поменял Бип?» (бесконечная): два листа «было» и «стало» (js/spot.js) =====
   Панель — там же, где лоток кубиков (левый край --cb-l, Бип целиком слева). Листы одинакового размера, чтобы сравнивать:
   в высокой панели (планшет) — друг над другом, в вытянутой (телефон) — рядом. Контейнер spb = .sp-board.
   Субтитр — под Бипом на полу, как у заказов. Кнопки без букв: «всё на месте» (с 7-й ступени) и стрелка «новая картинка». */
#spotg { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none !important; background: rgba(30,16,6,.28); transition: opacity .3s; }
#spotg.open { opacity: 1; pointer-events: auto !important; }
.sp-panel { padding-inline-end: 132px; }   /* справа сверху — кнопка «Повторить» (120×120): листы её не закрывают */
.sp-board { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 18px; background: #fffaf0; box-shadow: inset 0 0 0 4px #f1dcb6, 0 6px 12px rgba(80,40,10,.25); container: spb / size; }
.sp-sheets { position: absolute; inset: 14px; display: grid; grid-template-columns: auto auto; column-gap: 4cqw; justify-content: center; align-content: center; align-items: center; }
.sp-col { position: relative; aspect-ratio: 3 / 2; width: min(46cqw, 62cqh); }
@container spb (aspect-ratio < 1.5) {
  .sp-sheets { grid-template-columns: auto; row-gap: 5cqh; }
  .sp-col { width: min(92cqw, 67cqh); justify-self: center; }
}
/* g5b (кадры 20:07): кнопки «всё на месте» и стрелка — в правой полосе под «Повторить», а не отдельной строкой снизу:
   листам отдана вся высота панели (на телефоне они были ~190 реальных px). */
.sp-panel .sp-row { position: absolute; inset-inline-end: 22px; top: 150px; bottom: 18px; width: 104px; flex-direction: column; justify-content: flex-end; min-height: 0; }
.sp-was { background: #f6efe0; }
.sp-was::before { content: ''; position: absolute; left: 50%; top: -9%; width: 7%; height: 18%; translate: -50% 0; border-radius: 4px; background: linear-gradient(90deg, #c98a4b, #e8b273 50%, #c98a4b); box-shadow: 0 2px 3px rgba(60,28,8,.35); z-index: 2; }
.sp-badge { position: absolute; inset-inline-end: -5%; top: -12%; width: 20%; aspect-ratio: 1; object-fit: contain; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(60,28,8,.35)); }
.sp-badge.missing { display: none; }
#spotg .sh-cell { cursor: pointer; touch-action: manipulation; }
#spotg .sh-cell:focus-visible { outline: 4px solid #27b3aa; outline-offset: -4px; }
/* найдено — тёплое золотое кольцо на обоих листах; подсказка — мягкое свечение (не ответ словами) */
.sh-cell.sp-found::after { content: ''; position: absolute; inset: 3%; border-radius: 50%; border: 5px solid #ffc53d; box-shadow: 0 0 14px rgba(255,197,61,.8); pointer-events: none; }
.sh-cell.sp-hint:not(.sp-found)::after { content: ''; position: absolute; inset: 0; border-radius: 14px; background: radial-gradient(circle, rgba(255,226,140,.55), rgba(255,226,140,0) 70%); animation: sphint 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes sphint { 50% { opacity: .35; } }
.sp-row { flex: 0 0 auto; display: flex; gap: 22px; justify-content: center; align-items: center; min-height: 92px; }
.sp-btn { position: relative; width: 88px; height: 88px; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: none;
  background: radial-gradient(circle at 40% 35%, #c9f59a, #6cc23f 60%, #4a9a26); box-shadow: 0 6px 0 #3b7a1d, 0 9px 14px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.45); }
.sp-btn i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 46px/1 system-ui, sans-serif; font-style: normal; color: #fff; text-shadow: 0 2px 2px rgba(0,60,0,.35); }
.sp-none i::before { content: '✓'; }
.sp-btn:active { transform: translateY(5px); }
#spotg.sp-can-none .sp-none { display: block; }
#spotg .sp-next { position: relative; inset: auto; width: 88px; height: 88px; }
#spotg .sp-btn { width: calc(88px * var(--tk, 1)); height: calc(88px * var(--tk, 1)); }   /* g5b: на телефоне ≥44 реальных px */
/* N.24 (REVIEW 2333 п.3): невидимое поле касания 120×--tk — как у прочих детских кнопок, ≥64 реальных px на телефоне; кнопка выглядит прежней */
#spotg .sp-btn::before { content: ""; position: absolute; inset: calc(-16px * var(--tk, 1)); border-radius: 50%; }
/* N.26 (REVIEW 2358 п.3): стрелка «новая картинка» стоит на месте «Всё на месте» и показывается вместо неё — тот же размер и то же поле касания ≥64 реальных px */
#spotg .sp-next { width: calc(88px * var(--tk, 1)); height: calc(88px * var(--tk, 1)); }
#spotg .sp-next::before { content: ""; position: absolute; inset: calc(-16px * var(--tk, 1)); border-radius: 50%; }
#spotg.sp-can-next .sp-next { display: block; animation: cbgo 1.6s ease-in-out infinite; }
#spotg.sp-can-next .sp-none { display: none; }
.spot-open #caption { z-index: 6; top: auto; bottom: 14px; left: 14px; right: auto; transform: none; max-width: none; width: calc(var(--cb-l, 372px) - 42px); font-size: 22px; padding: 10px 16px; }
.wide.spot-open #caption { font-size: 24px; }
@media (prefers-reduced-motion: reduce) { .sh-cell.sp-hint::after, #spotg.sp-can-next .sp-next { animation: none !important; } }

/* первый вход: браузер не разрешает звук без касания — большая кнопка «играть» зовёт коснуться (музыка и приветствие стартуют по касанию) */
#start-tap { position: absolute; inset: 0; z-index: 90; border: 0; padding: 0; background: rgba(36,21,12,.28); cursor: pointer; display: flex; align-items: center; justify-content: center; }
#start-tap[hidden] { display: none; }
/* D.21 (ревью Codex 28.11): слой ▶ (z 90) перехватывал удержание ⚙ — до первого касания значок, замок и уголок выше слоя */
.pre-start #btn-parent { z-index: 92; }
.pre-start #parent { z-index: 94; }
.pre-start #zamok { z-index: 96; }
#start-tap::before { content: ""; width: 220px; height: 220px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 0 14px rgba(255,255,255,.55), 0 10px 40px rgba(0,0,0,.4); animation: starttap 1.2s ease-in-out infinite; }
#start-tap::after { content: ""; position: absolute; width: 0; height: 0; border-left: 90px solid #7a3b12; border-top: 58px solid transparent; border-bottom: 58px solid transparent; margin-left: 24px; animation: starttap 1.2s ease-in-out infinite; }
@keyframes starttap { 50% { transform: scale(1.1); } }

/* ---------- iPhone ×3: не держать бесконечные анимации на невидимых слоях ----------
   Каждый анимированный элемент — отдельный композитный слой; невидимый (opacity 0) всё равно
   рисуется в полную плотность экрана. На iPhone 15 Pro Max десятки таких слоёв роняли вкладку (>2 ГБ). */
/* звёзды в окне анимируются только поздним вечером дома, когда видны */
html:not(.at-home) #bg-tod .tod-stars i, html:not(.tod-late) #bg-tod .tod-stars i { animation: none; }
/* луч и пылинки вечером погашены — не анимировать */
#bg-back.is-evening ~ #bg-light .sunbeam, #bg-back.is-evening ~ #bg-light .motes i { animation: none; }
/* спящий Бип: основная фигура прозрачна — дыхание, антенна и свечение стоят */
.bip.sleep-art .bip-upper, .bip.sleep-art .antenna, .bip.sleep-art .ant-glow, .bip.sleep-art .lens, .bip.sleep-art .bip-head, .bip.sleep-art .arm-r { animation: none; }

/* ===== G.6b «Точная команда»: поле, образец, гнёзда программы и лоток (js/grid.js) =====
   Панель — там же, где лоток кубиков (левый край --cb-l, Бип целиком слева). Верх (.tk-top, контейнер tkt):
   поле слева во всю высоту, образец справа внизу — под кнопкой «Повторить» (120×120 в правом верхнем углу).
   Кнопки «Ещё раз» / «новое поле» — в ряду гнёзд справа от «Бип, делай!». Поле и образец — сетка W×H (--gw/--gh), клетки рисует CSS.
   Сцена поля всегда слева направо (стрелки — стороны экрана). */
#grid { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none !important; background: rgba(30,16,6,.28); transition: opacity .3s; --cs: 80px; --ar: 1.25; }
#grid.open { opacity: 1; pointer-events: auto !important; }
.tk-top { position: relative; flex: 1 1 auto; min-height: 0; container: tkt / size; direction: ltr; }
.tk-goal { position: absolute; right: 0; bottom: 0; width: min(31cqw, calc((100cqh - 136px) * var(--ar))); aspect-ratio: var(--ar); transform: rotate(2deg); }
.tk-field { position: absolute; left: 0; top: 50%; translate: 0 -50%;
  width: min(calc(100cqw - min(31cqw, calc((100cqh - 136px) * var(--ar))) - 18px), calc(100cqh * var(--ar))); aspect-ratio: var(--ar); }
.tk-acts { position: relative; flex: 0 0 auto; width: 76px; height: 76px; }   /* в ряду гнёзд, справа от «Бип, делай!»: место держится всегда */
.wide .tk-acts { width: 92px; height: 92px; }
#grid.tk-can-again .tk-again, #grid.tk-can-next .tk-next { display: block; animation: cbgo 1.6s ease-in-out infinite; }
.tk-field, .tk-goal { border-radius: 14px; background: #fffdf5; box-shadow: 0 0 0 4px #ecd7ae, 0 6px 12px rgba(80,40,10,.28); }
.tk-goal { background: #fff6e2; }
.tk-goal::before { content: ''; position: absolute; left: 50%; top: -9%; width: 9%; height: 18%; translate: -50% 0; border-radius: 4px; background: linear-gradient(90deg, #c98a4b, #e8b273 50%, #c98a4b); box-shadow: 0 2px 3px rgba(60,28,8,.35); z-index: 3; }
.tk-paper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: inherit; }
.tk-paper.missing { display: none; }
.tk-cells { position: absolute; inset: 4%; display: grid; grid-template-columns: repeat(var(--gw), 1fr); grid-template-rows: repeat(var(--gh), 1fr); }
.tk-cell { position: relative; border: 1.5px solid rgba(150,105,55,.32); margin: -0.75px; container-type: size; }
.tk-cell.tk-painted::before { content: ''; position: absolute; inset: 7%; border-radius: 10%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 45%), var(--pc); box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
/* готовая клетка: уже покрашена до начала — белая строчка по краю (её нельзя испортить) */
.tk-cell.tk-keep::after { content: ''; position: absolute; inset: 16%; border-radius: 8%; border: 3px dashed rgba(255,255,255,.9); pointer-events: none; }
.tk-start-pic { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; opacity: .85; }
.tk-start:not(:has(.tk-start-pic))::before, .tk-start:not(.tk-painted)::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 3px dashed rgba(39,179,170,.75); }
.tk-start.tk-painted::before { inset: 7%; border-radius: 10%; border: 0; }
.tk-stone-pic { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; z-index: 1; }
.tk-stone-ph::after { content: ''; position: absolute; inset: 16% 12% 20%; border-radius: 48% 52% 44% 56% / 58% 50% 50% 42%; background: radial-gradient(circle at 35% 30%, #c9c3bb, #8d857c 60%, #6c655d); box-shadow: 0 5px 4px rgba(40,30,20,.35); z-index: 1; }
.tk-token { position: absolute; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.tk-token.tk-anim { transition: left .38s cubic-bezier(.4,1.4,.6,1), top .38s cubic-bezier(.4,1.4,.6,1); }
.tk-token-pic { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(40,20,6,.4)); }
.tk-token.tk-bump { animation: tkbump .42s ease-in-out; }
@keyframes tkbump { 25% { transform: translateX(-9%) rotate(-8deg); } 60% { transform: translateX(7%) rotate(6deg); } }
.tk-dot { position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; translate: -50% -50%; border-radius: 50%; background: rgba(39,179,170,.75); box-shadow: 0 0 8px rgba(39,179,170,.6); animation: tkdot 1.4s ease-in-out infinite; z-index: 1; }
@keyframes tkdot { 50% { scale: 1.35; opacity: .6; } }
.tk-cell.tk-diff::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid #ff9d3a; box-shadow: 0 0 12px rgba(255,157,58,.65); animation: shdiff 1.6s ease-in-out infinite; pointer-events: none; z-index: 3; }
.tk-field.sh-ok { box-shadow: 0 0 0 5px #ffd45c, 0 0 24px rgba(255,212,92,.9), 0 6px 12px rgba(80,40,10,.28); }
/* гнёзда: на высокой панели — 2 ряда по 4 (класс tk-two ставит GRID.place), на вытянутой — один ряд */
#grid.tk-two .tk-slots { display: grid; grid-template-columns: repeat(4, auto); }
/* N.8: один ряд гнёзд (телефон) — промежутки уже (GRID.place считает с теми же числами); поле касания кубика
   закрывает промежутки до соседа: в лотке 10 px → по 5, в гнезде 2 px отступа + 4 px промежутка → 6 */
#grid.tk-tight .tk-slots { gap: 4px; }
#grid.tk-tight .tk-row { gap: 8px; }
#grid .cb-cube::after, #cubes .cb-cube::after { content: ''; position: absolute; inset: -5px; }
#grid .cb-slot > .cb-cube::after, #cubes .cb-slot > .cb-cube::after { inset: -6px; }
#grid.tk-tight .cb-slot > .cb-cube::after { inset: -4px; }
/* N.28: телефон — «Ещё раз» / «новое поле» / «повесить» в правом конце лотка, ряд гнёзд отдан кубикам (GRID.place, класс tk-acts-down) */
#grid.tk-acts-down .tk-tray { padding-inline-end: calc(20px + 92px); }
#grid.tk-acts-down .tk-acts { position: absolute; inset-inline-end: 28px; bottom: calc(26px + (var(--cs) - 92px) / 2); width: 92px; height: 92px; z-index: 2; }
html:not(.wide) #grid.tk-acts-down .tk-tray { padding-inline-end: calc(20px + 76px); }
html:not(.wide) #grid.tk-acts-down .tk-acts { bottom: calc(26px + (var(--cs) - 76px) / 2); width: 76px; height: 76px; }
/* N.10: кубик в перелёте (260 мс) касаний не ловит — касание достаётся неподвижному кубику под пальцем */
.cb-cube.cb-fly, .cb-cube.cb-fly::after { pointer-events: none; }
#grid:not(.has-cmd) .tk-go { filter: saturate(.35) brightness(.95); }
#grid.has-cmd:not(.reading):not(.tk-can-again):not(.tk-can-next) .tk-go { animation: cbgo 1.6s ease-in-out infinite; }
#grid .cb-slot.tk-now > .cb-cube { transform: translateY(-8px) scale(1.06); filter: drop-shadow(0 0 12px rgba(255,212,92,.95)); transition: transform .15s; }
#grid .cb-slot.tk-extra > .cb-cube { opacity: .35; transition: opacity .2s; }
/* временные пиктограммы без букв и цифр: стрелка (повёрнута по стороне экрана) и круговая стрелка с точками */
.tk-ph-arrow { position: relative; }
.tk-ph-arrow b { position: absolute; inset: 14%; background: #fff; clip-path: polygon(0 38%, 58% 38%, 58% 12%, 100% 50%, 58% 88%, 58% 62%, 0 62%); filter: drop-shadow(0 2px 0 rgba(60,28,8,.35)); }
.tk-ph-arrow b { background: #2f6fc9; }
.tk-ph-arrow.to-left b { rotate: 180deg; } .tk-ph-arrow.to-up b { rotate: -90deg; } .tk-ph-arrow.to-down b { rotate: 90deg; }
/* g6b-раскладка: знак повтора — дуга-петля сверху, под ней ряд крупных точек (2 или 3), чтобы ×2 и ×3 различались с первого взгляда, а не читались как смайлик */
.tk-ph-rep { position: relative; align-items: flex-end; gap: 6%; padding-bottom: 16%; box-sizing: border-box; }
.tk-ph-rep b { position: absolute; left: 20%; top: 10%; width: 60%; height: 40%; box-sizing: border-box; border-radius: 50% 50% 0 0 / 100% 100% 0 0; border: 3px solid #7a3fb3; border-bottom: 0; }
.tk-ph-rep b::after { content: ''; position: absolute; right: -6px; bottom: -7px; border: 6px solid transparent; border-top: 8px solid #7a3fb3; border-bottom: 0; }
.tk-ph-rep i { display: block; flex: 0 0 auto; width: 17%; aspect-ratio: 1; border-radius: 50%; background: #7a3fb3; }
/* субтитр — под Бипом, на полу (как у заказов): поле и образец не перекрыты */
.grid-open #caption { z-index: 6; transform: none; max-width: none; top: auto; bottom: 14px; left: 14px; right: auto; width: calc(var(--cb-l, 372px) - 42px); font-size: 22px; padding: 10px 16px; }
.wide.grid-open #caption { font-size: 24px; }
/* ===== G.6c «Моя мастерская» (режим .tk-free той же панели) =====
   Вместо образца справа — верёвочка: последние 3 работы, самая новая сверху (column-reverse), под кнопкой «Повторить».
   Рамка «Повесить» — в гнезде кнопок ряда (где «Ещё раз» / «новое поле»), видна, когда на листе есть краска. */
#grid:not(.tk-free) .tk-gal, #grid.tk-free .tk-goal { display: none; }
.tk-gal { position: absolute; right: 0; top: 136px; bottom: 0; width: min(31cqw, calc((100cqh - 136px) * var(--ar)));
  display: flex; flex-direction: column-reverse; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 8px; box-sizing: border-box; }
.tk-rope { position: absolute; left: 50%; top: -6px; bottom: 6px; width: 3px; translate: -50% 0; border-radius: 2px;
  background: repeating-linear-gradient(180deg, #b07a43 0 6px, #8a5a2c 6px 9px); opacity: .75; }
.tk-work { position: relative; flex: 0 0 auto; height: calc((100cqh - 136px - 8px - 24px) / 3); max-width: 100%; aspect-ratio: var(--ar);
  border-radius: 8px; background: #fffdf5; box-shadow: 0 0 0 3px #ecd7ae, 0 4px 8px rgba(80,40,10,.28); rotate: calc((var(--i, 0) - 1) * 2.5deg); }
.tk-work::before { content: ''; position: absolute; left: 50%; top: -10%; width: 10%; height: 20%; translate: -50% 0; border-radius: 3px;
  background: linear-gradient(90deg, #c98a4b, #e8b273 50%, #c98a4b); box-shadow: 0 2px 3px rgba(60,28,8,.35); z-index: 3; }
.tk-work .tk-cells { inset: 6%; }
.tk-work .tk-cell { border-width: 1px; border-color: rgba(150,105,55,.22); }
.tk-work .tk-cell.tk-painted::before { inset: 4%; box-shadow: none; }
/* пустая верёвочка — пунктирная рамка-место: «сюда повесим» */
.tk-gal:not(:has(.tk-work))::after { content: ''; flex: 0 0 auto; height: calc((100cqh - 136px - 8px - 24px) / 3); max-width: 100%; aspect-ratio: var(--ar);
  box-sizing: border-box; border-radius: 8px; border: 3px dashed rgba(150,105,55,.45); background: rgba(255,253,245,.45); }
#grid.tk-free .tk-cell.tk-painted::before { inset: 4%; }
.tk-hang { border-radius: 22%; background: linear-gradient(145deg, #f2c46b, #c98a3a 55%, #9c6424);
  box-shadow: 0 6px 0 #7a4a18, 0 9px 14px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,240,200,.55); }
.tk-hang i::before { content: ''; position: absolute; inset: 24%; border-radius: 6%; background: linear-gradient(180deg, #bfe6ff 0 55%, #7cc56b 55%); box-shadow: inset 0 0 0 3px #fff8e6; }
.tk-hang i::after { content: ''; position: absolute; left: 33%; top: 33%; width: 14%; aspect-ratio: 1; border-radius: 50%; background: #ffd23f; }
.tk-hang:has(.tk-hang-pic) i::before, .tk-hang:has(.tk-hang-pic) i::after { display: none; }
.tk-hang-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#grid.tk-free.tk-can-hang:not(.reading) .tk-hang { display: block; }
#grid.tk-free .tk-again, #grid.tk-free .tk-next { display: none !important; }
@media (prefers-reduced-motion: reduce) { .tk-dot, .tk-cell.tk-diff::after, #grid.tk-can-again .tk-again, #grid.tk-can-next .tk-next, #grid.has-cmd .tk-go, .tk-token.tk-bump { animation: none !important; } }
/* ===== N.5b: последняя картина «Моей мастерской» на стекле окна (#atl-slot — слой фона, координаты фона; home.js atlPos) =====
   Лист приклеен двумя полосками скотча, чуть наклонён; клетки — та же сетка, что на верёвочке (GRID.workEl). */
#atl-slot { position: absolute; left: 0; top: 0; width: 0; height: 0; }
#atl-slot:not(.on) { display: none; }
#atl-slot .atl-pic { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; rotate: -3deg; }
#atl-slot .atl-pic::before { content: ""; position: absolute; inset: -10px; }   /* цель касания чуть шире листа */
#atl-slot .atl-work { position: absolute; inset: 0; height: 100%; width: 100%; max-width: none; aspect-ratio: auto; rotate: 0deg; border-radius: 4px; background: #fffdf5;
  box-shadow: 0 3px 6px rgba(40,30,20,.35); container-type: size; }
#atl-slot .atl-work::before { display: none; }
#atl-slot .atl-tape { position: absolute; top: -7%; width: 26%; height: 16%; background: rgba(255,248,214,.78); box-shadow: 0 1px 2px rgba(60,40,10,.25); z-index: 2; }
#atl-slot .atl-tape-l { left: -6%; rotate: -32deg; }
#atl-slot .atl-tape-r { right: -6%; rotate: 30deg; }
/* REVIEW N.5b п.4: скрытая картина — и не видна, и не ловит касания, и не в порядке Tab (visibility гаснет после растворения) */
/* N.12 (REVIEW N.9 п.4): и под «Что поменял Бип?», «Заказами лавки» и лотком кубиков (spot-open / shop-open / cubes-open);
   из Tab и касаний убирает сразу home.js syncAtelier() (inert), не дожидаясь конца растворения */
html:not(.at-home) #atl-slot, .in-mini #atl-slot, .grid-open #atl-slot, .spot-open #atl-slot, .shop-open #atl-slot, .cubes-open #atl-slot { opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s linear .4s; }
html:not(.at-home) #atl-slot *, .in-mini #atl-slot *, .grid-open #atl-slot *, .spot-open #atl-slot *, .shop-open #atl-slot *, .cubes-open #atl-slot * { pointer-events: none !important; }
#atl-slot { transition: opacity .4s, visibility 0s; }
.home-sleep #atl-slot .atl-pic { filter: brightness(.55) saturate(.7); }

/* N.9: первый вход вечером — свет без перехода (greet.js applyLight(instant)) */
html.tod-instant #bg-back .evening, html.tod-instant #bg-light, html.tod-instant #bg-tod > * { transition: none !important; }

/* ---------- D.1 «Сломай Бипа» и D.3 проверка-игра (бриф 23-dlya-bolshih.md) ---------- */
/* верная карточка — приглушена, с бирюзовой галочкой; найденная ошибка — оранжевая отметка «!» (ошибка Бипа) */
#choice.brk .card.brk-ok .card-in { filter: saturate(.35) brightness(.92); opacity: .72; }
#choice.brk .card.brk-ok::after, #choice.brk .card.brk-found::after { content: ""; position: absolute; inset-inline-start: -14px; top: -18px; width: 84px; height: 84px; border-radius: 50%;
  background: center / 62% no-repeat; pointer-events: none; z-index: 3; }
#choice.brk .card.brk-ok::after { background-color: #2fb8ae; box-shadow: 0 5px 0 #17847e, 0 8px 12px rgba(30,20,6,.35), inset 0 0 0 5px rgba(255,255,255,.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M22 52 L42 72 L78 30' fill='none' stroke='white' stroke-width='14' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
#choice.brk .card.brk-found::after { background-color: #ff8a2b; box-shadow: 0 5px 0 #c35d0e, 0 8px 12px rgba(30,20,6,.35), inset 0 0 0 5px rgba(255,255,255,.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 16 L50 60' stroke='white' stroke-width='16' stroke-linecap='round'/%3E%3Ccircle cx='50' cy='82' r='9' fill='white'/%3E%3C/svg%3E");
  animation: brkpop .5s cubic-bezier(.3,1.6,.5,1) both; }
#choice.brk .card.brk-found .card-in { filter: saturate(.6); }
@keyframes brkpop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
/* стрелка «дальше» — в правом нижнем углу блокнота, поле касания ≥ 120 × --tk (на телефоне ≥ 64 реальных px) */
.nb-skip { position: absolute; inset-inline-end: 3%; bottom: 2%; width: 104px; height: 104px; border: 0; padding: 0; border-radius: 50%; cursor: pointer; z-index: 5;
  background: radial-gradient(circle at 40% 35%, #ffe58a, #f6b52c 60%, #d68a12); box-shadow: 0 6px 0 #a8670b, 0 9px 14px rgba(30,20,6,.4), inset 0 0 0 5px rgba(255,255,255,.5);
  opacity: 0; transform: scale(.5); transition: opacity .3s, transform .35s cubic-bezier(.3,1.5,.5,1); }
.nb-skip.in { opacity: 1; transform: none; }
.nb-skip::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; }
.nb-skip i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 54px/1 system-ui, sans-serif; font-style: normal; color: #fff; text-shadow: 0 2px 2px rgba(120,60,0,.35); }
.nb-skip i::before { content: '➜'; }
[dir="rtl"] .nb-skip i::before { content: '⬅'; }
.nb-skip.glow { animation: cbgo 1.6s ease-in-out infinite; }
.nb-skip.picked { transform: scale(1.15); }
#choice.instant .nb-skip { transition: none; }
/* счётчик проверки-игры: кружки сверху по центру, заполняются по одному */
.chk-dots { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -140%); display: flex; gap: 14px; padding: 10px 18px; border-radius: 40px;
  background: rgba(255,248,232,.92); box-shadow: 0 6px 16px rgba(40,20,5,.3); pointer-events: none !important; transition: transform .45s cubic-bezier(.3,1.4,.5,1); z-index: 20; }
.chk-dots.on { transform: translate(-50%, 0); }
/* D.9: телефон — столбиком справа от афиши (left/top ставит engine.check по рамке афиши) */
.chk-dots.side { flex-direction: column; transform: translateX(60px); opacity: 0; transition: transform .45s cubic-bezier(.3,1.4,.5,1), opacity .3s; }
.chk-dots.side.on { transform: none; opacity: 1; }
.chk-dots i { width: 38px; height: 38px; border-radius: 50%; border: 5px dashed #c9a77a; box-sizing: border-box; }
.chk-dots i.on { border: 0; background: radial-gradient(circle at 40% 35%, #8ff0e6, #27b3aa 65%); box-shadow: 0 0 14px rgba(127,243,238,.9); animation: brkpop .4s cubic-bezier(.3,1.6,.5,1) both; }
.chk-dots.full { box-shadow: 0 0 26px rgba(127,243,238,.95), 0 6px 16px rgba(40,20,5,.3); }
.zone.chk-changed .ring, .zone.chk-changed .stamp, .zone.chk-changed .stamp-svg { display: none; }
@media (prefers-reduced-motion: reduce) { .nb-skip.glow, .chk-dots i.on, #choice.brk .card.brk-found::after { animation: none !important; } .chk-dots { transition: none; } }
/* D.16 (кадр slomay-5, телефон): «!» снят посреди brkpop — мелкий и прозрачный; в стоп-кадре значки сразу на месте */
.hold-still #choice.brk .card.brk-found::after, .hold-still .chk-dots i.on { animation: none !important; opacity: 1; transform: none; }

/* D.11: блок «Бип устал» сверху уголка — тот же сегментный переключатель, что у языка */
.pc-rest { margin-top: 6px; }
.pc-tired { min-width: 96px; min-height: 52px; padding: 8px 14px; border: 0; background: transparent; color: #1f8b88; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.pc-tired.on { background: #2ec4c0; color: #fff; }
.pc-btn.pc-more:disabled { opacity: .45; cursor: default; }
/* D.11: родительский замок (js/zamok.js) — в #ui поверх уголка; размеры в реальных px через zoom var(--ik), как .pc-sheet */
#zamok { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(24,12,4,.62); font-family: system-ui, sans-serif; }
#zamok .zm-card { zoom: var(--ik, 1); box-sizing: border-box; width: 420px; max-width: calc(96% / var(--ik, 1)); max-height: calc(740px / var(--ik, 1)); overflow: auto; background: #fff8ec; border-radius: 16px;
  padding: 14px 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.35); color: #3a2a14; text-align: center; }
#zamok .zm-title { font-size: 19px; }
#zamok .zm-ask { color: #5a4526; font-size: 15px; }
#zamok .zm-words { font-size: 22px; color: #1f6f7d; min-height: 1.3em; }
#zamok .zm-slots { display: flex; gap: 10px; }
#zamok .zm-slots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #2a8a9a; box-sizing: border-box; }
#zamok .zm-slots i.on { background: #2a8a9a; }
#zamok .zm-err { min-height: 1.2em; font-size: 14px; color: #9a2e1e; }
#zamok .zm-pad { display: grid; grid-template-columns: repeat(5, 56px); gap: 8px; direction: ltr; }
#zamok .zm-pad button { height: 52px; border: 1px solid #d9c49c; border-radius: 12px; background: #fff; font: 600 22px system-ui, sans-serif; color: #3a2a14; cursor: pointer; }
#zamok .zm-pad button:disabled { opacity: .4; cursor: default; }
#zamok .zm-cancel { min-height: 44px; padding: 0 18px; border: 0; background: none; color: #7a6646; font: 15px system-ui, sans-serif; cursor: pointer; text-decoration: underline; }
#zamok button:focus-visible { outline: 3px solid #2a8a9a; outline-offset: 2px; }
.wide #zamok .zm-card { padding: 8px 14px 8px; gap: 3px; }
.wide #zamok .zm-pad button { height: 46px; }
/* D.12 + кадр 28.11: в стоп-кадре счётчик проверки-игры сразу на месте (снимок ловил его посреди проявления) */
.hold-still .chk-dots { transition: none !important; }

/* D.18 (ревью Codex, решение 377): пролог — «открой письмо». Письмо на доске мягко дышит светом, пока ребёнок его не коснётся.
   Только filter на .pz — transform афиши занят камерой и анимациями poster.go */
.poster.tap-me .pz { animation: tapme-glow 1.8s ease-in-out infinite; }
@keyframes tapme-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,236,150,0)); }
  50% { filter: drop-shadow(0 0 26px rgba(255,236,150,.95)) brightness(1.06); }
}
.zone.tap-poster { cursor: pointer; }
.hold-still .poster.tap-me .pz { animation: none; filter: drop-shadow(0 0 22px rgba(255,236,150,.9)); }

/* D.18 цели ≥ 44 px (ревью Codex, решение 379; отчёт касаний 844×390): уголок и замок рисуются в масштабе 0,78 реального px
   (--ik, stage.js:99), поэтому 52 → 41 px, 46 → 36 px. 58 css-px = 45 реальных — с запасом над 44. */
.pc-tired, .pc-lang { min-height: 58px; }
.pc-close { width: 58px; height: 58px; }
#zamok .zm-pad { grid-template-columns: repeat(5, 58px); }
#zamok .zm-pad button, .wide #zamok .zm-pad button { height: 58px; min-height: 58px; }
#zamok .zm-cancel { min-height: 58px; min-width: 96px; }

/* Кубик «А» — вход в Город Букв и Звуков (rech/ZAYAVKA-VHOD.md). Цель касания ≥96 мира; снизу узко — не задевать шар */
#btn-kubik { position: absolute; top: calc(28px + 128px * var(--tk, 1)); inset-inline-end: calc(18px + 14px * var(--tk, 1)); width: calc(92px * var(--tk, 1)); height: calc(92px * var(--tk, 1)); border: 0; padding: 0; background: none; cursor: pointer; z-index: 4; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
#btn-kubik::before { content: ""; position: absolute; inset: -14px; }   /* ревью v2: на 844×390 было ~59 px — теперь ≥64; сдвинут на 12 px ниже, зазор под «Повторить» */   /* под мордочкой «Повторить», цель ≥64 CSS px и на телефоне */
#btn-kubik:not(.on), .in-episode #btn-kubik { display: none; }
.prop-kubik img { display: block; width: 100%; }
.prop-kubik .kb-glow { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; }
.prop-kubik .kb-bukva { position: absolute; left: 45.3%; top: 55%; translate: -50% -50%; font: 900 calc(54px * var(--tk, 1))/1 "Nunito", -apple-system, system-ui, sans-serif; color: #7ff3ff;
  text-shadow: 0 0 6px rgba(80,230,255,.9), 0 0 14px rgba(40,200,240,.7), 0 2px 0 #2a5560; pointer-events: none; }
.prop-kubik.mig img:first-child { animation: kubikkach 1.2s ease-in-out; transform-origin: 50% 100%; }
.prop-kubik.mig .kb-glow { animation: kubikglow 1.6s ease-in-out; }
.prop-kubik.mig .kb-bukva { animation: kubikbukva 1.6s ease-in-out; }
@keyframes kubikkach { 20% { rotate: -6deg; } 45% { rotate: 5deg; } 70% { rotate: -2deg; } }
@keyframes kubikglow { 30%, 60% { opacity: 1; } }
@keyframes kubikbukva { 30%, 60% { scale: 1.15; filter: brightness(1.4); } }
.prop-kubik.boing { animation: balloonboing .6s cubic-bezier(.3,1.6,.5,1) both; }
@media (prefers-reduced-motion: reduce) { .prop-kubik.mig img, .prop-kubik.mig .kb-glow, .prop-kubik.mig .kb-bukva, .prop-kubik.boing { animation: none; } }
