/* Кота-карты. Язык Portals: стеклянные плашки с бликом, цветные
   градиентные плитки, крупные скругления, плавающее меню. При этом на
   экране одно главное действие — баннер сверху. */
:root {
  color-scheme: dark;
  --bg: #121212;
  --surface: #19191c;
  --surface-2: #232327;
  --line: rgba(255, 255, 255, .06);
  --text: #f5f5f7;
  --muted: #8b8b93;
  --muted-2: #5c5c63;
  --gold: #f5b82e;
  --gold-soft: #2c2412;
  --r-xl: 28px;
  --r-lg: 22px;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --paws: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='%23fff'%3E%3Cellipse cx='14' cy='18' rx='5' ry='4.2'/%3E%3Ccircle cx='8.5' cy='11.5' r='2'/%3E%3Ccircle cx='12' cy='8.5' r='2'/%3E%3Ccircle cx='16.5' cy='8.5' r='2'/%3E%3Ccircle cx='20' cy='11.5' r='2'/%3E%3Cellipse cx='42' cy='46' rx='5' ry='4.2'/%3E%3Ccircle cx='36.5' cy='39.5' r='2'/%3E%3Ccircle cx='40' cy='36.5' r='2'/%3E%3Ccircle cx='44.5' cy='36.5' r='2'/%3E%3Ccircle cx='48' cy='39.5' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 600 15px/1.4 var(--font);
  min-height: 100vh;
  padding-bottom: calc(100px + var(--safe-b));
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

main { padding: 8px 16px 16px; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 60px 16px; font-weight: 700; }
.empty-cat { width: 84px; margin: 0 auto 14px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ── стекло и плашки (как в Portals) ─────────── */
.glass-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px;
  font-weight: 800; font-size: 18px; background: rgba(44, 44, 48, .6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.glass-pill .ico { font-size: 19px; }
.pill-gold { background: linear-gradient(180deg, #4a3810, #2c210a); box-shadow: inset 0 1px 0 rgba(255, 210, 120, .22); }
.pill-blue { background: linear-gradient(180deg, #1c3858, #10233a); box-shadow: inset 0 1px 0 rgba(140, 190, 255, .22); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }
.page-title { font-size: 32px; font-weight: 800; letter-spacing: -.4px; margin: 6px 2px 0; }

.glass-card {
  border-radius: 32px; padding: 18px; background: linear-gradient(180deg, rgba(42, 42, 46, .9), rgba(28, 28, 31, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 10px 30px rgba(0, 0, 0, .3);
}
.glass-card.center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 20px 22px; }
.hero-sub { color: var(--muted); font-weight: 700; max-width: 32ch; text-wrap: balance; }
.hero-meta { color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 4px; }

/* ── кнопки и поля ───────────────────────────── */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: 17px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); text-align: center; transition: transform .12s ease; }
.btn:active { transform: scale(.97); }
.btn.primary, .btn.blue { background: #1f8bff; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px rgba(31, 139, 255, .3); }
.btn.white { background: #fff; color: #111; }
.btn.small { height: 36px; font-size: 14px; padding: 0 14px; }
.btn:disabled { opacity: .4; }
.field { width: 100%; height: 52px; padding: 0 18px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .06); color: var(--text); font: 800 17px var(--font); outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.field:focus { box-shadow: inset 0 0 0 2px #1f8bff; }
.link { color: var(--muted); font-weight: 800; font-size: 14px; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 10px 0; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f0a01e, #ffd27a); }

/* ── баннер (как «Осенний турнир» и «REDO») ──── */
.banner {
  position: relative; overflow: hidden; display: flex; align-items: center; width: 100%; min-height: 168px;
  border-radius: 34px; padding: 22px; text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .16), 0 14px 36px rgba(0, 0, 0, .35);
}
.banner.gold { background: linear-gradient(110deg, #7a5420 0%, #4f3714 50%, #2a1e0c 100%); }
.banner.blue { background: linear-gradient(110deg, #1f5fb0 0%, #163f72 50%, #0d1f38 100%); box-shadow: inset 0 1px 0 rgba(160, 205, 255, .18), 0 14px 36px rgba(0, 0, 0, .35); }
.banner::before { content: ""; position: absolute; inset: 0; background: var(--paws) 0 0 / 56px; opacity: .06; }
.b-text { position: relative; z-index: 2; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.b-title { font-size: 28px; font-weight: 800; line-height: 1.05; text-wrap: balance; }
.b-sub { color: rgba(255, 255, 255, .72); font-weight: 800; }
.b-bar { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); overflow: hidden; max-width: 170px; }
.b-bar i { display: block; height: 100%; background: #8fd0ff; border-radius: 999px; }
.b-pill { align-self: flex-start; margin-top: 6px; padding: 6px 16px; border-radius: 999px; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; color: #3a2606; background: linear-gradient(180deg, #ffd88a, #f2a93a); box-shadow: 0 0 0 2px rgba(0, 0, 0, .15); }
.banner.blue .b-pill { color: #08264a; background: linear-gradient(180deg, #8fd0ff, #3fa0ff); }
.banner .stack { position: relative; z-index: 1; flex: none; width: 104px; height: 130px; margin-right: 6px; }
.stack-card { position: absolute; inset: 0; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, #b9bcc4, #f1f2f5 40%, #a3a7b0 68%, #dfe1e6); box-shadow: 0 12px 26px rgba(0, 0, 0, .45); }
.stack-card span { font-size: 42px; font-weight: 800; color: rgba(40, 40, 50, .5); }
.stack-card:nth-child(1) { z-index: 3; animation: bob 2.4s ease-in-out infinite; }
.stack-card:nth-child(2) { transform: rotate(-10deg) translateX(-16px); opacity: .75; z-index: 2; }
.stack-card:nth-child(3) { transform: rotate(10deg) translateX(16px); opacity: .55; z-index: 1; }
.b-cat { position: relative; z-index: 1; width: 120px; flex: none; transform: rotate(-8deg); }

/* ── цветные плитки (как «Стейкинг») ─────────── */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; overflow: hidden; border-radius: 34px; padding: 18px 14px; min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .15s ease;
}
button.tile:active { transform: scale(.97); }
.tile::before { content: ""; position: absolute; inset: 0; background: var(--paws) 0 0 / 56px; opacity: .05; pointer-events: none; }
.tile > * { position: relative; }
.t-big { font-size: 34px; font-weight: 800; line-height: 1; }
.t-big small { font-size: 20px; color: rgba(255, 255, 255, .5); }
.t-title { font-size: 20px; font-weight: 800; line-height: 1.1; }
.t-sub { color: rgba(255, 255, 255, .55); font-weight: 800; font-size: 15px; }
.g-green { background: radial-gradient(120% 90% at 50% 0%, #1f7a3d 0%, #173a24 55%, #16201a 100%); }
.g-blue { background: radial-gradient(120% 90% at 50% 0%, #1b4a7a 0%, #172a40 55%, #151c26 100%); }
.c-green { color: #4ade80; } .c-blue { color: #5aaaff; }

/* ── списки ──────────────────────────────────── */
.block-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.block-head .muted { font-size: 15px; }
.row-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; text-align: left; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-ico { width: 44px; height: 44px; flex: none; border-radius: 15px; display: grid; place-items: center; padding: 6px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #888) 22%, #2a2a2e), #2a2a2e 75%); }
.row-ico.emoji { font-size: 20px; background: rgba(255, 255, 255, .06); }
.row-ico .cat-sil, .row-ico .skin-img { width: 100%; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-weight: 700; font-size: 13px; }
.chev { color: var(--muted-2); font-size: 22px; }
.balance { font-size: 58px; font-weight: 800; line-height: 1; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.balance span { font-size: 40px; }
.wd-row { display: flex; gap: 10px; width: 100%; margin-top: 12px; }
.wd-row .btn { flex: none; }

/* ── карты (как «Мои подарки») ───────────────── */
.seg { display: flex; padding: 5px; border-radius: 999px; background: rgba(44, 44, 48, .7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
.seg button { flex: 1; height: 46px; border-radius: 999px; font-weight: 800; font-size: 16px; color: var(--muted-2); text-align: center; }
.seg button.on { background: #fff; color: #111; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 14px; border-radius: 30px; text-align: left;
  background: linear-gradient(180deg, rgba(42, 42, 46, .9), rgba(28, 28, 31, .9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: transform .12s ease; }
.item:active { transform: scale(.97); }
.tile-pic { position: relative; aspect-ratio: 1; border-radius: 24px; overflow: hidden; display: grid; place-items: center; margin-bottom: 8px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #888) 18%, #2c2c30), #2c2c30 72%); }
.tile-pic::before { content: ""; position: absolute; inset: 0; background: var(--paws) 0 0 / 44px; opacity: .05; }
.tile-pic .cat-sil, .tile-pic .skin-img { width: 62%; position: relative; }
.tile-pic.foil { background: linear-gradient(135deg, #b9bcc4, #f1f2f5 40%, #a3a7b0 68%, #dfe1e6); }
.tile-pic.foil::before { filter: invert(1); opacity: .1; }
.tile-pic.foil span { position: relative; font-size: 44px; font-weight: 800; color: rgba(40, 40, 50, .5); }
.item b { font-weight: 800; font-size: 17px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item small { color: var(--muted); font-weight: 700; font-size: 13px; padding: 0 6px; }

/* ── скины ───────────────────────────────────── */
.set { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.set-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.set-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.set-name i { width: 10px; height: 10px; border-radius: 50%; }
.skins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.skin-cell { aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center; padding: 10px;
  background: rgba(36, 36, 40, .9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.skin-cell.on { background: linear-gradient(180deg, rgba(58, 58, 64, .95), rgba(36, 36, 40, .95)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.skin-img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.skin-img.locked { filter: brightness(0) invert(.25); opacity: .6; }
.skin-cell .cat-sil { width: 100%; }
@media (max-width: 360px) { .skins { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── рейтинг и люди ──────────────────────────── */
.avatar { width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 16px; background-size: cover; background-position: center; }
.rank { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rank + .rank { border-top: 1px solid var(--line); }
.rank .pl { width: 22px; text-align: center; color: var(--muted); font-weight: 800; }
.rank .nm, .member .nm { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank small, .member small { color: var(--muted); font-weight: 700; }
.rank .val { color: var(--muted); font-weight: 700; font-size: 14px; }
.rank .val b { color: var(--text); font-size: 17px; }
.rank.me { margin: 0 -10px; padding: 10px; border-radius: 18px; background: rgba(255, 184, 31, .08); }
.rank.me .pl { color: var(--gold); }
.member { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.wd { display: flex; justify-content: space-between; padding: 10px 0; font-weight: 800; }
.wd + .wd { border-top: 1px solid var(--line); }

/* ── нижнее меню (как в Portals) ─────────────── */
.dock { position: fixed; left: 0; right: 0; bottom: calc(12px + var(--safe-b)); z-index: 5; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; pointer-events: none; max-width: 520px; margin: 0 auto; }
.dock > * { pointer-events: auto; }
.dock svg { width: 26px; height: 26px; fill: currentColor; }
.dock-round, .dock-group { background: rgba(38, 38, 42, .72); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 34px rgba(0, 0, 0, .55); }
.dock-round { width: 66px; height: 66px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 800; flex: none; }
.dock-group { display: flex; flex: 1; min-width: 0; height: 66px; border-radius: 999px; padding: 0 5px; }
.dock-group button { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 800; border-radius: 999px; text-align: center; }
.dock button.on, .dock-round.on { color: #1f8bff; }
.dock-group button.on { background: rgba(255, 255, 255, .07); margin: 6px 0; }
.dock-avatar { padding: 5px; }
.dock-avatar .avatar { width: 56px; height: 56px; border-radius: 50%; font-size: 22px; }
.dock-avatar.on .avatar { box-shadow: 0 0 0 3px #1f8bff; }
.dock-badge { position: absolute; top: 4px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ff7a1a; color: #fff; font: 800 12px/20px var(--font); font-style: normal; box-shadow: 0 0 0 2px #26262a; }
@media (max-width: 360px) {
  .dock-round { width: 58px; height: 58px; font-size: 11px; }
  .dock-group { height: 58px; }
  .dock-group button { font-size: 11px; }
  .dock-avatar .avatar { width: 48px; height: 48px; }
}

/* ── котик-иконка ────────────────────────────── */
.cat-sil { display: block; width: 100%; height: auto; overflow: visible; }

/* ── карта (лицо) ────────────────────────────── */
.kcard {
  --rc: #d4d4d8;
  position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 38px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 10%, #3a3a3d 0%, #222224 60%, #19191b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 60px rgba(0, 0, 0, .55);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.kcard[data-r="home"] { --rc: #4ade80; background: radial-gradient(120% 80% at 50% 10%, #237f43 0%, #173a24 60%, #121c15 100%); }
.kcard[data-r="pedigree"] { --rc: #5aaaff; background: radial-gradient(120% 80% at 50% 10%, #1f5590 0%, #162a45 60%, #10161f 100%); }
.kcard[data-r="royal"] { --rc: #be93ff; background: radial-gradient(120% 80% at 50% 10%, #6431ab 0%, #2e1a4d 60%, #150f20 100%); }
.kcard[data-r="legend"] { --rc: #ffc24a; background: radial-gradient(120% 80% at 50% 10%, #a3741c 0%, #4d3610 60%, #1d150a 100%); }
.kcard[data-r="cheshire"] { --rc: #ff7ad9; background: radial-gradient(120% 80% at 50% 10%, #b03aa0 0%, #4b1a5c 60%, #1a0d22 100%); }
.kcard::before { content: ""; position: absolute; inset: 0; background: var(--paws) 0 0 / 64px; opacity: .06; }
.kcard-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 22px 20px 24px; }
.kc-top { width: 100%; display: flex; justify-content: space-between; align-items: center; position: relative; }
.kc-tag { padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; background: rgba(0, 0, 0, .28); backdrop-filter: blur(10px); color: rgba(255, 255, 255, .85); }
.kc-rarity { margin-top: 18px; padding: 7px 16px; border-radius: 999px; font-weight: 800; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--rc); background: rgba(0, 0, 0, .3); position: relative; box-shadow: 0 0 24px color-mix(in srgb, var(--rc) 30%, transparent); }
.kc-cat { position: relative; width: 62%; margin-top: 10px; animation: floaty 3.6s ease-in-out infinite; }
.kc-cat::before { content: ""; position: absolute; inset: 8% 8% 0; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 55%, transparent), transparent); filter: blur(14px); }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.kc-name { margin-top: auto; font-size: 30px; font-weight: 800; position: relative; text-align: center; line-height: 1.1; }
.kc-prize { margin-top: 12px; padding: 12px 22px; border-radius: 999px; font-weight: 800; font-size: 20px; background: #fff; color: #111; position: relative; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); max-width: 100%; text-align: center; }
.kc-prize.empty { background: rgba(0, 0, 0, .3); color: rgba(255, 255, 255, .75); box-shadow: none; }
.kc-prize.stars { background: linear-gradient(180deg, #ffd88a, #f2a93a); color: #3a2606; }

/* ── экран стирания ──────────────────────────── */
.scratch-screen { position: fixed; inset: 0; z-index: 10; background: rgba(10, 10, 12, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); overflow-y: auto; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.scratch-top { position: sticky; top: 0; display: flex; justify-content: space-between; padding: 14px 16px; z-index: 3; }
.scratch-top .glass-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); font-weight: 800; font-size: 15px; }
.scratch-wrap { width: min(88vw, 380px); margin: 0 auto; padding: 4px 0 40px; }
.kcard.big { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.85) rotate(-4deg); opacity: 0; } }
#foil { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; transition: opacity .6s ease; touch-action: none; }
#foil.gone { opacity: 0; pointer-events: none; }
.scratch-hint { text-align: center; color: var(--muted); margin-top: 16px; font-weight: 800; }
.scratch-events { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.scratch-events div { background: var(--gold-soft); color: #ffd88a; border-radius: 22px; padding: 12px 16px; font-weight: 800; text-align: center; animation: fadein .4s ease; }
.scratch-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.kcard.revealed { animation: glow 1.2s ease; }
@keyframes glow { 40% { box-shadow: 0 0 70px 8px color-mix(in srgb, var(--rc) 65%, transparent); transform: scale(1.03); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 4; width: 100%; height: 100%; }

/* ── карта в карте ───────────────────────────── */
.kc-nest { position: relative; width: 56%; margin-top: 12px; perspective: 600px; }
.nest-card {
  aspect-ratio: 3 / 4; border-radius: 22px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #b9bcc4, #f1f2f5 38%, #9ca0aa 62%, #e3e5ea);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 70%, transparent), 0 18px 40px rgba(0, 0, 0, .5);
  animation: nest-wiggle 1.4s ease-in-out infinite;
}
.nest-card::before { content: ""; position: absolute; inset: 0; background: var(--paws) 0 0 / 44px; opacity: .14; filter: invert(1); }
.nest-card span { position: relative; font-size: 64px; font-weight: 800; color: rgba(40, 40, 50, .55); }
@keyframes nest-wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
.kcard.nest-out .kc-nest { transition: transform .5s cubic-bezier(.5, 0, .3, 1); transform: scale(1.9) translateY(-14%); z-index: 3; }
.kcard.nest-out .kc-top, .kcard.nest-out .kc-rarity, .kcard.nest-out .kc-name, .kcard.nest-out .kc-prize { transition: opacity .3s ease; opacity: 0; }


.kc-cat .cat-sil { position: relative; width: 82%; margin: 0 auto; }
.kc-cat .skin-img { position: relative; width: 88%; margin: 0 auto; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .5)); }

/* всплывашка */
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); background: #fff; color: #111; padding: 12px 20px; border-radius: 22px; z-index: 20; font-weight: 800; font-size: 15px; max-width: 90vw; text-align: center; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); animation: fadein .2s ease; }

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

/* Текст баннера не заезжает на стопку карт и котика справа. */
.b-text { max-width: calc(100% - 140px); }
.b-title { font-size: 26px; overflow-wrap: anywhere; }
.banner .stack { margin-left: 16px; }

/* Кнопки в ряд (под стёртой картой: «В чат» и «Готово»). */
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }


/* ─────────────── строже и взрослее ───────────────
   Без узора из лапок, без «таблеток» на карте; редкость и подписи —
   мелкими заглавными, приз — крупной цифрой, рамка цвета редкости. */
.tile::before, .banner::before, .kcard::before, .tile-pic::before, .nest-card::before { display: none; }
body { letter-spacing: -.1px; }
.page-title, .b-title, .t-big, .kc-name, .balance { letter-spacing: -.8px; }
.b-title { font-size: 25px; font-weight: 800; }
.b-sub { font-weight: 600; color: rgba(255, 255, 255, .62); }
.b-pill, .banner.blue .b-pill { color: #fff; font-weight: 700; font-size: 15px; padding: 7px 16px;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); backdrop-filter: blur(10px); }
.banner.gold { background: linear-gradient(115deg, #4b3720 0%, #2c2116 55%, #18130e 100%); box-shadow: inset 0 0 0 1px rgba(255, 210, 140, .12), 0 14px 36px rgba(0, 0, 0, .35); }
.banner.blue { background: linear-gradient(115deg, #1c4a85 0%, #13305a 55%, #0b1830 100%); box-shadow: inset 0 0 0 1px rgba(150, 200, 255, .12), 0 14px 36px rgba(0, 0, 0, .35); }
.g-blue { background: linear-gradient(160deg, #183a63 0%, #142338 60%, #111722 100%); box-shadow: inset 0 0 0 1px rgba(140, 190, 255, .1); }
.g-green { background: linear-gradient(160deg, #19502f 0%, #142a1e 60%, #101814 100%); box-shadow: inset 0 0 0 1px rgba(120, 230, 160, .1); }
.tile { align-items: flex-start; text-align: left; justify-content: flex-end; padding: 18px; min-height: 132px; }
.t-label { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255, 255, 255, .5); margin-bottom: auto; }
.t-big { font-size: 36px; font-weight: 800; }
.t-big small { font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, .5); letter-spacing: 0; }
.t-sub { font-size: 13px; font-weight: 600; }
.glass-pill { font-weight: 700; font-size: 17px; }
.block-head { font-weight: 700; }
.row-main b, .item b { font-weight: 700; }

/* карта — как коллекционная */
.kcard[data-r] {
  border-radius: 26px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--rc) 20%, #141418) 0%, #121215 55%, #0c0c0f 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent), 0 30px 70px rgba(0, 0, 0, .6);
}
.kcard-inner::before { content: ""; position: absolute; inset: 10px; border-radius: 18px; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--rc) 22%, transparent); }
.kc-top { padding: 4px 6px 0; }
.kc-tag { background: none; backdrop-filter: none; padding: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.kc-rarity { background: none; box-shadow: none; padding: 0; margin-top: 30px; font-size: 12px; font-weight: 700; letter-spacing: 4px; }
.kc-cat { width: 50%; margin-top: 22px; animation-duration: 5s; }
.kc-cat::before { filter: blur(26px); opacity: .7; }
.kc-name { font-size: 46px; font-weight: 800; }
.kc-prize, .kc-prize.empty, .kc-prize.stars { background: none; box-shadow: none; padding: 0; margin-top: 6px; margin-bottom: 8px;
  color: rgba(255, 255, 255, .55); font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.kc-prize.stars { color: color-mix(in srgb, var(--gold) 85%, #fff); }
.scratch-events div { background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .75); font-weight: 600; font-size: 14px; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.scratch-hint { font-weight: 600; font-size: 14px; }
.btn { font-weight: 700; }


/* ─────────────── кот фоном карты, звезда-иконка ─────────────── */
.star-ico { display: inline-block; width: .92em; height: .92em; vertical-align: -.1em; margin-left: .06em; }
.glass-pill .star-ico.ico { width: 20px; height: 20px; margin: 0; }
.balance .star-ico { width: 44px; height: 44px; }
.kc-bgcat { position: absolute; left: 12%; right: 12%; bottom: 5%; pointer-events: none; z-index: 0; }
.kc-bgcat .cat-sil { width: 100%; }
.kc-top, .kc-rarity { position: relative; z-index: 1; }
.kc-main { position: relative; z-index: 1; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 18px; }
.kc-main .kc-name { margin-top: 0; font-size: 64px; line-height: 1; text-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
.kc-main.has-top .kc-name { font-size: 40px; margin-top: 14px; }
.kc-main .kc-prize { margin-top: 10px; font-size: 15px; }
.kc-main .kc-cat { width: 58%; margin-top: 0; }
.kc-main .kc-nest { margin-top: 0; }
.kcard.nest-out .kc-bgcat, .kcard.nest-out .kc-main > :not(.kc-nest) { transition: opacity .3s ease; opacity: 0; }
.row-ico .cat-sil, .tile-pic .cat-sil { width: 86%; }
/* приз — наверху, под редкостью; кот — внизу, не под цифрами */
.kc-main { justify-content: flex-start; padding-top: 28px; }
.kc-main.has-top { justify-content: center; padding-top: 0; }

/* Полноэкранный режим Telegram: шапку и кнопку «Закрыть» опускаем ниже
   системной строки и кнопок Telegram (их размеры Telegram отдаёт сам). */
main { padding-top: calc(8px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.scratch-top { padding-top: calc(14px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.dock { bottom: calc(12px + max(var(--safe-b), var(--tg-safe-area-inset-bottom, 0px))); }


/* ─────────────── анимации ─────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.rise { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* меню: активная иконка пружинит, подложка плавно появляется */
@keyframes tabpop { 0% { transform: scale(.8); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.dock button { transition: color .25s ease, background-color .25s ease, margin .25s ease; }
.dock button.on svg { animation: tabpop .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.dock-badge.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }

/* карта: блик после стирания, «съезжающаяся» редкость, наклон пальцем */
.kcard { transition: transform .35s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; will-change: transform; }
.kcard:active { transition-duration: .08s; }
.kcard::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .22) 48%, rgba(255, 255, 255, .06) 54%, transparent 66%);
  transform: translateX(-130%); }
.kcard.revealed::after { animation: sweep 1.1s .15s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes sweep { to { transform: translateX(130%); } }
.kcard[data-r="legend"].revealed::after, .kcard[data-r="cheshire"].revealed::after { animation: sweep 1.6s .15s ease-in-out infinite; animation-delay: .15s; }
.kcard[data-r="legend"]::before, .kcard[data-r="cheshire"]::before { display: block !important; content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .35;
  background: radial-gradient(60% 40% at var(--gx, 30%) var(--gy, 20%), color-mix(in srgb, var(--rc) 45%, transparent), transparent 70%); }
@keyframes spread { from { letter-spacing: 14px; opacity: 0; } }
.kcard.revealed .kc-rarity { animation: spread .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes namein { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.kcard.revealed .kc-name { animation: namein .6s .1s cubic-bezier(.2, 1.3, .4, 1) both; }
.kcard.revealed .kc-prize { animation: namein .6s .25s ease both; }
.kcard.revealed .kc-bgcat { animation: namein 1s .1s ease both; }

/* баннер: стопка карт мягко покачивается, блик по золотому баннеру */
.banner.gold::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 230, 180, .12) 50%, transparent 60%);
  transform: translateX(-120%); animation: sweep 4.5s 1s ease-in-out infinite; }
.btn, .item, .tile, .row-item, .glass-pill, .banner { transition: transform .15s ease, opacity .15s ease; }
.row-item:active, .banner:active { transform: scale(.98); }
/* счётчик новых карт — в углу иконки, не поверх неё */
.dock-badge { left: calc(50% + 9px); right: auto; top: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px; }


/* ─────────────── NiN cards: проще и чище ───────────────
   Без капса и разрядки — обычный текст. Скругления «как на айфоне»
   (суперэллипс) там, где браузер это умеет. */
.t-label, .kc-tag, .kc-rarity, .label { text-transform: none !important; letter-spacing: 0 !important; }
.t-label { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .62); }
.t-big { font-size: 38px; }
.t-big small { font-size: 17px; }
.tile { min-height: 120px; }
.kc-tag { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .5); }
.kc-rarity { font-size: 15px; font-weight: 600; margin-top: 18px; }
.kcard.revealed .kc-rarity { animation: namein .6s .05s ease both; }
.kc-brand { position: relative; z-index: 1; font-size: 15px; font-weight: 800; letter-spacing: -.2px; margin-bottom: 10px; }
.kc-brand span, .brand span { font-weight: 500; color: rgba(255, 255, 255, .55); }
.topbar { position: relative; }
.brand { position: absolute; left: 50%; transform: translateX(-50%); font-size: 15px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; pointer-events: none; }

/* синий баннер: «Карта дня» и счёт; котик правее и тише */
.b-count { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: rgba(255, 255, 255, .92); }
.banner.blue { min-height: 150px; }
.banner.blue .b-text { max-width: 60%; }
.b-cat { position: absolute; right: -34px; top: 50%; transform: translateY(-50%) rotate(-12deg); width: 156px; opacity: .26; z-index: 0; }

/* суперэллипс — плавное «айфоновское» скругление */
@supports (corner-shape: squircle) {
  .banner, .tile, .glass-card, .item, .tile-pic, .kcard, .kcard-inner::before, .skin-cell, .row-ico,
  .stack-card, .nest-card, .scratch-events div { corner-shape: squircle; }
  .banner, .tile, .glass-card { border-radius: 52px; }
  .item { border-radius: 48px; }
  .tile-pic { border-radius: 40px; }
  .kcard[data-r] { border-radius: 46px; }
  .kcard-inner::before { border-radius: 36px; }
  .skin-cell, .row-ico { border-radius: 30px; }
}
