/* ── базовая раскладка и общие компоненты ──────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #f6eef2;
  --ink-soft: rgba(246, 238, 242, .72);
  --ink-dim: rgba(246, 238, 242, .45);
  --pink: #ff6f9c;
  --gold: #ffd166;
  --mint: #7ee0d0;
  --violet: #c08cf5;
  --peach: #ff9f68;
  --sky: #8ec5ff;
  --panel: rgba(28, 20, 34, .72);
  --panel-line: rgba(255, 255, 255, .12);
  --radius: 18px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --shake: 1;
  --ease-out: cubic-bezier(.22, .9, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #140e1a;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { touch-action: manipulation; }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

/* ── комната ───────────────────────────────────────────────────────────── */

.room { position: absolute; inset: 0; overflow: hidden; }

.wall {
  position: absolute;
  inset: 0 0 26% 0;
  background: var(--wall-bg);
  transition: filter .9s ease, opacity .9s ease;
}

.wall::after {
  /* мягкое свечение от гирлянды */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--wall-glow);
  opacity: 0;
  transition: opacity 1.4s ease;
}
body.lights-on .wall::after { opacity: 1; }

.floor {
  position: absolute;
  inset: 74% 0 0 0;
  background: var(--floor-bg);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .45) inset;
}

.floor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 2px, transparent 2px 9%);
  opacity: .5;
}

/* затемнение до включения света */
.dark-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 60%, rgba(10,6,14,.55), rgba(8,5,12,.94));
  transition: opacity 1.2s ease;
  z-index: 6;
  pointer-events: none;
}
body.lights-on .dark-veil { opacity: 0; }

/* ── декор ─────────────────────────────────────────────────────────────── */

.garland-wrap {
  position: absolute;
  top: -6px; left: 0; right: 0;
  height: 92px;
  z-index: 3;
  pointer-events: none;
  transform: translateY(-100%);
  transition: transform 1s var(--spring);
}
body.lights-on .garland-wrap { transform: translateY(0); }
.garland { width: 100%; height: 92px; display: block; }

.bulb ellipse:first-of-type {
  filter: drop-shadow(0 0 0 currentColor);
  animation: bulbGlow 2.4s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes bulbGlow {
  0%, 100% { opacity: .55; filter: drop-shadow(0 0 3px rgba(255,220,160,.35)); }
  50%      { opacity: 1;   filter: drop-shadow(0 0 12px rgba(255,220,160,.9)); }
}

.bunting-wrap {
  position: absolute;
  top: 13%;
  left: 50%;
  width: min(78vw, 900px);
  transform: translateX(-50%) translateY(-140%);
  z-index: 2;
  pointer-events: none;
  transition: transform 1.1s var(--spring) .25s;
}
body.lights-on .bunting-wrap { transform: translateX(-50%) translateY(0); }
.bunting { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .4)); }
.pennant {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: pennantSway 4.2s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes pennantSway {
  0%, 100% { transform: rotate(-2.5deg); }
  50%      { transform: rotate(2.5deg); }
}

.balloons { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.balloon-slot {
  position: absolute;
  width: 74px;
  opacity: 0;
  transition: opacity .8s ease;
  animation: floaty 6s ease-in-out infinite;
}
body.lights-on .balloon-slot { opacity: 1; }
.balloon { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-16px) rotate(3deg); }
}

.disco-wrap {
  position: absolute;
  top: -110px; left: 50%;
  width: 86px;
  margin-left: -43px;
  z-index: 4;
  transition: top 1.2s var(--spring);
  pointer-events: none;
}
body.disco-on .disco-wrap { top: -6px; }
.disco { width: 100%; height: auto; animation: spin 8s linear infinite; transform-origin: 50% 8%; }
@keyframes spin { to { transform: rotateY(360deg); } }

.disco-light {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  background:
    radial-gradient(38% 60% at 20% 30%, rgba(255,111,156,.20), transparent 70%),
    radial-gradient(38% 60% at 80% 25%, rgba(126,224,208,.18), transparent 70%),
    radial-gradient(46% 70% at 50% 80%, rgba(192,140,245,.18), transparent 70%);
  animation: discoShift 7s ease-in-out infinite;
}
body.disco-on .disco-light { opacity: 1; }
@keyframes discoShift {
  0%, 100% { transform: translateX(-3%) scale(1.04); }
  50%      { transform: translateX(3%) scale(1.1); }
}

/* ── котики ────────────────────────────────────────────────────────────── */

.crowd { position: absolute; inset: 0; }

.cat-slot {
  position: absolute;
  width: clamp(70px, 8.6vw, 112px);
  transform: translate(-50%, -100%) scale(var(--s, 1));
  transform-origin: 50% 100%;
  cursor: pointer;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4));
}
.cat-slot.is-back { filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)) brightness(.82) saturate(.9); }

/* появление живёт на самом SVG, чтобы не перетирать transform слота */
@keyframes catArrive {
  from { transform: scale(.35) translateY(46%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.cat {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  transform-origin: 50% 100%;
  animation: catArrive .55s var(--spring) both;
}
.cat-shadow { fill: rgba(0, 0, 0, .18); }

.cat-all {
  transform-origin: 50% 92%;
  animation: catBreathe 3.6s ease-in-out infinite;
  animation-delay: var(--bd, 0s);
}
@keyframes catBreathe {
  0%, 100% { transform: scale(1, 1); }
  50%      { transform: scale(1.022, .985); }
}

.cat-tail {
  transform-origin: 69px 116px;
  animation: tailWag 3.1s ease-in-out infinite;
  animation-delay: var(--td, 0s);
  transition: stroke-width .25s ease;
}
@keyframes tailWag {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(9deg); }
}

.cat-ears {
  transform-origin: 50% 30px;
  animation: earTwitch 5.5s ease-in-out infinite;
  animation-delay: var(--ed, 0s);
  transition: transform .3s var(--spring);
}
@keyframes earTwitch {
  0%, 88%, 100% { transform: rotate(0deg); }
  91%           { transform: rotate(-4deg); }
  94%           { transform: rotate(3deg); }
}

.cat-eyes {
  transform-origin: 50% 41px;
  animation: blink 7s infinite;
  animation-delay: var(--kd, 0s);
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%           { transform: scaleY(.08); }
  96%           { transform: scaleY(1); }
}

.cat-eyes-happy { opacity: 0; transition: opacity .18s ease; }
.cat-mouth-open { opacity: 0; transition: opacity .1s ease; }

.cat-slot.is-purring .cat-eyes { opacity: 0; }
.cat-slot.is-purring .cat-eyes-happy { opacity: 1; }
.cat-slot.is-purring .cat-all { animation: purrBuzz .1s linear infinite; }
@keyframes purrBuzz {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(.5px, -.4px); }
  75%      { transform: translate(-.5px, .4px); }
}

.cat-slot.is-singing .cat-mouth-open { opacity: 1; }
.cat-slot.is-singing .cat-mouth { opacity: 0; }
.cat-slot.is-singing .cat-all { animation: catHop .34s var(--spring); }
@keyframes catHop {
  0%   { transform: translateY(0) scale(1, 1); }
  35%  { transform: translateY(-16%) scale(.96, 1.06); }
  70%  { transform: translateY(0) scale(1.05, .95); }
  100% { transform: translateY(0) scale(1, 1); }
}

.cat-slot.is-hopping .cat-all { animation: catHop .5s var(--spring); }

/* испуг: шерсть дыбом, хвост трубой, глаза круглые */
.cat-slot.is-spooked .cat-all { animation: spookJump .7s var(--spring); }
.cat-slot.is-spooked .cat-tail { stroke-width: 30; }
.cat-slot.is-spooked .cat-ears { transform: rotate(0) scaleY(.7) translateY(6px); }
.cat-slot.is-spooked .pupil { rx: 6.6; }
@keyframes spookJump {
  0%   { transform: translateY(0) scale(1, 1) rotate(0deg); }
  25%  { transform: translateY(-22%) scale(1.14, 1.1) rotate(-3deg); }
  55%  { transform: translateY(-6%) scale(1.1, 1.06) rotate(2deg); }
  100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
}

.cat-slot.is-sleeping .cat-eyes { opacity: 0; }
.cat-slot.is-sleeping .cat-eyes-happy { opacity: 1; }
.cat-slot.is-sleeping .cat-all { animation: sleepBreathe 4.4s ease-in-out infinite; }
.cat-slot.is-sleeping .cat-tail { animation: none; transform: rotate(-14deg); }
@keyframes sleepBreathe {
  0%, 100% { transform: scale(1, .99) translateY(0); }
  50%      { transform: scale(1.03, .96) translateY(2%); }
}

.zzz {
  position: absolute;
  top: -6%;
  left: 76%;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-soft);
  pointer-events: none;
  animation: zzzFloat 3s ease-in-out infinite;
}
@keyframes zzzFloat {
  0%   { opacity: 0; transform: translate(0, 0) scale(.7); }
  30%  { opacity: .9; }
  100% { opacity: 0; transform: translate(18px, -34px) scale(1.15); }
}

.cat--pepsi { filter: drop-shadow(0 0 18px rgba(255, 209, 102, .18)); }

.pet-pop {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-size: 15px;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  animation: petPop 1s var(--ease-out) forwards;
  z-index: 40;
  white-space: nowrap;
}
@keyframes petPop {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  25%  { opacity: 1; transform: translate(-50%, -18px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}

/* ── стол с реквизитом ─────────────────────────────────────────────────── */

.table {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 3vw, 40px);
  z-index: 100;
}

.table-top {
  position: absolute;
  left: 50%;
  bottom: 10.4%;
  transform: translateX(-50%);
  width: min(74vw, 720px);
  height: 20px;
  border-radius: 6px;
  background: var(--table-bg);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .45);
  z-index: 99;
}

.prop-btn {
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45));
  transition: transform .25s var(--spring), filter .25s ease;
  opacity: 0;
  animation: propIn .6s var(--spring) forwards;
}
body.lights-on .prop-btn { animation-play-state: running; }
@keyframes propIn { from { opacity: 0; transform: translateY(24px) scale(.85); } to { opacity: 1; transform: none; } }

.prop-btn:hover, .prop-btn:focus-visible { transform: translateY(-6px) scale(1.05); outline: none; }
.prop-btn.is-done { filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)) saturate(.75) brightness(.85); }
.prop-btn.is-bumped { animation: propBump .45s var(--spring); }
@keyframes propBump {
  0%, 100% { transform: translateY(0) rotate(0); }
  30%      { transform: translateY(-8px) rotate(-3deg); }
  60%      { transform: translateY(0) rotate(2deg); }
}
.prop-btn::before {
  content: "";
  position: absolute;
  inset: -10px -6px;
  border-radius: 16px;
}

.prop-btn::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  border: 2px dashed rgba(255, 209, 102, .5);
  opacity: 0;
  pointer-events: none;
}
.prop-btn.is-hinted::after { animation: hintPulse 2.4s ease-in-out infinite; }
@keyframes hintPulse { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.05); opacity: .8; } }

.prop { display: block; height: auto; touch-action: none; }
.prop--cake { width: clamp(110px, 20vw, 190px); }
.prop--bottle { width: clamp(52px, 9vw, 84px); }
.prop--popper { width: clamp(44px, 8vw, 74px); }
.prop--fortune { width: clamp(58px, 10vw, 104px); }
.prop--gramo { width: clamp(64px, 12vw, 122px); }

/* пламя свечей */
.flame {
  transform-origin: 50% 100%;
  animation: flicker .48s ease-in-out infinite alternate;
  animation-delay: var(--d);
  filter: drop-shadow(0 0 8px rgba(255, 180, 60, .85));
}
@keyframes flicker {
  from { transform: scale(.9, .92) rotate(-3deg); opacity: .92; }
  to   { transform: scale(1.08, 1.1) rotate(3deg); opacity: 1; }
}
.smoke { opacity: 0; }
/* свеча, задутая ещё до открытия окна — без вспышки и дымка */
.candle.is-cold .flame { opacity: 0; animation: none; }
.candle.is-out .flame { opacity: 0; transform: scale(.2); transition: all .3s ease; animation: none; }
.candle.is-out .smoke { animation: smokeUp 1.6s ease-out forwards; }
@keyframes smokeUp {
  0%   { opacity: .8; transform: translateY(0) scale(.6); }
  100% { opacity: 0; transform: translateY(-30px) scale(1.3); }
}

/* ── HUD ───────────────────────────────────────────────────────────────── */

.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 104;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(12px, 3vw, 26px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .6s ease .3s, transform .6s var(--spring) .3s;
}
body.lights-on .hud { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }

.meter {
  flex: 1;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 8px 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 5px;
  font-weight: 700;
}
.meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--mint));
  background-size: 200% 100%;
  transition: width .7s var(--ease-out);
  animation: meterShimmer 3s linear infinite;
}
@keyframes meterShimmer { to { background-position: 200% 0; } }

.hud-btn {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .2s var(--spring), background .2s ease;
  white-space: nowrap;
}
.hud-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .14); }
.guest-count { font-variant-numeric: tabular-nums; }

/* ── фокус-слой ────────────────────────────────────────────────────────── */

.focus {
  position: absolute;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: rgba(10, 6, 14, .78);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fadeIn .3s ease;
}
.focus.is-open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.focus-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: focusIn .45s var(--spring);
}
@keyframes focusIn { from { transform: scale(.6) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.focus-stage .prop--cake { width: min(72vw, 340px); }
.focus-stage .prop--bottle { width: min(38vw, 170px); }
.focus-stage .prop--popper { width: min(34vw, 150px); }
.focus-stage .prop--fortune { width: min(46vw, 220px); }

.focus-prompt {
  font-size: clamp(15px, 3.6vw, 20px);
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  max-width: 30ch;
}

.focus-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #2a1520;
  box-shadow: 0 10px 24px rgba(255, 111, 156, .3);
  transition: transform .2s var(--spring), box-shadow .2s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 30px rgba(255, 111, 156, .42); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--ghost {
  background: rgba(255, 255, 255, .1);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--panel-line);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .18); box-shadow: none; }

.focus-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.focus-close:hover { background: rgba(255, 255, 255, .18); }

/* индикатор дуновения */
.blow-meter {
  width: min(70vw, 280px);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.blow-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  transition: width .08s linear;
}

/* заряд хлопушки */
.popper-wrap { position: relative; touch-action: none; cursor: pointer; }

.charge-ring {
  position: absolute;
  inset: -22px;
  pointer-events: none;
  border-radius: 50%;
  border: 4px solid rgba(255, 209, 102, .25);
  border-top-color: var(--gold);
  opacity: 0;
  transition: opacity .2s ease;
}
.charge-ring.is-charging { opacity: 1; animation: spinRing .6s linear infinite; }
@keyframes spinRing { to { transform: rotate(360deg); } }

.popper-body { transform-origin: 50% 100%; transition: transform .12s ease; }

/* ── хор ───────────────────────────────────────────────────────────────── */

.choir-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2px, 1.4vw, 14px);
  flex-wrap: nowrap;
  max-width: 96vw;
}
.choir-cat {
  width: clamp(46px, 11vw, 96px);
  cursor: pointer;
  transition: transform .18s var(--spring);
  position: relative;
}
.choir-cat:hover { transform: translateY(-8px); }
.choir-cat.is-singing { animation: catHop .34s var(--spring); }
.choir-note {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
}
.choir-cat.is-singing .choir-note { animation: noteUp .8s ease-out; }
@keyframes noteUp {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1.2) rotate(18deg); }
}

/* ── тост ──────────────────────────────────────────────────────────────── */

.toast {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translate(-50%, -18px);
  z-index: 106;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  max-width: min(90vw, 460px);
  text-align: center;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .45s var(--spring);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── canvas эффектов ───────────────────────────────────────────────────── */

#fx {
  position: absolute;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ── интро ─────────────────────────────────────────────────────────────── */

.screen {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px;
  text-align: center;
  background: var(--screen-bg);
}
.screen.is-hidden { display: none; }
.screen.is-leaving { animation: screenOut .8s var(--ease-out) forwards; }
@keyframes screenOut { to { opacity: 0; transform: scale(1.08); visibility: hidden; } }

.screen-kicker {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}
.screen-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 68px);
  line-height: 1.05;
  margin: 0;
  font-weight: 700;
  letter-spacing: -.01em;
}
.screen-text {
  font-size: clamp(14px, 2.6vw, 18px);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0;
}
.screen-hint { font-size: 12px; color: var(--ink-dim); letter-spacing: .06em; }

.intro-eyes {
  display: flex;
  gap: 26px;
  margin-bottom: 6px;
  animation: eyesBlink 4.2s ease-in-out infinite;
}
.intro-eye {
  width: 26px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #eaff8a, #b8d43a 60%, #6d8a1e);
  position: relative;
  box-shadow: 0 0 26px rgba(200, 230, 90, .55);
}
.intro-eye::after {
  content: "";
  position: absolute;
  inset: 6px 10px;
  border-radius: 50%;
  background: #14100f;
}
@keyframes eyesBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  92%           { transform: scaleY(.05); }
  95%           { transform: scaleY(1); }
}

/* ── финал ─────────────────────────────────────────────────────────────── */

.finale {
  z-index: 120;
  background: var(--finale-bg);
  overflow-y: auto;
  justify-content: center;
  scrollbar-width: none;
}
.finale::-webkit-scrollbar { display: none; }
.finale-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 620px;
  padding: 40px 0;
}
.finale .screen-title { margin-bottom: 4px; }
.finale .screen-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--pink), var(--gold) 45%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.finale-text {
  font-size: clamp(14px, 2.5vw, 17px);
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-line;
  max-width: 44ch;
  margin: 0;
}
.finale-sign {
  font-family: var(--font-display);
  font-size: clamp(15px, 3vw, 20px);
  color: var(--gold);
  font-style: italic;
}
.finale-cats {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}
.finale-cats .cat { width: clamp(38px, 8vw, 62px); }
.finale-cats > div { animation: catArrive .5s var(--spring) both; }

/* ── тряска ────────────────────────────────────────────────────────────── */

.is-shaking { animation: shakeIt .4s ease-in-out; }
@keyframes shakeIt {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(calc(-7px * var(--shake)), calc(4px * var(--shake))); }
  40% { transform: translate(calc(6px * var(--shake)), calc(-5px * var(--shake))); }
  60% { transform: translate(calc(-5px * var(--shake)), calc(-3px * var(--shake))); }
  80% { transform: translate(calc(4px * var(--shake)), calc(3px * var(--shake))); }
}

/* ── мобильные ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* панели заданий больше нет — стол опускаем ниже и делаем предметы крупнее */
  .table { gap: 4px; bottom: 16%; }
  .table-top { width: 96vw; bottom: 14.4%; }
  .wall { inset: 0 0 37% 0; }
  .floor { inset: 63% 0 0 0; }
  .prop--cake { width: clamp(96px, 27vw, 150px); }
  .prop--bottle { width: clamp(44px, 12vw, 60px); }
  .prop--gramo { width: clamp(62px, 17vw, 90px); }
  .prop--popper { width: clamp(42px, 11vw, 52px); }
  .prop--fortune { width: clamp(54px, 14vw, 70px); }
  .prop-btn::after { inset: -6px; border-radius: 14px; }
  .hud { padding: 10px 10px; gap: 6px; }
  .hud-btn { padding: 8px 11px; font-size: 12px; }
  .meter { padding: 7px 12px; }
  .toast { top: 64px; font-size: 13px; padding: 10px 15px; max-width: 88vw; }
  .bunting-wrap { top: 26%; width: 78vw; }
  .balloon-slot { width: 52px; }
  .cat-slot { width: clamp(80px, 22vw, 112px); }
  .focus-close { top: 10px; right: 10px; }
}

@media (max-height: 560px) {
  .table { bottom: 18%; }
  .screen-title { font-size: clamp(24px, 6vw, 40px); }
}

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

/* в финале сцена уходит на второй план */
body.is-finale .hud,
body.is-finale .toast { opacity: 0; pointer-events: none; transition: opacity .5s ease; }


/* ── кнопка-подсказка и подсветка целей ────────────────────────────────── */

.hud-btn--icon { min-width: 42px; text-align: center; font-size: 16px; }

/* когда очередь за поглаживанием — коты сами намекают */
body.hint-pets .cat-slot:not(.pepsi-slot) { animation: petGlow 2.2s ease-in-out infinite; }
@keyframes petGlow {
  0%, 100% { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4)); }
  50%      { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4)) drop-shadow(0 0 12px rgba(255, 224, 102, .85)); }
}

/* спящую Пепси подсвечиваем, пока её не разбудили */
body.hint-pepsi .cat-slot.is-sleeping { animation: pepsiCall 2.4s ease-in-out infinite; }
@keyframes pepsiCall {
  0%, 100% { filter: drop-shadow(0 10px 14px rgba(0,0,0,.4)); }
  50%      { filter: drop-shadow(0 10px 14px rgba(0,0,0,.4)) drop-shadow(0 0 16px rgba(255, 224, 102, .9)); }
}

/* граммофон: труба покачивается, пластинка крутится */
.gramo-horn {
  transform-box: fill-box;
  transform-origin: 50% 90%;
  animation: hornSway 3.8s ease-in-out infinite;
}
@keyframes hornSway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}
.prop-btn.is-hinted .gramo-horn { animation-duration: 1.4s; }
