@font-face { font-family: Nunito; font-weight: 400; src: url(/fonts/Nunito-Regular.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Nunito; font-weight: 700; src: url(/fonts/Nunito-Bold.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Nunito; font-weight: 800; src: url(/fonts/Nunito-ExtraBold.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Nunito; font-weight: 900; src: url(/fonts/Nunito-Black.ttf) format('truetype'); font-display: swap; }

/* ================= токены ================= */
:root {
  color-scheme: light;
  --bg: #fff7ef;
  --aur-a: #ffd2bd;
  --aur-b: #ffd0e6;
  --aur-c: #ddd6ff;
  --surface: #ffffff;
  --surface-2: #fff4ea;
  --sunken: #f4e9df;
  --press: #eadccf;
  --ink: #2a2135;
  --ink-2: #74688a;
  --ink-3: #a99db8;
  --line: rgba(42, 33, 53, .08);
  --line-2: rgba(42, 33, 53, .16);
  --glass: rgba(255, 255, 255, .74);
  --glass-line: rgba(255, 255, 255, .7);

  --accent: #ff5a3c;
  --accent-soft: #ffe7df;
  --pink: #ff4d8d;
  --violet: #7b5cff;
  --violet-soft: #efeaff;
  --mint: #18a864;
  --mint-soft: #dcf5e7;
  --amber: #f59f00;
  --amber-soft: #fff0c9;
  --red: #f03e3e;

  --grad: linear-gradient(135deg, #ff9a3d 0%, #ff5a3c 48%, #ff4d8d 100%);
  --grad-text: linear-gradient(100deg, #ff7a2f 0%, #ff3d6e 50%, #8f5cff 100%);
  --grad-violet: linear-gradient(135deg, #9b7bff 0%, #7b5cff 50%, #ff6fb1 100%);

  --shadow-sm: 0 1px 2px rgba(70, 35, 45, .06), 0 3px 10px rgba(70, 35, 45, .05);
  --shadow: 0 2px 6px rgba(70, 35, 45, .05), 0 14px 36px rgba(70, 35, 45, .11);
  --shadow-accent: 0 10px 26px -8px rgba(255, 80, 60, .6);

  --vh: var(--tg-viewport-stable-height, 100dvh);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --spring: linear(0, 0.016 0.5%, 0.06 1%, 0.226 2%, 1.116 5.4%, 1.375 6.6%, 1.527 7.7%, 1.565 8.2%, 1.585 8.8%, 1.581 9.3%, 1.559 9.8%, 1.458 10.9%, 0.937 14.3%, 0.784 15.5%, 0.693 16.6%, 0.67 17.1%, 0.657 17.7%, 0.671 18.7%, 0.729 19.8%, 1.042 23.3%, 1.13 24.5%, 1.182 25.6%, 1.201 26.7%, 1.192 27.7%, 1.156 28.8%, 0.977 32.2%, 0.925 33.4%, 0.894 34.5%, 0.882 35.6%, 0.887 36.6%, 0.907 37.7%, 1.045 42.4%, 1.069 44.5%, 1.059 46.3%, 0.979 50.9%, 0.96 53.4%, 0.966 55.3%, 1.013 59.9%, 1.024 62.3%, 0.986 71.2%, 1.008 79.9%, 0.995 88.9%, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15111d;
  --aur-a: #4b2030;
  --aur-b: #3b1c4c;
  --aur-c: #1d2858;
  --surface: #221b2e;
  --surface-2: #2b2339;
  --sunken: #1a1424;
  --press: #0f0b15;
  --ink: #f7f1ff;
  --ink-2: #b4a7c8;
  --ink-3: #7b6f8f;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .15);
  --glass: rgba(28, 22, 38, .66);
  --glass-line: rgba(255, 255, 255, .1);
  --accent-soft: rgba(255, 90, 60, .16);
  --violet-soft: rgba(123, 92, 255, .2);
  --mint-soft: rgba(24, 168, 100, .2);
  --amber-soft: rgba(245, 159, 0, .17);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 14px 36px rgba(0, 0, 0, .4);
}

/* ================= база ================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color: var(--ink); min-height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
/* мягкое «северное сияние» на фоне */
body::before {
  content: ''; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 32% at 12% 12%, var(--aur-a), transparent 70%),
    radial-gradient(42% 36% at 92% 22%, var(--aur-b), transparent 70%),
    radial-gradient(50% 40% at 55% 105%, var(--aur-c), transparent 72%);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-4%, 3%, 0) rotate(8deg); }
}
button { font: inherit; color: inherit; }

.screen {
  min-height: var(--vh); max-width: 520px; margin: 0 auto;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.center { align-items: center; justify-content: center; text-align: center; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

h1 { font-size: 30px; font-weight: 900; margin: 0 0 10px; letter-spacing: -.7px; line-height: 1.1; }
h2 { font-size: 24px; font-weight: 900; margin: 0 0 8px; line-height: 1.2; letter-spacing: -.4px; }
p { margin: 0 0 10px; line-height: 1.45; }
.mute { color: var(--ink-2); }
.lead { font-size: 16px; font-weight: 700; color: var(--ink-2); max-width: 340px; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* появление */
.fade-in { animation: fadeIn .45s var(--ease-out) backwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } }
.rise { animation: rise .6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ================= кнопки ================= */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 20px; border: 0; border-radius: 18px;
  font-size: 17px; font-weight: 900; letter-spacing: -.1px; cursor: pointer;
  background: var(--ink); color: var(--bg);
  transition: transform .25s var(--spring), box-shadow .2s, opacity .2s;
  user-select: none; touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .42; cursor: default; transform: none; }
.btn.accent { background: var(--grad); color: #fff; box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--line); }
.btn.link { background: none; color: var(--ink-2); font-weight: 800; font-size: 15px; min-height: 44px; }
.btn.star { background: linear-gradient(135deg, #ffc53d 0%, #ff9500 100%); color: #fff; box-shadow: 0 8px 18px -8px rgba(255, 149, 0, .7); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 13px; }
.btn.icon { flex: none; width: 54px; padding: 0; font-size: 21px; }
.btn.shine::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-130%); animation: shine 3.6s ease-in-out 1.2s infinite;
}
@keyframes shine { 0% { transform: translateX(-130%); } 30%, 100% { transform: translateX(130%); } }
.btns { display: grid; gap: 10px; width: 100%; margin-top: 18px; }

/* ================= яйцо ================= */
.egg-hero { position: relative; width: 230px; height: 236px; margin: 4px auto 10px; display: grid; place-items: center; }
.egg-hero.sm { width: 190px; height: 200px; }
.egg-hero.sm .egg { width: 124px; height: 157px; }
.egg-hero .halo {
  position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 110, .6) 0%, rgba(255, 110, 160, .22) 50%, transparent 70%);
  animation: halo 3.4s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
.spark {
  position: absolute; font-style: normal; font-size: 18px; line-height: 1;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(25deg); } }
.egg { position: relative; width: 150px; height: 190px; display: block; overflow: visible; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.egg .shell { transform-box: fill-box; transform-origin: 50% 100%; }
.wobble .shell { animation: wobble 2.8s ease-in-out infinite; }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(2deg); } }
.shake { animation: none; }
.shake .shell { animation: shake .32s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
.egg .crack { stroke-dasharray: 220; stroke-dashoffset: 220; }
.cracked .crack { animation: draw .45s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.egg .top, .egg .bottom { transform-box: view-box; transform-origin: 75px 100px; transition: transform .7s cubic-bezier(.3, 1.6, .5, 1), opacity .7s; }
.open .shell { animation: none; }
.open .top { transform: translate(-40px, -150px) rotate(-50deg); opacity: 0; }
.open .bottom { transform: translateY(60px) scale(.9); opacity: 0; }

/* ================= приветствие ================= */
.kicker {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 6px 12px; border-radius: 99px;
}
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; width: 100%; text-align: left; }
.steps li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--glass-line);
  font-size: 15px; font-weight: 900; line-height: 1.25;
}
.steps li small { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 1px; }
.steps .n { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }

/* ================= анкета ================= */
.quiz-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.pbar { flex: 1; height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); box-shadow: 0 0 12px rgba(255, 90, 60, .55); transition: width .7s var(--ease-out); }
.qcount { font-size: 14px; font-weight: 900; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.qcount b { color: var(--ink); font-size: 17px; }
.qhint {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--ink-2);
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 7px 12px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--glass-line);
}
.qbox { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px 0 5vh; animation: slideIn .45s var(--ease-out) backwards; }
.qbox.out { animation: slideOut .24s ease-in forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(46px); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(-46px); } }
.qemoji {
  width: 86px; height: 86px; border-radius: 28px; display: grid; place-items: center; font-size: 46px; line-height: 1;
  background: var(--surface); box-shadow: var(--shadow); margin-bottom: 20px; transform: rotate(-6deg);
  animation: emojiIn .7s var(--pop) backwards .05s;
}
@keyframes emojiIn { from { opacity: 0; transform: rotate(-30deg) scale(.4); } }
.qtitle { font-size: 31px; font-weight: 900; line-height: 1.1; letter-spacing: -.8px; margin: 0 0 22px; }
.opts { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 0; border-radius: 22px; padding: 11px 16px 11px 11px; cursor: pointer;
  background: var(--surface); font-size: 17px; font-weight: 800; line-height: 1.2;
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--line);
  transition: transform .3s var(--spring), box-shadow .2s, background .2s, opacity .2s;
  animation: rise .5s var(--ease-out) backwards; animation-delay: calc(110ms + var(--i, 0) * 70ms);
  touch-action: manipulation;
}
.opt:active { transform: scale(.97); }
.opt .oi { flex: none; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 27px; background: var(--surface-2); transition: transform .45s var(--pop); }
.opt .ol { flex: 1; }
.opt .radio { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line-2); transition: background .2s, box-shadow .2s, transform .35s var(--pop); }
.opt.picked { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent), 0 12px 26px -12px rgba(255, 90, 60, .7); transform: scale(1.02); }
.opt.picked .oi { transform: scale(1.14) rotate(-10deg); }
.opt.picked .radio { background: var(--grad); box-shadow: none; transform: scale(1.12); }
.opt.picked .radio::after { content: ''; width: 11px; height: 6px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.opts.locked .opt:not(.picked) { opacity: .38; transform: scale(.97); }

/* ================= приглашение / ожидание ================= */
.duo { display: flex; align-items: flex-start; justify-content: center; gap: 4px; margin: 8px 0 16px; }
.duo .who { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; font-weight: 900; }
.duo .who small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.duo .ava {
  position: relative; width: 60px; height: 60px; border-radius: 50%; margin-bottom: 6px;
  display: grid; place-items: center; font-size: 28px; background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--line);
}
.duo .ava.ok { box-shadow: var(--shadow-sm), inset 0 0 0 2.5px var(--mint); }
.duo .ava.ok::after {
  content: '✓'; position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; background: var(--mint);
  box-shadow: 0 0 0 3px var(--bg);
}
.duo .ava.wait::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2.5px dashed var(--accent); opacity: .7; animation: spin 7s linear infinite;
}
.duo .wire {
  flex: 1; max-width: 70px; height: 3px; margin-top: 29px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 7px, transparent 7px 13px); background-size: 26px 3px;
}
.duo .wire.live { background-image: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 13px); animation: wire .8s linear infinite; }
@keyframes wire { to { background-position: 26px 0; } }

.linkfield {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 6px 6px 14px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--line);
}
.linkfield span { flex: 1; min-width: 0; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkfield button {
  flex: none; border: 0; cursor: pointer; border-radius: 13px; padding: 10px 14px;
  font-size: 13px; font-weight: 900; background: var(--sunken); color: var(--ink);
  transition: transform .25s var(--spring);
}
.linkfield button:active { transform: scale(.92); }

/* ================= вылупление ================= */
.hatch { position: relative; width: 100%; height: 360px; display: grid; place-items: center; }
.hatch > .rays { position: absolute; left: 50%; top: 50%; margin: -280px 0 0 -280px; }
.rays {
  width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 196, 90, .5) 0deg 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); mask: radial-gradient(circle, #000 12%, transparent 62%);
  opacity: 0; transform: scale(.4); transition: opacity .8s, transform 1s var(--ease-out);
  animation: spin 24s linear infinite;
}
.rays.on { opacity: 1; transform: none; }
.hatch-text { min-height: 30px; }
.quake { animation: quake .5s ease-in-out; }
@keyframes quake {
  0%, 100% { transform: none; } 15% { transform: translate(-6px, 2px); } 30% { transform: translate(6px, -3px); }
  45% { transform: translate(-4px, 3px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); }
}
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle, #fff 30%, #fff6dd 100%); animation: flash .9s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.burst { position: absolute; width: 12px; height: 12px; border-radius: 50%; opacity: 0; }
.burst.go { animation: burst .8s var(--ease-out) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) scale(1.2); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

.confetti { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -24px; left: var(--x); width: var(--w); height: var(--h); border-radius: 3px;
  background: var(--c); opacity: 0;
  animation: fall var(--t) cubic-bezier(.2, .6, .35, 1) var(--dl) forwards;
}
@keyframes fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), 108vh, 0) rotate(var(--r)); }
}

/* анимация самого чудика (классы приходят из SVG генератора) */
.bob { transform-box: view-box; transform-origin: 150px 262px; animation: bob var(--dur, 2.4s) ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(var(--hop, -4px)) scale(var(--sx, 1.03), var(--sy, .97)); } }
.tw { animation: tw 2.2s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ================= знакомство ================= */
.reveal { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }
.reveal-kicker { font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.reveal-wrap { position: relative; width: min(100%, 320px); display: grid; place-items: center; }
.reveal-wrap > .rays { position: absolute; width: 180%; height: auto; aspect-ratio: 1; opacity: 1; transform: none; }
.reveal-card {
  position: relative; width: 100%; aspect-ratio: 300 / 290; border-radius: 34px; overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 5px var(--surface), 0 0 0 6px var(--line);
  animation: popIn .9s var(--pop) backwards;
}
.reveal-card svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scale(1.18) translateY(3%); }
@keyframes popIn { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }
.tier {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
}
.tier-0 { background: #eee8f5; color: #6a5f7c; }
.tier-1 { background: #d9f5e4; color: #12804a; }
.tier-2 { background: #dbe6ff; color: #2c55c7; }
.tier-3 { background: linear-gradient(110deg, #ffe28a, #ffb938 40%, #fff1b8 50%, #ffb938 60%, #ffd96a); background-size: 250% 100%; color: #6e4300; animation: goldShine 3s linear infinite; box-shadow: 0 6px 18px -6px rgba(255, 170, 0, .7); }
:root[data-theme="dark"] .tier-0 { background: rgba(200, 185, 230, .15); color: #cfc3e3; }
:root[data-theme="dark"] .tier-1 { background: rgba(40, 190, 110, .18); color: #6ee7a7; }
:root[data-theme="dark"] .tier-2 { background: rgba(80, 130, 255, .2); color: #9db8ff; }
@keyframes goldShine { to { background-position: -250% 0; } }
.reveal .tier { margin-top: 22px; }
.rname { font-size: 44px; font-weight: 900; letter-spacing: -1.4px; line-height: 1; margin: 12px 0 10px; }
.rchar { font-size: 16px; font-weight: 800; color: var(--ink-2); max-width: 320px; }
.rares { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 0; }
.rares span { font-size: 13px; font-weight: 900; background: var(--amber-soft); color: #9a6200; padding: 6px 11px; border-radius: 99px; }
:root[data-theme="dark"] .rares span { color: #ffd27a; }

/* ================= экран питомца ================= */
.screen.pet-screen {
  height: var(--vh); min-height: 0;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  gap: 10px; overflow: hidden;
}
@media (max-height: 620px) {
  .screen.pet-screen { height: auto; min-height: var(--vh); overflow: visible; }
  .scene { min-height: 260px; }
}
.enter > * { animation: rise .55s var(--ease-out) backwards; }
.enter > :nth-child(2) { animation-delay: 60ms; }
.enter > :nth-child(3) { animation-delay: 120ms; }
.enter > :nth-child(4) { animation-delay: 180ms; }
.enter > :nth-child(5) { animation-delay: 240ms; }

.topbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; }
.topbar .title { flex: 1; min-width: 0; }
.pname { display: flex; align-items: center; gap: 8px; font-size: 23px; font-weight: 900; letter-spacing: -.6px; line-height: 1.15; white-space: nowrap; }
.pname .tier { padding: 3px 8px; font-size: 9.5px; letter-spacing: .1em; }
.pchar { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 40px; padding: 0 13px;
  border: 0; border-radius: 99px; cursor: pointer; background: var(--surface);
  font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform .25s var(--spring);
}
.chip:active { transform: scale(.92); }
.chip.square { width: 40px; padding: 0; border-radius: 14px; font-size: 19px; }
.chip.shop { background: linear-gradient(135deg, #ffe58a, #ffc13b); box-shadow: 0 6px 16px -6px rgba(255, 170, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .6); }
.chip.hearts .hv { color: var(--pink); }
.chip.bump { animation: bump .5s var(--pop); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* сцена с чудиком */
.scene {
  position: relative; flex: 1 1 auto; min-height: 210px; border-radius: 30px; overflow: hidden; isolation: isolate;
  cursor: pointer; user-select: none; touch-action: manipulation;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.scene .art { position: absolute; inset: 0; transform-origin: 50% 85%; }
.scene .art svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scale(1.14) translateY(2%); }
.scene .art.squish { animation: petSquish .5s var(--spring); }
@keyframes petSquish {
  0% { transform: scale(1, 1); } 25% { transform: scale(1.08, .9); } 50% { transform: scale(.96, 1.05); }
  75% { transform: scale(1.02, .98); } 100% { transform: none; }
}
.scene::after { /* мягкая виньетка, чтобы стеклянные плашки читались */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .06), transparent 22%, transparent 78%, rgba(0, 0, 0, .07));
}
.glass {
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08), inset 0 0 0 1px var(--glass-line);
}
.scene-top, .scene-bottom { position: absolute; left: 12px; right: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.scene-top { top: 12px; }
.scene-bottom { bottom: 12px; justify-content: center; }
.scene-top > *, .scene-bottom > * { pointer-events: auto; }
.gchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 900; color: var(--ink); border: 0; }
.gchip.off { color: var(--ink-2); }
.gchip.off .fl { filter: grayscale(1); opacity: .6; }
.gchip .fl { display: inline-block; }
.gchip.lit .fl { animation: flicker 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.18) rotate(4deg); } }
.gchip .ice { font-size: 12px; opacity: .9; }
.note-btn { cursor: pointer; transition: transform .25s var(--spring); }
.note-btn:active { transform: scale(.92); }
.note-btn.unread { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -6px rgba(255, 77, 141, .7); animation: notePulse 1.8s ease-in-out infinite; }
.note-badge { font-size: 9px; font-weight: 900; letter-spacing: .06em; background: #fff; color: var(--pink); padding: 2px 6px; border-radius: 99px; }
@keyframes notePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.stage-chip { height: auto; min-height: 34px; padding: 6px 12px; gap: 8px; font-size: 12.5px; white-space: nowrap; }
.mini-bar { width: 54px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.stage-chip small { font-size: 11.5px; font-weight: 800; color: var(--ink-2); }

.bubble {
  position: absolute; top: 58px; left: 50%; z-index: 4; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 18px; white-space: nowrap; pointer-events: none;
  font-size: 13px; font-weight: 900; color: #2a2135; background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  animation: bubbleIn .5s var(--pop) backwards .3s, bubbleFloat 2.6s ease-in-out .8s infinite;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; background: #fff; border-radius: 3px; transform: translateX(-50%) rotate(45deg); }
@keyframes bubbleIn { from { opacity: 0; transform: translateX(-50%) scale(.5); } }
@keyframes bubbleFloat { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }

/* частицы и всплывающий текст */
.heart-burst {
  position: absolute; left: 50%; top: 52%; z-index: 10; font-size: 22px; line-height: 1;
  pointer-events: none; user-select: none; opacity: 0; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .15));
}
.heart-burst.go { animation: burstFloat .9s var(--ease-out) forwards; }
@keyframes burstFloat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
  60% { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -40px))) scale(1.25); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px) * 1.2), calc(-50% + var(--dy, -40px) - 26px)) scale(.8); }
}
.care-float {
  position: absolute; left: 50%; top: 42%; z-index: 12; transform: translate(-50%, -50%);
  padding: 7px 16px; border-radius: 99px; white-space: nowrap; pointer-events: none;
  font-size: 16px; font-weight: 900; color: #fff; background: var(--grad);
  box-shadow: 0 10px 24px -6px rgba(255, 80, 60, .6);
  animation: floatPop 1.2s var(--ease-out) forwards;
}
@keyframes floatPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  22% { opacity: 1; transform: translate(-50%, -22px) scale(1.12); }
  75% { opacity: 1; transform: translate(-50%, -40px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(.9); }
}

/* пара и вопрос дня */
.duo-row { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 11px 12px; text-align: left;
  border: 0; border-radius: 20px; background: var(--surface); cursor: default;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform .25s var(--spring);
}
button.tile { cursor: pointer; }
button.tile:active { transform: scale(.96); }
.tile-k { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tile-k b { font-size: 13px; letter-spacing: 0; color: var(--accent); }
.tile.lit { background: linear-gradient(160deg, var(--surface) 30%, #ffe2c9); box-shadow: 0 10px 24px -12px rgba(255, 120, 40, .6), inset 0 0 0 1.5px rgba(255, 140, 60, .5); }
:root[data-theme="dark"] .tile.lit { background: linear-gradient(160deg, var(--surface) 30%, rgba(255, 120, 40, .25)); }
.pair-dots { display: flex; align-items: center; gap: 8px; }
.pd { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.pd i {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 900; background: var(--sunken); color: var(--ink-3);
}
.pd.ok { color: var(--ink); }
.pd.ok i { background: var(--mint); color: #fff; }
.daily-tile.new { background: linear-gradient(160deg, var(--surface) 30%, var(--violet-soft)); box-shadow: 0 10px 24px -14px rgba(123, 92, 255, .7), inset 0 0 0 1.5px rgba(123, 92, 255, .45); }
.daily-tile .tile-k { color: var(--violet); }
.daily-text { font-size: 13.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 77, 141, .18); }
.dot.new { animation: dotPing 1.6s ease-out infinite; }
.dot.wait { background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 159, 0, .18); }
.dot.done { background: var(--mint); box-shadow: 0 0 0 4px rgba(24, 168, 100, .18); }
@keyframes dotPing { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 141, .5); } 100% { box-shadow: 0 0 0 9px rgba(255, 77, 141, 0); } }

/* кнопки заботы */
.care-grid { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 3px; }
.care-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 4px 10px; border: 0; border-radius: 22px; cursor: pointer; background: var(--surface);
  box-shadow: 0 4px 0 var(--press), var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
  user-select: none; touch-action: manipulation;
}
.care-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--press), inset 0 0 0 1px var(--line); }
.care-btn:disabled { cursor: default; transform: translateY(3px); box-shadow: 0 1px 0 var(--press), inset 0 0 0 1px var(--line); background: var(--surface-2); }
.care-btn:disabled .em { filter: grayscale(.7); opacity: .55; }
.care-btn.is-fav:not(:disabled) { background: linear-gradient(180deg, var(--surface) 35%, var(--amber-soft)); box-shadow: 0 4px 0 #f1c75a, var(--shadow-sm), inset 0 0 0 1.5px rgba(245, 159, 0, .5); }
.care-btn.is-fav:active:not(:disabled) { box-shadow: 0 1px 0 #f1c75a, inset 0 0 0 1.5px rgba(245, 159, 0, .5); }
.ring { position: relative; width: 60px; height: 60px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.ring .trk { fill: none; stroke: var(--sunken); stroke-width: 6; }
.ring .val { fill: none; stroke: var(--c); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .8s var(--ease-out); filter: drop-shadow(0 0 4px var(--c)); }
.ring .em { font-size: 27px; line-height: 1; transition: transform .4s var(--pop); }
.care-btn:active:not(:disabled) .em { transform: scale(1.2) rotate(-8deg); }
.ring .pct {
  position: absolute; right: -10px; bottom: -3px; padding: 1px 6px; border-radius: 99px;
  font-size: 10.5px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--c);
  background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.lv-high { --c: #1fb26b; }
.lv-mid { --c: #f59f00; }
.lv-low { --c: #f03e3e; }
.care-title { font-size: 14px; font-weight: 900; line-height: 1.1; }
.care-cd { font-size: 11.5px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1; }
.care-btn.is-fav .care-cd { color: #b26b00; }
:root[data-theme="dark"] .care-btn.is-fav .care-cd { color: #ffc861; }
.fav-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  padding: 2px 8px; border-radius: 99px; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: #5a3a00; background: linear-gradient(135deg, #ffe066, #fab005); box-shadow: 0 3px 8px -2px rgba(250, 176, 5, .6);
}

/* нижняя панель */
.dock { flex: none; display: flex; gap: 10px; }
.dock .btn { min-height: 52px; border-radius: 17px; }

/* ================= тост ================= */
.toast {
  position: fixed; left: 50%; top: calc(12px + var(--tg-content-safe-area-inset-top, 0px)); z-index: 99;
  max-width: calc(100% - 32px); width: max-content; padding: 11px 18px; border-radius: 18px;
  font-size: 14px; font-weight: 900; text-align: center; line-height: 1.3;
  color: #fff; background: rgba(36, 28, 46, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  opacity: 0; transform: translate(-50%, -16px) scale(.96); pointer-events: none;
  transition: transform .4s var(--spring), opacity .25s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
:root[data-theme="dark"] .toast { background: rgba(250, 245, 255, .95); color: #2a2135; }

.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--sunken); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-emoji { font-size: 64px; margin-bottom: 12px; animation: floaty 3s ease-in-out infinite; }

/* ================= шторки (<dialog>) ================= */
dialog { color: var(--ink); }
dialog:modal {
  width: 100%; max-width: 520px; max-height: 90vh; margin: auto auto 0;
  border: 0; border-radius: 30px 30px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -12px 40px rgba(20, 10, 30, .25);
  overflow-y: auto; overscroll-behavior: contain;
  animation: sheetUp .45s var(--ease-out) both;
}
dialog.no-anim { animation: none; }
dialog:modal::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
dialog::backdrop { background: rgba(25, 15, 35, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: backdropFade .3s ease both; }
@keyframes backdropFade { from { opacity: 0; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-header h2 { font-size: 22px; margin: 0; }
.modal-close {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 16px; font-weight: 900; color: var(--ink-2); background: var(--sunken);
  transition: transform .25s var(--spring);
}
.modal-close:active { transform: scale(.85); }
.sheet-sub { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: -6px 0 14px; }
.row { display: flex; gap: 8px; }
.row > .grow { flex: 1; }

.note-paper {
  position: relative; margin-bottom: 14px; padding: 18px 18px 14px; border-radius: 22px;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(255, 120, 150, .16) 27px 28px), linear-gradient(180deg, #fffdf6, #fff6e6);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(240, 200, 140, .5);
  color: #3a2e39;
}
.note-paper::after { content: '💌'; position: absolute; top: -12px; right: 14px; font-size: 26px; transform: rotate(12deg); }
.note-paper p { font-size: 17px; line-height: 28px; font-weight: 800; font-style: italic; margin: 0 0 6px; }
.note-meta { font-size: 12px; font-weight: 800; color: #9a8a96; }
.empty-hint { text-align: center; padding: 8px 10px 16px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.empty-hint .big { display: block; font-size: 44px; margin-bottom: 6px; }
.modal-input {
  width: 100%; margin-bottom: 12px; padding: 14px 16px; border: 0; border-radius: 18px; resize: none;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .2s;
}
.modal-input::placeholder { color: var(--ink-3); }
.modal-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }

.daily-q {
  margin-bottom: 14px; padding: 18px; border-radius: 22px; color: #fff;
  font-size: 18px; font-weight: 900; line-height: 1.3; letter-spacing: -.2px;
  background: var(--grad-violet); box-shadow: 0 14px 30px -14px rgba(123, 92, 255, .8);
}
.ans-box { margin-bottom: 10px; padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.ans-box.my { box-shadow: inset 0 0 0 1.5px rgba(123, 92, 255, .4); }
.ans-box.partner { box-shadow: inset 0 0 0 1.5px rgba(255, 140, 60, .5); }
.ans-box .who { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ans-box p { margin: 0; font-size: 15px; font-weight: 800; }
.daily-reward { margin: 4px 0 14px; padding: 10px; border-radius: 16px; text-align: center; font-size: 14px; font-weight: 900; color: #c2410c; background: #ffedd5; }
:root[data-theme="dark"] .daily-reward { background: rgba(255, 140, 60, .16); color: #ffb37a; }
.locked-ans { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 14px; border-radius: 18px; background: var(--sunken); font-size: 14px; font-weight: 800; color: var(--ink-2); }
.locked-ans .big { font-size: 26px; }

/* лавка */
.shop-balance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { padding: 10px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.stat small { display: block; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.stat b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.shop-h { margin: 4px 2px 10px; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.shop-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 10px 10px; text-align: center;
  border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.shop-item.equipped { box-shadow: 0 12px 26px -14px rgba(255, 90, 60, .8), inset 0 0 0 2px var(--accent); }
.shop-item .ic {
  width: 62px; height: 62px; margin-bottom: 6px; border-radius: 20px; display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(circle at 35% 30%, var(--surface-2), var(--sunken));
}
.shop-item.locked .ic { filter: saturate(.7); }
.shop-item-name { font-size: 14px; font-weight: 900; line-height: 1.15; }
.shop-item-desc { min-height: 28px; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; line-height: 1.25; color: var(--ink-2); }
.shop-actions { display: flex; gap: 6px; width: 100%; margin-top: auto; }
.shop-actions .btn { min-height: 38px; padding: 0 6px; font-size: 13px; border-radius: 12px; }
.shop-actions .btn:disabled { opacity: 1; background: var(--sunken); color: var(--ink-3); box-shadow: none; }
.ribbon { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 99px; font-size: 9.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--grad); }
.ribbon.own { background: var(--mint); }

/* инфо */
.info-content { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.info-hero { display: flex; align-items: center; gap: 12px; }
.info-hero .rname { font-size: 30px; margin: 0; }
.info-block { padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 700; line-height: 1.4; }
.info-block .k { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.info-block .rares { justify-content: flex-start; margin: 2px 0 0; }
.info-block.contrast { color: var(--ink-2); font-style: italic; }
.stage-track { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.stage-track .st { flex: 1; text-align: center; font-size: 11.5px; font-weight: 900; color: var(--ink-3); }
.stage-track .st .e { display: block; font-size: 22px; filter: grayscale(1); opacity: .45; margin-bottom: 2px; }
.stage-track .st.on { color: var(--ink); }
.stage-track .st.on .e { filter: none; opacity: 1; }
.stage-track .bar { flex: 1.3; height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin-bottom: 16px; }
.stage-track .bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.premium-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
  border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: #5a3a00;
  background: linear-gradient(135deg, #fff4c2, #ffd36b 60%, #ffb938);
  box-shadow: 0 14px 30px -14px rgba(255, 160, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .25s var(--spring);
}
.premium-card:active { transform: scale(.97); }
.premium-card .e { font-size: 34px; }
.premium-card b { display: block; font-size: 16px; font-weight: 900; }
.premium-card small { font-size: 12.5px; font-weight: 800; opacity: .8; }
.premium-card .price { margin-left: auto; padding: 6px 10px; border-radius: 12px; font-weight: 900; background: rgba(255, 255, 255, .7); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= несколько питомцев ================= */
button.title {
  display: block; text-align: left; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer;
  border-radius: 14px; transition: transform .25s var(--spring);
}
button.title:active { transform: scale(.97); }
.pname .nm { overflow: hidden; text-overflow: ellipsis; }
.pname .caret { margin-left: -3px; font-size: 14px; color: var(--ink-3); transform: translateY(1px); }
.pchar { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pchar .tier { flex: none; padding: 2px 7px; font-size: 9px; letter-spacing: .08em; }
.pchar .ch { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.scene .art.from-r { animation: petFromR .38s var(--ease-out); }
.scene .art.from-l { animation: petFromL .38s var(--ease-out); }
@keyframes petFromR { from { opacity: 0; transform: translateX(28%) scale(.94); } }
@keyframes petFromL { from { opacity: 0; transform: translateX(-28%) scale(.94); } }
.scene { touch-action: pan-y; }

.pets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.pet-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 12px;
  border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); font: inherit; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform .25s var(--spring), box-shadow .2s;
}
.pet-card:active { transform: scale(.96); }
.pet-card.on { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); cursor: default; }
.pthumb { width: 100%; aspect-ratio: 300 / 290; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: var(--sunken); }
.pthumb img { display: block; width: 100%; height: 100%; }
.pthumb .ph { font-size: 38px; opacity: .55; }
.pc-name { font-size: 15px; font-weight: 900; letter-spacing: -.3px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-card .tier { padding: 3px 8px; font-size: 9px; letter-spacing: .08em; }
.pc-desc { font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.egg-card { cursor: default; background: linear-gradient(160deg, var(--surface), var(--amber-soft)); }
.egg-card .pthumb { background: transparent; }
.egg-ph { opacity: 1 !important; font-size: 52px !important; animation: wobble 2.4s ease-in-out infinite; }

/* ================= тематические яйца ================= */
.pthumb { position: relative; }
.egg-badge {
  position: absolute; right: 18%; bottom: 14%; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 99px; font-size: 16px; background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.egg-badge.big { right: calc(50% - 76px); bottom: 26px; width: 44px; height: 44px; font-size: 24px; animation: bump 2.4s ease-in-out infinite; }
.egg-themed { position: relative; }
.egg-card.theme-animal { background: linear-gradient(160deg, var(--surface), #ffe3cf); }
:root[data-theme="dark"] .egg-card.theme-animal { background: linear-gradient(160deg, var(--surface), #3a2a22); }
.pet-card.egg-wait .pthumb { background: var(--amber-soft); }
.pet-card.egg-wait .pc-desc { color: var(--accent); }
.egg-back {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 24px; font-weight: 900; line-height: 1; color: var(--ink);
  background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.egg-back:active { transform: scale(.92); }
.egg-promise { margin: 10px 0 0; text-align: center; font-size: 14px; font-weight: 800; color: var(--ink-2); }
