/* «Корзинка вязальщицы». Лавка пряжи: стена, окно и свет меняются по главам (день, ночь, вечер, ярмарка),
   корзинки стоят на полках, белый Лупик сидит у работы. Экран не прокручивается: поле подгоняется под окно. */
:root {
  --yk-card: #fbf8f1;
  --yk-card-ink: #2b2620;
  --yk-card-muted: #6f6559;
  --yk-line: rgba(43, 38, 32, .14);
  --yk-accent: #2c6b5a;
  --yk-accent-ink: #ffffff;
  --yk-hint: #e0a63a;
  --yk-ok: #3fa37f;
  --yk-glow: rgba(255, 196, 92, .75);
  --yk-shadow: rgba(40, 28, 16, .3);
  --yk-wood: #c0925a;
  --yk-wood-dark: #8d6236;
  --yk-wood-light: #dcb47f;
  --yk-ghost: rgba(43, 38, 32, .12);
  --yk-display: "Comfortaa", "Nunito", "Trebuchet MS", sans-serif;
  --yk-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --yk-card: #1f2730;
    --yk-card-ink: #ebe6dc;
    --yk-card-muted: #a39b8e;
    --yk-line: rgba(235, 230, 220, .14);
    --yk-accent: #8ccfb6;
    --yk-accent-ink: #10231d;
    --yk-shadow: rgba(0, 0, 0, .5);
    --yk-ghost: rgba(235, 230, 220, .12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --yk-card: #1f2730;
  --yk-card-ink: #ebe6dc;
  --yk-card-muted: #a39b8e;
  --yk-line: rgba(235, 230, 220, .14);
  --yk-accent: #8ccfb6;
  --yk-accent-ink: #10231d;
  --yk-shadow: rgba(0, 0, 0, .5);
  --yk-ghost: rgba(235, 230, 220, .12);
  color-scheme: dark;
}

/* Сцены глав: стена, узор обоев, свет, цвет надписей поверх стены. */
#game-root, #game-root[data-scene="day"] {
  --yk-wall: #f3e6cc; --yk-wall2: rgba(160, 120, 70, .07); --yk-light: rgba(255, 236, 190, .85);
  --yk-floor: #c99a63; --yk-ink: #3a2f25; --yk-muted: #7a6a58;
}
#game-root[data-scene="night"] {
  --yk-wall: #1f2a44; --yk-wall2: rgba(160, 180, 255, .05); --yk-light: rgba(170, 190, 255, .2);
  --yk-floor: #2a3352; --yk-ink: #e8ecf7; --yk-muted: #a9b3cc;
}
#game-root[data-scene="evening"] {
  --yk-wall: #e2c49b; --yk-wall2: rgba(120, 70, 20, .08); --yk-light: rgba(255, 205, 120, .8);
  --yk-floor: #9c6a3a; --yk-ink: #3a2a1c; --yk-muted: #6e5640;
}
#game-root[data-scene="fair"] {
  --yk-wall: #2b3558; --yk-wall2: rgba(255, 255, 255, .035); --yk-light: rgba(255, 214, 120, .24);
  --yk-floor: #4a4f78; --yk-ink: #f1f3fa; --yk-muted: #b9bfd8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #game-root[data-scene="day"], :root:not([data-theme="light"]) #game-root:not([data-scene]) {
    --yk-wall: #352d23; --yk-wall2: rgba(255, 220, 160, .04); --yk-light: rgba(255, 220, 160, .2); --yk-floor: #5a4128; --yk-ink: #f0e6d6; --yk-muted: #b8a88f;
  }
  :root:not([data-theme="light"]) #game-root[data-scene="evening"] {
    --yk-wall: #3b2c1e; --yk-wall2: rgba(255, 200, 120, .05); --yk-light: rgba(255, 190, 100, .26); --yk-floor: #5c3d22; --yk-ink: #f3e4cf; --yk-muted: #c4a888;
  }
}
:root[data-theme="dark"] #game-root[data-scene="day"], :root[data-theme="dark"] #game-root:not([data-scene]) {
  --yk-wall: #352d23; --yk-wall2: rgba(255, 220, 160, .04); --yk-light: rgba(255, 220, 160, .2); --yk-floor: #5a4128; --yk-ink: #f0e6d6; --yk-muted: #b8a88f;
}
:root[data-theme="dark"] #game-root[data-scene="evening"] {
  --yk-wall: #3b2c1e; --yk-wall2: rgba(255, 200, 120, .05); --yk-light: rgba(255, 190, 100, .26); --yk-floor: #5c3d22; --yk-ink: #f3e4cf; --yk-muted: #c4a888;
}

#game-root [hidden] { display: none !important; }
html, body { height: 100%; }
body.yk-page {
  margin: 0;
  background: #f3e6cc;
  color: #2b2620;
  font: 15px/1.4 var(--yk-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
#game-root { height: 100%; position: relative; color: var(--yk-ink); }

/* --- сцена: стена, свет, окно, полки по бокам ---------------------------------------------- */
.yk-scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% -6%, var(--yk-light), transparent 72%),
    repeating-linear-gradient(90deg, var(--yk-wall2) 0 12px, transparent 12px 30px),
    linear-gradient(to bottom, transparent 0 86%, rgba(0, 0, 0, .1) 86% 86.6%, var(--yk-floor) 86.6%),
    var(--yk-wall);
  transition: background-color .8s ease;
}
.yk-scene__side { position: absolute; top: 0; bottom: 14%; width: max(0px, calc((100vw - 760px) / 2)); display: none; }
.yk-scene__side--l { left: 0; }
.yk-scene__side--r { right: 0; }
.yk-scene__side svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* фон, а не игровое поле: приглушённо, чуть размыто и с затуханием к центру */
.yk-scene__side { pointer-events: none; opacity: .62; filter: saturate(.55) blur(.8px); }
.yk-scene__side--l { -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); }
.yk-scene__side--r { -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent); mask-image: linear-gradient(270deg, #000 55%, transparent); }
@media (min-width: 1000px) { .yk-scene__side { display: block; } }
.yk-scene__garland { position: absolute; left: 0; right: 0; top: 0; height: 40px; display: none; }
#game-root[data-scene="fair"] .yk-scene__garland { display: block; }
.yk-scene__garland svg { width: 100%; height: 100%; display: block; }
.yk-bulb { animation: yk-twinkle 2.6s ease-in-out infinite; }
.yk-bulb:nth-child(3n) { animation-delay: -.9s; }
.yk-bulb:nth-child(3n+1) { animation-delay: -1.7s; }
@keyframes yk-twinkle { 50% { opacity: .45; } }
.yk-ambient { position: fixed; inset: 0; z-index: 1; pointer-events: none; width: 100%; height: 100%; }
.yk-fx { position: fixed; inset: 0; z-index: 45; pointer-events: none; width: 100%; height: 100%; }

/* --- каркас ----------------------------------------------------------------------------- */
.yk {
  position: relative; z-index: 2;
  box-sizing: border-box;
  height: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
}
.yk button { font-family: inherit; }
.yk :focus-visible { outline: 3px solid var(--yk-hint); outline-offset: 2px; }

.yk-top { display: flex; align-items: center; gap: 10px; }
.yk-title { flex: 1; min-width: 0; }
.yk-eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--yk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yk-title h1 { margin: 1px 0 0; font: 700 clamp(18px, 5vw, 24px)/1.15 var(--yk-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yk-icon {
  appearance: none; border: 1px solid var(--yk-line); background: var(--yk-card); color: var(--yk-card-ink);
  width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center; flex: none;
  box-shadow: 0 6px 14px -8px var(--yk-shadow);
  transition: transform .15s ease, background-color .2s ease;
}
.yk-icon:active { transform: scale(.92); }
.yk-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.yk-icon[aria-pressed="true"] { background: var(--yk-accent); color: var(--yk-accent-ink); border-color: transparent; }

/* --- что вяжем: вещь, цвета проекта, кот ------------------------------------------------------ */
.yk-work {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--yk-card); color: var(--yk-card-ink); border: 1px solid var(--yk-line); border-radius: 18px;
  padding: 6px 76px 6px 8px; min-height: 64px; box-sizing: border-box;
  box-shadow: 0 10px 24px -16px var(--yk-shadow);
}
.yk-work canvas { width: 104px; height: 58px; flex: none; display: block; }
.yk-work canvas.is-pop { animation: yk-pop .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes yk-pop { 40% { transform: scale(1.12) rotate(-2deg); } }
.yk-work__text { min-width: 0; display: grid; gap: 3px; }
.yk-work__what { font-weight: 800; font-size: 14.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yk-work__sub { font-size: 12px; color: var(--yk-card-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yk-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.yk-dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--yk-line); background: transparent; transition: background-color .3s ease, transform .3s ease; }
.yk-dot.is-done { background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 2px var(--yk-card); transform: scale(1.12); }

.yk-pet { position: absolute; right: 2px; bottom: 0; width: 76px; height: 76px; pointer-events: auto; cursor: pointer; }
.yk-pet svg { width: 100%; height: 100%; display: block; overflow: visible; }
.yk-pet svg * { transform-box: view-box; }
.yk-pet__tail { transform-origin: 54px 66px; animation: yk-tail 3.2s ease-in-out infinite; }
@keyframes yk-tail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(9deg); } }
.yk-pet__eyes { transform-origin: 38px 31px; animation: yk-blink 5s infinite; }
@keyframes yk-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.yk-pet__head { transform-origin: 38px 42px; transition: transform .35s ease; }
.yk-pet__paw { transform-origin: 46px 72px; transition: transform .3s cubic-bezier(.3,1.5,.5,1); }
.yk-pet__all { transform-origin: 38px 76px; }
.yk-pet__ball { transform-origin: 66px 71px; }
.yk-pet.is-tilt .yk-pet__head { transform: rotate(13deg); }
.yk-pet.is-paw .yk-pet__paw { transform: translate(4px, -17px) rotate(-28deg); }
.yk-pet.is-paw .yk-pet__head { transform: rotate(-8deg); }
.yk-pet.is-happy .yk-pet__all { animation: yk-hop .7s cubic-bezier(.3,.7,.4,1); }
.yk-pet.is-happy .yk-pet__ball { animation: yk-roll .9s ease-out; }
@keyframes yk-hop { 30% { transform: translateY(-14px) scale(.96, 1.05); } 60% { transform: translateY(0) scale(1.06, .94); } }
@keyframes yk-roll { 40% { transform: translateX(-8px) rotate(-120deg); } }
.yk-pet.is-away { visibility: hidden; }
.yk-pet.is-back .yk-pet__all { animation: yk-arrive .6s cubic-bezier(.3,1.4,.5,1); }
@keyframes yk-arrive { from { transform: translateY(30px) scale(.4); } }
.yk-heart { position: absolute; right: 30px; top: 0; font-size: 14px; color: #e46a7a; pointer-events: none; animation: yk-heart 1.4s ease-out forwards; }
@keyframes yk-heart { to { transform: translate(var(--dx, 0px), -40px) scale(1.3); opacity: 0; } }

/* --- реплика / подсказка над полем --------------------------------------------------------------- */
.yk-say {
  display: flex; align-items: center; gap: 8px; min-height: 40px; box-sizing: border-box;
  margin: 0; padding: 6px 12px 6px 6px; border-radius: 16px;
  background: color-mix(in srgb, var(--yk-card) 82%, transparent); color: var(--yk-card-ink);
  font-size: 14px; line-height: 1.3; border: 1px solid var(--yk-line);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.yk-say__face { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--who, var(--yk-line)); background: var(--yk-card); display: grid; place-items: center; }
.yk-say__face svg { width: 100%; height: 100%; display: block; }
.yk-say__face--sys svg { width: 18px; height: 18px; fill: var(--yk-card-muted); }
.yk-say__text b { color: var(--who, inherit); font-weight: 800; }
.yk-say.is-soft .yk-say__text { color: var(--yk-card-muted); }
.yk-say.is-new { animation: yk-nudge .35s ease-out; }
@keyframes yk-nudge { from { transform: translateY(4px); } }

/* --- поле: полки, корзинки, клубки --------------------------------------------------------------- */
.yk-board { position: relative; flex: 1; min-height: 200px; touch-action: none; }
.yk-shelf {
  position: absolute; left: 0; top: 0; height: 14px; border-radius: 4px; pointer-events: none;
  background: linear-gradient(to bottom, var(--yk-wood-light) 0 3px, var(--yk-wood) 3px 10px, var(--yk-wood-dark) 10px);
  box-shadow: 0 10px 14px -6px var(--yk-shadow);
}
.yk-shelf::before, .yk-shelf::after { content: ""; position: absolute; top: 12px; width: 10px; height: 16px; background: var(--yk-wood-dark); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.yk-shelf::before { left: 14px; transform: scaleX(-1); }
.yk-shelf::after { right: 14px; }
.yk-basket {
  position: absolute; left: 0; top: 0;
  appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit;
  background: none; border-radius: 14px 14px 22px 22px;
}
.yk-basket__back, .yk-front { background-size: 100% 100%; background-repeat: no-repeat; }
.yk-basket__back { position: absolute; inset: 0; border-radius: inherit; transition: filter .25s ease; }
.yk-front { position: absolute; left: 0; top: 0; z-index: 24; pointer-events: none; transition: filter .25s ease; }
.yk-basket::after {
  content: ""; position: absolute; inset: -5px; border-radius: 18px 18px 26px 26px; pointer-events: none;
  border: 2.5px solid transparent; transition: border-color .2s ease, box-shadow .25s ease;
}
.yk-basket.is-picked::after { border-color: var(--yk-hint); box-shadow: 0 0 16px var(--yk-glow); }
.yk-basket.is-ok::after { border-color: var(--yk-ok); border-style: dashed; animation: yk-okpulse 1.2s ease-in-out infinite; }
.yk-basket.is-target::after { border-style: solid; border-color: var(--yk-ok); box-shadow: 0 0 18px color-mix(in srgb, var(--yk-ok) 60%, transparent); }
@keyframes yk-okpulse { 50% { box-shadow: 0 0 14px color-mix(in srgb, var(--yk-ok) 55%, transparent); } }
.yk-basket.is-no .yk-basket__back, .yk-front.is-no { filter: saturate(.5) brightness(.82); }
.yk-basket.is-full .yk-basket__back { filter: drop-shadow(0 0 12px var(--yk-glow)); }
.yk-basket.is-hint::after { border-color: var(--yk-hint); border-style: solid; animation: yk-hintpulse 1s ease-in-out infinite; }
@keyframes yk-hintpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--yk-hint) 35%, transparent); } }
.yk-basket.is-asleep { cursor: default; }
.yk-basket.is-shake, .yk-front.is-shake { animation: yk-shake .38s ease; }
@keyframes yk-shake { 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
.yk-front.is-bump { animation: yk-bump .35s ease-out; }
@keyframes yk-bump { 40% { scale: 1.04 .95; } }

.yk-tag {
  position: absolute; left: 0; top: 0; z-index: 26; pointer-events: none;
  font: 800 11px/1 var(--yk-body); color: #3a3328; background: #faf6ec; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding: 4px 7px 4px 5px; border-radius: 6px; box-shadow: 0 3px 6px -2px rgba(0,0,0,.35);
  display: flex; align-items: center; gap: 4px;
}
.yk-tag i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.yk-tag.is-new { animation: yk-stamp .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes yk-stamp { from { scale: 1.8; rotate: -12deg; } }

.yk-ball {
  position: absolute; left: 0; top: 0; display: block;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 3px 2px rgba(30, 20, 10, .3));
  transition: transform .24s cubic-bezier(.3,.7,.4,1);
}
.yk-ball.is-flying, .yk-ball.is-dragging { transition: none; z-index: 40 !important; }
.yk-ball.is-lifted { z-index: 30 !important; animation: yk-bob 1.3s ease-in-out infinite; }
@keyframes yk-bob { 50% { translate: 0 -4px; } }
.yk-ball.is-wobble { animation: yk-wobble .4s ease; }
@keyframes yk-wobble { 25% { rotate: -9deg; } 75% { rotate: 7deg; } }

.yk-cat {
  position: absolute; pointer-events: none; z-index: 28;
  transition: transform .8s cubic-bezier(.4,-0.3,.4,1), opacity .5s ease .3s;
}
.yk-cat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.yk-cat .yk-zz { animation: yk-zz 2.4s ease-in-out infinite; }
.yk-cat .yk-breath { transform-box: fill-box; transform-origin: center bottom; animation: yk-breath 3s ease-in-out infinite; }
@keyframes yk-zz { 0%, 100% { opacity: .25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes yk-breath { 50% { transform: scale(1.03, 1.06); } }

.yk-marks { position: absolute; inset: 0; z-index: 50; pointer-events: none; overflow: visible; }
.yk-marks path { fill: none; stroke: var(--yk-hint); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 8; animation: yk-march .6s linear infinite; }
@keyframes yk-march { to { stroke-dashoffset: -10; } }
.yk-paw { position: absolute; z-index: 51; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; color: var(--yk-hint); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); animation: yk-pawpop .45s cubic-bezier(.3,1.6,.5,1); }
.yk-paw svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes yk-pawpop { from { scale: 0.2; } }
.yk-hand { position: absolute; z-index: 60; width: 46px; height: 46px; margin: 0 0 0 -12px; pointer-events: none; transition: transform .55s cubic-bezier(.4,.1,.3,1); }
.yk-hand svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
.yk-hand span { display: block; animation: yk-tap 1.1s ease-in-out infinite; transform-origin: 30% 10%; }
@keyframes yk-tap { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(8px) scale(.92); } }

/* --- нижняя панель: назад, подсказка, заново ----------------------------------------------------- */
.yk-bar { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; }
.yk-tool {
  appearance: none; border: 1px solid var(--yk-line); background: var(--yk-card); color: var(--yk-card-ink);
  border-radius: 16px; min-height: 52px; padding: 6px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 14px/1.1 var(--yk-body);
  box-shadow: 0 8px 18px -12px var(--yk-shadow);
  transition: transform .15s ease, opacity .2s ease;
}
.yk-tool:active { transform: scale(.95); }
.yk-tool:disabled { opacity: .45; cursor: default; }
.yk-tool svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.yk-tool--paw { background: color-mix(in srgb, var(--yk-hint) 18%, var(--yk-card)); }
.yk-tool--paw svg { fill: color-mix(in srgb, #e58a9a 35%, transparent); stroke: #d4687c; }
.yk-tool.is-nudge { animation: yk-nudgebtn 1s ease-in-out 3; }
@keyframes yk-nudgebtn { 50% { transform: scale(1.06); box-shadow: 0 0 0 5px color-mix(in srgb, var(--yk-hint) 40%, transparent); } }
.yk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; color: var(--yk-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.yk-foot a { color: inherit; }
.yk-foot b { color: var(--yk-ink); }

/* --- реплики героев --------------------------------------------------------------------------------- */
.yk-talk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  padding: 40px max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, rgba(20, 14, 8, .42), transparent);
}
.yk-talk__card {
  position: relative; max-width: 660px; margin: 0 auto; box-sizing: border-box;
  background: var(--yk-card); color: var(--yk-card-ink); border: 1px solid var(--yk-line); border-radius: 22px;
  padding: 16px 16px 12px; display: grid; grid-template-columns: 76px 1fr; gap: 4px 14px;
  box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .55);
  cursor: pointer;
  animation: yk-rise .35s cubic-bezier(.3,.7,.4,1);
}
/* Только сдвиг, без прозрачности: если анимация не отыграет, карточка всё равно видна. */
@keyframes yk-rise { from { transform: translateY(22px); } to { transform: none; } }
.yk-portrait { grid-row: span 2; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--yk-card), 0 0 0 5.5px var(--who, var(--yk-line)); margin-top: -34px; background: var(--yk-card); }
.yk-portrait svg { width: 100%; height: 100%; display: block; }
.yk-portrait.is-talking { animation: yk-talking .32s ease-in-out infinite alternate; }
@keyframes yk-talking { to { transform: translateY(-2px) scale(1.02); } }
.yk-talk__who { font: 700 15px var(--yk-display); color: var(--who, inherit); align-self: end; }
.yk-talk__who small { font: 600 12px var(--yk-body); color: var(--yk-card-muted); margin-left: 6px; }
.yk-talk__text { font-size: 16px; line-height: 1.45; min-height: 2.9em; }
.yk-talk__nav { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.yk-talk__skip { appearance: none; border: 0; background: none; color: var(--yk-card-muted); font-size: 13px; cursor: pointer; padding: 8px 2px; }
.yk-talk__pips { display: flex; gap: 4px; }
.yk-talk__pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--yk-line); }
.yk-talk__pips i.is-on { background: var(--yk-card-muted); }
.yk-talk__next { appearance: none; border: 0; background: var(--yk-accent); color: var(--yk-accent-ink); font: 800 14px var(--yk-body); padding: 10px 18px; border-radius: 999px; cursor: pointer; }

/* --- карточки: глава, готово, оглавление ---------------------------------------------------------- */
.yk-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 14, 8, .38);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  display: grid; place-items: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
}
.yk-sheet__card {
  width: min(500px, 100%); box-sizing: border-box; max-height: 100%; overflow: auto;
  background: var(--yk-card); color: var(--yk-card-ink); border: 1px solid var(--yk-line); border-radius: 24px;
  padding: 20px 18px; display: grid; gap: 12px; grid-auto-rows: max-content;
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .6);
  animation: yk-rise .45s cubic-bezier(.3,.7,.4,1);
}
.yk-sheet__card h2 { margin: 0; font: 700 23px/1.2 var(--yk-display); text-wrap: balance; }
.yk-sheet__card p { margin: 0; color: var(--yk-card-muted); line-height: 1.5; }
.yk-sheet__card .yk-eyebrow { color: var(--yk-card-muted); }
.yk-vignette { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: inset 0 0 0 1px var(--yk-line); }
.yk-vignette svg { width: 100%; height: 100%; display: block; }
.yk-chaptercard .yk-vignette svg { animation: yk-kenburns 14s ease-out forwards; transform-origin: 60% 40%; }
@keyframes yk-kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
.yk-chaptercard h2 { font-size: 27px; }
.yk-item-big { width: 100%; height: 118px; display: block; }
.yk-donecard { gap: 10px; }
.yk-donecard p { font-size: 14px; }
.yk-donecard .yk-chip { font-size: 12px; }
.yk-donecard .yk-btn--main { flex-basis: 100%; }
.yk-donecard .yk-btn--soft { flex: 1 1 130px; font-size: 14px; padding: 12px 10px; }
.yk-stars { display: flex; justify-content: center; gap: 14px; margin: -4px 0 0; }
.yk-star { width: 42px; height: 42px; }
.yk-star svg { width: 100%; height: 100%; display: block; }
.yk-star.is-on svg { animation: yk-starpop .5s cubic-bezier(.3,1.7,.5,1) both; animation-delay: var(--d, 0s); }
@keyframes yk-starpop { from { transform: scale(.2) rotate(-40deg); } }
.yk-verdict { text-align: center; font-weight: 800; font-size: 14px; color: var(--yk-card-ink); }
.yk-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.yk-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--yk-line); font-variant-numeric: tabular-nums; }
.yk-chip i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.yk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.yk-btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none; text-align: center; box-sizing: border-box;
  font: 800 15px/1 var(--yk-body); padding: 14px 16px; border-radius: 14px; flex: 1 1 180px;
}
.yk-btn--main { background: var(--yk-accent); color: var(--yk-accent-ink); }
.yk-btn--soft { background: transparent; color: var(--yk-card-ink); border: 1px solid var(--yk-line); }
.yk-chapter { display: grid; gap: 6px; }
.yk-chapter__head { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: center; margin-top: 6px; }
.yk-chapter__head .yk-vignette { border-radius: 10px; }
.yk-chapter h3 { margin: 0; font: 700 15px var(--yk-display); }
.yk-chapter h3 small { display: block; font: 600 12px var(--yk-body); color: var(--yk-card-muted); margin-top: 2px; }
.yk-chapter.is-locked .yk-vignette { filter: grayscale(1) opacity(.5); }
.yk-proj {
  appearance: none; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 0 10px; text-align: left;
  border: 1px solid var(--yk-line); background: transparent; color: var(--yk-card-ink); border-radius: 12px; padding: 6px 10px 6px 6px; cursor: pointer;
  font: inherit;
}
.yk-proj:disabled { opacity: .45; cursor: default; }
.yk-proj canvas { grid-row: span 2; width: 64px; height: 38px; }
.yk-proj strong { font-size: 14px; }
.yk-proj span { font-size: 12px; color: var(--yk-card-muted); grid-column: 2; }
.yk-proj .yk-mini-stars { grid-row: span 2; grid-column: 3; font-size: 13px; letter-spacing: 1px; color: var(--yk-hint); white-space: nowrap; }
.yk-proj.is-current { border-color: var(--yk-accent); box-shadow: inset 0 0 0 1px var(--yk-accent); }
.yk-shelf-works { display: flex; flex-wrap: wrap; gap: 6px; }
.yk-shelf-works canvas { width: 72px; height: 44px; background: color-mix(in srgb, var(--yk-wood-light) 22%, transparent); border-radius: 8px; }

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

/* --- старт, пролог, знакомство ------------------------------------------------------------------ */
.yk-intro {
  position: fixed; inset: 0; z-index: 90; box-sizing: border-box; overflow: auto;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(90% 60% at 50% 28%, #3a3f6c, #141a2e 78%);
  color: #f3efe6;
}
.yk-intro.is-meet { background: radial-gradient(90% 60% at 50% 40%, rgba(80, 58, 40, .55), rgba(20, 14, 8, .82)); }
.yk-start, .yk-pro { width: min(560px, 100%); display: grid; gap: 18px; }
.yk-start { text-align: center; }
.yk-start__body { display: grid; gap: 10px; justify-items: center; }
.yk-start__art, .yk-pro__art {
  position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 9;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .08);
}
.yk-start__art svg, .yk-pro__art svg { width: 100%; height: 100%; display: block; }
.yk-start__art svg { animation: yk-kenburns 16s ease-out forwards; transform-origin: 45% 55%; }
.yk-start h1 { margin: 0; font: 700 clamp(30px, 8.5vw, 42px)/1.1 var(--yk-display); color: #fff8e6; text-wrap: balance; }
.yk-start p { margin: 0; color: #d9d4ea; line-height: 1.5; font-size: 16px; max-width: 30em; }
.yk-start .yk-eyebrow, .yk-pro .yk-eyebrow { color: #f0bc5a; }
.yk-start small { color: #a9a6c4; font-size: 12.5px; }
.yk-start .yk-actions { width: 100%; }
.yk-start .yk-btn--main { background: #f0bc5a; color: #2b1d0c; font-size: 17px; padding: 17px; box-shadow: 0 12px 30px -10px rgba(240, 188, 90, .75); animation: yk-breathe 2.6s ease-in-out infinite; }
.yk-start .yk-btn--soft { color: #f3efe6; border-color: rgba(255, 255, 255, .25); }
@keyframes yk-breathe { 50% { transform: scale(1.03); } }
.yk-pro__art svg { animation: yk-zoomin 16s ease-out forwards; transform-origin: 50% 55%; }
.yk-pro__art.is-p2 svg { transform-origin: 50% 35%; }
.yk-pro__art.is-p3 svg { transform-origin: 30% 60%; }
.yk-pro__art.is-p4 svg { transform-origin: 70% 75%; }
@keyframes yk-zoomin { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.yk-pro__cap { margin: 0; min-height: 4.4em; font: 600 clamp(17px, 4.6vw, 21px)/1.45 var(--yk-display); color: #fff8e6; text-align: center; text-wrap: balance; }
.yk-pro__nav { display: flex; justify-content: space-between; align-items: center; }
.yk-pro__nav .yk-talk__skip { color: #a9a6c4; font-size: 14px; }
.yk-pro__nav .yk-talk__pips i { background: rgba(255, 255, 255, .22); }
.yk-pro__nav .yk-talk__pips i.is-on { background: #f0bc5a; }
.yk-pro__ball { position: absolute; width: 24%; left: 38%; top: 50%; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .35)); animation: yk-rollin 2.4s cubic-bezier(.2, .7, .3, 1) .3s both; }
@keyframes yk-rollin { from { transform: translate(260%, -70%) scale(.3) rotate(620deg); } to { transform: none; } }

/* оживление картинок: снег, вывеска, свет в двери, кот из коробки, свечи */
.yk-intro .yk-snowfall, .yk-chaptercard .yk-snowfall { animation: yk-snow 10s linear infinite; }
@keyframes yk-snow { to { transform: translateY(180px); } }
.yk-doorlight { opacity: 0; transition: opacity 1.4s ease .9s; }
.yk-pro__art.is-p2 .yk-doorlight, .yk-start__art .yk-doorlight { opacity: .85; }
.yk-pro__art.is-p1 .yk-sign { opacity: .3; }
.yk-pro__art.is-p2 .yk-sign { animation: yk-signon 1.8s steps(1) .4s both; }
@keyframes yk-signon { 0% { opacity: .3; } 20% { opacity: 1; } 30% { opacity: .3; } 45% { opacity: 1; } 55% { opacity: .5; } 70%, 100% { opacity: 1; } }
.yk-glowpulse { animation: yk-glowp 4s ease-in-out infinite; }
@keyframes yk-glowp { 50% { opacity: .72; } }
.yk-popcat > g { transform-box: fill-box; transform-origin: 50% 100%; }
.yk-pro__art.is-p3 .yk-popcat > g, .yk-chaptercard .yk-popcat > g { animation: yk-popup 1.1s cubic-bezier(.3, 1.6, .5, 1) .9s both; }
@keyframes yk-popup { from { transform: translateY(26px) scale(.5); } }
.yk-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: yk-flame .5s ease-in-out infinite alternate; }
@keyframes yk-flame { to { transform: scale(.85, 1.15); } }
.yk-vbulb { animation: yk-twinkle 2.4s ease-in-out infinite; }
.yk-vbulb:nth-child(2n) { animation-delay: -1.2s; }

.yk-meet {
  position: relative; width: min(440px, 100%); box-sizing: border-box; margin-top: 50px;
  background: var(--yk-card); color: var(--yk-card-ink); border-radius: 26px; padding: 58px 20px 16px;
  display: grid; justify-items: center; gap: 10px; text-align: center;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7); animation: yk-rise .45s cubic-bezier(.3, .7, .4, 1);
}
.yk-meet .yk-portrait { position: absolute; top: -48px; left: 50%; margin: 0 0 0 -48px; width: 96px; height: 96px; animation: yk-talking .32s ease-in-out 6 alternate; }
.yk-meet__text { margin: 0; font-size: 17px; line-height: 1.45; }
.yk-meet__form { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; margin-top: 4px; }
.yk-meet__input {
  flex: 1 1 170px; min-width: 0; box-sizing: border-box; font: 700 17px var(--yk-body); padding: 13px 14px; border-radius: 14px;
  border: 1.5px solid var(--yk-line); background: transparent; color: inherit;
}
.yk-meet__input:focus { outline: none; border-color: var(--who); box-shadow: 0 0 0 3px color-mix(in srgb, var(--who) 25%, transparent); }
.yk-meet .yk-btn { flex: 0 1 auto; }

/* выбор игрока в реплике */
.yk-talk__choices { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }
.yk-talk__choice {
  appearance: none; cursor: pointer; border: 1.5px solid var(--who); background: transparent; color: var(--yk-card-ink);
  font: 800 14.5px var(--yk-body); padding: 11px 18px; border-radius: 999px; animation: yk-pawpop .4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.yk-talk__choice:first-child { background: var(--who); color: #fff; }
.yk-talk__choice:nth-child(2) { animation-delay: .12s; }

/* подарок и именной «диплом» */
.yk-reward { text-align: center; justify-items: center; }
.yk-reward__gift { width: 86px; height: 86px; animation: yk-giftin .9s cubic-bezier(.3, 1.6, .5, 1) both, yk-wiggle 2.6s ease-in-out 1s infinite; }
.yk-reward__gift svg { width: 100%; height: 100%; display: block; }
@keyframes yk-giftin { from { transform: scale(.2) rotate(-25deg); } }
@keyframes yk-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(7deg); } 95% { transform: rotate(-4deg); } }
.yk-cert {
  width: 100%; box-sizing: border-box; border: 2px dashed #e3b34c; border-radius: 16px; padding: 14px;
  display: grid; gap: 4px; background: color-mix(in srgb, #e3b34c 10%, transparent);
}
.yk-cert small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--yk-card-muted); font-weight: 800; }
.yk-cert strong { font: 700 26px/1.2 var(--yk-display); }
.yk-cert span { font-size: 13px; color: var(--yk-card-muted); }
.yk-next { font-style: italic; }
.yk-invite { font-weight: 700; color: var(--yk-card-ink) !important; }
/* ярмарочная гирлянда не должна закрывать шапку */
#game-root[data-scene="fair"] .yk { padding-top: max(34px, env(safe-area-inset-top, 0px)); }
#game-root[data-scene="fair"] .yk-scene__garland { height: 30px; }
.yk-reward { gap: 9px; }
.yk-reward__gift { width: 64px; height: 64px; }
.yk-reward p { font-size: 14px; }
.yk-reward .yk-cert strong { font-size: 23px; }
.yk-claimed { flex-basis: 100%; margin: 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; color: var(--yk-card-ink) !important; background: color-mix(in srgb, #3fa37f 14%, transparent); }
.yk-claimed a { color: var(--yk-accent); }
.yk-start .yk-claimed { color: #fff8e6 !important; background: rgba(63, 163, 127, .22); }
.yk-start .yk-claimed a { color: #f0bc5a; }
.yk-count {
  position: absolute; left: 0; top: 0; z-index: 46; pointer-events: none;
  font: 800 13px/1 var(--yk-body); color: #2b1d0c; background: #f0bc5a; padding: 5px 8px; border-radius: 999px;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .4); animation: yk-pawpop .35s cubic-bezier(.3, 1.6, .5, 1);
}

/* текст проявляется по словам: из лёгкого тумана, без печатной машинки */
/* Без filter: blur — iOS Safari оставлял слова размытыми. Только прозрачность и лёгкий подъём. */
.yk-w { display: inline-block; opacity: 0; transform: translateY(.3em); transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.25, .7, .35, 1); }
.yk-w.is-in { opacity: 1; transform: none; }
.yk-talk__text .yk-w { transition-duration: .55s; transform: translateY(.18em); }
.yk-pro__cap { font-weight: 500; letter-spacing: .01em; text-shadow: 0 2px 18px rgba(255, 220, 160, .25); }
.yk-pro { transition: opacity 1s ease, transform 1s ease; }
.yk-pro.is-leaving { opacity: 0; transform: translateY(-8px); }
.yk-pro__veil { position: absolute; inset: 0; background: #141a2e; opacity: 1; transition: opacity 2.2s ease; pointer-events: none; }

/* комната за полками и дощатый пол */
.yk-scene__deco { position: absolute; left: 50%; top: 44%; width: min(560px, 96vw); transform: translate(-50%, -50%); opacity: .5; pointer-events: none; }
.yk-scene__deco svg { width: 100%; height: auto; display: block; }
#game-root[data-scene="night"] .yk-scene__deco, #game-root[data-scene="fair"] .yk-scene__deco { opacity: .62; }
.yk-scene__deco .yk-snowfall-d { animation: yk-snowd 7s linear infinite; }
@keyframes yk-snowd { 50% { transform: translateY(6px); } }
.yk-scene::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 13.4%;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .18), transparent 14px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 2px, transparent 2px 120px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 18px);
  border-top: 6px solid color-mix(in srgb, var(--yk-floor) 70%, #000);
}
.yk-ending { width: 100%; box-sizing: border-box; border-radius: 16px; padding: 12px 14px; display: grid; gap: 3px; background: color-mix(in srgb, var(--yk-accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--yk-accent) 30%, transparent); }
.yk-ending small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--yk-card-muted); font-weight: 800; }
.yk-ending strong { font: 700 19px/1.25 var(--yk-display); }
.yk-ending span { font-size: 13px; color: var(--yk-card-muted); }
.yk-talk__memo { grid-column: 2; font-size: 12.5px; font-weight: 800; color: var(--who, var(--yk-accent)); letter-spacing: .02em; animation: yk-pawpop .5s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
.yk-ending em { font-size: 13.5px; line-height: 1.45; color: var(--yk-card-ink); }

/* медали за концовки */
.yk-medals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
.yk-medal { display: grid; justify-items: center; gap: 3px; text-align: center; }
.yk-medal span { width: 44px; height: 53px; display: block; }
.yk-medal svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .18)); }
.yk-medal small { font-size: 10px; line-height: 1.2; color: var(--yk-card-muted); font-weight: 700; }
.yk-medal:not(.is-on) small { font-style: italic; font-weight: 600; opacity: .85; }
.yk-medal.is-on small { color: var(--yk-card-ink); }
.yk-medal.is-new span { animation: yk-medal 1.1s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
.yk-medal.is-new small { color: var(--yk-accent); }
@keyframes yk-medal { from { transform: scale(.2) rotate(-200deg); } 70% { transform: scale(1.25) rotate(8deg); } }
.yk-letter { margin: 6px 0 2px !important; font: 500 italic 15px/1.5 var(--yk-display) !important; color: var(--yk-card-ink) !important; background: #fbf4e2; border-radius: 10px; padding: 10px 12px; box-shadow: inset 0 0 0 1px rgba(200, 160, 90, .3); transform: rotate(-.6deg); }

/* выборы — все варианты равны, ни один не выделен */
.yk-talk__choice, .yk-talk__choice:first-child { background: color-mix(in srgb, var(--who) 10%, var(--yk-card)); color: var(--yk-card-ink); border: 1.5px solid var(--who); }
@media (hover: hover) { .yk-talk__choice:hover { background: color-mix(in srgb, var(--who) 22%, var(--yk-card)); } }
.yk-talk__choice:focus-visible { background: color-mix(in srgb, var(--who) 22%, var(--yk-card)); }
.yk-talk__choices { justify-content: stretch; }
.yk-talk__choice { flex: 1 1 100%; text-align: left; padding: 12px 16px; border-radius: 14px; font-size: 15px; }
/* имена и подписи читаются и в тёмной теме */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .yk-talk__who, :root:not([data-theme="light"]) .yk-say__text b, :root:not([data-theme="light"]) .yk-meet .yk-talk__who { color: color-mix(in srgb, var(--who) 55%, #ffffff); }
}
:root[data-theme="dark"] .yk-talk__who, :root[data-theme="dark"] .yk-say__text b { color: color-mix(in srgb, var(--who) 55%, #ffffff); }
/* письмо Арины — тёмные чернила на светлой бумаге в любой теме */
.yk-letter { color: #3a2f25 !important; }
/* текст реплик крупнее — легче читать с телефона */
.yk-talk__text { font-size: 17.5px; line-height: 1.5; }
.yk-talk__who { font-size: 16px; }
.yk-say { font-size: 15px; }
.yk-meet__text { font-size: 18px; }
.yk-pro__btns { display: flex; align-items: center; gap: 14px; }
.yk-pro__next { appearance: none; border: 0; cursor: pointer; background: #f0bc5a; color: #2b1d0c; font: 800 15px var(--yk-body); padding: 11px 20px; border-radius: 999px; box-shadow: 0 8px 20px -10px rgba(240, 188, 90, .8); }
.yk-talk__left { display: flex; align-items: center; gap: 6px; }
.yk-talk__back { appearance: none; cursor: pointer; border: 1px solid var(--yk-line); background: transparent; color: var(--yk-card-muted); width: 34px; height: 34px; border-radius: 50%; font: 800 18px/1 var(--yk-body); padding: 0 0 2px; }
.yk-talk__back--choice { width: auto; height: auto; border: 0; border-radius: 8px; font-size: 13.5px; padding: 6px 4px; align-self: flex-start; }

/* Лупик живее: дышит, оглядывается, дёргает ухом; спящий — потягивается и лениво мяукает */
.yk-pet__all { animation: yk-catbreath 3.8s ease-in-out infinite; }
@keyframes yk-catbreath { 50% { transform: scale(1.015, .99); } }
.yk-pet__eyes { transition: translate .35s ease; }
.yk-pet.is-look-l .yk-pet__eyes { translate: -2px 0; }
.yk-pet.is-look-r .yk-pet__eyes { translate: 2px 0; }
.yk-pet.is-look-l .yk-pet__head { transform: rotate(-6deg); }
.yk-pet.is-look-r .yk-pet__head { transform: rotate(6deg); }
.yk-pet.is-twitch .yk-pet__head { animation: yk-twitch .45s ease 2; }
@keyframes yk-twitch { 30% { transform: rotate(-4deg) translateY(-1px); } 60% { transform: rotate(3deg); } }
.yk-pet.is-blink2 .yk-pet__eyes { animation: yk-blink2 .7s ease; }
@keyframes yk-blink2 { 15%, 55% { transform: scaleY(.1); } 30%, 75% { transform: scaleY(1); } }
.yk-cat.is-stir .yk-breath { animation: yk-stir 1.5s ease-in-out; }
@keyframes yk-stir { 25% { transform: scale(1.06, .94) translateY(2px); } 55% { transform: scale(.97, 1.06) translateY(-3px); } }
.yk-cat__meow { position: absolute; right: -4px; top: -10px; font: 700 13px var(--yk-display); color: #fff; background: #6f9bd0; padding: 3px 8px; border-radius: 10px 10px 10px 2px; animation: yk-heart 1.7s ease-out forwards; white-space: nowrap; }
/* строка подсказки — постоянной высоты (до трёх строк), чтобы поле не прыгало */
.yk-say { height: 68px; min-height: 0; overflow: hidden; font-size: 14.5px; line-height: 1.3; }
.yk-say__text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== телефоны ===================================================================================== */
/* высота экрана без панелей Safari; без двойного тапа-зума; без выделения при долгом нажатии */
#game-root { height: 100vh; height: 100dvh; }
.yk button, .yk a, .yk-board, .yk-intro, .yk-talk, .yk-sheet { touch-action: manipulation; }
.yk-board { -webkit-touch-callout: none; }
.yk-meet__input { font-size: 17px; }  /* меньше 16px — iOS зумит страницу при фокусе */

/* невысокие экраны (SE, мини, большинство Android): всё вокруг поля компактнее, поле — крупнее */
@media (max-height: 760px) {
  .yk { gap: 6px; padding-top: max(6px, env(safe-area-inset-top, 0px)); padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .yk-icon { width: 38px; height: 38px; }
  .yk-icon svg { width: 18px; height: 18px; }
  .yk-title h1 { font-size: 19px; }
  .yk-eyebrow { font-size: 10px; letter-spacing: .06em; }
  .yk-work { min-height: 50px; padding: 4px 60px 4px 6px; border-radius: 14px; }
  .yk-work canvas { width: 78px; height: 42px; }
  .yk-work__what { font-size: 13.5px; }
  .yk-work__sub { font-size: 11px; }
  .yk-dot { width: 10px; height: 10px; }
  .yk-pet { width: 60px; height: 60px; }
  .yk-say { height: 50px; padding: 4px 10px 4px 4px; font-size: 13px; line-height: 1.25; border-radius: 13px; }
  .yk-say__face { width: 26px; height: 26px; }
  .yk-tool { min-height: 44px; font-size: 13.5px; border-radius: 13px; }
  .yk-tool svg { width: 19px; height: 19px; }
  .yk-foot { display: none; }
  .yk-talk__text { font-size: 16.5px; }
  .yk-portrait { width: 64px; height: 64px; }
  .yk-talk__card { grid-template-columns: 64px 1fr; padding: 13px 13px 10px; }
}
/* очень узкие (360 и меньше) */
@media (max-width: 370px) {
  .yk { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .yk-bar { gap: 6px; }
  .yk-tool { gap: 5px; padding: 6px 4px; font-size: 13px; }
  .yk-talk__choice { font-size: 14.5px; padding: 11px 13px; }
}
/* горизонтальный телефон: просим повернуть (игра рассчитана на вертикальный экран) */
.yk-rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .yk-rotate { display: grid; place-items: center; position: fixed; inset: 0; z-index: 200; background: #141a2e; color: #fff8e6; text-align: center; padding: 24px; }
  .yk-rotate svg { width: 96px; height: 96px; display: block; margin: 0 auto 10px; }
  .yk-rotate p { margin: 0; font: 600 17px/1.4 var(--yk-display); max-width: 22em; }
}

/* ===== катсцены (cutscenes.js): движение — только CSS, стартует при показе ============================ */
.yk-cs { display: block; width: 100%; height: 100%; }
/* камера: у каждой сцены свой проезд (наезд, отъезд, панорама, подъём) */
.yk-cs .cs-cam1 { animation: cs-cam1 14s ease-in-out .3s both; }
@keyframes cs-cam1 { to { transform: scale(1.16); } }
.yk-cs .cs-cam2 { animation: cs-cam2 3.4s ease-in-out .8s both; }
@keyframes cs-cam2 { from { transform: scale(1.34); } }
.yk-cs .cs-cam3 { animation: cs-cam3 13s ease-in-out .3s both; }
@keyframes cs-cam3 { 0%, 22% { transform: none; } 58% { transform: translateY(-190px); } 100% { transform: translateY(-190px) scale(1.06); } }
.yk-cs .cs-cam4 { animation: cs-cam4 12s ease-in-out .6s both; }
@keyframes cs-cam4 { to { transform: translateX(-226px); } }
.yk-cs .cs-fgpar { animation: cs-fgpar 12s ease-in-out .6s both; }
@keyframes cs-fgpar { to { transform: translateX(-70px); } }
.yk-cs .cs-cam5 { animation: cs-cam5 13s ease-in-out .2s both; }
@keyframes cs-cam5 { to { transform: scale(1.22); } }
.yk-cs .cs-cam6 { animation: cs-cam6 10s linear both; }
@keyframes cs-cam6 {
  0%, 26.5% { transform: scale(1.14); }
  28% { transform: translate(2px, -2px) scale(.985); }
  29.5% { transform: translate(-2px, 1px) scale(1.005); }
  31% { transform: none; animation-timing-function: ease-in-out; }
  100% { transform: scale(1.04); }
}
/* свет и воздух */
.yk-cs .cs-twinkle, .yk-cs .cs-bulb { animation: cs-twinkle 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-twinkle { 50% { opacity: .25; } }
.yk-cs .cs-winlit { animation: cs-twinkle 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.yk-cs .cs-glowp { animation: cs-glowp 3.6s ease-in-out infinite; }
@keyframes cs-glowp { 50% { opacity: .55; } }
.yk-cs .cs-lamp { animation: cs-lamp 5s ease-in-out infinite; }
@keyframes cs-lamp { 0%, 100% { opacity: 1; } 46% { opacity: .82; } 50% { opacity: .94; } 54% { opacity: .78; } }
.yk-cs .cs-beam { animation: cs-glowp 7s ease-in-out infinite; }
.yk-cs .cs-mote { animation: cs-mote var(--t, 8s) ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-mote { 0% { transform: none; opacity: 0; } 25% { opacity: .9; } 75% { opacity: .55; } 100% { transform: translate(var(--dx, 0px), -38px); opacity: 0; } }
.yk-cs .cs-wisp { animation: cs-wisp 3s ease-out infinite; }
.yk-cs .cs-wisp--2 { animation-delay: -1.5s; }
@keyframes cs-wisp { from { transform: translateY(4px); opacity: 0; } 35% { opacity: 1; } to { transform: translateY(-9px); opacity: 0; } }
.yk-cs .cs-spark { transform-box: fill-box; transform-origin: center; animation: cs-spark 3s ease-out infinite both; animation-delay: var(--d, 0s); }
@keyframes cs-spark { 0% { transform: scale(0) rotate(0); opacity: 0; } 14% { transform: scale(1.15) rotate(30deg); opacity: 1; } 40%, 100% { transform: scale(0) rotate(80deg); opacity: 0; } }
.yk-cs .cs-heart { transform-box: fill-box; transform-origin: center; animation: cs-heart 3.2s ease-out infinite both; animation-delay: var(--d, 0s); }
@keyframes cs-heart { 0% { transform: scale(.3); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 60%, 100% { transform: translateY(-20px) scale(.8); opacity: 0; } }
.yk-cs .cs-heart--once { animation-iteration-count: 1; animation-duration: 1.6s; }
.yk-cs .cs-spin { animation: cs-spin 40s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
.yk-cs .cs-drift { animation: cs-drift 18s linear infinite alternate; }
.yk-cs .cs-drift--slow { animation-duration: 28s; }
@keyframes cs-drift { to { transform: translateX(36px); } }
.yk-cs .cs-birds { animation: cs-birds 16s linear infinite; }
@keyframes cs-birds { to { transform: translateX(380px) translateY(-18px); } }
.yk-cs .cs-gulls { animation: cs-gulls 9s ease-in-out infinite alternate; }
@keyframes cs-gulls { to { transform: translate(50px, -10px); } }
.yk-cs .cs-flap { transform-box: fill-box; transform-origin: center; animation: cs-flap .42s ease-in-out infinite alternate; }
.yk-cs .cs-flap--2 { animation-delay: -.2s; }
@keyframes cs-flap { to { transform: scaleY(.35); } }
/* герои: дыхание, моргание, руки */
.yk-cs .cs-head { animation: cs-nod 4.2s ease-in-out infinite; }
@keyframes cs-nod { 50% { transform: rotate(2.5deg); } }
.yk-cs .cs-blink { transform-box: fill-box; transform-origin: center; animation: cs-blink 4.4s infinite; }
@keyframes cs-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.yk-cs .cs-ears { animation: cs-ears 3.6s ease-in-out infinite; }
@keyframes cs-ears { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-4deg); } 95% { transform: rotate(3deg); } }
.yk-cs .cs-knitl { animation: cs-knitl .9s ease-in-out infinite; }
.yk-cs .cs-knitr { animation: cs-knitr .9s ease-in-out infinite; }
@keyframes cs-knitl { 50% { transform: rotate(-8deg); } }
@keyframes cs-knitr { 50% { transform: rotate(8deg); } }
.yk-cs .cs-needles { transform-origin: 32px 80px; animation: cs-needles .9s ease-in-out infinite; }
@keyframes cs-needles { 50% { transform: rotate(5deg) translateY(1px); } }
.yk-cs .cs-grow { animation: cs-grow 6.2s ease-out .6s both; }
@keyframes cs-grow { from { transform: scale(.15); opacity: .2; } }
.yk-cs .cs-lift { animation: cs-lift 1s cubic-bezier(.3, 1.5, .5, 1) 6.8s both; }
@keyframes cs-lift { to { transform: translateY(-5px) rotate(-3deg); } }
.yk-cs .cs-thread { stroke-dasharray: 4 5; animation: cs-dash 1.2s linear infinite; }
@keyframes cs-dash { to { stroke-dashoffset: -18; } }
.yk-cs .cs-wobble { animation: cs-wobble 2.6s ease-in-out infinite; }
@keyframes cs-wobble { 50% { transform: rotate(-7deg); } }
.yk-cs .cs-yeartitle { animation: cs-yeartitle 4.2s cubic-bezier(.6, 0, .3, 1) .2s both; }
@keyframes cs-yeartitle {
  0% { transform: translate(var(--tx, -80px), 36px) scale(var(--sc, 2.3)); opacity: 0; }
  14%, 42% { transform: translate(var(--tx, -80px), 36px) scale(var(--sc, 2.3)); opacity: 1; }
  100% { transform: none; opacity: .92; }
}
.yk-cs .cs-yearstay { animation: cs-fadein 1s ease .3s both; opacity: .92; }
.yk-cs .cs-wave { animation: cs-wave .55s ease-in-out infinite alternate; }
.yk-cs .cs-wave--r { animation-name: cs-wave-r; }
@keyframes cs-wave { to { transform: rotate(-14deg); } }
@keyframes cs-wave-r { to { transform: rotate(14deg); } }
.yk-cs .cs-pointing { animation: cs-point 1.6s ease-in-out infinite; }
@keyframes cs-point { 50% { transform: rotate(-7deg); } }
.yk-cs .cs-stroke { animation: cs-strokeh 1.8s ease-in-out infinite; }
@keyframes cs-strokeh { 50% { transform: rotate(7deg); } }
.yk-cs .cs-typel { animation: cs-typel .28s ease-in-out infinite alternate; }
.yk-cs .cs-typer { animation: cs-typer .28s ease-in-out .14s infinite alternate; }
@keyframes cs-typel { to { transform: rotate(-4deg) translateY(1px); } }
@keyframes cs-typer { to { transform: rotate(4deg) translateY(1px); } }
.yk-cs .cs-bob { animation: cs-bobw .45s ease-in-out infinite alternate; }
@keyframes cs-bobw { to { transform: translateY(-3px); } }
.yk-cs .cs-leg--l { animation: cs-leg .45s ease-in-out infinite alternate; }
.yk-cs .cs-leg--r { animation: cs-leg .45s ease-in-out infinite alternate-reverse; }
@keyframes cs-leg { from { transform: rotate(12deg); } to { transform: rotate(-12deg); } }
.yk-cs .cs-swing { animation: cs-leg .45s ease-in-out infinite alternate-reverse; }
.yk-cs .cs-swing--r { animation-direction: alternate; }
/* смена позы: одна фигура пропадает, другая появляется в тот же миг */
.yk-cs .cs-swapout { animation: cs-hide .01s linear var(--at, 1s) both; }
.yk-cs .cs-swapin { animation: cs-show .01s linear var(--at, 1s) both; }
@keyframes cs-hide { to { opacity: 0; } }
@keyframes cs-show { from { opacity: 0; } to { opacity: 1; } }
/* полёт по дуге: --fx/--fy — откуда, --at — когда */
.yk-cs .cs-arcx { animation: cs-arcx .7s linear var(--at, 0s) both; }
.yk-cs .cs-arcy { animation: cs-arcy .7s var(--at, 0s) both; }
.yk-cs .cs-arc--slow, .yk-cs .cs-arc--slow > .cs-arcy { animation-duration: 1s; }
.yk-cs .cs-arc--shown { animation-name: cs-arcx-shown; }
@keyframes cs-arcx { 0% { transform: translateX(var(--fx, 0px)); opacity: 0; } 6% { opacity: 1; } 100% { transform: none; } }
@keyframes cs-arcx-shown { 0% { transform: translateX(var(--fx, 0px)); } 100% { transform: none; } }
@keyframes cs-arcy {
  0% { transform: translateY(var(--fy, 0px)); animation-timing-function: cubic-bezier(.3, .7, .6, 1); }
  42% { transform: translateY(calc(var(--fy, 0px) - 26px)); animation-timing-function: cubic-bezier(.5, 0, .8, .6); }
  100% { transform: none; }
}
.yk-cs .cs-env { animation: cs-hide .3s ease 1.55s both; }

/* 2021 */
.yk-cs--s2021 .cs-cattail { animation: none; }
/* первая закупка: фургон, коробки, вывеска */
.yk-cs .cs-awning { animation: cs-awning 3.2s ease-in-out infinite; }
@keyframes cs-awning { 50% { transform: rotate(1.4deg); } }
.yk-cs .cs-drivein { animation: cs-drive 2.2s cubic-bezier(.15, .6, .3, 1) 2s both; }
@keyframes cs-drive { from { transform: translateX(240px); } }
.yk-cs .cs-wheel { animation: cs-wheel 2.2s cubic-bezier(.15, .6, .3, 1) 2s both; }
@keyframes cs-wheel { from { transform: rotate(-760deg); } }
.yk-cs .cs-brake { transform-origin: 212px 228px; animation: cs-brake .7s ease-out 3.9s both; }
@keyframes cs-brake { 35% { transform: rotate(-2.4deg); } 70% { transform: rotate(.6deg); } }
.yk-cs .cs-puff { transform-box: fill-box; transform-origin: center; animation: cs-puff .5s ease-out 2s 4 both; }
@keyframes cs-puff { from { transform: scale(.6); opacity: .9; } to { transform: translate(14px, -6px) scale(1.5); opacity: 0; } }
.yk-cs .cs-dust { transform-box: fill-box; transform-origin: 50% 100%; animation: cs-dust 1s ease-out 3.95s both; }
@keyframes cs-dust { 0% { transform: scale(.3); opacity: 0; } 25% { opacity: .95; } 100% { transform: translateY(-5px) scale(1.7); opacity: 0; } }
.yk-cs .cs-sign { animation: cs-signon 1.6s steps(1) 6s both; }
.yk-cs .cs-signglow { animation: cs-signon 1.6s steps(1) 6s both; }
.yk-cs--sTonight .cs-sign { animation-delay: .5s; }
@keyframes cs-signon { 0% { opacity: 0; } 20% { opacity: 1; } 30% { opacity: .15; } 50% { opacity: 1; } 60% { opacity: .4; } 75%, 100% { opacity: 1; } }
.yk-cs--sStart .cs-hop { animation: cs-hop .55s ease-out 1.7s 2, cs-hop2 .55s ease-out 6.3s 3; }
@keyframes cs-hop { 40% { transform: translateY(-12px); } }
@keyframes cs-hop2 { 40% { transform: translateY(-14px); } }
/* глубина: герои дышат, ближний план — мягкие блики, лужи отражают фонари, росток */
.yk-cs .cs-breathe { animation: cs-breathe 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-breathe { 50% { transform: scale(1.006, 1.014); } }
.yk-cs .cs-bokeh { animation: cs-bokeh var(--t, 12s) ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes cs-bokeh { from { transform: translate(0, 6px); opacity: .5; } to { transform: translate(var(--dx, 10px), -10px); opacity: 1; } }
.yk-cs .cs-shimmer { transform-box: fill-box; transform-origin: center; animation: cs-shimmer 1.8s ease-in-out infinite alternate; }
@keyframes cs-shimmer { to { transform: scaleX(1.8); opacity: .12; } }
.yk-cs .cs-sprout { animation: cs-sprout 1.4s cubic-bezier(.3, 1.3, .5, 1) 8.6s both; }
@keyframes cs-sprout { from { transform: scaleY(0); } }
.yk-cs .cs-leaf { animation: cs-leaf .7s cubic-bezier(.3, 1.6, .5, 1) var(--d, 9s) both; }
@keyframes cs-leaf { from { transform: scale(0); } }
/* конец 2021: ночью на склад */
.yk-cs .cs-camW { animation: cs-cam5 12s ease-in-out both; }
.yk-cs .cs-farW { animation: cs-farW 6.2s cubic-bezier(.25, .35, .3, 1) .2s both; }
@keyframes cs-farW { to { transform: translateX(-70px); } }
.yk-cs .cs-midW { animation: cs-midW 6.2s cubic-bezier(.25, .35, .3, 1) .2s both; }
@keyframes cs-midW { to { transform: translateX(-420px); } }
.yk-cs .cs-wheelW { animation: cs-wheelW 6.2s cubic-bezier(.25, .35, .3, 1) .2s both; }
@keyframes cs-wheelW { to { transform: rotate(1500deg); } }
.yk-cs .cs-vanbob { animation: cs-bobw .3s ease-in-out .2s 20 alternate; }
.yk-cs .cs-beamW { animation: cs-lamp 3s ease-in-out infinite; }
.yk-cs .cs-puffW { transform-box: fill-box; transform-origin: center; animation: cs-puffW .6s ease-out .2s 10 both; }
@keyframes cs-puffW { from { transform: scale(.6); opacity: .9; } to { transform: translate(-14px, -4px) scale(1.5); opacity: 0; } }
.yk-cs .cs-notify { transform-box: fill-box; transform-origin: 10% 50%; animation: cs-bubble .55s cubic-bezier(.3, 1.6, .5, 1) var(--d, 7s) both, cs-wiggle .5s ease-in-out calc(var(--d, 7s) + .6s) 2; }
@keyframes cs-wiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
/* 2022: курс, граница, посылки */
.yk-cs .cs-cam22 { animation: cs-cam22 12s ease-in-out both; }
@keyframes cs-cam22 { to { transform: scale(1.06); } }
.yk-cs .cs-draw { stroke-dasharray: 100; animation: cs-trail 2.6s ease-in-out .4s both; }
.yk-cs .cs-draw--2 { animation-duration: 1.4s; animation-delay: 3.6s; }
.yk-cs .cs-barrier { animation: cs-bardown .5s ease-out 1.6s both, cs-barup .6s ease-in-out 4.4s forwards; }
@keyframes cs-bardown { from { transform: rotate(-75deg); } }
@keyframes cs-barup { to { transform: rotate(-75deg); } }
.yk-cs .cs-truck { animation: cs-truck 2.6s linear 4.8s both; }
@keyframes cs-truck { 0% { transform: translateX(24px); opacity: 0; } 6%, 94% { opacity: 1; } 100% { transform: translateX(118px); opacity: 0; } }
.yk-cs .cs-clockfast { animation: cs-spin 1.2s linear infinite; }
.yk-cs .cs-clockslow { animation: cs-spin 14.4s linear infinite; }
.yk-cs .cs-page { animation: cs-page 3.2s ease-in-out 1s infinite; }
@keyframes cs-page { 0%, 55% { transform: none; } 75%, 100% { transform: scaleX(-1); } }
.yk-cs .cs-tape { stroke-dasharray: 100; animation: cs-tape 2.4s ease-in-out infinite; }
.yk-cs .cs-tape--2 { animation-delay: 1.2s; }
@keyframes cs-tape { 0% { stroke-dashoffset: 100; } 45%, 100% { stroke-dashoffset: 0; } }
.yk-cs .cs-popin { transform-box: fill-box; transform-origin: 50% 100%; animation: cs-popin .5s cubic-bezier(.3, 1.6, .5, 1) var(--d, 1s) both; }
@keyframes cs-popin { from { transform: scale(0); opacity: 0; } }
/* 2024: уходим с Ozon, новые линейки */
.yk-cs .cs-cam24 { animation: cs-cam24 12s ease-in-out .6s both; }
@keyframes cs-cam24 { to { transform: translateX(-190px); } }
.yk-cs .cs-rise { animation: cs-rise 4s ease-out var(--d, 0s) infinite both; }
@keyframes cs-rise { 0% { transform: translateY(10px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-54px); opacity: 0; } }
.yk-cs .cs-walk24 { animation: cs-walk24 3.6s linear .5s both; }
@keyframes cs-walk24 { to { transform: translateX(62px); } }
.yk-cs .cs-steps24.cs-bob, .yk-cs .cs-steps24 .cs-leg { animation-iteration-count: 8; animation-delay: .5s; }
.yk-cs .cs-rowon { animation: cs-rowon .7s ease-out var(--d, 5s) both; }
@keyframes cs-rowon { from { transform: translateX(-8px); opacity: 0; } }
/* 2025: Москва, Оливка — Лупик */
.yk-cs .cs-cam25 { animation: cs-cam22 12s ease-in-out both; }
.yk-cs .cs-flashsky { opacity: 0; animation: cs-flashsky 6s linear 1s infinite; }
@keyframes cs-flashsky { 0%, 30% { opacity: 0; } 31% { opacity: .55; } 32.5% { opacity: 0; } 34% { opacity: .35; } 35.5%, 100% { opacity: 0; } }
.yk-cs .cs-landing { animation: cs-landing 11s ease-in .3s both; }
@keyframes cs-landing { from { transform: translate(132px, 40px) rotate(4deg); } to { transform: translate(320px, 104px) rotate(8deg); } }
.yk-cs .cs-rain { animation: cs-rain 1.1s linear infinite; }
@keyframes cs-rain { to { transform: translateY(260px); } }
.yk-cs .cs-kitten { animation: cs-kitten .9s cubic-bezier(.3, 1.4, .5, 1) 1.2s both; }
@keyframes cs-kitten { from { transform: translateY(22px); } }
.yk-cs .cs-strike { stroke-dasharray: 100; animation: cs-trail .5s ease-out 4.6s both; }
.yk-cs .cs-tagold { animation: cs-tagold .3s ease-in 5.6s both; }
@keyframes cs-tagold { to { transform: scaleY(0); } }
.yk-cs .cs-tagnew { animation: cs-tagnew .35s cubic-bezier(.3, 1.6, .5, 1) 5.9s both; }
@keyframes cs-tagnew { from { transform: scaleY(0); } }
/* 2026: пожары, свадебный конверт */
.yk-cs .cs-cam26 { animation: cs-cam26 12s ease-in-out both; }
@keyframes cs-cam26 { 0%, 22% { transform: scale(2); } 52% { transform: none; } 100% { transform: scale(1.04); } }
.yk-cs .cs-fire { animation: cs-fadein 1.2s ease var(--d, 0s) both; }
.yk-cs .cs-smokecol { animation: cs-smokecol 4.2s ease-out var(--d, 0s) infinite both; }
@keyframes cs-smokecol { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(4px, -16px); opacity: .25; } }
.yk-cs .cs-envin { animation: cs-envin 2s ease-in-out 6.2s both; }
@keyframes cs-envin { 0% { transform: translateY(-14px); opacity: 0; } 30%, 70% { transform: none; opacity: 1; } 100% { transform: translateY(30px); opacity: 0; } }
.yk-cs .cs-hope { animation: cs-fadein 1.4s ease 7.8s both; }
/* Стамбул, шоурум YarnArt */
.yk-cs .cs-camI { animation: cs-camI 12s ease-in-out both; }
@keyframes cs-camI { 0%, 10% { transform: scale(2.1); } 34% { transform: none; } 100% { transform: scale(1.05); } }
.yk-cs .cs-cellon { animation: cs-fadein .5s ease var(--d, 3s) both; }
.yk-cs .cs-sway { animation: cs-sway 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.yk-cs .cs-ferry { animation: cs-ferry 14s linear both; }
@keyframes cs-ferry { to { transform: translateX(-130px); } }
.yk-cs .cs-smoke { animation: cs-steam 2.4s ease-out infinite; }
.yk-cs .cs-teapot { animation: cs-teapot 2s ease-in-out 4.8s both; }
@keyframes cs-teapot { 0% { transform: none; } 20%, 78% { transform: rotate(-26deg); } 100% { transform: none; } }
.yk-cs .cs-pourline { stroke-dasharray: 3 2; animation: cs-pour 2s linear 4.8s both, cs-dash .5s linear infinite; }
@keyframes cs-pour { 0%, 20% { opacity: 0; } 26%, 74% { opacity: 1; } 82%, 100% { opacity: 0; } }
.yk-cs .cs-teafill { animation: cs-teafill 1.2s ease-out 5.2s both; }
@keyframes cs-teafill { from { transform: scaleY(0); } }
.yk-cs .cs-wisp--late { animation: cs-wisp 3s ease-out 6.4s infinite both; }
.yk-cs .cs-photoflash { animation: cs-photoflash 3.2s ease-out var(--d, 7s) infinite both; }
@keyframes cs-photoflash { 0% { opacity: 0; } 4% { opacity: 1; } 22%, 100% { opacity: 0; } }
/* Бурса, фабрики */
.yk-cs .cs-carin { animation: cs-carin 3.8s ease-in-out .3s both; }
@keyframes cs-carin { from { transform: translateX(-40px); } to { transform: translateX(340px); } }
.yk-cs .cs-plane { animation: cs-plane 7.5s ease-in-out .2s both; }
@keyframes cs-plane { from { transform: translate(-70px, 104px) rotate(-6deg); } to { transform: translate(380px, 34px) rotate(-3deg); } }
.yk-cs .cs-trail { stroke-dasharray: 100; animation: cs-trail 7.5s ease-in-out .2s both; }
@keyframes cs-trail { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.yk-cs .cs-glint { animation: cs-twinkle 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.yk-cs .cs-waves { animation: cs-waves 4s linear infinite; }
@keyframes cs-waves { to { transform: translateX(40px); } }
.yk-cs .cs-steam { animation: cs-steam 3.2s ease-out infinite; }
@keyframes cs-steam { from { transform: translateY(10px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-16px) translateX(6px); opacity: 0; } }
.yk-cs .cs-bobbin { animation: cs-bobbin .5s linear infinite; animation-delay: var(--d, 0s); }
@keyframes cs-bobbin { 50% { transform: scaleX(.55); } }
.yk-cs .cs-flow { animation: cs-dash .6s linear infinite; }
.yk-cs .cs-plus { animation: cs-plus 4s ease-out infinite both; animation-delay: var(--d, 0s); }
@keyframes cs-plus { 0% { transform: translateY(4px); opacity: 0; } 10% { opacity: 1; } 34%, 100% { transform: translateY(-9px); opacity: 0; } }
.yk-cs .cs-tick { transform-origin: 50px 86px; animation: cs-tick 1.1s ease-in-out infinite; }
@keyframes cs-tick { 50% { transform: rotate(-5deg); } }
/* лавка сейчас */
.yk-cs .cs-ping { transform-box: fill-box; transform-origin: center; animation: cs-ping 1.6s ease-out infinite; }
@keyframes cs-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.yk-cs .cs-clock { animation: cs-spin 6s linear infinite; }
.yk-cs .cs-walk4 { animation: cs-walk4 7.5s linear .4s both; }
@keyframes cs-walk4 { to { transform: translateX(120px); } }
.yk-cs .cs-steps.cs-bob, .yk-cs .cs-steps .cs-leg { animation-iteration-count: 17; animation-delay: .4s; }
.yk-cs .cs-bubble { transform-box: fill-box; transform-origin: 0 50%; animation: cs-bubble .5s cubic-bezier(.3, 1.6, .5, 1) var(--d, 1s) both; }
@keyframes cs-bubble { from { transform: scale(.2); opacity: 0; } }
.yk-cs .cs-screenglow { animation: cs-lamp 2.4s ease-in-out infinite; }
.yk-cs .cs-code { animation: cs-code 2.4s linear infinite; }
@keyframes cs-code { to { transform: translateY(-15px); } }
.yk-cs .cs-peek { animation: cs-peek 3.4s ease-in-out .8s infinite both; }
@keyframes cs-peek { 0%, 100% { transform: translateY(22px); } 30%, 70% { transform: translateY(0); } }
/* 1 ноября: дверь, свет, клубок «13» */
.yk-cs .cs-winon { animation: cs-winon .01s linear var(--d, 1s) both; }
@keyframes cs-winon { from { opacity: .1; } to { opacity: 1; } }
.yk-cs .cs-door { animation: cs-door 1.2s ease-in-out 1s both; }
@keyframes cs-door { to { transform: scaleX(.12); } }
.yk-cs .cs-lightwedge { animation: cs-fadein 1s ease 1.4s both; }
@keyframes cs-fadein { from { opacity: 0; } }
.yk-cs .cs-ball13 { transform-origin: 196px 216px; animation: cs-ball13 2.2s cubic-bezier(.3, .6, .4, 1) 1.9s both; }
@keyframes cs-ball13 { from { transform: scale(.5); opacity: 0; } 10% { opacity: 1; } to { transform: translate(-32px, 22px) scale(1.8) rotate(-720deg); } }
.yk-cs .cs-trail13 { stroke-dasharray: 100; animation: cs-trail 2.2s cubic-bezier(.3, .6, .4, 1) 1.9s both; }
.yk-cs .cs-ballshadow { animation: cs-fadein .8s ease 3.4s both; }
.yk-cs .cs-doorpeek { animation: cs-doorpeek 1.4s ease-out 3.6s both; }
@keyframes cs-doorpeek { from { transform: translateY(30px); opacity: 0; } }
.yk-cs .cs-flake { animation: cs-flake var(--t, 9s) linear infinite; animation-delay: var(--d, 0s); }
@keyframes cs-flake { to { transform: translate(var(--dx, 0px), 300px); } }
.yk-cs .cs-flag { transform-box: fill-box; transform-origin: 50% 0; animation: cs-flag 2.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-flag { 50% { transform: rotate(7deg); } }
/* «Сюрприз!» */
.yk-cs .cs-dark { animation: cs-lightson .45s ease 2.7s both; }
@keyframes cs-lightson { to { opacity: 0; visibility: hidden; } }
.yk-cs .cs-flash { animation: cs-flash .7s ease-out 2.65s both; pointer-events: none; }
@keyframes cs-flash { 0% { opacity: 0; } 8% { opacity: .8; } 100% { opacity: 0; } }
.yk-cs .cs-doorline { animation: cs-fadein .6s ease .3s both; }
.yk-cs .cs-wedge { transform-origin: 160px 204px; animation: cs-wedge 1s ease 1.1s both; }
@keyframes cs-wedge { from { opacity: 0; transform: scaleX(.2); } }
.yk-cs .cs-darkdoor { animation: cs-doorglow .9s ease 1.1s both; }
@keyframes cs-doorglow { to { opacity: .92; } }
.yk-cs .cs-sil { animation: cs-fadein .8s ease 1.5s both; }
.yk-cs .cs-banner { transform-origin: 160px 34px; animation: cs-banner .9s cubic-bezier(.3, 1.5, .5, 1) 3s both; }
@keyframes cs-banner { from { transform: translateY(-70px) rotate(-8deg); } }
.yk-cs .cs-surprise { animation: cs-surprise .7s cubic-bezier(.3, 1.6, .5, 1) 2.85s both; }
.yk-cs .cs-surprise--2 { animation-delay: 3s; }
.yk-cs .cs-surprise--3 { animation-delay: 3.15s; }
.yk-cs .cs-surprise--4 { animation-delay: 3.3s; }
@keyframes cs-surprise { from { transform: translateY(70px); } }
.yk-cs .cs-arina { animation: cs-hop .5s ease-out 3.2s 4; }
.yk-cs .cs-streamer { stroke-dasharray: 100; animation: cs-streamer 1s ease-out var(--d, 3s) both; }
@keyframes cs-streamer { from { stroke-dashoffset: 100; opacity: 1; } 70% { opacity: 1; } to { stroke-dashoffset: 0; opacity: .85; } }
.yk-cs .cs-bal { animation: cs-bal 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cs-bal { 50% { transform: rotate(3deg) translateY(-3px); } }
.yk-cs .cs-catjump { animation: cs-catjump .7s ease-out 2.95s 2; }
@keyframes cs-catjump { 40% { transform: translateY(-16px) scale(1.04, .96); } }
.yk-cs .cs-confetti { animation: cs-confetti var(--t, 4s) linear var(--d, 3s) infinite both; }
@keyframes cs-confetti { from { transform: translate(0, 0) rotate(0); } to { transform: translate(var(--dx, 0px), 300px) rotate(var(--r, 360deg)); } }
.yk-cs .cs-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: cs-flame .5s ease-in-out infinite alternate; }
@keyframes cs-flame { to { transform: scale(.82, 1.18); } }
.yk-cs .cs-knitcat { animation: cs-pop 2s ease-in-out infinite; }
@keyframes cs-pop { 50% { transform: translateY(-3px); } }
.yk-cs .cs-cattail { transform-box: fill-box; transform-origin: 0 100%; animation: cs-tail 2.6s ease-in-out infinite; }
@keyframes cs-tail { 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) {
  .yk-cs .cs-dark, .yk-cs .cs-sil, .yk-cs .cs-swapout, .yk-cs .cs-flash, .yk-cs .cs-env, .yk-cs .cs-pourline, .yk-cs .cs-photoflash, .yk-cs .cs-flashsky, .yk-cs .cs-envin, .yk-cs .cs-tagold, .yk-cs .cs-bokehs { display: none; }
  .yk-cs .cs-door { transform: scaleX(.12); }
  .yk-cs .cs-ball13 { transform: translate(-32px, 22px) scale(1.8); }
  .yk-cs .cs-trail, .yk-cs .cs-trail13, .yk-cs .cs-streamer { stroke-dashoffset: 0; }
}

/* реплика никогда не уходит за экран: карточка ограничена по высоте, кнопки всегда видны */
/* карточку не прокручиваем — портрет выступает над её краем и обрезался бы; длинный текст и ответы листаются внутри */
.yk-talk__text, .yk-talk__choices { max-height: max(4.6em, calc(50vh - 110px)); max-height: max(4.6em, calc(50dvh - 110px)); overflow-y: auto; overscroll-behavior: contain; }
.yk-talk__choices { max-height: max(7em, calc(50vh - 90px)); max-height: max(7em, calc(50dvh - 90px)); }
.yk-talk__nav { gap: 8px; }
.yk-talk__count { font-size: 12px; font-weight: 700; color: var(--yk-card-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* пролог-катсцены: картинка почти квадратная, крупно на телефоне; подпись и кнопки под ней */
.yk-pro { width: min(560px, 100%, 70vh); gap: 14px; }
.yk-pro__art { aspect-ratio: 8 / 7; }
.yk-pro__art svg { animation: none; }
.yk-pro__cap { min-height: 5.8em; font-size: clamp(16px, 4.3vw, 19px); }
.yk-pro__nav { gap: 8px; }
/* низкие экраны (iPhone SE): длинная подпись чуть мельче и плотнее, чтобы «Дальше» оставалась на экране */
@media (max-height: 620px) {
  .yk-pro { gap: 9px; }
  .yk-pro__cap { min-height: 5.4em; font-size: 15px; line-height: 1.38; }
}
.yk-pro__nav .yk-talk__count { color: #a9a6c4; }
.yk-pro__back { color: #d9d4ea; border-color: rgba(255, 255, 255, .25); }
.yk-pro__veil { transition-duration: 1.2s; }
/* звук — сразу, на стартовом экране и в прологе */
.yk-introsound { display: none; position: fixed; z-index: 96; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
.yk-intro:not([hidden]) ~ .yk-introsound { display: inline-grid; }
.yk-intro.is-meet:not([hidden]) ~ .yk-introsound { display: none; }
/* катсцена во весь экран (финал): поверх поля, под репликами */
.yk-csfull { position: fixed; inset: 0; z-index: 65; background: #0d1020; display: grid; place-items: start center; overflow: hidden; }
.yk-csfull__art { width: min(100%, 760px, 114vh); aspect-ratio: 8 / 7; margin-top: max(0px, env(safe-area-inset-top, 0px)); }
.yk-csfull__art svg { width: 100%; height: 100%; display: block; }
.yk-csfull__skip { position: fixed; z-index: 66; right: 14px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); appearance: none; border: 0; cursor: pointer; background: #f0bc5a; color: #2b1d0c; font: 800 15px var(--yk-body); padding: 11px 20px; border-radius: 999px; animation: cs-fadein .5s ease 4.2s both; }
/* ночная глава — тёплая лампа, а не тёмная синева: поле не кажется тусклым */
#game-root[data-scene="night"] {
  --yk-wall: #2e3858; --yk-wall2: rgba(255, 220, 170, .05); --yk-light: rgba(255, 206, 140, .42);
  --yk-floor: #3a3f60; --yk-ink: #f3efe6; --yk-muted: #c3c6da;
}
#game-root[data-scene="night"] .yk-say, #game-root[data-scene="fair"] .yk-say { background: var(--yk-card); }

/* ===== сборка заказов ================================================================================ */
.yk-order { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; }
.yk-slip {
  display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; align-items: center;
  background: #fbf4e2; color: #3a2f25; border-radius: 12px; padding: 8px 12px 9px 8px;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(200, 160, 90, .35); transform: rotate(-.6deg);
}
.yk-slip__face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; grid-row: span 2; box-shadow: 0 0 0 2px var(--who); }
.yk-slip__face svg { width: 100%; height: 100%; display: block; }
.yk-slip__head b { font: 800 14px var(--yk-body); display: block; }
.yk-slip__head small { font-size: 12px; color: #7a6a58; }
.yk-slip__list { grid-column: 2; list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font: 700 14px var(--yk-body); font-variant-numeric: tabular-nums; }
.yk-slip__list li { display: inline-flex; align-items: center; gap: 5px; }
.yk-slip__list i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.yk-slip__list span { color: #c8434e; font-weight: 800; }
.yk-slip__list li.is-done { opacity: .5; text-decoration: line-through; }
.yk-slip__list li.is-done span { color: #3fa37f; }
.yk-shelfgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); align-content: center; gap: 6px 4px; padding: 6px 8px 10px; border-radius: 14px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(33.33% - 9px), var(--yk-wood) calc(33.33% - 9px), var(--yk-wood-dark) 33.33%);
}
.yk-pickball { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; aspect-ratio: 1; max-height: 86px; justify-self: center; width: min(100%, 86px); transition: transform .15s ease, opacity .3s ease; }
.yk-pickball img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 2px rgba(30, 20, 10, .3)); pointer-events: none; }
.yk-pickball:active { transform: scale(.92); }
.yk-pickball.is-taken { opacity: 0; pointer-events: none; transform: scale(.4); }
.yk-pickball.is-shake { animation: yk-shake .38s ease; }
.yk-pickball.is-hint { animation: yk-hintball 1s ease-in-out 3; }
@keyframes yk-hintball { 50% { transform: scale(1.14); filter: drop-shadow(0 0 10px var(--yk-hint)); } }
.yk-flyball { position: fixed; z-index: 60; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .3)); }
.yk-parcel { position: relative; justify-self: center; width: 120px; height: 70px; }
.yk-parcel__box { position: absolute; inset: 14px 0 0; border-radius: 6px; background: linear-gradient(#d8a76a, #c8955b); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .5); }
.yk-parcel__box::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 12px; margin-left: -6px; background: rgba(232, 211, 166, .85); }
.yk-parcel__flap { position: absolute; left: 4px; right: 4px; top: 0; height: 18px; background: #b98652; border-radius: 4px 4px 0 0; transform-origin: 50% 100%; transform: rotateX(70deg); transition: transform .5s ease; z-index: 2; }
.yk-parcel.is-closed .yk-parcel__flap { transform: translateY(14px) scaleY(.2); background: #c8955b; }
.yk-parcel.is-bump { animation: yk-bump .35s ease-out; }

/* ===== распутать нитки ================================================================================ */
.yk-tangle { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; overflow: visible; }
.yk-thread { fill: none; stroke: #dca762; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .25)); transition: stroke .3s ease; }
.yk-thread.is-bad { stroke: #e0556a; stroke-dasharray: 9 5; animation: yk-badthread .8s linear infinite; }
@keyframes yk-badthread { to { stroke-dashoffset: -14; } }
.yk-tangle.is-solved .yk-thread { stroke: #3fa37f; }
.yk-knot { cursor: grab; filter: drop-shadow(0 4px 3px rgba(30, 20, 10, .35)); }
.yk-knot.is-drag { cursor: grabbing; }
.yk-tangle-meter { display: block; width: 110px; height: 8px; border-radius: 4px; background: var(--yk-line); overflow: hidden; }
.yk-tangle-meter i { display: block; height: 100%; background: #3fa37f; border-radius: 4px; transition: width .3s ease; }

/* ===== финал: подарок, телефон, «поделиться» ===================================================== */
.yk-giftbadge { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 16px; border-radius: 16px; background: linear-gradient(135deg, #f0bc5a, #e8954b); color: #2b1d0c; text-align: left; }
.yk-giftbadge b { font: 800 44px/1 var(--yk-display); letter-spacing: -.02em; }
.yk-giftbadge span { font: 800 18px/1.15 var(--yk-body); display: grid; gap: 3px; }
.yk-giftbadge small { font: 600 13px/1.3 var(--yk-body); opacity: .85; }
.yk-claimbox { width: 100%; display: grid; }
.yk-claim { display: grid; gap: 8px; text-align: left; }
.yk-claim__note { font-size: 13.5px !important; }
.yk-claim__phone { font: 700 18px var(--yk-body); padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--yk-line); background: transparent; color: inherit; width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.yk-claim__phone:focus { outline: none; border-color: var(--yk-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yk-accent) 25%, transparent); }
.yk-claim__ok { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--yk-card-muted); }
.yk-claim__ok input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--yk-accent); }
.yk-claim__ok a { color: inherit; }
.yk-claim__err { margin: 0 !important; color: #c8434e !important; font-weight: 700; font-size: 13.5px; }
.yk-claim .yk-btn { width: 100%; }
.yk-btn--share { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--yk-accent) 14%, var(--yk-card)); color: var(--yk-card-ink); border: 1.5px solid var(--yk-accent); }
.yk-btn--share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.yk-sharepanel { width: 100%; display: grid; gap: 8px; }
.yk-sharepanel img { width: min(240px, 70%); justify-self: center; border-radius: 12px; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.yk-sharelinks { display: flex; justify-content: center; gap: 16px; font-weight: 800; font-size: 14px; }
.yk-sharelinks a { color: var(--yk-accent); }
/* полка заказов вписывается в поле по высоте: три ряда поровну, клубок — по высоте ряда */
.yk-order { grid-template-rows: auto minmax(0, 1fr) auto; }
.yk-shelfgrid { min-height: 0; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.yk-pickball { height: 100%; width: auto; max-width: 100%; min-height: 0; }
.yk-parcel { width: 104px; height: 58px; }
@media (max-height: 760px) { .yk-slip { padding: 6px 10px 7px 6px; } .yk-slip__list { font-size: 13px; } .yk-slip__face { width: 34px; height: 34px; } .yk-slip { grid-template-columns: 34px 1fr; } }
#game-root[data-mode="untangle"] .yk-scene__deco, #game-root[data-mode="order"] .yk-scene__deco { opacity: .18; }

/* финальная карточка: крестик и выход внизу всегда на виду, даже когда карточка длинная и прокручивается */
.yk-reward__x {
  position: sticky; top: -8px; z-index: 2; justify-self: end; margin: -10px -8px -44px 0;
  appearance: none; cursor: pointer; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--yk-line); background: var(--yk-card); color: var(--yk-card-muted);
  font: 400 26px/1 var(--yk-body); padding: 0 0 3px; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .45);
}
.yk-reward__exit {
  position: sticky; bottom: -20px; z-index: 2; justify-self: stretch; display: flex; gap: 8px;
  margin: 2px -18px -20px; padding: 10px 18px 16px; background: var(--yk-card); border-top: 1px solid var(--yk-line);
}
.yk-reward__exit .yk-btn { flex: 1 1 0; font-size: 14.5px; padding: 13px 10px; }

/* меню: катсцены истории — по годам, кнопкой пересмотреть */
.yk-scenes h3 { margin: 0 0 4px; }
.yk-scenes__group { display: grid; gap: 6px; margin-top: 6px; }
.yk-scenes__label { font: 800 11px var(--yk-body); letter-spacing: .06em; text-transform: uppercase; color: var(--yk-card-muted); }
.yk-replay:disabled { cursor: default; opacity: .5; background: transparent; }
.yk-scenes__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.yk-replay {
  appearance: none; cursor: pointer; text-align: left; display: grid; gap: 2px; padding: 9px 11px; border-radius: 12px;
  border: 1px solid var(--yk-line); background: color-mix(in srgb, var(--yk-accent) 6%, var(--yk-card)); color: var(--yk-card-ink); font: 600 13.5px/1.25 var(--yk-body);
}
.yk-replay b { font: 800 11.5px var(--yk-body); color: var(--yk-accent); letter-spacing: .02em; }
@media (hover: hover) { .yk-replay:hover { background: color-mix(in srgb, var(--yk-accent) 14%, var(--yk-card)); } }
.yk-cs--sFamily .cs-yeartitle { animation: cs-yeartitle 4.2s cubic-bezier(.6, 0, .3, 1) .2s both, cs-hide .8s ease 8.5s forwards; }
.yk-restart {
  appearance: none; cursor: pointer; justify-self: start; border: 1px solid var(--yk-line); background: transparent; color: var(--yk-card-ink);
  font: 700 13.5px var(--yk-body); padding: 8px 14px; border-radius: 999px; margin: -2px 0 2px;
}
@media (hover: hover) { .yk-restart:hover { background: var(--yk-ghost); } }
/* под заголовком меню: «Начать заново» и переключатель анимаций сцен */
.yk-menu-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 2px; }
.yk-menu-opts .yk-restart { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.yk-restart .yk-ico { width: 16px; height: 16px; flex: none; }
.yk-restart[data-lite][aria-pressed="true"] { border-color: color-mix(in srgb, var(--yk-accent) 45%, var(--yk-line)); }
.yk-confirm { text-align: center; }
.yk-cs--sParty .cs-bokehs { animation: cs-fadein 1.2s ease 2.9s both; }

/* пауза листания катсцены: плашка в углу картинки */
.yk-pro__art, .yk-csfull__art { position: relative; }
.yk-pro__pause {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; pointer-events: none;
  background: rgba(20, 14, 30, .62); color: #fff4dc; font: 700 12.5px var(--yk-body); padding: 6px 11px; border-radius: 999px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: cs-fadein .25s ease both;
}
.yk-pro__pause[hidden] { display: none; }
.yk-pro__art, .yk-pro__cap, .yk-csfull__art { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }

/* катсцены перед главами */
.yk-cs .cs-camC1 { animation: cs-camC1 12s ease-in-out both; }
@keyframes cs-camC1 { 0%, 18% { transform: scale(2.1); } 46% { transform: none; } 100% { transform: scale(1.04) translateX(-4px); } }
.yk-cs .cs-camC2 { animation: cs-camC2 12s ease-in-out both; }
@keyframes cs-camC2 { 0% { transform: translateX(10px); } 30% { transform: none; } 60%, 100% { transform: scale(1.18); } }
.yk-cs .cs-camC3 { animation: cs-camC3 12s ease-in-out .4s both; }
@keyframes cs-camC3 { from { transform: translateX(6px) scale(1.06); } to { transform: translateX(-30px) scale(1.06); } }
.yk-cs .cs-camC4 { animation: cs-camC4 12s ease-in-out both; }
@keyframes cs-camC4 { 0% { transform: scale(1.5) translateY(-14px); } 40% { transform: none; } 100% { transform: scale(1.05); } }
.yk-cs .cs-sunup { animation: cs-sunup 4.6s ease-out .3s both; }
@keyframes cs-sunup { from { transform: translateY(26px); opacity: .5; } }
.yk-cs .cs-load { transform: scaleX(0); animation: cs-load 3s ease-in-out 1.6s both; }
@keyframes cs-load { to { transform: scaleX(1); } }
.yk-cs .cs-leave { animation: cs-leave 1.4s ease-in 1.2s both; }
@keyframes cs-leave { to { transform: translateX(14px); opacity: 0; } }
.yk-cs .cs-carlight { animation: cs-carlight 4.6s linear 1s infinite both; }
@keyframes cs-carlight { from { transform: translateX(-20px); } to { transform: translateX(130px); } }
.yk-cs .cs-balloon { transform-box: fill-box; animation: cs-balloon 2.6s cubic-bezier(.2, .8, .3, 1) var(--d, 1s) both; }
@keyframes cs-balloon { from { transform: translateY(90px); opacity: 0; } 30% { opacity: 1; } }
.yk-cs .cs-dim { opacity: 0; animation: cs-dim 1.2s ease-in 8.8s both; }
@keyframes cs-dim { to { opacity: .62; } }
.yk-cs .cs-dimglow { opacity: 0; animation: cs-dim2 1.2s ease-in 8.8s both; }
@keyframes cs-dim2 { to { opacity: 1; } }

.yk-pro__timer { display: block; height: 3px; margin: -9px 18px -8px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.yk-pro__timer i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0bc5a, #ffd98a); }

/* под мостиком в магазин: прогресс сохранён — можно уйти и вернуться */
.yk-saved { margin: 4px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--yk-card-muted); text-align: center; }
.yk-saved i { font-style: normal; color: var(--yk-accent); font-weight: 800; }

/* анонс новогодней главы */
.yk-nextch { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #1f2a4a, #2c3a66); color: #f4efe6; text-align: left; }
.yk-nextch__art svg { width: 96px; height: auto; display: block; border-radius: 10px; }
.yk-nextch small { display: block; font: 700 11.5px var(--yk-body); letter-spacing: .06em; text-transform: uppercase; color: #ffd66b; }
.yk-nextch strong { display: block; font: 700 18px var(--yk-display); margin: 2px 0 4px; }
.yk-nextch p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #d9d4ea; }

/* отзыв об игре */
.yk-fb { display: grid; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--yk-line); background: color-mix(in srgb, var(--yk-card) 92%, var(--yk-accent)); text-align: left; }
.yk-fb > strong { font: 700 18px var(--yk-display); }
.yk-fb__note { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--yk-card-muted); }
.yk-fb__rate { display: flex; justify-content: space-between; gap: 6px; }
.yk-fb__rate button { flex: 1; min-height: 44px; font-size: 24px; line-height: 1; border-radius: 12px; border: 1px solid var(--yk-line); background: var(--yk-card); cursor: pointer; filter: grayscale(.7); opacity: .75; transition: transform .15s, filter .15s, opacity .15s; }
.yk-fb__rate button.is-on { filter: none; opacity: 1; transform: scale(1.08); border-color: var(--yk-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--yk-accent) 35%, transparent); }
.yk-fb label { display: grid; gap: 4px; font: 600 13.5px var(--yk-body); }
.yk-fb textarea { font: 400 15px/1.4 var(--yk-body); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--yk-line); background: var(--yk-card); color: inherit; resize: vertical; min-height: 54px; }
.yk-fb textarea:focus-visible, .yk-fb__rate button:focus-visible { outline: 2px solid var(--yk-accent); outline-offset: 1px; }
.yk-fb__err { margin: 0; color: #c8434e; font-size: 13px; }
.yk-fb__err[hidden] { display: none; }
.yk-fb.is-sent { text-align: center; }
.yk-fb.is-sent p { margin: 0; color: var(--yk-card-muted); font-size: 14px; }
.yk-replay--soon { opacity: .7; border-style: dashed; }

/* Облегчённый режим для слабых телефонов (yk-lite на #game-root: мало ядер/памяти, экономия трафика
   или катсцена сама увидела, что кадры не успевают). Сюжетные движения — камера, ходьба, руки, появления —
   остаются; замирают фоновые «дыхание», блики, пылинки, моргание и свечение — их перерисовка дороже всего. */
.yk-lite .yk-cs .cs-breathe, .yk-lite .yk-cs .cs-head, .yk-lite .yk-cs .cs-blink, .yk-lite .yk-cs .cs-ears,
.yk-lite .yk-cs .cs-twinkle, .yk-lite .yk-cs .cs-bulb, .yk-lite .yk-cs .cs-winlit, .yk-lite .yk-cs .cs-glint,
.yk-lite .yk-cs .cs-glowp, .yk-lite .yk-cs .cs-lamp, .yk-lite .yk-cs .cs-beam, .yk-lite .yk-cs .cs-beamW, .yk-lite .yk-cs .cs-screenglow,
.yk-lite .yk-cs .cs-shimmer, .yk-lite .yk-cs .cs-wisp, .yk-lite .yk-cs .cs-wisp--late, .yk-lite .yk-cs .cs-steam, .yk-lite .yk-cs .cs-smoke,
.yk-lite .yk-cs .cs-drift, .yk-lite .yk-cs .cs-spin, .yk-lite .yk-cs .cs-sway, .yk-lite .yk-cs .cs-awning, .yk-lite .yk-cs .cs-waves,
.yk-lite .yk-cs .cs-wobble, .yk-lite .yk-cs .cs-gulls, .yk-lite .yk-cs .cs-birds, .yk-lite .yk-cs .cs-flap { animation: none !important; }
.yk-lite .yk-cs .cs-bokehs, .yk-lite .yk-cs .cs-bokeh, .yk-lite .yk-cs .cs-mote { display: none !important; }
/* камера: наезды замирают на общем плане; проезды (там, где без них часть кадра не видна) остаются */
.yk-lite .yk-pro__art svg, .yk-lite .yk-start__art svg, .yk-lite .yk-cs .cs-cam:not(.cs-cam3):not(.cs-cam4):not(.cs-cam24):not(.cs-camC3) { animation: none !important; }
.yk-pro__art, .yk-csfull__art, .yk-start__art { contain: layout paint; }

/* звук: значок показывает состояние; пока его ни разу не включали — кнопка пульсирует и подписана */
.yk-icon[aria-pressed="true"] .yk-snd-off, .yk-icon[aria-pressed="false"] .yk-snd-on { display: none; }
.yk-icon.is-nudge { border-color: #f0bc5a; animation: yk-nudge 1.8s ease-out infinite; }
.yk-icon.is-nudge:not(.yk-introsound) { position: relative; }
@keyframes yk-nudge {
  0% { box-shadow: 0 0 0 0 rgba(240, 188, 90, .75), 0 6px 14px -8px var(--yk-shadow); }
  70% { box-shadow: 0 0 0 12px rgba(240, 188, 90, 0), 0 6px 14px -8px var(--yk-shadow); }
  100% { box-shadow: 0 0 0 0 rgba(240, 188, 90, 0), 0 6px 14px -8px var(--yk-shadow); }
}
/* подпись — только на стартовом экране; в шапке игры она закрыла бы название работы, там кнопка просто пульсирует */
.yk-introsound.is-nudge::after {
  content: attr(data-nudge); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; pointer-events: none; padding: 7px 12px; border-radius: 999px;
  background: #f0bc5a; color: #2b1d0c; font: 700 13px var(--yk-body); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55);
  animation: yk-nudge-tip 9s ease both;
}
@keyframes yk-nudge-tip { 0% { opacity: 0; transform: translate(8px, -50%); } 6%, 85% { opacity: 1; transform: translate(0, -50%); } 100% { opacity: 0; transform: translate(0, -50%); } }
@media (prefers-reduced-motion: reduce) {
  .yk-icon.is-nudge { animation: none; box-shadow: 0 0 0 3px rgba(240, 188, 90, .7); }
  .yk-introsound.is-nudge::after { animation: none; }
}

/* значки Lucide: родная обводка 2 px, ровные размеры — без размытия */
.yk-ico { display: block; flex: none; }
.yk-icon svg, .yk-tool svg { stroke-width: 2; }
.yk-icon svg.yk-ico { width: 20px; height: 20px; }
/* залитый значок: контур той же краски — подушечки лапы не распадаются на точки */
.yk-ico--fill { fill: currentColor; stroke: currentColor; }
.yk-say__face:has(.yk-ico--face) { display: grid; place-items: center; background: color-mix(in srgb, var(--yk-accent) 12%, var(--yk-card)); }
.yk-say__face .yk-ico--face { width: 58%; height: 58%; color: var(--yk-accent); }
.yk-talk__back { display: inline-grid; place-items: center; padding: 0; }
.yk-talk__back svg { width: 18px; height: 18px; }
.yk-talk__back--choice { display: inline-flex; align-items: center; gap: 2px; }
.yk-talk__back--choice svg { width: 16px; height: 16px; }
.yk-reward__x { display: inline-grid; place-items: center; }
.yk-reward__x svg { width: 20px; height: 20px; }
.yk-saved .yk-ico { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; color: var(--yk-accent); }
.yk-say__face .yk-ico--face { fill: none; stroke: currentColor; }
