:root {
	--v1: #7c3aed; --v2: #a855f7; --v3: #5b21b6; --v4: #3b0f7a;
	--g1: #22c55e; --g2: #16a34a; --g3: #bbf7d0;
	--y1: #fcd34d; --y2: #f59e0b; --y3: #fff3c4;
	--card: rgba(255, 255, 255, .13); --card-b: rgba(255, 255, 255, .22);
	--txt: #fff; --muted: rgba(255, 255, 255, .7);
	--sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
	--tab-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bgc, var(--v4)); color: var(--txt); font-family: -apple-system, "SF Pro Rounded", "Segoe UI", Roboto, system-ui, sans-serif; overscroll-behavior: none; }
body { background: var(--bg-img, radial-gradient(120% 70% at 50% -10%, #a855f7 0%, #7c3aed 38%, #4c1d95 75%, #2e1065 100%)) fixed; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.app { display: flex; flex-direction: column; height: 100dvh; padding-top: calc(var(--sat) + var(--tg-content-safe-area-inset-top, 0px)); }
b { font-weight: 800; }

/* шапка */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.logo { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--y1); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.top-title { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.top-title b { font-size: 17px; letter-spacing: .2px; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.top-title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vip-chip { background: linear-gradient(180deg, var(--y1), var(--y2)); color: #5b3a00; font-weight: 800; font-size: 12px; padding: 5px 10px; border-radius: 99px; box-shadow: 0 2px 0 #b45309; }

/* балансы */
.balances { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 6px 12px 4px; }
.bal { background: var(--card); border: 1px solid var(--card-b); border-radius: 12px; padding: 5px 2px; text-align: center; backdrop-filter: blur(6px); }
.bal.money { grid-column: span 6; background: linear-gradient(180deg, #4ade80, var(--g2)); border-color: #86efac; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; box-shadow: 0 3px 0 #166534; }
.bal.money .n { font-size: 26px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.bal.money small { font-size: 12px; opacity: .85; align-self: flex-end; padding-bottom: 4px; }
.bal .n { font-weight: 800; font-size: 12.5px; display: block; line-height: 1.25; white-space: nowrap; }
.bal .n em { font-style: normal; font-size: 17px; display: block; }
.bal .l { display: none; }
.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.14); } }

/* экран */
.screen { flex: 1; overflow-y: auto; padding: 8px 12px calc(var(--tab-h) + var(--sab) + 16px); -webkit-overflow-scrolling: touch; }
.card { background: var(--card); border: 1px solid var(--card-b); border-radius: 20px; padding: 14px; margin-bottom: 12px; backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(30, 5, 80, .25); }
.card h2 { margin: 0 0 8px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.card h2 small { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }

/* кнопки */
.btn { display: block; width: 100%; padding: 13px 14px; border-radius: 16px; font-weight: 800; font-size: 16px; text-align: center; transition: transform .08s; }
.btn:active { transform: translateY(2px) scale(.99); }
.btn.green { background: linear-gradient(180deg, #4ade80, var(--g2)); box-shadow: 0 4px 0 #166534; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn.yellow { background: linear-gradient(180deg, var(--y1), var(--y2)); color: #4a2e00; box-shadow: 0 4px 0 #b45309; }
.btn.violet { background: linear-gradient(180deg, #a78bfa, var(--v1)); box-shadow: 0 4px 0 var(--v4); }
.btn.ghost { background: var(--card); border: 1px solid var(--card-b); }
.btn[disabled] { opacity: .5; filter: grayscale(.4); pointer-events: none; }
.btn.sm { padding: 9px 12px; font-size: 14px; border-radius: 13px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* поле */
.field-wrap { background: linear-gradient(180deg, #8a5a2b, #6b4220); border-radius: 22px; padding: 10px; box-shadow: inset 0 3px 8px rgba(0, 0, 0, .35), 0 4px 0 #3d2410; }
.field { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cell { aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #a9743f, #7d5028); display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); position: relative; transition: transform .1s; }
.cell.full { background: radial-gradient(circle at 50% 35%, #86efac, #22c55e); box-shadow: inset 0 -3px 0 #15803d, 0 0 0 2px var(--y1); animation: sway 2.4s ease-in-out infinite; }
.cell.full:active { transform: scale(.88); }
.cell.empty::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 0, 0, .22); }
.cell.pop { animation: pop .38s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes sway { 50% { transform: rotate(-3deg) scale(1.03); } }
@keyframes pop { 35% { transform: scale(1.4) rotate(-8deg) translateY(-6px); } 100% { transform: scale(0) rotate(40deg); opacity: 0; } }
.depth { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pill { background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.hint { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* огород */
.crops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.crop { background: rgba(0, 0, 0, .2); border: 2px solid transparent; border-radius: 16px; padding: 8px 4px; text-align: center; }
.crop.sel { border-color: var(--y1); background: rgba(252, 211, 77, .18); }
.crop .e { font-size: 28px; display: block; }
.crop small { display: block; font-size: 11px; color: var(--muted); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 10px; }
.stepper button { width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--card-b); font-size: 22px; font-weight: 800; }
.stepper b { font-size: 22px; min-width: 40px; text-align: center; }
.progress { height: 12px; background: rgba(0, 0, 0, .3); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; transition: width .9s cubic-bezier(.22, 1, .36, 1); background: linear-gradient(90deg, var(--g1), var(--y1)); border-radius: 99px; }

/* обмен */
.ex { display: flex; align-items: center; gap: 12px; }
.ex .e { font-size: 38px; }
.ex .info { flex: 1; }
.ex .info b { font-size: 16px; display: block; }
.ex .info span { font-size: 13px; color: var(--muted); }
.ex .btn { width: auto; min-width: 118px; }

/* задания */
.q { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, .2); }
.q:last-of-type { border-bottom: 0; }
.q .ic { font-size: 28px; width: 40px; text-align: center; }
.q .tx { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.q .tx small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.q .st { font-size: 12px; font-weight: 800; text-align: right; }
.q .st.done { color: var(--g3); }
.q .st.cl { color: var(--muted); }
.q .tier { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--y1); }

/* профиль / магазин */
.prof { display: flex; align-items: center; gap: 12px; }
.prof img { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--y1); }
.prof .nm { font-size: 18px; font-weight: 900; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.stat { background: rgba(0, 0, 0, .2); border-radius: 14px; padding: 8px 10px; }
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 12px; color: var(--muted); }
.shop { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, .2); }
.shop:last-child { border: 0; }
.shop .e { font-size: 28px; }
.shop .info { flex: 1; min-width: 0; }
.shop .info b { display: block; font-size: 15px; }
.shop .info span { font-size: 12px; color: var(--muted); }
.shop .btn { width: auto; min-width: 88px; padding: 10px; font-size: 15px; }
.badge { display: inline-block; background: var(--y1); color: #4a2e00; border-radius: 8px; font-size: 11px; font-weight: 800; padding: 1px 6px; margin-left: 4px; }

/* таб-бар */
.tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--sab) + 8px); height: var(--tab-h); display: flex; background: rgba(46, 16, 101, .88); backdrop-filter: blur(14px); border: 1px solid var(--card-b); border-radius: 24px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); padding: 6px; gap: 4px; }
.tab { flex: 1; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); position: relative; transition: background .15s; }
.tab i { font-style: normal; font-size: 22px; line-height: 1; }
.tab span { font-size: 11px; font-weight: 700; }
.tab.active { background: linear-gradient(180deg, var(--v2), var(--v1)); color: #fff; box-shadow: 0 2px 0 var(--y1) inset; }
.dot { position: absolute; top: 5px; right: 22%; width: 10px; height: 10px; border-radius: 50%; background: var(--y1); border: 2px solid #2e1065; }

/* тосты / загрузка / модалка */
.toasts { position: fixed; left: 12px; right: 12px; top: calc(var(--sat) + 8px); z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(30, 10, 70, .96); border: 1px solid var(--card-b); border-radius: 16px; padding: 11px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); animation: tin .25s ease; pointer-events: auto; }
.toast.err { border-color: #f87171; background: rgba(127, 29, 29, .95); }
.toast.ok { border-color: var(--g1); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
.loader { position: fixed; inset: 0; z-index: 60; background: radial-gradient(120% 70% at 50% -10%, #a855f7, #4c1d95 70%, #2e1065); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; transition: opacity .3s; }
.loader.hide { opacity: 0; pointer-events: none; }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .2); border-top-color: var(--y1); animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.busy { position: relative; pointer-events: none; opacity: .75; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(20, 5, 50, .7); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { width: 100%; max-width: 520px; background: linear-gradient(180deg, #6d28d9, #3b0f7a); border-radius: 26px 26px 0 0; padding: 18px 16px calc(var(--sab) + 18px); text-align: center; animation: up .25s ease; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; }
.sheet .big { font-size: 46px; }
.sheet .gain { font-size: 18px; font-weight: 800; margin: 8px 0 14px; color: var(--y1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.empty-note { text-align: center; padding: 24px 8px; color: var(--muted); }

/* ---------- v2: вывод и оплата ---------- */
.sheet { max-height: 90dvh; overflow-y: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.lbl { font-size: 13px; font-weight: 800; margin: 12px 0 6px; color: var(--y3); text-align: left; }
.lbl small { font-weight: 600; color: var(--muted); margin-left: 4px; }
.inp { width: 100%; box-sizing: border-box; background: rgba(0, 0, 0, .28); border: 2px solid var(--card-b); border-radius: 14px; padding: 12px 14px; font-size: 17px; font-weight: 700; color: #fff; outline: none; font-family: inherit; }
.inp:focus { border-color: var(--y1); }
.inp::placeholder { color: rgba(255, 255, 255, .38); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.sm { margin-top: 8px; }
.chip { background: var(--card); border: 1px solid var(--card-b); border-radius: 99px; padding: 8px 14px; font-weight: 800; font-size: 14px; color: #fff; }
.chip.sel { border-color: var(--y1); background: rgba(252, 211, 77, .2); color: var(--y1); }
.get { margin-top: 14px; background: linear-gradient(180deg, rgba(74, 222, 128, .28), rgba(22, 163, 74, .22)); border: 1px solid #86efac; border-radius: 16px; padding: 10px 14px; text-align: center; }
.get span { display: block; font-size: 12px; color: var(--g3); }
.get b { font-size: 28px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.get small { display: block; font-size: 11px; color: var(--muted); }
.checks { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.chk { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .2); border-radius: 12px; padding: 7px 10px; font-size: 13px; font-weight: 700; }
.chk i { font-style: normal; font-size: 16px; }
.chk span { flex: 1; min-width: 0; }
.chk span small { font-weight: 500; color: var(--muted); }
.chk.no { border: 1px dashed rgba(252, 211, 77, .55); }
.mini { background: linear-gradient(180deg, var(--y1), var(--y2)); color: #4a2e00; font-weight: 800; font-size: 12px; border-radius: 10px; padding: 6px 10px; box-shadow: 0 2px 0 #b45309; white-space: nowrap; }
.hint.warn { color: var(--y1); font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed rgba(255, 255, 255, .15); text-align: left; }
.kv:last-child { border: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; word-break: break-all; }
.kv.copy { cursor: pointer; }
.sum { background: rgba(0, 0, 0, .22); border-radius: 16px; padding: 4px 12px; }
.pending { text-align: center; background: rgba(252, 211, 77, .14); border: 1px dashed var(--y1); border-radius: 16px; padding: 14px; }
.pending .big { font-size: 40px; }
.pending b { font-size: 17px; color: var(--y1); }
.hist { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, .18); }
.hist:last-child { border: 0; }
.hist .e { font-size: 26px; }
.hist .info { flex: 1; min-width: 0; }
.hist .info b { display: block; font-size: 16px; }
.hist .info span { font-size: 12px; color: var(--muted); }
.st-b { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.st-b.ok { background: rgba(34, 197, 94, .25); color: var(--g3); border: 1px solid var(--g1); }
.st-b.wait { background: rgba(252, 211, 77, .18); color: var(--y1); border: 1px solid var(--y1); }
.shop .btn.yellow { min-width: 96px; }

/* ---- v3: вкладка «Ещё», лидеры, друзья, кейсы, задания ---- */
.tab .dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 10px; height: 10px; border-radius: 50%; background: #ef4444; border: 2px solid #2e1065; }
.back { color: var(--y1); font-weight: 800; font-size: 14px; padding: 4px 4px 2px; }
.subtitle { margin: 2px 4px 10px; font-size: 20px; }
.menu-card { padding-bottom: 6px; }
.menu { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 4px; border-bottom: 1px dashed rgba(255, 255, 255, .18); }
.menu:last-child { border: 0; }
.menu .ic { font-size: 28px; width: 38px; text-align: center; }
.menu .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu .tx b { font-size: 16px; }
.menu .tx small { font-size: 12px; color: var(--muted); }
.menu .bd { font-style: normal; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.menu .ch { font-size: 24px; color: var(--muted); }
.myplace { display: flex; align-items: center; gap: 14px; background: linear-gradient(180deg, rgba(252, 211, 77, .28), rgba(245, 158, 11, .18)); border-color: var(--y1); }
.mp-n { font-size: 38px; font-weight: 900; color: var(--y1); min-width: 70px; text-align: center; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.mp-i { display: flex; flex-direction: column; } .mp-i span { font-size: 12px; color: var(--muted); }
.top-row { display: flex; align-items: center; gap: 8px; padding: 9px 6px; border-bottom: 1px dashed rgba(255, 255, 255, .15); border-radius: 10px; }
.top-row:last-child { border: 0; }
.top-row.me { background: rgba(252, 211, 77, .18); }
.top-row .pl { width: 52px; font-weight: 800; }
.top-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.top-row .dp { text-align: right; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; } .top-row .dp small { color: var(--muted); font-weight: 600; font-size: 11px; }
.case-h { display: flex; align-items: center; gap: 12px; }
.case-e { font-size: 42px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.case-h .info { flex: 1; } .case-h .info b { font-size: 18px; display: block; } .case-h .info span { font-size: 12px; color: var(--muted); }
.own { background: rgba(255, 255, 255, .16); border-radius: 99px; padding: 4px 11px; font-weight: 800; font-size: 13px; }
.rng { font-size: 12px; margin: 8px 0 10px; line-height: 1.5; }
.buyrow { margin-top: 8px; gap: 8px; }
.buyrow .btn { font-size: 13px; padding: 10px 6px; }
.promo { text-align: center; font-weight: 800; color: var(--y1); border-color: var(--y1); }
.big-ic { font-size: 54px; text-align: center; }
.cur { border-color: var(--y1); }
.step { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; opacity: .6; }
.step.current, .step.done { opacity: 1; }
.step.current { font-weight: 800; color: var(--y1); }
.step span { flex: 1; } .step small { color: var(--muted); font-size: 11px; text-align: right; max-width: 38%; }
.st-b.no { background: rgba(239, 68, 68, .22); color: #fecaca; border: 1px solid #ef4444; }
.hist .info .why { display: block; color: #fecaca; margin-top: 2px; }
.reveal .chest { font-size: 76px; }
.prizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 16px; }
.prize { background: rgba(255, 255, 255, .16); border: 1px solid var(--y1); border-radius: 16px; padding: 10px 14px; min-width: 96px; display: flex; flex-direction: column; align-items: center; opacity: 0; animation: prizein .45s ease-out forwards; }
.prize .e { font-size: 34px; } .prize b { font-size: 20px; color: var(--y1); }
.prizes:not(.multi) .prize { padding: 16px 30px; } .prizes:not(.multi) .prize .e { font-size: 52px; } .prizes:not(.multi) .prize b { font-size: 28px; }
@keyframes prizein { from { opacity: 0; transform: translateY(14px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
@keyframes chestpop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* =================== v8: анимации (transform/opacity; уважают prefers-reduced-motion) =================== */
.loader { display: none; }
/* фон: медленно плывущие облака */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky i { position: absolute; left: 0; width: 150px; height: 44px; border-radius: 99px; background: rgba(255, 255, 255, .13); will-change: transform; animation: drift var(--t, 90s) linear var(--dl, 0s) infinite; }
.sky i::before, .sky i::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.sky i::before { width: 64px; height: 64px; left: 22px; top: -28px; }
.sky i::after { width: 80px; height: 80px; left: 62px; top: -38px; }
.sky i:nth-child(1) { top: 13%; --t: 95s; --dl: -30s; }
.sky i:nth-child(2) { top: 36%; --t: 130s; --dl: -90s; transform-origin: left; opacity: .7; scale: .75; }
.sky i:nth-child(3) { top: 62%; --t: 110s; --dl: -10s; opacity: .85; scale: 1.2; }
.sky i:nth-child(4) { top: 82%; --t: 150s; --dl: -60s; opacity: .55; scale: .6; }
@keyframes drift { from { transform: translate3d(-220px, 0, 0); } to { transform: translate3d(calc(100vw + 40px), 0, 0); } }
.app { position: relative; z-index: 1; }

/* скелетоны (shimmer) */
.skel { position: relative; overflow: hidden; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); animation: shim 1.3s ease-in-out infinite; }
@keyframes shim { to { transform: translateX(100%); } }
.sk-field { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: rgba(0, 0, 0, .18); border-radius: 22px; padding: 10px; }
.sk-field .skel { aspect-ratio: 1; border-radius: 14px; }
.balances.loading .skel { height: 46px; border-radius: 12px; }
.balances.loading .skel.money { grid-column: span 6; height: 52px; }

/* смена вкладки */
.screen.in-r { animation: in-r .32s cubic-bezier(.2, .8, .2, 1); }
.screen.in-l { animation: in-l .32s cubic-bezier(.2, .8, .2, 1); }
.screen.in-f { animation: in-f .25s ease; }
@keyframes in-r { from { opacity: 0; transform: translate3d(34px, 0, 0); } }
@keyframes in-l { from { opacity: 0; transform: translate3d(-34px, 0, 0); } }
@keyframes in-f { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.tab.active i { animation: tabpop .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tabpop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.tab:active, .menu:active, .crop:active, .stepper button:active, .shop:active, .vip-chip:active { transform: scale(.94); }
.tab, .menu, .crop, .stepper button, .vip-chip { transition: transform .12s, background .15s; }
.btn { transition: transform .12s cubic-bezier(.3, 1.6, .5, 1), box-shadow .12s; }
.btn:active { transform: translateY(3px) scale(.96); }
.btn.green:active, .btn.yellow:active, .btn.violet:active { box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* ферма */
.cell.full.grow { animation: sway 2.4s ease-in-out infinite, grow .6s cubic-bezier(.34, 1.56, .64, 1) var(--gd, 0ms) backwards; }
@keyframes grow { 0% { transform: scale(0) translateY(14px); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.cell.swept { animation: swept .4s ease-in var(--sd, 0ms) forwards; pointer-events: none; }
@keyframes swept { 30% { transform: translate3d(8px, 0, 0) scale(.95); } 100% { transform: translate3d(36px, 0, 0) scale(0); opacity: 0; } }
.field-wrap { position: relative; overflow: hidden; }

/* слой эффектов */
#fx { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.fly { position: absolute; display: flex; align-items: center; gap: 4px; font-size: 26px; white-space: nowrap; will-change: transform, opacity; animation: fly .85s cubic-bezier(.45, .05, .55, .95) both; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.fly b { font-size: 17px; color: var(--y1); text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
@keyframes fly {
	0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
	14% { transform: translate(-50%, calc(-50% - 24px)) scale(1.5); opacity: 1; }
	50% { transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(1.1); opacity: 1; }
	100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.45); opacity: .9; }
}
.coin { position: absolute; font-size: 22px; will-change: transform, opacity; animation: coin 1.05s cubic-bezier(.2, .7, .4, 1) both; }
@keyframes coin {
	0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 0; }
	15% { opacity: 1; }
	60% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--r)); opacity: 1; }
	100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 80px)) scale(.8) rotate(var(--r)); opacity: 0; }
}
.tractor-run { position: absolute; font-size: 54px; line-height: 1; transform: translate(-70px, -50%) scaleX(-1); will-change: transform; animation: drive 1.05s cubic-bezier(.4, 0, .6, 1) .1s both; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .45)); }
@keyframes drive { 0% { transform: translate(-70px, -50%) scaleX(-1) rotate(0); } 15% { transform: translate(calc(var(--w) * .1), -52%) scaleX(-1) rotate(-3deg); } 50% { transform: translate(calc(var(--w) * .5), -48%) scaleX(-1) rotate(2deg); } 85% { transform: translate(calc(var(--w) * .9), -52%) scaleX(-1) rotate(-2deg); } 100% { transform: translate(calc(var(--w) + 40px), -50%) scaleX(-1) rotate(0); } }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.hit { animation: hit .45s ease; }
@keyframes hit { 30% { transform: scale(1.18); box-shadow: 0 0 0 3px var(--y1), 0 0 18px var(--y1); } }
.bal.gain { animation: gainf .9s ease; }
.bal.loss { animation: lossf .7s ease; }
@keyframes gainf { 20% { transform: scale(1.12); box-shadow: 0 0 0 2px #86efac, 0 0 16px #4ade80; } }
@keyframes lossf { 20% { transform: scale(.94); box-shadow: 0 0 0 2px #fca5a5; } }
.bal .v { font-variant-numeric: tabular-nums; }

/* задания */
.pbar { height: 6px; background: rgba(0, 0, 0, .28); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.pbar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--g1), var(--y1)); transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.q.fin .pbar i { background: linear-gradient(90deg, #4ade80, #22c55e); }
.chk-sm { width: 16px; height: 16px; vertical-align: -3px; }
.chk-anim, .chk-sm { fill: none; }
.chk-sm circle { stroke: #4ade80; stroke-width: 4; fill: rgba(74, 222, 128, .2); }
.chk-sm path { stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s ease .25s forwards; }
.chk-anim { width: 74px; height: 74px; animation: tick-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.chk-anim circle { stroke: #4ade80; stroke-width: 3; fill: rgba(74, 222, 128, .18); stroke-dasharray: 152; stroke-dashoffset: 152; animation: draw .6s ease forwards; }
.chk-anim path { stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s ease .45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes tick-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* модалки / кейсы */
.modal:not([hidden]) { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.chest.shaking { animation: chestshake .9s ease-in-out both; transform-origin: 50% 90%; }
@keyframes chestshake {
	0% { transform: rotate(0) scale(1); } 12% { transform: rotate(-9deg) scale(1.02); } 24% { transform: rotate(9deg) scale(1.05); } 36% { transform: rotate(-12deg) scale(1.08); }
	48% { transform: rotate(12deg) scale(1.1); } 60% { transform: rotate(-14deg) scale(1.14); } 72% { transform: rotate(14deg) scale(1.18); } 85% { transform: rotate(-6deg) scale(1.22); } 100% { transform: rotate(0) scale(1.28); }
}
.reveal .stage { position: relative; height: 118px; margin: 6px 0 4px; }
.reveal .stage .chest { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: transform .35s ease, opacity .35s ease; }
.reveal .stage .chest.out { transform: scale(2.2); opacity: 0; animation: none; }
.roul { position: absolute; inset: 0; overflow: hidden; border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid var(--card-b); opacity: 0; transform: scale(.92); transition: opacity .3s ease, transform .3s ease; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.roul.on { opacity: 1; transform: none; }
.roul::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--y1); box-shadow: 0 0 12px 2px var(--y1); z-index: 2; }
.strip { position: absolute; left: 0; top: 10px; display: flex; gap: 8px; will-change: transform; }
.tile { flex: 0 0 84px; height: 98px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(255, 255, 255, .13); border: 2px solid rgba(255, 255, 255, .22); }
.tile .e { font-size: 34px; line-height: 1.1; } .tile b { font-size: 14px; }
.t-rare { border-color: #fcd34d; background: linear-gradient(180deg, rgba(252, 211, 77, .38), rgba(245, 158, 11, .2)); }
.t-epic { border-color: #f0abfc; background: linear-gradient(180deg, rgba(217, 70, 239, .5), rgba(124, 58, 237, .3)); }
.stage.done .tile:not(.win) { opacity: .3; transition: opacity .4s ease; }
.tile.win { animation: winpop .7s cubic-bezier(.3, 1.6, .5, 1) both; z-index: 3; position: relative; box-shadow: 0 0 0 3px #fff, 0 0 26px 6px rgba(252, 211, 77, .85); }
.tile.win.t-epic { box-shadow: 0 0 0 3px #fff, 0 0 30px 8px rgba(217, 70, 239, .9); }
@keyframes winpop { 0% { transform: scale(1); } 50% { transform: scale(1.22); } 100% { transform: scale(1.12); } }
.res { min-height: 28px; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; font-size: 24px; }
.res.show { opacity: 1; transform: none; }
.prize.t-rare { border-color: #fcd34d; box-shadow: 0 0 16px rgba(252, 211, 77, .55); }
.prize.t-epic { border-color: #f0abfc; background: linear-gradient(180deg, rgba(217, 70, 239, .45), rgba(124, 58, 237, .3)); box-shadow: 0 0 20px rgba(217, 70, 239, .7); }
.sheet.q-epic { background: linear-gradient(180deg, #86198f, #3b0f7a); }
.sheet.q-rare { background: linear-gradient(180deg, #a16207, #5b21b6 70%, #3b0f7a); }

/* тёмная тема Telegram */
:root[data-theme="dark"] {
	--bgc: #0d0720;
	--bg-img: radial-gradient(120% 70% at 50% -10%, #3b2a86 0%, #261a5c 38%, #170f3a 75%, var(--dk-bg, #0d0720) 100%);
	--card: rgba(255, 255, 255, .07); --card-b: rgba(255, 255, 255, .13); --muted: rgba(255, 255, 255, .6);
}
:root[data-theme="dark"] .tabbar { background: rgba(14, 7, 34, .92); }
:root[data-theme="dark"] .sheet { background: linear-gradient(180deg, #2c1a63, #150a35); }
:root[data-theme="dark"] .sheet.q-epic { background: linear-gradient(180deg, #5b1167, #150a35); }
:root[data-theme="dark"] .sheet.q-rare { background: linear-gradient(180deg, #6b4a06, #1f1050 70%, #150a35); }
:root[data-theme="dark"] .modal { background: rgba(5, 2, 15, .78); }
:root[data-theme="dark"] .toast { background: rgba(15, 7, 38, .96); }
:root[data-theme="dark"] .sky i { background: rgba(255, 255, 255, .07); }
:root[data-theme="dark"] .field-wrap { background: linear-gradient(180deg, #6b4524, #4d3016); }
:root[data-theme="dark"] .tab.active { background: linear-gradient(180deg, #7c3aed, #5b21b6); }
body, .card, .tabbar, .sheet { transition: background-color .4s ease, border-color .4s ease; }

/* без анимаций */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
	.sky { display: none; }
}
