:root {
  --cream: #FFF4E4;
  --cream2: #F6E2C4;
  --ink: #3B2618;
  --orange: #FF8A3D;
  --mint: #6CCFA8;
  --sun: #FFC94A;
  --berry: #FF7FA0;
  --sky: #8FD3FF;
  --night: #8A84E8;
  --red: #FF5F5F;
  --bar-h: 92px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream2);
  background-image: radial-gradient(#EED2AC 2px, transparent 2.5px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: Rubik, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }

.ic { display: inline-flex; }
.ic svg { display: block; }

/* ---------- каркас ---------- */
#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}
@media (min-width: 620px) and (min-height: 640px) {
  body { display: grid; place-items: center; }
  #app {
    width: 430px;
    height: min(calc(100dvh - 40px), 880px);
    border: 6px solid var(--ink);
    border-radius: 40px;
    box-shadow: 0 10px 0 var(--ink);
  }
}

#stage { position: relative; flex: 1; min-height: 0; }
#room { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#room .tappable { cursor: pointer; }
#heroPos { cursor: grab; }

/* ---------- верхняя панель ---------- */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 0;
  pointer-events: none;
}
#hud > * > * { pointer-events: auto; }
.stats { display: flex; align-items: center; gap: 8px; }
.stat {
  --v: 50; --c: var(--orange);
  position: relative;
  width: 50px; height: 50px; border-radius: 50%;
  border: 3px solid var(--ink);
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #fff 0);
  display: grid; place-items: center;
  transition: --v .3s;
}
.stat::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.stat .ic { position: relative; z-index: 1; }
#st-food { --c: var(--orange); }
#st-clean { --c: var(--sky); }
#st-mood { --c: var(--berry); }
#st-energy { --c: var(--sun); }
.stat.low { --c: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

.coins {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  background: var(--sun);
  border: 3px solid var(--ink); border-radius: 22px;
  padding: 5px 12px 5px 6px;
  font-weight: 800; font-size: 17px;
  box-shadow: 0 3px 0 var(--ink);
}
.coins.bump { animation: bump .3s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

.namebar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.nametag {
  background: #fff; border: 3px solid var(--ink); border-radius: 18px;
  padding: 5px 12px 7px; min-width: 150px;
}
.nametag__row { display: flex; align-items: baseline; gap: 8px; }
.nametag__row b { font-size: 16px; font-weight: 800; }
.nametag__row span { font-size: 12px; font-weight: 500; opacity: .6; }
.grow { height: 6px; border-radius: 3px; background: #F1E3CF; margin-top: 4px; overflow: hidden; }
.grow i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 3px; transition: width .5s; }

.iconbtn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--ink); background: #fff;
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 3px 0 var(--ink);
}
.iconbtn:active { transform: translateY(3px); box-shadow: none; }
#btnSettings { margin-left: auto; }

/* ---------- нижняя панель ---------- */
#bar {
  flex: none;
  height: var(--bar-h);
  padding: 0 4px;
  background: #fff;
  border-top: 4px solid var(--ink);
  display: flex; justify-content: space-around; align-items: center;
  position: relative; z-index: 5;
}
.act {
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  width: 64px;
}
.act i {
  position: relative;
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--bg);
  display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.act:active i { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.act.active i { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); filter: brightness(.92); }
.act--locked i > .ic { opacity: .45; }
.act .lock { position: absolute; right: -6px; bottom: -4px; }

/* ---------- холодильник ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #fff;
  border-top: 4px solid var(--ink);
  border-radius: 28px 28px 0 0;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.3, 1.3, .5, 1);
  box-shadow: 0 -8px 0 rgba(59, 38, 24, .12);
}
.sheet.open { transform: translateY(0); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet__head b { font-size: 20px; font-weight: 800; }
.foods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.food {
  border: 3px solid var(--ink); border-radius: 20px; background: var(--cream);
  padding: 8px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 4px 0 var(--ink);
}
.food:active { transform: translateY(4px); box-shadow: none; }
.food b { font-size: 14px; }
.food small { font-size: 11px; opacity: .65; min-height: 14px; }
.food .price { display: flex; align-items: center; gap: 3px; font-weight: 800; font-size: 14px; }
.food.cant { opacity: .45; }

/* ---------- всплывашки ---------- */
#toasts {
  position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 128px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; z-index: 6;
}
.toast {
  background: #fff; border: 3px solid var(--ink); border-radius: 18px;
  padding: 9px 16px; font-weight: 700; font-size: 15px; text-align: center;
  box-shadow: 0 4px 0 var(--ink);
  animation: toastIn .3s cubic-bezier(.3, 1.5, .5, 1);
  max-width: min(100%, 330px); pointer-events: auto; cursor: pointer;
}
@keyframes toastIn { from { transform: translateY(-14px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }

.gamehud {
  position: absolute; top: calc(env(safe-area-inset-top) + 124px); left: 50%; transform: translateX(-50%);
  background: var(--berry); color: #fff; border: 3px solid var(--ink); border-radius: 20px;
  padding: 6px 16px; font-weight: 800; font-size: 18px; white-space: nowrap;
  box-shadow: 0 4px 0 var(--ink); z-index: 6;
  text-shadow: 0 2px 0 var(--ink);
}
.hidden { display: none !important; }

/* ---------- мини-игры ---------- */
.mg { position: absolute; inset: 0; z-index: 15; background: var(--cream); }
.mg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.mg__hud { top: calc(env(safe-area-inset-top) + 14px); background: var(--orange); }
.mg__close { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 12px; z-index: 2; }

.games { grid-template-columns: repeat(2, 1fr); }
.game-card { padding: 10px 6px 10px; gap: 4px; }
.game-card .game-art { width: 64px; height: 64px; display: grid; place-items: center; }
.game-card .game-art svg { overflow: visible; }
.game-card b { font-size: 15px; }
.game-card small { min-height: 28px; }

.fartCloud { animation: fartCloud 2.6s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fartCloud {
  0% { transform: translate(0, 0) scale(.25); opacity: 0; }
  12% { transform: translate(0, 0) scale(1); opacity: .95; }
  100% { transform: translate(var(--dx, 20px), -70px) scale(1.7); opacity: 0; }
}

/* ---------- модальные окна ---------- */
.modal {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(59, 38, 24, .45);
  display: grid; place-items: center; padding: 16px;
}
.modal__card {
  width: 100%; max-width: 340px;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 30px;
  padding: 20px 18px 18px; text-align: center;
  box-shadow: 0 8px 0 var(--ink);
  animation: toastIn .35s cubic-bezier(.3, 1.5, .5, 1);
}
.modal__card h2 { margin: 4px 0 6px; font-size: 24px; font-weight: 800; }
.modal__card p { margin: 0 0 14px; font-size: 15px; line-height: 1.4; opacity: .8; }
.modal__card .pet { width: 150px; height: 150px; overflow: visible; }
.field {
  width: 100%; font: inherit; font-size: 18px; font-weight: 700; text-align: center;
  border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; margin-bottom: 12px;
  background: #fff; color: var(--ink); outline: none; user-select: text; -webkit-user-select: text;
}
.field:focus { border-color: var(--orange); }
.btn {
  display: block; width: 100%;
  border: 3px solid var(--ink); border-radius: 18px;
  background: var(--orange); color: #fff;
  font-weight: 800; font-size: 18px; padding: 12px;
  box-shadow: 0 5px 0 var(--ink);
  text-shadow: 0 2px 0 rgba(59, 38, 24, .5);
  margin-top: 10px;
}
.btn:active { transform: translateY(5px); box-shadow: none; }
.btn--ghost { background: #fff; color: var(--ink); text-shadow: none; }
.btn--danger { background: var(--red); }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }
.small-note { font-size: 12px; opacity: .55; margin-top: 12px; }

/* ---------- анимации SVG ---------- */
#heroAct, #heroIdle, #bin { transform-box: fill-box; transform-origin: 50% 100%; }
.bob { animation: bob 1.7s ease-in-out infinite; }
.bob.slow { animation-duration: 3.2s; }
@keyframes bob { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.05, .94); } }
.squash { animation: squash .5s ease; }
@keyframes squash { 0% { transform: scale(1, 1); } 25% { transform: scale(1.25, .75); } 55% { transform: scale(.9, 1.15) translateY(-10px); } 100% { transform: scale(1, 1); } }
.squish { animation: squish .35s ease; }
@keyframes squish { 40% { transform: scale(1.12, .88); } }
.wiggle { animation: wiggle .25s ease-in-out infinite; }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg); } }

.blink { animation: blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.chew { animation: chew .18s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes chew { to { transform: scaleY(.3); } }
.snore { animation: snore 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes snore { 50% { transform: scale(1.4); } }
.zzz { animation: zzz 2.2s ease-in-out infinite; }
@keyframes zzz { 0% { transform: translate(0, 6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(10px, -14px); opacity: 0; } }
.tear { animation: tear 1.6s ease-in infinite; }
@keyframes tear { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
.wing { animation: wing .08s infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes wing { to { transform: scaleY(.4); } }
.twinkle { animation: twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; } }
.cloud { animation: cloud 18s linear infinite alternate; }
@keyframes cloud { to { transform: translateX(46px); } }

.popIn { animation: popIn .45s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes popIn { from { transform: scale(.1, .1); } }

.floatUp { animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { transform: translateY(-6px) scale(1.1); opacity: 1; } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }
.rise { animation: rise 1.4s ease-out forwards; }
@keyframes rise { 0% { transform: translateY(0) scale(.3); opacity: 0; } 20% { opacity: 1; transform: translateY(-8px) scale(1); } 100% { transform: translateY(-70px) scale(1.1); opacity: 0; } }
.crumb { animation: crumb .7s ease-in forwards; }
@keyframes crumb { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(var(--dx), 40px); opacity: 0; } }
.sparkle { animation: sparkle .9s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes sparkle { 0% { transform: scale(0) rotate(0); } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } 100% { transform: scale(0) rotate(90deg); opacity: 0; } }

#bubbleIn { animation: bubbleIn .3s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes bubbleIn { from { transform: scale(.2); } }
#dark { transition: opacity 1.2s ease; }
#lampGlow { transition: opacity 1s ease; }

@media (prefers-reduced-motion: reduce) {
  .bob, .cloud, .twinkle { animation: none; }
}

/* ---------- магазин ---------- */
#btnSettings { margin-left: 0; }
.iconbtn--shop { margin-left: auto; background: var(--berry); }
.shop {
  position: absolute; inset: 0; z-index: 12;
  background: var(--cream);
  display: flex; flex-direction: column;
  animation: toastIn .25s ease;
}
.shop__head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 8px;
}
.shop__head > b { font-size: 24px; font-weight: 800; }
.coins--static { margin-left: auto; cursor: default; }
.shop__preview {
  flex: none; height: 170px; margin: 0 12px;
  border: 4px solid var(--ink); border-radius: 26px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #fff 0, #FFF4E4 70%);
  display: grid; place-items: center;
}
.shop__pet { height: 160px; width: 160px; overflow: visible; }
.shop__room { width: 100%; height: 100%; display: block; background: #F6E2C4; }
.shop__tabs { display: flex; gap: 6px; padding: 10px 12px 6px; }
.shop__tabs button {
  flex: 1; border: 3px solid var(--ink); border-radius: 16px; background: #fff;
  font-weight: 800; font-size: 15px; padding: 8px 4px;
  box-shadow: 0 3px 0 var(--ink);
}
.shop__tabs button.active { background: var(--sun); transform: translateY(3px); box-shadow: none; }
.shop__grid {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: start;
  padding: 6px 12px 12px;
}
.shop__group { grid-column: 1 / -1; font-weight: 800; font-size: 14px; opacity: .65; margin: 6px 2px -2px; }
.item {
  border: 3px solid var(--ink); border-radius: 18px; background: #fff;
  padding: 6px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 3px 0 var(--ink); min-width: 0;
}
.item b { font-size: 12px; line-height: 1.15; text-align: center; min-height: 28px; display: flex; align-items: center; }
.item__art { height: 62px; display: grid; place-items: center; }
.item__art svg { overflow: visible; }
.item .price { display: flex; align-items: center; gap: 3px; font-weight: 800; font-size: 13px; }
.item .tag { font-size: 11px; font-weight: 700; opacity: .55; }
.item .tag--on { opacity: 1; color: #2E9E73; }
.item.on { background: #E5F8EF; }
.item.sel { border-color: var(--orange); box-shadow: 0 3px 0 var(--orange); background: #FFF1E2; }
.item.cant .price { opacity: .5; }
.shop__bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--ink); background: #fff;
}
.shop__sel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop__sel b { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop__sel small { font-size: 12px; opacity: .6; }
.shop__act { width: auto; margin: 0; padding: 10px 16px; font-size: 16px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.shop__act:disabled { opacity: .7; }

/* ---------- энергия за рекламу ---------- */
#st-energy { cursor: pointer; }
#st-energy::before {
  content: "+"; position: absolute; right: -5px; bottom: -5px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sun); border: 2.5px solid var(--ink);
  font-weight: 800; font-size: 15px; line-height: 15px; text-align: center;
}
.btn--energy { background: var(--sun); color: var(--ink); text-shadow: none; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: .6; transform: none; }

.adstub {
  --p: 0;
  position: absolute; inset: 0; z-index: 30;
  background: #1D1B33; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; text-align: center;
}
.adstub__tag { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 14px; background: #fff3; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.adstub__ring {
  width: 110px; height: 110px; border-radius: 50%;
  background: conic-gradient(var(--sun) calc(var(--p) * 360deg), #ffffff22 0);
  display: grid; place-items: center; transition: background .3s;
}
.adstub__ring b { width: 88px; height: 88px; border-radius: 50%; background: #1D1B33; display: grid; place-items: center; font-size: 40px; font-weight: 800; }
.adstub p { margin: 0; font-size: 17px; line-height: 1.4; }
.adstub small { opacity: .6; font-size: 13px; }
.adstub__close { width: auto; padding: 10px 22px; }

/* ---------- места: стрелки, переход ---------- */
.navbtn {
  position: absolute; bottom: 8px; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 0;
}
.navbtn--l { left: 6px; }
.navbtn--r { right: 6px; }
.navbtn__ic {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  display: grid; place-items: center; opacity: .92;
}
.navbtn:active .navbtn__ic { transform: translateY(3px); box-shadow: none; }
.navbtn small {
  font-size: 11px; font-weight: 800; color: var(--ink);
  background: #ffffffcc; border-radius: 8px; padding: 1px 6px;
}
.navbadge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: #8C7A5B; color: #fff; border: 2.5px solid var(--ink);
  font-style: normal; font-size: 12px; font-weight: 800; line-height: 15px; text-align: center;
}
.fade { position: absolute; inset: 0; background: var(--cream); opacity: 0; pointer-events: none; transition: opacity .26s ease; z-index: 5; }
.fade.on { opacity: 1; }

/* ---------- анимации мест ---------- */
.bfly .wingL, .bfly .wingR { animation: flapL .16s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 100% 50%; }
.bfly .wingR { transform-origin: 0% 50%; }
@keyframes flapL { to { transform: scaleX(.25); } }
.wag { animation: wag .22s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0% 100%; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
.dogBody { animation: dogBob .5s ease-in-out infinite; }
@keyframes dogBob { 50% { transform: translateY(-2px); } }
.tongue { animation: pant .3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes pant { to { transform: scaleY(1.4); } }
.duck { transform-box: fill-box; transform-origin: 50% 100%; }
.duck.squeeze { animation: squeeze .35s ease; }
@keyframes squeeze { 30% { transform: scale(1.25, .7); } 60% { transform: scale(.9, 1.15); } }
.foamIn { animation: popIn .4s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: 50% 100%; }
.tvHop { animation: tvHop .6s ease-in-out infinite; }
@keyframes tvHop { 50% { transform: translateY(-10px); } }
.tvBall { animation: tvBall 1.2s ease-in-out infinite; }
@keyframes tvBall { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-20px, -14px); } }
.tvSun { animation: tvSun 2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes tvSun { to { transform: scale(1.25); } }
.blinkCursor { animation: twinkle 1s steps(1) infinite; }

/* ---------- рекламный баннер внизу ---------- */
.adbanner {
  flex: none;
  height: calc(58px + env(safe-area-inset-bottom));
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  background: #F1E3CF;
  border-top: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.adbanner.off { display: none; }
.adbanner__stub {
  width: 320px; max-width: 100%; height: 50px;
  border: 2px dashed #C9B394; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: #9C8466;
}
.adbanner__stub b { font-size: 11px; background: #C9B394; color: #fff; padding: 2px 6px; border-radius: 6px; }

/* ---------- кухня и шкаф ---------- */
#panFood { transform-box: fill-box; transform-origin: 50% 100%; }
#panFood.flip { animation: flip .5s ease; }
@keyframes flip { 0% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-18px) scaleY(-1); } 100% { transform: translateY(0) scaleY(1); } }
.shop__empty { grid-column: 1 / -1; text-align: center; padding: 30px 10px; font-weight: 700; opacity: .6; line-height: 1.5; }

/* ---------- холодильник открывается ---------- */
.fridge .doorFront, .fridge .doorInner { transform-box: fill-box; transform-origin: 100% 50%; }
.fridge .doorFront { transition: transform .16s ease-out .18s; }
.fridge .doorInner { transform: scaleX(0); transition: transform .18s ease-in; }
.fridge.open .doorFront { transform: scaleX(0); transition: transform .16s ease-in; }
.fridge.open .doorInner { transform: scaleX(-.44); transition: transform .24s cubic-bezier(.3, 1.5, .5, 1) .16s; }
.fridgeLight { opacity: 0; transition: opacity .2s; }
/* холодильник-картинки: закрытый ↔ открытый */
.fridge .frC, .fridge .frO { transition: opacity .14s ease; }
.fridge .frO { opacity: 0; }
.fridge.open .frC { opacity: 0; }
.fridge.open .frO { opacity: 1; }
.fridge.open .fridgeLight { opacity: 1; }

/* ---------- трэш-механика ---------- */
.alert {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 124px); transform: translateX(-50%);
  z-index: 7; white-space: nowrap;
  background: #FF5F5F; color: #fff; border: 3px solid var(--ink); border-radius: 18px;
  padding: 8px 14px; font-weight: 800; font-size: 16px; text-shadow: 0 2px 0 var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  animation: alertPulse .5s ease-in-out infinite alternate;
  cursor: pointer;
}
@keyframes alertPulse { to { transform: translateX(-50%) scale(1.07); background: #FF3D5E; } }
#stage.quake { animation: quake .6s ease; }
@keyframes quake {
  10%, 50%, 90% { transform: translate(-7px, 4px) rotate(-1deg); }
  30%, 70% { transform: translate(7px, -4px) rotate(1deg); }
}
.slip { animation: slip .9s ease; }
@keyframes slip {
  0% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-40px) rotate(-200deg); }
  60% { transform: translateY(0) rotate(-360deg) scale(1.15, .8); }
  100% { transform: translateY(0) rotate(-360deg); }
}
.lakeWave { animation: lakeWave 2.6s ease-in-out infinite alternate; }
@keyframes lakeWave { to { transform: translateX(-20px); } }
.blub { animation: blub 1.8s ease-in infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blub { 0% { transform: translateY(0) scale(.4); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(-14px) scale(1); opacity: 1; } 100% { transform: translateY(-18px) scale(1.4); opacity: 0; } }
#lake .lakeStink { opacity: 0; transition: opacity .6s; }
#lake.stinky .lakeStink { opacity: 1; }
.stinkRise { animation: stinkRise 1.6s ease-in-out infinite alternate; }
@keyframes stinkRise { from { transform: translateY(2px); opacity: .55; } to { transform: translateY(-6px); opacity: 1; } }
.bagSwing { animation: bagSwing 1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes bagSwing { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.hintBounce { animation: hintBounce .6s ease-in-out infinite alternate; }
@keyframes hintBounce { to { transform: translateY(-10px); } }

/* ---------- кляксы и поломки ---------- */
.splatIn { animation: splatIn .35s cubic-bezier(.3, 1.7, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes splatIn { from { transform: scale(.1); } }
.drip { animation: drip 2.4s ease-in forwards; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.smash { animation: splatIn .3s cubic-bezier(.3, 1.8, .5, 1); transform-box: fill-box; transform-origin: center; }
.hammerSwing { animation: hammerSwing .3s ease-in-out 3; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes hammerSwing { 0%, 100% { transform: rotate(10deg); } 50% { transform: rotate(-55deg); } }
.smoke .rise { animation-duration: 1.6s; }

/* ---------- дебошир: хотелки, плевки, газ, пакет у игрока ---------- */
.thinkIn { animation: popIn .4s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: 0% 100%; }
#think > g { animation: thinkFloat 1.6s ease-in-out infinite alternate; }
@keyframes thinkFloat { to { transform: translateY(-4px); } }
.navbtn.want .navbtn__ic { background: var(--sun); animation: wantPulse .7s ease-in-out infinite alternate; }
.navbtn.want small { background: var(--sun); }
.act.want i { animation: wantPulse .7s ease-in-out infinite alternate; }
@keyframes wantPulse { from { transform: scale(1); box-shadow: 0 3px 0 var(--ink), 0 0 0 0 #FFC94A; } to { transform: scale(1.12); box-shadow: 0 3px 0 var(--ink), 0 0 0 8px #FFC94A88; } }

.screenfx { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.spit {
  position: absolute; pointer-events: auto; cursor: pointer;
  border-radius: 48% 52% 55% 45%;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 12%, rgba(205,236,255,.75) 30%, rgba(160,210,245,.5) 62%, rgba(160,210,245,.25) 100%);
  border: 2px solid rgba(110,160,200,.55);
  animation: spitHit .22s cubic-bezier(.3, 1.8, .5, 1), spitSlide 5s ease-in forwards;
}
.spit::after {
  content: ""; position: absolute; left: 42%; top: 82%; width: 22%; height: 70%;
  border-radius: 0 0 50% 50%;
  background: rgba(180,220,250,.55); border: 2px solid rgba(110,160,200,.4); border-top: 0;
}
@keyframes spitHit { from { transform: scale(2.4); opacity: 0; } }
@keyframes spitSlide { 0%, 30% { translate: 0 0; opacity: 1; } 100% { translate: 0 60px; opacity: 0; } }
.haze {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 70%, rgba(150,200,60,.55), rgba(120,170,40,.35) 60%, rgba(120,170,40,.15));
  display: grid; place-items: center;
  animation: haze 2.8s ease forwards;
}
.haze b { font-size: 46px; font-weight: 800; color: #CFE58A; -webkit-text-stroke: 3px var(--ink); transform: rotate(-8deg); animation: bump .5s ease 2; }
@keyframes haze { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

.bagchip {
  width: 46px; height: 46px; border-radius: 50%; padding: 0;
  border: 3px solid var(--ink); background: #FFE2A8; box-shadow: 0 3px 0 var(--ink);
  display: grid; place-items: center; margin-left: auto;
  animation: wantPulse .9s ease-in-out infinite alternate;
}
.bagchip:not(.hidden) + .iconbtn--shop { margin-left: 0; }
.bagchip.bump { animation: bump .3s ease; }
.tongueWag { animation: tongueWag .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes tongueWag { to { transform: rotate(8deg) scaleY(1.1); } }
.spitFly { animation: spitFly .6s ease-out infinite; }
@keyframes spitFly { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(14px, 18px) scale(.4); opacity: 0; } }

/* ---------- этап 2: засор, кучкопедия, достижения ---------- */
.clogBubble { animation: clogBubble .9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes clogBubble { to { transform: scale(1.06, .94); } }
.plunger { transform-box: fill-box; transform-origin: 50% 100%; }
.plunger.pump { animation: pump .25s ease; }
@keyframes pump { 50% { transform: translateY(12px) scaleY(.8); } }
.flicker { animation: flicker .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flicker { to { transform: scale(1.12, .9) rotate(4deg); } }
.dex { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.dex__item { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; }
.dex__item b { font-size: 12px; }
.dex__item.locked { opacity: .55; }
.achs { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; text-align: left; margin-bottom: 6px; }
.ach { background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px; opacity: .5; }
.ach b { display: block; font-size: 14px; }
.ach small { font-size: 12px; opacity: .7; }
.ach--got { opacity: 1; background: #FFF4C2; }

/* ---------- схватить и швырнуть ---------- */
#heroAct.dangle { animation: dangle .45s ease-in-out infinite alternate; transform-origin: 50% 10%; }
@keyframes dangle { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.starsSpin { animation: starsSpin 1s linear infinite; }
@keyframes starsSpin { to { transform: rotate(360deg); } }

/* ---------- обустройство и премиум ---------- */
.shop__locs { grid-column: 1 / -1; display: flex; gap: 6px; margin-bottom: 2px; }
.shop__locs button { flex: 1; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 700; font-size: 12px; padding: 6px 2px; }
.shop__locs button.active { background: var(--mint); }
.shop__tabs button { font-size: 13px; }
.item.premium { background: linear-gradient(160deg, #FFF6D0, #FFE58A); }
.item.premium b::before { content: "★ "; color: #E9A520; }
.shop__perk { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px; text-align: center; }
.shop__perk p { margin: 0; font-size: 14px; font-weight: 600; opacity: .8; }
.shop__crown { font-size: 64px; color: #FFC94A; -webkit-text-stroke: 3px var(--ink); line-height: 1; }
.fishSwim { animation: fishSwim 3s ease-in-out infinite alternate; }
@keyframes fishSwim { from { transform: translateX(-12px); } to { transform: translateX(10px); } }
.robot .brush { animation: starsSpin .4s linear infinite; transform-box: fill-box; transform-origin: center; }

/* ---------- задания дня ---------- */
.nametag { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.iconbtn--quest { position: relative; margin-left: auto; background: #FFF4C2; }
.iconbtn--quest .navbadge { top: -6px; right: -6px; background: #FF5F5F; }
.iconbtn--shop { margin-left: 0; }
.bagchip:not(.hidden) ~ .iconbtn--quest { margin-left: 0; }
.quests { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-bottom: 4px; }
.quest { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.quest b { font-size: 14px; display: block; margin-bottom: 6px; }
.quest__bar { height: 9px; background: #F1E3CF; border-radius: 5px; overflow: hidden; }
.quest__bar i { display: block; height: 100%; background: var(--mint); }
.quest__row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; min-height: 34px; }
.quest__row small { font-weight: 700; opacity: .6; }
.quest__rew { display: flex; align-items: center; gap: 4px; font-weight: 800; }
.quest__claim { width: auto; margin: 0; padding: 6px 12px; font-size: 14px; }
.quest__ok { font-weight: 800; color: #2E9E73; }
.quest--done { background: #FFF6D0; }
.quest--claimed { opacity: .6; }

/* ---------- ночь ---------- */
.glowPulse { animation: glowPulse 2.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes glowPulse { from { transform: scale(.88); } to { transform: scale(1.08); } }

/* ---------- подарок дня ---------- */
.daily { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 8px; }
.daily__d { border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 13px; }
.daily__d small { font-size: 10px; font-weight: 700; opacity: .6; }
.daily__d.past { opacity: .45; background: #E8F7EF; }
.daily__d.now { background: #FFE58A; transform: scale(1.08); box-shadow: 0 3px 0 var(--ink); }
.daily__d:last-child { grid-column: span 2; background: linear-gradient(160deg, #FFF6D0, #FFC94A); }
.daily__bonus { font-weight: 800; color: #C98A00; margin: 0 0 6px; }

/* ---------- лава-лампа и диско ---------- */
.lavaBlob { animation: lavaUp 4s ease-in-out infinite alternate; }
.lavaBlob2 { animation-duration: 5.5s; animation-direction: alternate-reverse; }
@keyframes lavaUp { from { transform: translateY(6px); } to { transform: translateY(-10px); } }
.lavaGlow { animation: twinkle 3s ease-in-out infinite alternate; }
.discoSpin { animation: discoSpin 3s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes discoSpin { 0% { transform: scaleX(1); } 50% { transform: scaleX(.92); } 100% { transform: scaleX(1); } }
.discoSpot { animation: discoSpot 5.4s ease-in-out infinite alternate; transform: translate(var(--dx), var(--dy)); mix-blend-mode: screen; }
@keyframes discoSpot { 0% { transform: translate(var(--dx), var(--dy)); } 50% { transform: translate(calc(var(--dx) * -0.6), calc(var(--dy) + 40px)); } 100% { transform: translate(calc(var(--dx) * 0.3), calc(var(--dy) - 30px)); } }

/* ---------- уровни ---------- */
.item.locked { filter: grayscale(.75); opacity: .75; }
.item .tag--lock { opacity: 1; display: inline-flex; align-items: center; gap: 2px; color: var(--ink); }

/* ---------- кошка-гостья ---------- */
.catTail { animation: catTail 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0% 100%; }
@keyframes catTail { from { transform: rotate(-6deg); } to { transform: rotate(8deg); } }

/* ---------- профиль дебошира ---------- */
.nametag { cursor: pointer; }
.prof__top { display: flex; align-items: center; gap: 10px; text-align: left; }
.prof__top .pet { width: 110px; height: 120px; flex: 0 0 auto; margin: 0; }
.prof__top h2 { margin: 0; }
.prof__top p { margin: 2px 0 6px; font-size: 13px; }
.prof__top small { font-size: 11px; font-weight: 700; opacity: .6; }
.prof__xp { height: 9px; background: #F1E3CF; border-radius: 5px; overflow: hidden; border: 2px solid var(--ink); }
.prof__xp i { display: block; height: 100%; background: #FFC94A; }
.prof__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.prof__stats div { background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px 2px; display: flex; flex-direction: column; }
.prof__stats b { font-size: 18px; }
.prof__stats small { font-size: 10px; font-weight: 700; opacity: .6; line-height: 1.1; }
#modalCard h3 { margin: 6px 0; font-size: 15px; }
.sticks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-height: 190px; overflow-y: auto; margin-bottom: 8px; padding: 2px; }
.stick { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.stick small { font-size: 9px; font-weight: 700; line-height: 1.05; opacity: .55; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stick--got small { opacity: 1; }
.stick--got svg { animation: stickPop .4s ease; }
@keyframes stickPop { from { transform: scale(.6) rotate(-12deg); } to { transform: none; } }

/* ---------- экономный режим ---------- */
body.lite .twinkle, body.lite .glowPulse, body.lite .discoSpot, body.lite .lavaBlob, body.lite .lavaGlow,
body.lite .stinkRise, body.lite .fishSwim, body.lite .catTail, body.lite .cloud, body.lite .wag,
body.lite .discoSpin, body.lite .robot .brush, body.lite .stick--got svg { animation: none !important; }
body.lite .discoSpot { mix-blend-mode: normal; opacity: .2; }
body.lite #glow { opacity: .8; }
body.lite .modal { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* ---------- погода ---------- */
.rainDrop { animation: rainFall .6s linear infinite; }
@keyframes rainFall { from { transform: translate(0, 0); } to { transform: translate(-30px, 660px); } }
.snowFlake { animation: snowFall 5s linear infinite; }
@keyframes snowFall { 0% { transform: translate(0, 0); } 50% { transform: translate(12px, 330px); } 100% { transform: translate(-6px, 660px); } }
body.lite .rainDrop, body.lite .snowFlake { animation-duration: 2s !important; }

/* ---------- кучко-фонтан ---------- */
.coinPop { animation: coinPop 2.4s ease-out infinite; opacity: 0; }
@keyframes coinPop { 0% { transform: translate(0, 30px); opacity: 0; } 15% { opacity: 1; } 60% { transform: translate(14px, -24px); opacity: 1; } 100% { transform: translate(26px, 10px); opacity: 0; } }
.choco { animation: twinkle 1.2s ease-in-out infinite alternate; }
body.lite .coinPop { animation: none; opacity: 1; }

/* ---------- обучение ---------- */
.tutTip { position: absolute; left: 14px; right: 14px; top: calc(env(safe-area-inset-top) + 124px); z-index: 7;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; text-align: center;
  font-weight: 800; font-size: 15px; box-shadow: 0 4px 0 var(--ink); pointer-events: none; animation: tutIn .35s ease; }
.tutTip small { display: block; font-size: 11px; opacity: .55; margin-bottom: 2px; }
@keyframes tutIn { from { transform: translateY(-10px); opacity: 0; } }
.tutGlow { position: relative; animation: tutGlow 1s ease-in-out infinite; z-index: 8; }
@keyframes tutGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 74, .9); } 50% { box-shadow: 0 0 0 9px rgba(255, 201, 74, .25); } }
body:has(.tutTip) #toasts { top: calc(env(safe-area-inset-top) + 200px); }
.act.tutGlow { animation: none; }
.act.tutGlow i { animation: tutGlow 1s ease-in-out infinite; border-radius: 50%; }
.iconbtn.tutGlow { border-radius: 50%; }



/* ---------- гроза ---------- */
.flash { position: absolute; inset: 0; background: #fff; pointer-events: none; animation: flash .7s ease-out forwards; z-index: 9; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .9; } 20% { opacity: .2; } 30% { opacity: .75; } 100% { opacity: 0; } }
body.lite .flash { animation-duration: .3s; }

/* ---------- уведомления: по одному ---------- */
.toast { font-size: 14px; padding: 7px 14px; border-radius: 16px; line-height: 1.25; }
.toast--hi { background: #FFE3D6; }
.toast--out { animation: toastOut .26s ease forwards; }

/* ---------- обучение: затемнение и окошко ---------- */
#stage { overflow: hidden; }
#room { transform-origin: 0 0; transition: transform .8s cubic-bezier(.45, .05, .25, 1); }
.tut { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.tut.hidden { display: none; }
.tut__dim { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tut__shade { position: fixed; pointer-events: none; }
.tut__shade::after { content: ''; position: absolute; inset: -5px; border-radius: inherit; border: 4px solid #FFC94A; animation: tutRing 1.1s ease-in-out infinite; }
.tut--nohole .tut__shade::after { display: none; }
@keyframes tutRing { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.07); opacity: .5; } }
.tut__blk { position: fixed; pointer-events: auto; }
.tut__all { position: fixed; inset: 0; pointer-events: auto; display: none; }
.tut--info .tut__all { display: block; }
.tut__card { position: fixed; pointer-events: auto; background: var(--cream); border: 4px solid var(--ink); border-radius: 22px;
  box-shadow: 0 6px 0 var(--ink); padding: 10px 14px 8px; text-align: center; box-sizing: border-box; transition: top .35s ease; }
.tut__card--in { animation: tutIn .35s ease; }
.tut__card.nudge { animation: tutNudge .4s ease; }
@keyframes tutIn { from { transform: translateY(10px) scale(.96); opacity: 0; } }
@keyframes tutNudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tut__card p { margin: 6px 0 10px; font-weight: 800; font-size: 17px; line-height: 1.3; }
.tut__dots { display: flex; gap: 5px; justify-content: center; }
.tut__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: .18; }
.tut__dots i.past { opacity: .45; }
.tut__dots i.on { opacity: 1; background: var(--orange); width: 18px; border-radius: 5px; }
.tut__next { min-width: 150px; margin-bottom: 2px; }
.tut__skip { display: block; margin: 4px auto 0; background: none; border: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink); opacity: .45; text-decoration: underline; cursor: pointer; padding: 4px; }
.tut__hand { position: fixed; width: 44px; height: 52px; pointer-events: none; transition: left .35s ease, top .35s ease;
  transform: rotate(var(--r, 0deg)); animation: tutHand .7s ease-in-out infinite alternate; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
@keyframes tutHand { from { transform: translateY(0) rotate(var(--r, 0deg)); } to { transform: translateY(var(--dy, -9px)) rotate(var(--r, 0deg)); } }
body.tutOn #toasts { z-index: 45; }
body.lite #room { transition: none; }
#app { overflow: clip; }

body, #app, #room { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- рисованные спрайты ---------- */
.flyA { animation: flyA .12s steps(1) infinite; }
.flyB { animation: flyB .12s steps(1) infinite; }
@keyframes flyA { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes flyB { 0% { opacity: 0; } 50% { opacity: 1; } }
body.lite .flyA, body.lite .flyB { animation: none; }
body.lite .flyB { opacity: 0; }

/* шторка с едой/играми: не выше экрана, список листается пальцем */
.sheet { max-height: calc(100% - 24px); display: flex; flex-direction: column; box-sizing: border-box; }
.sheet .foods { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; min-height: 0; flex: 1 1 auto; padding-bottom: 6px; }
.modal__card { max-height: calc(100% - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.blanketIn { animation: toastIn .4s ease; }

/* ---------- живое окружение (envart.js) ---------- */
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: envSway 5s ease-in-out infinite; }
@keyframes envSway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.treeSway { transform-box: fill-box; transform-origin: 50% 100%; animation: envTree 7s ease-in-out infinite; }
@keyframes envTree { 0%, 100% { transform: skewX(-.8deg); } 50% { transform: skewX(.8deg); } }
.beam { animation: envBeam 6s ease-in-out infinite; }
@keyframes envBeam { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
.mote { animation: envMote 7s ease-in-out infinite; }
@keyframes envMote { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: .85; } 80% { opacity: .6; } 100% { transform: translate(14px, -26px); opacity: 0; } }
.steam { transform-box: fill-box; transform-origin: 50% 50%; animation: envSteam 2.6s ease-out infinite; opacity: 0; }
@keyframes envSteam { 0% { transform: translate(0, 0) scale(.5); opacity: 0; } 25% { opacity: .6; } 100% { transform: translate(4px, -26px) scale(1.5); opacity: 0; } }
.bubble { animation: envBubble 2.4s ease-in infinite; opacity: 0; }
@keyframes envBubble { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(2px, -18px); opacity: 0; } }
.tapDrip { transform-box: fill-box; transform-origin: 50% 0%; animation: envDrip 3.4s ease-in infinite; }
@keyframes envDrip { 0%, 60% { transform: translate(0, 0) scale(.3); opacity: 0; } 70% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(0, 24px) scale(1); opacity: 0; } }
.groundApple { cursor: pointer; }
body.lite .sway, body.lite .treeSway, body.lite .beam, body.lite .mote, body.lite .steam, body.lite .bubble, body.lite .tapDrip { animation: none !important; }
body.lite .mote, body.lite .steam, body.lite .bubble, body.lite .tapDrip { display: none; }
body.lite .fg g[filter] { filter: none; }
.tvLight { mix-blend-mode: screen; animation: envTvLight 2.2s ease-in-out infinite; }
@keyframes envTvLight { 0% { opacity: .85; filter: hue-rotate(0deg); } 25% { opacity: 1; } 45% { opacity: .7; filter: hue-rotate(70deg); } 70% { opacity: 1; filter: hue-rotate(-50deg); } 100% { opacity: .85; filter: hue-rotate(0deg); } }
body.lite .tvLight { mix-blend-mode: normal; animation: none; opacity: .7; }

/* шкала «хочу какать»: трубочка у правого края под кнопками */
.urge { position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 132px); width: 30px; height: 112px; padding: 0;
  border: 3px solid var(--ink); border-radius: 16px; background: #fff; pointer-events: auto; cursor: pointer; }
.urge img { position: absolute; left: 50%; top: -20px; width: 36px; height: 36px; margin-left: -18px; pointer-events: none; }
.urge__tube { position: absolute; left: 4px; right: 4px; bottom: 4px; top: 16px; border-radius: 10px; background: #F3E6D4; overflow: hidden; }
.urge__tube i { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(#A8693F, #7A4526); transition: height .5s ease; }
.urge.hot .urge__tube i { background: linear-gradient(#F0954E, #B5542A); }
.urge.crit { animation: urgeShake .5s ease-in-out infinite; }
.urge.crit .urge__tube i { background: linear-gradient(#FF6A5F, #C0392B); }
@keyframes urgeShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
body.lite .urge.crit { animation: none; }
.lore__pic { display: flex; justify-content: center; align-items: flex-end; gap: 4px; min-height: 120px; }
.lore__pic svg.pet { width: 120px; height: 130px; }
.lore__ch { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #B5542A; margin-bottom: 2px; }
.lore__letter { background: #FFF4E4; border: 2px dashed #C98A4E; border-radius: 12px; padding: 8px 10px; font-style: italic; text-align: left; }
.lore__dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 2px; }
.lore__dots i { width: 8px; height: 8px; border-radius: 50%; background: #E3D3BD; }
.lore__dots i.on { background: var(--orange); }

/* ---- улица: дорога, почта, гидрант, лужа, голуби; новые тыки в комнатах ---- */
#hydrant, #laundry, #micro { transform-box: fill-box; transform-origin: 50% 100%; }
.mailbox .mailFlag { transition: transform .35s cubic-bezier(.5, 1.8, .5, 1); transform: rotate(-90deg); }
.mailbox.mailUp .mailFlag { transform: rotate(0deg); }
.mailbox .mailLetter { opacity: 0; transition: opacity .3s; }
.mailbox.mailUp .mailLetter { opacity: 1; animation: mailPeek 2.6s ease-in-out infinite; }
@keyframes mailPeek { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-3px); } 90% { transform: translateY(0); } }
.car .wheel { transform-box: fill-box; transform-origin: 50% 50%; animation: wheelSpin .55s linear infinite reverse; }
@keyframes wheelSpin { to { transform: rotate(360deg); } }
.car .carBody { transform-box: fill-box; transform-origin: 50% 100%; animation: carRide .32s ease-in-out infinite alternate; }
@keyframes carRide { to { transform: translateY(-.8px); } }
.car .carBody.honk { animation: carHonk .45s ease; }
@keyframes carHonk { 30% { transform: translateY(-6px) scale(1.06, .94); } 60% { transform: translateY(0) scale(.96, 1.05); } }
.pigeon .pigeonBody { transform-box: fill-box; transform-origin: 20% 100%; animation: peck 2.2s ease-in-out infinite; }
@keyframes peck { 0%, 62%, 100% { transform: rotate(0); } 72% { transform: rotate(28deg); } 80% { transform: rotate(4deg); } 86% { transform: rotate(26deg); } }
.pigeon .pigeonWings { display: none; }
.pigeon.flying .pigeonBody { animation: none; }
.pigeon.flying .pigeonBody { display: none; }
.pigeon.flying .pigeonWings { display: inline; transform-box: fill-box; transform-origin: 50% 100%; animation: flapImg .16s ease-in-out infinite alternate; }
@keyframes flapImg { from { transform: scaleY(1); } to { transform: scaleY(.82) translateY(-1px); } }
@keyframes flap { to { transform: scaleY(-.6); } }
.puddle .puddleIn { transition: transform .8s ease; }
.puddle.wet .puddleIn { transform: scale(1.35, 1.25); }
.puddle.ice .puddleIn image { filter: saturate(.25) brightness(1.3); }
.puddle.splash .puddleIn { animation: puddleSplash .5s ease; }
@keyframes puddleSplash { 30% { transform: scale(1.25, .8); } 65% { transform: scale(.92, 1.1); } }
.puddle .ripple { transform-box: fill-box; transform-origin: 50% 50%; animation: ripple 3s ease-out infinite; }
@keyframes ripple { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.microOn { animation: microHum .12s linear infinite alternate; }
@keyframes microHum { to { transform: translateX(.8px); } }
body.lite .car .wheel, body.lite .car .carBody, body.lite .pigeon .pigeonBody, body.lite .puddle .ripple, body.lite .mailbox.mailUp .mailLetter { animation: none !important; }

/* ---- спальня: копилка, мишка; песочница ---- */
#piggy, #toys, #teddy .teddyIn { transform-box: fill-box; transform-origin: 50% 100%; }
.piggy .piggyCoin { opacity: 0; transition: opacity .3s; }
.piggy.full .piggyCoin { opacity: 1; animation: mailPeek 2.2s ease-in-out infinite; }
#teddy .teddyIn.squeeze { animation: squeeze .45s ease; }
body.lite .piggy.full .piggyCoin { animation: none !important; }

/* мячик: подсказка «тыкай по мячу» */
#ballHint .ballRing { transform-box: fill-box; transform-origin: 50% 50%; animation: ballRing 1.1s ease-out infinite; }
#ballHint .ballRing2 { animation-delay: .55s; }
@keyframes ballRing { 0% { transform: scale(.85); opacity: .95; } 100% { transform: scale(1.45); opacity: 0; } }
#ballHint .ballHand { animation: ballHand .55s ease-in-out infinite alternate; }
@keyframes ballHand { from { transform: translateY(0); } to { transform: translateY(-9px); } }
body.lite #ballHint .ballRing2 { display: none; }

/* горка одеяла над спящим Кучиком тихо дышит */
#blanketFront .hump { animation: humpBreath 3.2s ease-in-out infinite; }
@keyframes humpBreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.06); } }
body.lite #blanketFront .hump { animation: none; }

/* спит под одеялом: Кучика не видно, видна выпуклость одеяла; ровное одеяло кровати под ней прячем */
#heroPos.inBed { opacity: 0; }
body:has(#blanketFront) .bedBlanket { opacity: 0; }

/* читает на диване: книжка чуть покачивается в «руках» */
.readBook { transform-box: fill-box; transform-origin: 50% 100%; animation: readBook 2.4s ease-in-out infinite; }
@keyframes readBook { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-1.5px); } }
body.lite .readBook { animation: none; }

/* премиум за рубли */
.price--rub { color: #B5651D; font-weight: 800; }
.shop__tabs button { white-space: nowrap; min-width: 0; font-size: 14px; padding: 8px 2px; }
.shop__tabs .tab--prem { color: #B07A00; flex: 1.3; }
.shop__tabs .tab--prem.active { background: linear-gradient(160deg, #FFE58A, #FFC94A); color: #5A3A00; }
.btn--prem { background: linear-gradient(160deg, #FFE58A, #FFB938); color: #5A3A00; }
.prem-code { font: 800 20px/1.2 Rubik, sans-serif; letter-spacing: .08em; text-align: center; padding: 10px; margin: 6px 0 10px;
  background: #FFF6D0; border: 2.5px dashed #E9A520; border-radius: 14px; user-select: all; }
