/* БАБЛО — стиль */
:root {
  --bg0: #020805;
  --bg1: #05140c;
  --bg2: #0a2216;
  --neon: #2bff88;
  --neon2: #12d66b;
  --gold: #ffd23f;
  --gold2: #ff9f1c;
  --red: #ff3b3b;
  --text: #eafff3;
  --muted: #86b29a;
  --card: rgba(255, 255, 255, 0.045);
  --card-b: rgba(255, 255, 255, 0.07);
  --app-h: 100vh;
  --tg-sat: 0px;
  --tg-sab: 0px;
  --sat: max(env(safe-area-inset-top, 0px), var(--tg-sat));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-sab));
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --panel-h: 45vh;
  --head-h: 150px;
  --coin: 230px;
  --heat: 0;
  --font-head: "Russo One", "Rubik Mono One", "Arial Black", "Segoe UI Black", system-ui, sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

#app {
  position: fixed; left: 0; top: 0; width: 100%;
  height: var(--app-h);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 70% at 50% 28%, #0d2c1b 0%, var(--bg1) 45%, var(--bg0) 100%);
}

/* ---------------- фон: гильош ---------------- */
#bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-pattern {
  position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  background-image: var(--guilloche, none),
    repeating-radial-gradient(circle at 30% 40%, rgba(43, 255, 136, 0.035) 0 1px, transparent 1px 9px),
    repeating-radial-gradient(circle at 70% 60%, rgba(255, 210, 63, 0.025) 0 1px, transparent 1px 11px);
  background-size: 240px 120px, auto, auto;
  animation: bgDrift 90s linear infinite;
  will-change: transform;
  opacity: 0.95;
}
@keyframes bgDrift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-60px, -120px, 0) rotate(3deg); }
  100% { transform: translate3d(0, -240px, 0) rotate(0deg); }
}
.bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(85% 60% at 50% 35%, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}
.bg-pulse {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(70% 55% at 50% 38%, rgba(43, 255, 136, 0.28), transparent 70%);
}
body.frenzy .bg-pulse { animation: bgPulse 0.9s ease-in-out infinite; }
@keyframes bgPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

canvas#rain { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; }
canvas#fxc { position: absolute; left: 0; top: 0; z-index: 60; pointer-events: none; }

/* ---------------- игровое поле ---------------- */
#playfield { position: absolute; inset: 0; z-index: 2; will-change: transform; }

#top {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(var(--sat) + 6px) calc(12px + var(--sar)) 6px calc(12px + var(--sal));
  text-align: center;
  z-index: 3;
}
.title-row { display: flex; align-items: center; justify-content: center; position: relative; height: 46px; }
.logo {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 40px; line-height: 1;
  letter-spacing: 3px;
  background: linear-gradient(100deg, #b86a06 0%, #ffd23f 22%, #fff3b8 34%, #ffffff 40%, #ffe066 47%, #ff9f1c 62%, #ffd23f 78%, #b86a06 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3.2s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 180, 30, 0.45)) drop-shadow(0 2px 0 rgba(90, 40, 0, 0.9));
  position: relative;
}
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -130% 0; } }

.icon-btn {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 18px; line-height: 38px;
}
.net-badge {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 5px 8px; border-radius: 10px;
  background: rgba(255, 159, 28, 0.12); color: #ffc46b; border: 1px solid rgba(255, 159, 28, 0.35);
  max-width: 82px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.net-badge.offline { background: rgba(255, 70, 60, 0.12); color: #ff8f86; border-color: rgba(255, 70, 60, 0.35); }

.balance-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; min-width: 0; }
.bal-coin { width: 30px; height: 30px; flex: 0 0 30px; filter: drop-shadow(0 0 8px rgba(255, 200, 50, 0.55)); }
.bal-coin svg { width: 100%; height: 100%; display: block; }
.balance {
  font-family: var(--font-head);
  font-size: 38px; line-height: 1.1;
  color: #b9ffd6;
  background: linear-gradient(180deg, #f0fff6 0%, #7dffb8 45%, #2bff88 70%, #12c768 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(43, 255, 136, 0.45));
  white-space: nowrap;
  max-width: calc(100vw - 70px); overflow: hidden; text-overflow: clip;
  transition: transform 0.08s;
  font-variant-numeric: tabular-nums;
}
.balance.pop { transform: scale(1.06); }
.rates { display: flex; justify-content: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(43, 255, 136, 0.08); border: 1px solid rgba(43, 255, 136, 0.22);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.pill b { color: var(--neon); font-family: var(--font-head); font-weight: 400; font-size: 14px; }
.pill i { font-style: normal; }
.pill-tap { background: rgba(255, 210, 63, 0.08); border-color: rgba(255, 210, 63, 0.25); }
.pill-tap b { color: var(--gold); }
.pill b::before { content: "+"; }
.pill-tap b::before { content: ""; }

/* ---------------- сцена / монета ---------------- */
#stage {
  position: absolute; left: 0; right: 0;
  top: var(--head-h);
  bottom: var(--panel-h);
  z-index: 2;
  transition: bottom 0.32s cubic-bezier(.2, .9, .3, 1);
}
body.panel-drag #stage, body.panel-drag .coin-wrap { transition: none; }
#tapzone {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  cursor: pointer;
}
.coin-wrap {
  position: relative;
  width: var(--coin); height: var(--coin);
  pointer-events: none;
  transition: width 0.32s cubic-bezier(.2, .9, .3, 1), height 0.32s cubic-bezier(.2, .9, .3, 1);
}
.coin-rosette {
  position: absolute; left: 50%; top: 50%;
  width: 175%; height: 175%;
  transform: translate(-50%, -50%);
  background: var(--rosette, none) center / contain no-repeat;
  animation: spin 160s linear infinite;
  opacity: 0.9;
}
.coin-rays {
  position: absolute; left: 50%; top: 50%; width: 190%; height: 190%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 63, 0.16) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 62%);
  mask-image: radial-gradient(circle, #000 18%, transparent 62%);
  animation: spin 50s linear infinite;
  opacity: calc(0.55 + var(--heat) * 0.45);
}
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.coin-glow {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 50, 0.38) 0%, rgba(255, 160, 20, 0.12) 45%, transparent 68%);
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse { 0%, 100% { opacity: 0.7; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.05); } }
.coin-breath {
  position: absolute; inset: 0;
  animation: breath 2.6s ease-in-out infinite;
}
@keyframes breath { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.035) translateY(-3px); } }
.coin-body { position: absolute; inset: 0; will-change: transform; }
.coin-body svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55)); }
.coin-shine { animation: coinShine 3.8s ease-in-out infinite; }
@keyframes coinShine { 0%, 55% { transform: translateX(-60px); } 100% { transform: translateX(260px); } }
.coin-shadow {
  position: absolute; left: 18%; right: 18%; bottom: -9%; height: 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent);
  animation: shadowBreath 2.6s ease-in-out infinite;
}
@keyframes shadowBreath { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(0.92); opacity: 0.7; } }

/* комбо-стикер */
.combo {
  position: absolute; right: -6%; top: -4%;
  transform: rotate(10deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(.2, 1.6, .4, 1);
  pointer-events: none;
  z-index: 3;
}
.combo.on { opacity: 1; transform: rotate(10deg) scale(calc(0.9 + var(--heat) * 0.35)); }
.combo.bump .combo-txt { animation: comboBump 0.18s ease-out; }
@keyframes comboBump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.combo-txt {
  position: relative; display: inline-block;
  font-family: var(--font-head);
  font-size: 15px; white-space: nowrap;
  padding: 6px 10px; border-radius: 12px;
  color: #fff7d6;
  background: linear-gradient(180deg, #ff9f1c, #e63b0e);
  border: 2px solid #ffd23f;
  box-shadow: 0 0 calc(8px + var(--heat) * 22px) rgba(255, 120, 20, calc(0.4 + var(--heat) * 0.5)), 0 3px 0 #7a1c00;
  text-shadow: 0 1px 0 #7a1c00;
}
.combo-txt b { font-weight: 400; font-size: 18px; color: #fff; }
.combo-fire {
  position: absolute; left: 6%; right: 6%; bottom: 60%; height: calc(20px + var(--heat) * 34px);
  background: radial-gradient(60% 100% at 50% 100%, rgba(255, 220, 80, 0.95), rgba(255, 110, 20, 0.7) 45%, transparent 75%);
  filter: blur(2px);
  transform-origin: 50% 100%;
  animation: fire 0.22s ease-in-out infinite alternate;
  opacity: calc(var(--heat) * 1.2);
}
@keyframes fire { from { transform: scaleY(0.85) skewX(-4deg); } to { transform: scaleY(1.12) skewX(4deg); } }

/* баффы */
.buffs {
  position: absolute; left: 10px; right: 10px; top: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  z-index: 4; pointer-events: none;
}
.buff {
  position: relative; overflow: hidden;
  min-width: 108px; max-width: 48%;
  padding: 5px 10px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 210, 63, 0.22), rgba(255, 159, 28, 0.12));
  border: 1px solid rgba(255, 210, 63, 0.5);
  box-shadow: 0 0 14px rgba(255, 190, 40, 0.3);
  font-size: 12px; font-weight: 800; color: #fff3c4;
  display: flex; justify-content: space-between; gap: 8px; white-space: nowrap;
  animation: buffIn 0.35s cubic-bezier(.2, 1.5, .4, 1);
}
.buff.frenzy { background: linear-gradient(180deg, rgba(43, 255, 136, 0.28), rgba(18, 214, 107, 0.12)); border-color: rgba(43, 255, 136, 0.7); box-shadow: 0 0 16px rgba(43, 255, 136, 0.45); color: #dcffeb; }
.buff .b-lbl { overflow: hidden; text-overflow: ellipsis; }
.buff .b-time { font-family: var(--font-head); font-weight: 400; opacity: 0.9; }
.buff .b-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; transition: transform 0.25s linear; }
.buff.frenzy .b-bar { background: var(--neon); }
.buff.out { animation: buffOut 0.3s forwards; }
@keyframes buffIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes buffOut { to { transform: scale(0.5); opacity: 0; } }

#frameGlow {
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0; transition: opacity 0.5s;
  box-shadow: inset 0 0 0 3px rgba(43, 255, 136, 0.8), inset 0 0 40px rgba(43, 255, 136, 0.55), inset 0 0 90px rgba(43, 255, 136, 0.2);
  border-radius: 6px;
}
body.frenzy #frameGlow { opacity: 1; animation: frameGlow 0.9s ease-in-out infinite; }
@keyframes frameGlow { 0%, 100% { filter: brightness(0.8); } 50% { filter: brightness(1.35); } }

/* ---------------- золотая купюра ---------------- */
#goldenLayer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.golden {
  position: absolute; width: 132px; height: 132px;
  margin: -66px 0 0 -66px;
  pointer-events: auto; touch-action: none;
  animation: gIn 0.45s cubic-bezier(.2, 1.6, .4, 1);
}
.golden .g-rays {
  position: absolute; inset: -30%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 220, 90, 0.55) 0deg 8deg, transparent 8deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 66%);
  mask-image: radial-gradient(circle, #000 15%, transparent 66%);
  animation: gSpin 6s linear infinite;
}
.golden .g-glow { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 120, 0.6), transparent 65%); animation: glowPulse 1.2s ease-in-out infinite; }
.golden .g-bob { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; animation: gBob 2.2s ease-in-out infinite; }
.golden .g-bill {
  width: 104px; height: 50px; border-radius: 7px; position: relative; overflow: hidden;
  background:
    repeating-radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 5px),
    linear-gradient(120deg, #8a5200 0%, #ffd23f 30%, #fff3b0 48%, #ffc021 62%, #a86400 100%);
  border: 2px solid #fff0a8;
  box-shadow: 0 0 22px rgba(255, 210, 63, 0.9), 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(122, 74, 0, 0.45);
  animation: gFlip 1.6s ease-in-out infinite;
}
.golden .g-bill svg { position: absolute; right: 10px; top: 6px; width: 38px; height: 38px; }
.golden .g-bill::before {
  content: ""; position: absolute; left: 12px; top: 9px; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe0, #e0a000); border: 1.5px solid #fff3b0;
}
.golden .g-bill::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30px; left: -40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-20deg);
  animation: gShine 1.4s ease-in-out infinite;
}
.golden.dying { animation: gBlink 0.28s steps(2) infinite; }
.golden.gone { animation: gOut 0.35s forwards; pointer-events: none; }
.golden.caught { animation: gCaught 0.4s forwards; pointer-events: none; }
@keyframes gIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes gOut { to { transform: scale(0.2); opacity: 0; } }
@keyframes gCaught { 50% { transform: scale(1.5); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@keyframes gSpin { to { transform: rotate(360deg); } }
@keyframes gBob { 0%, 100% { transform: translateY(-6px) rotate(-7deg); } 50% { transform: translateY(6px) rotate(7deg); } }
@keyframes gFlip { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.72); } }
@keyframes gShine { 0% { left: -40px; } 70%, 100% { left: 130px; } }
@keyframes gBlink { 0% { opacity: 1; } 100% { opacity: 0.25; } }

/* ---------------- панель ---------------- */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--panel-h);
  z-index: 20;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 32, 20, 0.97), rgba(4, 14, 9, 0.99) 40%);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(255, 210, 63, 0.35);
  transition: height 0.32s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--neon), var(--gold), transparent);
  opacity: 0.7;
}
.panel.dragging { transition: none; }
.panel-grip { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.panel-grip span { width: 46px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.pages { flex: 1 1 auto; position: relative; min-height: 0; }
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 2px 0 14px;
  display: none;
}
.page.active { display: block; animation: pageIn 0.22s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page::-webkit-scrollbar { width: 0; height: 0; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 14px 10px; }
.page-head span { font-family: var(--font-head); font-size: 16px; color: var(--gold); }
.page-head span b { font-weight: 400; color: var(--neon); margin-left: 6px; }
.page-head small { color: var(--muted); font-size: 11px; text-align: right; }

.tabs {
  flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px calc(4px + var(--sar)) calc(4px + var(--sab)) calc(4px + var(--sal));
  background: rgba(2, 8, 5, 0.96);
  border-top: 1px solid rgba(43, 255, 136, 0.12);
}
.tabs button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 5px; border-radius: 12px;
  color: var(--muted); font-size: 10.5px; font-weight: 700;
  min-width: 0;
}
.tabs button i { font-style: normal; font-size: 21px; line-height: 1.1; filter: grayscale(0.6) brightness(0.8); transition: transform 0.2s, filter 0.2s; }
.tabs button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabs button.active { color: var(--neon); background: rgba(43, 255, 136, 0.08); }
.tabs button.active i { filter: none; transform: translateY(-2px) scale(1.12); }
.badge {
  position: absolute; top: 2px; right: calc(50% - 22px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-style: normal; font-size: 10px; line-height: 17px; font-weight: 800;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.6);
}
.badge.green { background: var(--neon2); color: #021; box-shadow: 0 0 8px rgba(43, 255, 136, 0.6); }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 5px; right: calc(50% - 16px); background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* режим покупки */
.buymode {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px 10px;
  background: linear-gradient(180deg, rgba(8, 26, 16, 1) 70%, rgba(8, 26, 16, 0));
}
.bm-label { font-size: 12px; color: var(--muted); margin-right: auto; }
.buymode button {
  min-width: 56px; padding: 7px 10px; border-radius: 10px;
  font-family: var(--font-head); font-size: 13px;
  background: var(--card); border: 1px solid var(--card-b); color: var(--muted);
}
.buymode button.active { background: rgba(43, 255, 136, 0.16); border-color: rgba(43, 255, 136, 0.6); color: var(--neon); box-shadow: 0 0 12px rgba(43, 255, 136, 0.25); }

/* строки бизнесов */
.list { padding: 0 10px; }
.brow {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px 11px; margin-bottom: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-b);
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.08s;
  cursor: pointer;
}
.brow:active { transform: scale(0.985); }
.brow .em {
  width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle at 35% 30%, rgba(43, 255, 136, 0.22), rgba(0, 0, 0, 0.25));
  position: relative;
}
.brow .cnt {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 22px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #0d2a1a; border: 1px solid rgba(43, 255, 136, 0.5);
  font-family: var(--font-head); font-size: 11px; line-height: 18px; color: var(--neon); text-align: center;
}
.brow .cnt.zero { opacity: 0; }
.brow .info { min-width: 0; }
.brow .nm { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.brow .sub b { color: var(--neon); font-weight: 700; }
.brow .buy { text-align: right; min-width: 78px; }
.brow .qty { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.brow .price { font-family: var(--font-head); font-size: 15px; color: #ffb4a8; white-space: nowrap; }
.brow .prog, .ucard .prog, .megacard .prog-bar i {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--neon2), var(--gold));
  transform-origin: left; transform: scaleX(0);
  transition: transform 0.25s linear;
}
.brow.can { border-color: rgba(43, 255, 136, 0.5); box-shadow: inset 0 0 0 1px rgba(43, 255, 136, 0.12), 0 0 16px rgba(43, 255, 136, 0.12); }
.brow.can .price { color: var(--neon); text-shadow: 0 0 10px rgba(43, 255, 136, 0.5); }
.brow.can .prog { opacity: 0; }
.brow.cant { opacity: 0.6; }
.brow.teaser { opacity: 0.45; cursor: default; }
.brow.teaser .em { filter: brightness(0) drop-shadow(0 0 1px rgba(43, 255, 136, 0.6)); }
.brow.nope, .ucard.nope { animation: nope 0.3s; }
@keyframes nope { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.brow.bought, .ucard.bought { animation: bought 0.35s; }
@keyframes bought { 0% { box-shadow: 0 0 0 0 rgba(43, 255, 136, 0.8); } 100% { box-shadow: 0 0 0 14px rgba(43, 255, 136, 0); } }

/* апгрейды */
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 0 10px; }
.ucard {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 10px 6px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-b);
  text-align: center;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.08s;
  cursor: pointer;
  animation: cardIn 0.3s ease-out;
}
@keyframes cardIn { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
.ucard:active { transform: scale(0.96); }
.ucard .u-em { font-size: 30px; line-height: 1.15; }
.ucard .u-nm { font-size: 11.5px; font-weight: 800; line-height: 1.2; height: 28px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 3px; }
.ucard .u-pr { font-family: var(--font-head); font-size: 13px; color: #ffb4a8; margin-top: 4px; white-space: nowrap; }
.ucard .u-i {
  position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 800; font-style: italic; font-family: Georgia, serif;
  background: rgba(255, 255, 255, 0.08); color: var(--muted); line-height: 22px;
}
.ucard.can { border-color: rgba(255, 210, 63, 0.6); box-shadow: 0 0 16px rgba(255, 210, 63, 0.18), inset 0 0 16px rgba(255, 210, 63, 0.08); }
.ucard.can .u-pr { color: var(--gold); }
.ucard.can .prog { opacity: 0; }
.ucard.can::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40px; left: -60px;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 180, 0.25), transparent);
  transform: skewX(-20deg); animation: cardShine 2.8s ease-in-out infinite;
}
@keyframes cardShine { 0% { left: -60px; } 60%, 100% { left: 140%; } }
.ucard.cant { opacity: 0.58; }
.empty { text-align: center; color: var(--muted); padding: 30px 20px; font-size: 14px; line-height: 1.5; }

/* достижения */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; padding: 0 10px; }
.acell {
  border-radius: 14px; padding: 8px 4px 7px; text-align: center;
  background: var(--card); border: 1px solid var(--card-b);
  cursor: pointer; min-width: 0;
}
.acell .a-em { font-size: 28px; line-height: 1.15; }
.acell .a-nm { font-size: 10px; font-weight: 700; color: var(--muted); line-height: 1.15; height: 23px; overflow: hidden; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.acell.got { background: linear-gradient(180deg, rgba(255, 210, 63, 0.16), rgba(255, 159, 28, 0.05)); border-color: rgba(255, 210, 63, 0.45); }
.acell.got .a-nm { color: #ffe9a6; }
.acell.lock .a-em { filter: brightness(0) opacity(0.45); }
.acell.lock .a-nm { letter-spacing: 2px; }
.acell.fresh { animation: freshAch 1.2s ease-out 2; }
@keyframes freshAch { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9); } 100% { box-shadow: 0 0 0 12px rgba(255, 210, 63, 0); } }

/* отмывка */
.wash { padding: 0 12px; }
.card {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-b);
  margin-bottom: 10px;
}
.card h3 { margin: 0 0 4px; font-family: var(--font-head); font-weight: 400; font-size: 18px; color: var(--neon); }
.card p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.stat { background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 8px 6px; text-align: center; min-width: 0; }
.stat small { display: block; font-size: 10px; color: var(--muted); }
.stat b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 16px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.stat.green b { color: var(--neon); }
.bigbtn {
  display: block; width: 100%;
  padding: 14px 12px; border-radius: 14px;
  font-family: var(--font-head); font-size: 17px; letter-spacing: 0.5px;
  color: #032013;
  background: linear-gradient(180deg, #7dffb8, #2bff88 45%, #12c768);
  box-shadow: 0 4px 0 #087a3e, 0 0 22px rgba(43, 255, 136, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.bigbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #087a3e, 0 0 22px rgba(43, 255, 136, 0.35); }
.bigbtn.gold { color: #3a1d00; background: linear-gradient(180deg, #fff3b0, #ffd23f 45%, #ff9f1c); box-shadow: 0 4px 0 #8a4c03, 0 0 26px rgba(255, 190, 40, 0.45); }
.bigbtn.gold:active { box-shadow: 0 1px 0 #8a4c03; }
.bigbtn:disabled { filter: grayscale(1) brightness(0.55); box-shadow: none; transform: none; }
.megacard {
  border: 1px solid rgba(255, 210, 63, 0.5);
  background:
    repeating-radial-gradient(circle at 80% 20%, rgba(255, 210, 63, 0.06) 0 1px, transparent 1px 7px),
    linear-gradient(160deg, rgba(255, 210, 63, 0.18), rgba(255, 120, 20, 0.06) 50%, rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 24px rgba(255, 190, 40, 0.15);
}
.megacard h3 { color: var(--gold); font-size: 20px; padding-right: 58px; }
.megacard .mega-em { position: absolute; right: 10px; top: 6px; font-size: 44px; filter: drop-shadow(0 0 12px rgba(255, 200, 50, 0.7)); animation: breath 2.4s ease-in-out infinite; }
.megacard .prog-bar { position: relative; height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); overflow: hidden; margin: 6px 0 4px; }
.megacard .prog-bar i { height: 100%; }
.megacard .prog-txt { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.megacard .prog-txt b { color: var(--gold); font-family: var(--font-head); font-weight: 400; }
.megacard.done h3 { color: var(--neon); }

/* топ */
.top-wrap { padding: 0 12px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(43, 255, 136, 0.18), rgba(43, 255, 136, 0.04)); border: 1px solid rgba(43, 255, 136, 0.45); }
.me-card .me-rank { font-family: var(--font-head); font-size: 22px; color: var(--neon); min-width: 54px; }
.me-card .me-info { flex: 1; min-width: 0; }
.me-card .me-info small { display: block; color: var(--muted); font-size: 11px; }
.me-card .me-info b { font-family: var(--font-head); font-weight: 400; font-size: 17px; color: var(--gold); }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 12px; margin-bottom: 4px; background: var(--card); }
.trow.me { background: rgba(43, 255, 136, 0.12); border: 1px solid rgba(43, 255, 136, 0.4); }
.trow .t-r { font-family: var(--font-head); font-size: 14px; color: var(--muted); text-align: center; }
.trow .t-n { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .t-s { font-family: var(--font-head); font-size: 14px; color: var(--gold); white-space: nowrap; }
.trow.r1 .t-r, .trow.r2 .t-r, .trow.r3 .t-r { font-size: 20px; }
.msg { text-align: center; padding: 26px 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.msg .msg-em { font-size: 44px; display: block; margin-bottom: 8px; }
.msg b { color: var(--text); }
.smallbtn { margin-top: 12px; padding: 9px 18px; border-radius: 12px; background: rgba(43, 255, 136, 0.12); border: 1px solid rgba(43, 255, 136, 0.4); color: var(--neon); font-weight: 700; font-size: 13px; }

/* ---------------- тосты ---------------- */
#toasts {
  position: absolute; left: 0; right: 0; top: calc(var(--sat) + 8px);
  z-index: 50; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 12px;
}
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 380px;
  padding: 10px 14px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 24, 6, 0.97), rgba(14, 10, 2, 0.97));
  border: 1px solid rgba(255, 210, 63, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 190, 40, 0.25);
  animation: toastIn 0.45s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.green { background: linear-gradient(180deg, rgba(6, 30, 18, 0.97), rgba(2, 14, 8, 0.97)); border-color: rgba(43, 255, 136, 0.6); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(43, 255, 136, 0.25); }
.toast .t-em { font-size: 30px; flex: 0 0 auto; filter: drop-shadow(0 0 8px rgba(255, 210, 63, 0.6)); }
.toast .t-body { min-width: 0; }
.toast .t-title { font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.toast.green .t-title { color: var(--neon); }
.toast .t-text { font-size: 14px; font-weight: 800; color: #fff; }
.toast .t-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.toast::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 190, 0.35), transparent);
  transform: skewX(-20deg); animation: toastShine 1.1s 0.25s ease-out;
}
.toast.out { animation: toastOut 0.35s forwards; }
@keyframes toastIn { from { transform: translateY(-40px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-30px); opacity: 0; } }
@keyframes toastShine { from { left: -80px; } to { left: 110%; } }

/* баннер золотой купюры */
.banner {
  position: absolute; left: 12px; right: 12px; top: 38%;
  z-index: 52; pointer-events: none; text-align: center;
  opacity: 0;
}
.banner.show { animation: bannerShow 2.4s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.banner .bn-main {
  display: inline-block; padding: 10px 18px; border-radius: 16px;
  font-family: var(--font-head); font-size: 26px; line-height: 1.15;
  color: #3a1d00;
  background: linear-gradient(180deg, #fff3b0, #ffd23f 50%, #ff9f1c);
  box-shadow: 0 0 40px rgba(255, 200, 50, 0.7), 0 5px 0 #8a4c03;
  max-width: 100%;
}
.banner .bn-sub { margin-top: 8px; font-family: var(--font-head); font-size: 20px; color: var(--neon); text-shadow: 0 0 14px rgba(43, 255, 136, 0.7), 0 2px 0 #021; }
@keyframes bannerShow {
  0% { opacity: 0; transform: scale(0.3) rotate(-6deg); }
  14% { opacity: 1; transform: scale(1.1) rotate(2deg); }
  22% { transform: scale(1) rotate(0); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9) translateY(-30px); }
}

/* веха */
.milestone { position: absolute; inset: 0; z-index: 55; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; visibility: hidden; }
.milestone.show { visibility: visible; }
.ms-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 220, 0.95), rgba(255, 210, 63, 0.6) 35%, rgba(255, 140, 0, 0) 75%); opacity: 0; }
.ms-rays { position: absolute; left: 50%; top: 45%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; background: repeating-conic-gradient(rgba(255, 220, 100, 0.22) 0deg 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 5%, transparent 45%); mask-image: radial-gradient(circle, #000 5%, transparent 45%); opacity: 0; }
.ms-text {
  position: relative; text-align: center; padding: 0 12px; max-width: 100%;
  font-family: var(--font-head); font-size: clamp(38px, 13vw, 64px); line-height: 1.05;
  background: linear-gradient(180deg, #fffbe6 0%, #ffe066 40%, #ff9f1c 75%, #c45a00 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #5a2a00) drop-shadow(0 0 22px rgba(255, 190, 40, 0.8));
  opacity: 0; word-break: break-word;
}
.ms-sub { position: relative; margin-top: 10px; font-family: var(--font-head); font-size: 18px; color: var(--neon); text-shadow: 0 0 12px rgba(43, 255, 136, 0.8); opacity: 0; padding: 0 16px; text-align: center; }
.milestone.show .ms-flash { animation: msFlash 1.9s ease-out forwards; }
.milestone.show .ms-rays { animation: msRays 1.9s ease-out forwards; }
.milestone.show .ms-text { animation: msText 1.9s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.milestone.show .ms-sub { animation: msSub 1.9s ease-out forwards; }
@keyframes msFlash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
@keyframes msRays { 0% { opacity: 0; transform: rotate(0) scale(0.6); } 15% { opacity: 1; } 80% { opacity: 0.8; } 100% { opacity: 0; transform: rotate(40deg) scale(1.1); } }
@keyframes msText { 0% { opacity: 0; transform: scale(3); } 15% { opacity: 1; transform: scale(0.92); } 24% { transform: scale(1.04); } 30% { transform: scale(1); } 82% { opacity: 1; transform: scale(1.02); } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes msSub { 0%, 18% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- модалки ---------------- */
#modalRoot { position: absolute; inset: 0; z-index: 58; pointer-events: none; }
.modal-back {
  position: absolute; inset: 0; pointer-events: auto;
  background: rgba(0, 6, 3, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px);
  animation: fadeIn 0.2s;
}
.modal-back.out { animation: fadeOut 0.2s forwards; }
.modal {
  width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto;
  border-radius: 22px; padding: 20px 18px 16px;
  background: linear-gradient(180deg, #0f2a1b, #06140c);
  border: 1px solid rgba(255, 210, 63, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 190, 40, 0.15);
  text-align: center;
  animation: modalIn 0.32s cubic-bezier(.2, 1.4, .4, 1);
}
.modal .m-em { font-size: 52px; line-height: 1.1; filter: drop-shadow(0 0 14px rgba(255, 210, 63, 0.5)); }
.modal h2 { margin: 6px 0 8px; font-family: var(--font-head); font-weight: 400; font-size: 22px; color: var(--gold); }
.modal .m-body { font-size: 14px; color: #cfe9da; line-height: 1.45; }
.modal .m-body b { color: var(--neon); }
.modal .m-body .big { display: block; font-family: var(--font-head); font-size: 30px; color: var(--neon); margin: 8px 0; text-shadow: 0 0 16px rgba(43, 255, 136, 0.5); word-break: break-word; }
.modal .m-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.modal .m-btns .ghost { padding: 11px; border-radius: 14px; color: var(--muted); background: rgba(255, 255, 255, 0.05); font-weight: 700; }
@keyframes modalIn { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------------- финал ---------------- */
.final {
  position: absolute; inset: 0; z-index: 57;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--sat) + 20px) 20px calc(var(--sab) + 20px);
  text-align: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(60, 40, 0, 0.92), rgba(5, 3, 0, 0.97) 70%);
  animation: fadeIn 0.8s;
}
.final .f-rays { position: absolute; left: 50%; top: 40%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; background: repeating-conic-gradient(rgba(255, 210, 63, 0.14) 0deg 5deg, transparent 5deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 5%, transparent 50%); mask-image: radial-gradient(circle, #000 5%, transparent 50%); animation: gSpin 40s linear infinite; pointer-events: none; }
.final > *:not(.f-rays) { position: relative; }
.final .f-crown { font-size: 64px; animation: breath 2.2s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255, 210, 63, 0.8)); }
.final h2 {
  margin: 4px 0 10px; font-family: var(--font-head); font-weight: 400;
  font-size: clamp(28px, 9vw, 44px); line-height: 1.05;
  background: linear-gradient(100deg, #b86a06 0%, #ffd23f 22%, #fff3b8 34%, #ffffff 40%, #ffe066 47%, #ff9f1c 62%, #ffd23f 78%, #b86a06 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 2.6s linear infinite;
  filter: drop-shadow(0 3px 0 #5a2a00) drop-shadow(0 0 18px rgba(255, 190, 40, 0.6));
}
.final p { max-width: 360px; font-size: 14.5px; line-height: 1.5; color: #f3e6c0; margin: 0 0 16px; }
.final .f-stats { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; max-width: 340px; margin-bottom: 20px; }
.final .f-stat { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 210, 63, 0.08); border: 1px solid rgba(255, 210, 63, 0.3); font-size: 13px; color: #e9d9a8; }
.final .f-stat b { font-family: var(--font-head); font-weight: 400; color: var(--gold); white-space: nowrap; }
.final .bigbtn { max-width: 340px; }

/* ---------------- загрузка / ошибка ---------------- */
.loader {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #0d2c1b, #020805 70%);
  transition: opacity 0.4s;
}
.loader.out { opacity: 0; pointer-events: none; }
.loader-coin { width: 86px; height: 86px; animation: coinSpin 1.1s linear infinite; filter: drop-shadow(0 0 18px rgba(255, 200, 50, 0.6)); }
.loader-coin svg { width: 100%; height: 100%; }
@keyframes coinSpin { 0% { transform: scaleX(1); } 50% { transform: scaleX(0.08); } 100% { transform: scaleX(1); } }
.loader-text { font-family: var(--font-head); color: var(--gold); font-size: 16px; letter-spacing: 1px; }
.fatal {
  position: absolute; inset: 0; z-index: 95;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 10px;
  background: #020805; color: var(--text);
}
.fatal .f-em { font-size: 56px; }
.fatal h2 { font-family: var(--font-head); font-weight: 400; color: var(--red); margin: 0; }
.fatal p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; max-width: 320px; }
.fatal code { color: var(--gold); }

@media (max-width: 360px) {
  .logo { font-size: 34px; }
  .balance { font-size: 32px; }
  .tabs button { font-size: 9.5px; }
}
@media (max-height: 600px) {
  .title-row { height: 38px; }
  .logo { font-size: 30px; }
  .balance { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-pattern, .coin-rosette, .coin-rays { animation: none; }
}

/* =====================================================================
   v2
   ===================================================================== */

/* ---------- стадии: фон и силуэты ---------- */
.stage-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.stage-layer.on { opacity: 1; }
.stage-layer .st-sky { position: absolute; inset: 0; }
.stage-layer .st-scene {
  position: absolute; left: 0; right: 0; bottom: var(--panel-h, 45%);
  height: 34%; min-height: 120px;
  transition: bottom 0.32s cubic-bezier(.2, .9, .3, 1);
}
.stage-layer .st-scene svg { width: 100%; height: 100%; display: block; }
/* Цвета сцены — переменные для тем (docs/core-client.md, «Переменные тем»): --scene-<роль> на всех стадиях,
   --scene<N>-<роль> — только на стадии N (0 гараж … 4 планета). По умолчанию — классические цвета. */
.st0 {
  --sc-sky-1: var(--scene0-sky-1, var(--scene-sky-1, #22260f));
  --sc-sky-2: var(--scene0-sky-2, var(--scene-sky-2, #0b0f06));
  --sc-sky-3: var(--scene0-sky-3, var(--scene-sky-3, #030502));
  --sc-ground: var(--scene0-ground, var(--scene-ground, #0b0d06));
  --sc-build: var(--scene0-build, var(--scene-build, #141909));
  --sc-edge: var(--scene0-edge, var(--scene-edge, #4a4a1c));
  --sc-build-2: var(--scene0-build-2, var(--scene-build-2, #1c2210));
  --sc-edge-2: var(--scene0-edge-2, var(--scene-edge-2, #3b4220));
  --sc-glow: var(--scene0-glow, var(--scene-glow, #ffd23f));
}
.st1 {
  --sc-sky-1: var(--scene1-sky-1, var(--scene-sky-1, #0d3330));
  --sc-sky-2: var(--scene1-sky-2, var(--scene-sky-2, #04161a));
  --sc-sky-3: var(--scene1-sky-3, var(--scene-sky-3, #01080a));
  --sc-star: var(--scene1-star, var(--scene-star, #9ff0c0));
  --sc-build: var(--scene1-build, var(--scene-build, #06201e));
  --sc-edge: var(--scene1-edge, var(--scene-edge, #0f3a35));
  --sc-window: var(--scene1-window, var(--scene-window, #2bff88));
}
.st2 {
  --sc-sky-1: var(--scene2-sky-1, var(--scene-sky-1, #2e1a3f));
  --sc-sky-2: var(--scene2-sky-2, var(--scene-sky-2, #120820));
  --sc-sky-3: var(--scene2-sky-3, var(--scene-sky-3, #05020a));
  --sc-star: var(--scene2-star, var(--scene-star, #ffe9b0));
  --sc-moon: var(--scene2-moon, var(--scene-moon, #fff3c4));
  --sc-build: var(--scene2-build, var(--scene-build, #120a1e));
  --sc-edge: var(--scene2-edge, var(--scene-edge, #2c1a40));
  --sc-window: var(--scene2-window, var(--scene-window, #ffd23f));
  --sc-glow: var(--scene2-glow, var(--scene-glow, #ffd23f));
  --sc-build-2: var(--scene2-build-2, var(--scene-build-2, #160c24));
  --sc-edge-2: var(--scene2-edge-2, var(--scene-edge-2, #3a2456));
}
.st3 {
  --sc-sky-1: var(--scene3-sky-1, var(--scene-sky-1, #0a3550));
  --sc-sky-2: var(--scene3-sky-2, var(--scene-sky-2, #04192a));
  --sc-sky-3: var(--scene3-sky-3, var(--scene-sky-3, #010811));
  --sc-star: var(--scene3-star, var(--scene-star, #bfe9ff));
  --sc-moon: var(--scene3-moon, var(--scene-moon, #e9f6ff));
  --sc-ground: var(--scene3-ground, var(--scene-ground, #04243a));
  --sc-ground-2: var(--scene3-ground-2, var(--scene-ground-2, #031a2b));
  --sc-build: var(--scene3-build, var(--scene-build, #0d2f45));
  --sc-build-2: var(--scene3-build-2, var(--scene-build-2, #103a55));
  --sc-glow: var(--scene3-glow, var(--scene-glow, #7fd0ff));
}
.st4 {
  --sc-sky-1: var(--scene4-sky-1, var(--scene-sky-1, #3a1250));
  --sc-sky-2: var(--scene4-sky-2, var(--scene-sky-2, #160626));
  --sc-sky-3: var(--scene4-sky-3, var(--scene-sky-3, #05010c));
  --sc-star: var(--scene4-star, var(--scene-star, #f3d6ff));
  --sc-moon: var(--scene4-moon, var(--scene-moon, #e8c8ff));
  --sc-glow: var(--scene4-glow, var(--scene-glow, #ffb3ff));
  --sc-ground: var(--scene4-ground, var(--scene-ground, #1a0628));
  --sc-edge: var(--scene4-edge, var(--scene-edge, #6a2a9a));
}
.stage-layer .st-sky { background: radial-gradient(120% 70% at 50% 28%, var(--sc-sky-1) 0%, var(--sc-sky-2) 50%, var(--sc-sky-3) 100%); }
.stage-layer .sc-ground { fill: var(--sc-ground); }
.stage-layer .sc-ground2 { fill: var(--sc-ground-2); }
.stage-layer .sc-build { fill: var(--sc-build); }
.stage-layer .sc-build2 { fill: var(--sc-build-2); }
.stage-layer .sc-edge { stroke: var(--sc-edge); }
.stage-layer .sc-edge2 { stroke: var(--sc-edge-2); }
.stage-layer .sc-win { fill: var(--sc-window); }
.stage-layer .sc-glow { fill: var(--sc-glow); }
.stage-layer .sc-glow-s { stroke: var(--sc-glow); }
.stage-layer .sc-star { fill: var(--sc-star); }
.stage-layer .sc-moon { fill: var(--sc-moon); }
.stage-layer .sc-moon-s { stroke: var(--sc-moon); }
.st-twinkle { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- стопки ---------- */
#stacks { position: absolute; left: 0; bottom: 0; pointer-events: none; z-index: 1; }
#tapzone { z-index: 2; }

/* ---------- сегменты/подвкладки ---------- */
.seg {
  display: flex; gap: 4px; padding: 3px; margin: 2px 10px 10px;
  border-radius: 13px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.06);
}
.seg button {
  flex: 1 1 0; min-width: 0; padding: 7px 4px; border-radius: 10px;
  font-size: 12px; font-weight: 800; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button.active { background: rgba(43, 255, 136, 0.15); color: var(--neon); box-shadow: inset 0 0 0 1px rgba(43, 255, 136, 0.45); }
.seg.gold button.active { background: rgba(255, 210, 63, 0.15); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.5); }
.subpage { display: none; }
.subpage.active { display: block; animation: pageIn 0.2s ease-out; }
.page-pad { padding: 0 10px; }

/* замок */
.lockbox {
  text-align: center; padding: 22px 16px; margin: 0 10px 10px; border-radius: 18px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 10px, transparent 10px 20px), rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.14); color: var(--muted); font-size: 13px; line-height: 1.45;
}
.lockbox .lk-em { font-size: 40px; display: block; margin-bottom: 6px; filter: grayscale(0.4); }
.lockbox b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }

/* ---------- событие ---------- */
#eventCard {
  position: absolute; left: 10px; right: 10px; top: 0; z-index: 5;
  display: none; overflow: hidden;
  padding: 8px 12px 10px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(40, 10, 10, 0.94), rgba(20, 5, 5, 0.94));
  border: 1px solid rgba(255, 90, 60, 0.65);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 80, 40, 0.3);
  pointer-events: auto;
}
#eventCard.show { display: block; animation: evIn 0.45s cubic-bezier(.2, 1.4, .4, 1); }
#eventCard.k-buff { background: linear-gradient(180deg, rgba(8, 40, 22, 0.94), rgba(3, 18, 10, 0.94)); border-color: rgba(43, 255, 136, 0.6); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px rgba(43, 255, 136, 0.25); }
#eventCard.k-gamble { background: linear-gradient(180deg, rgba(40, 30, 6, 0.95), rgba(18, 12, 2, 0.95)); border-color: rgba(255, 210, 63, 0.65); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 190, 40, 0.3); }
@keyframes evIn { from { transform: translateY(-30px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.ev-row { display: flex; align-items: center; gap: 10px; }
.ev-em { font-size: 30px; flex: 0 0 auto; animation: evWobble 0.9s ease-in-out infinite; }
@keyframes evWobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.08); } }
.ev-txt { flex: 1 1 auto; min-width: 0; }
.ev-title { font-family: var(--font-head); font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-desc { font-size: 11.5px; color: #e6c9c0; line-height: 1.3; max-height: 30px; overflow: hidden; }
.k-buff .ev-desc { color: #bfe8cf; } .k-gamble .ev-desc { color: #eedfb5; }
.ev-time { font-family: var(--font-head); font-size: 16px; color: var(--gold); flex: 0 0 auto; min-width: 34px; text-align: right; }
.ev-count { margin-top: 6px; text-align: center; font-family: var(--font-head); font-size: 26px; line-height: 1; color: #fff; text-shadow: 0 0 14px rgba(255, 80, 40, 0.8), 0 2px 0 #500; }
.ev-count small { display: block; font-family: var(--font); font-size: 11px; font-weight: 800; color: #ffb3a3; text-shadow: none; margin-bottom: 3px; letter-spacing: 0.5px; text-transform: uppercase; }
.ev-pbar { position: relative; height: 8px; border-radius: 5px; background: rgba(0, 0, 0, 0.45); overflow: hidden; margin-top: 6px; }
.ev-pbar i { position: absolute; inset: 0; background: linear-gradient(90deg, #ff9f1c, #ffd23f); transform-origin: left; transform: scaleX(0); transition: transform 0.12s; }
.ev-tbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #ff5a3c; transform-origin: left; transition: transform 0.25s linear; }
.k-buff .ev-tbar { background: var(--neon); } .k-gamble .ev-tbar { background: var(--gold); }
.ev-btn { margin-top: 8px; width: 100%; padding: 9px; border-radius: 12px; font-family: var(--font-head); font-size: 14px; color: #3a1d00; background: linear-gradient(180deg, #fff3b0, #ffd23f 50%, #ff9f1c); box-shadow: 0 3px 0 #8a4c03; }
#eventCard.hit .ev-count { animation: evHit 0.12s ease-out; }
@keyframes evHit { from { transform: scale(1.18); } to { transform: scale(1); } }
.stage-has-event #buffs { top: var(--ev-h, 84px); }

.banner.bad .bn-main { color: #fff; background: linear-gradient(180deg, #8a8f8c, #4b524e 55%, #2b302d); box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), 0 5px 0 #1a1d1b; }
.banner.bad .bn-sub { color: #ff8f86; text-shadow: 0 0 12px rgba(255, 60, 40, 0.6), 0 2px 0 #300; }

/* ---------- цитата менеджера ---------- */
.quote {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 4px;
  width: max-content; max-width: min(300px, 86vw);
  transform: translateX(-50%) scale(0.6); opacity: 0;
  padding: 8px 12px; border-radius: 14px;
  background: #fffbe9; color: #2a2008; font-size: 13px; font-weight: 700; line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none; z-index: 6; text-align: left;
}
.quote::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -8px; border: 8px solid transparent; border-top-color: #fffbe9; }
.quote.on { opacity: 1; transform: translateX(-50%) scale(1); }
.quote b { color: #8a5200; }

/* ---------- менеджеры ---------- */
.mgr {
  position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px; margin: 0 10px 8px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-b);
}
.mgr-ava {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(circle at 35% 30%, #2c4a38, #0b1a12);
  box-shadow: 0 0 0 3px #c98a14, 0 0 0 5px #6b4205, 0 0 14px rgba(255, 190, 40, 0.35);
}
.mgr.owned .mgr-ava { box-shadow: 0 0 0 3px var(--neon), 0 0 0 5px #0b5a30, 0 0 16px rgba(43, 255, 136, 0.45); }
.mgr-nm { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-ef { font-size: 12px; color: var(--neon); font-weight: 700; margin-top: 1px; }
.mgr-ds { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; max-height: 29px; overflow: hidden; }
.mgr-btn { min-width: 84px; padding: 9px 8px; border-radius: 12px; font-family: var(--font-head); font-size: 13px; white-space: nowrap; background: rgba(255, 255, 255, 0.06); color: #ffb4a8; border: 1px solid rgba(255, 255, 255, 0.08); }
.mgr-btn small { display: block; font-family: var(--font); font-size: 10px; font-weight: 800; color: var(--muted); }
.mgr.can .mgr-btn { color: #3a1d00; background: linear-gradient(180deg, #fff3b0, #ffd23f 50%, #ff9f1c); border-color: transparent; box-shadow: 0 3px 0 #8a4c03, 0 0 14px rgba(255, 190, 40, 0.35); }
.mgr.can .mgr-btn small { color: #6b4205; }
.mgr.owned .mgr-btn { background: rgba(43, 255, 136, 0.12); color: var(--neon); border-color: rgba(43, 255, 136, 0.4); }
.mgr.cant { opacity: 0.7; }

/* ---------- биржа ---------- */
.dcard { position: relative; overflow: hidden; margin: 0 10px 10px; padding: 12px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)); border: 1px solid var(--card-b); }
.dcard h3 { margin: 0 0 8px; font-family: var(--font-head); font-weight: 400; font-size: 17px; color: var(--gold); display: flex; align-items: center; gap: 6px; }
.coin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.coin-price { font-family: var(--font-head); font-size: 24px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-chg { font-family: var(--font-head); font-size: 14px; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.coin-chg.up { color: var(--neon); background: rgba(43, 255, 136, 0.12); }
.coin-chg.down { color: #ff6b5e; background: rgba(255, 70, 60, 0.12); }
.coin-chart { display: block; width: 100%; height: 130px; margin: 8px 0; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.coin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.coin-stats .stat b { font-size: 13px; }
.coin-stats .stat.pl-up b { color: var(--neon); } .coin-stats .stat.pl-down b { color: #ff6b5e; }
.btn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.btn-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.tbtn { padding: 10px 2px; border-radius: 11px; font-family: var(--font-head); font-size: 12.5px; white-space: nowrap; background: rgba(43, 255, 136, 0.12); color: var(--neon); border: 1px solid rgba(43, 255, 136, 0.4); transition: transform 0.08s; }
.tbtn:active { transform: scale(0.95); }
.tbtn.sell { background: rgba(255, 90, 70, 0.12); color: #ff8f86; border-color: rgba(255, 90, 70, 0.4); }
.tbtn:disabled { opacity: 0.4; }
.dlabel { font-size: 11px; color: var(--muted); margin: 0 0 5px; font-weight: 700; }
.dcard.flash-up { animation: flashUp 0.7s ease-out; } .dcard.flash-down { animation: flashDown 0.7s ease-out; }
@keyframes flashUp { 0% { box-shadow: inset 0 0 0 2px var(--neon), 0 0 30px rgba(43, 255, 136, 0.6); } 100% { box-shadow: none; } }
@keyframes flashDown { 0% { box-shadow: inset 0 0 0 2px #ff5a4a, 0 0 30px rgba(255, 60, 40, 0.5); } 100% { box-shadow: none; } }

/* ---------- казино ---------- */
.bet-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.bet-row .seg { flex: 1; margin: 0; }
.bet-amt { font-size: 11.5px; color: var(--muted); text-align: right; min-width: 82px; }
.bet-amt b { display: block; color: var(--gold); font-family: var(--font-head); font-weight: 400; font-size: 13px; white-space: nowrap; }
.cas-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.cas-msg { min-height: 22px; margin: 6px 0; font-family: var(--font-head); font-size: 15px; text-align: center; color: var(--muted); }
.cas-msg.win { color: var(--neon); text-shadow: 0 0 12px rgba(43, 255, 136, 0.6); animation: casWin 0.5s cubic-bezier(.2, 1.6, .4, 1); }
.cas-msg.lose { color: #9aa39f; animation: casLose 0.8s ease-out; }
@keyframes casWin { from { transform: scale(0.5); } to { transform: scale(1); } }
@keyframes casLose { 0% { transform: translateY(-6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cas-stage.sad { animation: casSad 0.9s ease-out; }
@keyframes casSad { 0% { filter: grayscale(0); } 30% { filter: grayscale(1) brightness(0.7); transform: translateY(4px); } 100% { filter: none; transform: none; } }
/* рулетка */
.wheel-box { position: relative; width: 210px; height: 210px; }
.wheel-box canvas { width: 210px; height: 210px; display: block; border-radius: 50%; box-shadow: 0 0 0 6px #5a3204, 0 0 0 9px #c98a14, 0 0 26px rgba(255, 190, 40, 0.35), 0 10px 20px rgba(0, 0, 0, 0.5); will-change: transform; }
.wheel-ptr { position: absolute; left: 50%; top: -12px; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 22px solid #ffd23f; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); z-index: 2; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd23f 45%, #a96006); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); display: grid; place-items: center; font-family: var(--font-head); color: #3a1d00; font-size: 15px; }
.pick-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; margin-top: 4px; }
.pick { padding: 11px 4px; border-radius: 12px; font-family: var(--font-head); font-size: 13px; color: #fff; white-space: nowrap; transition: transform 0.08s; }
.pick:active { transform: scale(0.95); }
.pick.red { background: linear-gradient(180deg, #e3352a, #9c140e); box-shadow: 0 3px 0 #5a0a06; }
.pick.black { background: linear-gradient(180deg, #3a3a40, #121216); box-shadow: 0 3px 0 #000; }
.pick.zero { background: linear-gradient(180deg, #19b35c, #0a6a33); box-shadow: 0 3px 0 #04381a; }
.pick:disabled, .bigbtn.cas:disabled { opacity: 0.45; }
/* слоты */
.slots { display: flex; gap: 8px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, #5a1010, #2a0505); box-shadow: inset 0 0 0 3px #c98a14, 0 0 22px rgba(255, 60, 40, 0.3); }
.reel { width: 70px; height: 76px; overflow: hidden; border-radius: 10px; background: linear-gradient(180deg, #d9d2bd, #fffdf3 30%, #fffdf3 70%, #d9d2bd); position: relative; box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.35); }
.reel-strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel-strip div { height: 76px; display: grid; place-items: center; font-size: 42px; line-height: 1; }
.reel.win { box-shadow: inset 0 0 0 3px var(--neon), 0 0 16px rgba(43, 255, 136, 0.7); }
/* напёрстки */
.thimbles { position: relative; width: 270px; max-width: 100%; height: 120px; }
.cup { position: absolute; bottom: 14px; width: 74px; height: 86px; margin-left: -37px; transition: left 0.22s ease-in-out, transform 0.3s cubic-bezier(.2, 1.3, .4, 1); cursor: pointer; z-index: 2; }
.cup::before { content: ""; position: absolute; inset: 0; clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 14px), linear-gradient(90deg, #7a0c08, #e3352a 40%, #ff6a4a 55%, #9c140e); border-radius: 6px; }
.cup::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -4px; height: 10px; border-radius: 6px; background: linear-gradient(180deg, #ffd23f, #a96006); }
.cup.up { transform: translateY(-46px) rotate(-6deg); }
.thimbles.pickable .cup { animation: cupHint 0.9s ease-in-out infinite; }
.thimbles.pickable .cup:nth-child(2) { animation-delay: 0.15s; } .thimbles.pickable .cup:nth-child(3) { animation-delay: 0.3s; }
@keyframes cupHint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ball { position: absolute; bottom: 16px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8cc, #ffd23f 45%, #a96006); box-shadow: 0 0 12px rgba(255, 200, 50, 0.8); z-index: 1; opacity: 0; transition: opacity 0.2s; }
.ball.on { opacity: 1; }
.bigbtn.cas { margin-top: 8px; padding: 12px; font-size: 15px; }

/* ---------- тень ---------- */
.shadow-card {
  position: relative; overflow: hidden; margin: 0 10px 10px; padding: 14px; border-radius: 18px;
  background: radial-gradient(120% 90% at 20% 0%, rgba(120, 40, 200, 0.35), transparent 60%), linear-gradient(180deg, #160a24, #07030d);
  border: 1px solid rgba(170, 90, 255, 0.45);
  box-shadow: 0 0 26px rgba(130, 50, 220, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.shadow-card h3 { margin: 0 0 6px; font-family: var(--font-head); font-weight: 400; font-size: 19px; color: #d6b4ff; text-shadow: 0 0 14px rgba(170, 90, 255, 0.7); }
.shadow-card p { margin: 0 0 10px; font-size: 12.5px; color: #b7a3cf; line-height: 1.4; }
.shadow-card .stat { background: rgba(0, 0, 0, 0.4); }
.shadow-card .stat b { color: #d6b4ff; }
.bigbtn.shadow { color: #f2e6ff; background: linear-gradient(180deg, #7a3fd0, #4a1a90 55%, #2a0b5a); box-shadow: 0 4px 0 #1a0638, 0 0 24px rgba(150, 70, 255, 0.45); }
.bigbtn.shadow:active { box-shadow: 0 1px 0 #1a0638; }
.perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.perk { padding: 10px 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(170, 90, 255, 0.25); text-align: center; cursor: pointer; }
.perk .p-em { font-size: 26px; }
.perk .p-nm { font-size: 12px; font-weight: 800; color: #eadcff; margin-top: 2px; }
.perk .p-ds { font-size: 10.5px; color: #a993c4; line-height: 1.25; margin-top: 2px; }
.perk .p-c { font-family: var(--font-head); font-size: 13px; color: #d6b4ff; margin-top: 5px; }
.perk.owned { border-color: rgba(170, 90, 255, 0.8); box-shadow: 0 0 14px rgba(150, 70, 255, 0.35); }
.perk.owned .p-c { color: var(--neon); }
.perk.can { border-color: rgba(214, 180, 255, 0.7); }
.perk.cant { opacity: 0.6; }
.shadow-smoke { position: absolute; inset: -20%; background: radial-gradient(40% 30% at 70% 80%, rgba(140, 60, 220, 0.25), transparent 70%), radial-gradient(30% 25% at 20% 60%, rgba(90, 30, 160, 0.25), transparent 70%); animation: smoke 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes smoke { from { transform: translate(-4%, 2%) rotate(0deg); } to { transform: translate(4%, -3%) rotate(8deg); } }
.shadow-card > *:not(.shadow-smoke) { position: relative; }

/* ---------- скины ---------- */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; padding: 0 10px; }
.skin { position: relative; padding: 10px 6px 9px; border-radius: 16px; text-align: center; background: var(--card); border: 1px solid var(--card-b); cursor: pointer; }
.skin .sk-prev { width: 64px; height: 64px; margin: 0 auto 4px; }
.skin .sk-prev svg { width: 100%; height: 100%; display: block; overflow: visible; }
.skin .sk-nm { font-size: 12px; font-weight: 800; }
.skin .sk-ds { font-size: 10px; color: var(--muted); line-height: 1.25; margin-top: 2px; max-height: 26px; overflow: hidden; }
.skin.sel { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 210, 63, 0.3); background: rgba(255, 210, 63, 0.08); }
.skin.sel::after { content: "✓"; position: absolute; right: 7px; top: 5px; font-weight: 900; color: var(--gold); }
.skin.locked .sk-prev { filter: grayscale(1) brightness(0.35); }
.skin.locked .sk-nm::before { content: "🔒 "; }

.coin-glow { background: radial-gradient(circle, var(--glow, rgba(255, 200, 50, 0.38)) 0%, rgba(255, 160, 20, 0.08) 45%, transparent 68%); }

/* ---------- банда (заглушка) ---------- */
#socialRoot { min-height: 100%; }
.gem-spark { animation: twinkle 1.6s ease-in-out infinite; }

/* ---------- настройки / лайт / топ ---------- */
.gear-btn { right: 44px; }
.set-presets { margin: 0 0 6px; }
.set-presets button { font-size: 11px; padding: 7px 2px; }
.set-hint { min-height: 16px; font-size: 11.5px; color: var(--muted); text-align: center; margin-bottom: 6px; }
.set-list { text-align: left; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.set-row .st { min-width: 0; } .set-row b { display: block; font-size: 14px; color: var(--text); } .set-row small { font-size: 11px; color: var(--muted); }
.sw { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.sw input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 13px; background: rgba(255, 255, 255, 0.14); transition: background 0.15s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.sw input:checked + i { background: var(--neon2); } .sw input:checked + i::after { transform: translateX(20px); }

body.no-flash .ms-flash, body.no-flash .ms-rays, body.no-flash .f-rays, body.no-flash #frameGlow { display: none !important; }
body.no-flash .bg-pulse { animation: none; opacity: 0; }
body.no-bganim .bg-pattern, body.no-bganim .coin-rosette, body.no-bganim .coin-rays, body.no-bganim .coin-glow, body.no-bganim .stage-layer .st-twinkle { animation: none !important; }
html.tab-hidden *, html.tab-hidden *::before, html.tab-hidden *::after { animation-play-state: paused !important; }

/* лёгкая графика: без blur/свечений/анимированных градиентов */
html.lite *, html.lite *::before, html.lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; text-shadow: none !important; }
html.lite .bg-pattern, html.lite .coin-rosette, html.lite .coin-rays, html.lite .coin-glow, html.lite .coin-breath, html.lite .coin-shadow, html.lite .coin-shine,
html.lite .logo, html.lite .bg-pulse, html.lite .shadow-smoke, html.lite .stage-layer .st-twinkle, html.lite .ms-rays, html.lite .f-rays, html.lite .g-rays, html.lite .combo-fire { animation: none !important; }
html.lite .coin-rosette, html.lite .coin-rays, html.lite .combo-fire { display: none; }
html.lite .logo, html.lite .balance, html.lite .coin-body svg, html.lite .bal-coin, html.lite .golden .g-bill, html.lite .toast, html.lite .panel, html.lite .brow.can, html.lite .ucard.can, html.lite .buff, html.lite .combo-txt, html.lite .bigbtn, html.lite .modal, html.lite .banner .bn-main, html.lite .dcard, html.lite .mgr { filter: none !important; box-shadow: none !important; }
html.lite .brow.can, html.lite .ucard.can { outline: 1px solid var(--neon); }
html.lite .brow.can::after, html.lite .ucard.can::after, html.lite .toast::after { display: none; }
html.lite .stage-layer { transition: none; }
body.fx-battery .stage-layer .st-twinkle { animation: none; }

/* вкладка «Топ» */
.page[data-page="top"] { padding-top: 0; }
.me-card { position: sticky; top: 0; z-index: 2; }
.me-card .me-money { text-align: right; flex: 0 0 auto; }
.me-card .me-money small { display: block; color: var(--muted); font-size: 10px; }
.me-card .me-money b { font-family: var(--font-head); font-weight: 400; font-size: 14px; color: var(--neon); }
.trow { grid-template-columns: 34px minmax(0, 1fr) auto auto; }
.trow.thead { background: none; font-size: 10px; color: var(--muted); padding: 2px 10px; text-align: right; }
.trow.thead div:nth-child(2) { text-align: left; }
.trow .t-m { font-family: var(--font-head); font-size: 12px; color: var(--neon); white-space: nowrap; min-width: 52px; text-align: right; }
.trow .t-s { font-size: 13px; min-width: 56px; text-align: right; }
.trow.r1 { background: linear-gradient(90deg, rgba(255, 210, 63, 0.22), rgba(255, 210, 63, 0.04)); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.5); }
.trow.r2 { background: linear-gradient(90deg, rgba(200, 215, 230, 0.18), rgba(200, 215, 230, 0.03)); box-shadow: inset 0 0 0 1px rgba(200, 215, 230, 0.4); }
.trow.r3 { background: linear-gradient(90deg, rgba(220, 140, 80, 0.2), rgba(220, 140, 80, 0.03)); box-shadow: inset 0 0 0 1px rgba(220, 140, 80, 0.4); }
.trow.vip { box-shadow: inset 0 0 0 2px #ffd23f, 0 0 10px rgba(255, 210, 63, 0.35); }
.trow.vip .t-n::after { content: " 👑"; }
.tabs button { font-size: 10px; }
.tabs button i { font-size: 19px; }
.badge { right: calc(50% - 20px); }
.tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-left: 2px; padding-right: 2px; }

/* ---------- v4: модули (слоты, подвкладки, настройки) ---------- */
.tabroot { min-height: 100%; }
.seg-scroll, .seg { overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-scroll button { flex: 1 0 auto; min-width: 64px; padding-left: 8px; padding-right: 8px; }
/* A38: 5+ подвкладок — не обрезать до «З…», а прокручивать ряд по горизонтали */
.seg > button:first-child:nth-last-child(n+5), .seg > button:first-child:nth-last-child(n+5) ~ button {
  flex: 1 0 auto; min-width: 0; padding-left: 9px; padding-right: 9px; overflow: visible; text-overflow: clip; }
.seg { scroll-behavior: smooth; overscroll-behavior-x: contain; }
.slot:empty { display: none; }
/* A38: слот header — компактный ряд бейджей под балансом (титул, сундуки, война), баннер ивента — отдельной строкой */
.slot-header { display: flex; flex-flow: row wrap; justify-content: center; align-items: center; gap: 4px 6px; margin-top: 5px; max-width: 100%; }
.slot-header > * { margin: 0 !important; min-width: 0; max-width: 100%; }
.slot-header > .slot-item { display: flex; justify-content: center; }
.slot-header > .slot-item:empty { display: none; }
.slot-header > .evb-slot { flex: 1 0 100%; order: 10; }
.slot-header .ttl-badge, .slot-header .cst-pill, .slot-header .bp-chip, .slot-header .qst-pill {
  margin: 0; height: 24px; padding: 0 10px; font-size: 12px; line-height: 22px; max-width: 62vw;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-header .evb { margin: 0 auto !important; padding: 3px 6px 3px 10px !important; font-size: 12px !important; min-height: 0; }
.slot-header .evb-b { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.slot-header .evb-t { flex: 1 1 auto; min-width: 0; }
.slot-header .evb-c { flex: none; white-space: nowrap; }
.slot-header .evb-e { font-size: 15px; }
.slot-header .evb-x { width: 22px; height: 22px; line-height: 22px; }
/* мало высоты — шапка ужимается, а не налезает на сцену (ui.js пересчитывает --head-h по #top) */
@media (max-height: 800px) {
  .title-row { height: 38px; }
  .logo { font-size: 32px; letter-spacing: 2px; }
  .balance { font-size: 32px; }
  .bal-coin { width: 26px; height: 26px; flex-basis: 26px; }
  .rates { margin-top: 4px; }
  .pill { padding: 3px 10px; }
}
@media (max-height: 690px) {
  #top { padding-top: calc(var(--sat) + 3px); padding-bottom: 3px; }
  .title-row { height: 32px; }
  .title-row .icon-btn { width: 32px; height: 32px; line-height: 32px; font-size: 16px; border-radius: 10px; }
  .logo { font-size: 26px; }
  .balance { font-size: 28px; }
  .rates { margin-top: 3px; }
  .slot-header { margin-top: 3px; }
}
.slot-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.slot-overlay > * { pointer-events: auto; }
.slot[data-slot="top-extra"], .slot[data-slot="bonus"] { padding: 0 10px 8px; }
.set-sub { margin: 12px 2px 4px; font-size: 12px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; }
.set-sel { max-width: 46%; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.4); color: inherit; font: inherit; font-size: 13px; }
.set-range { width: 42%; accent-color: var(--neon); }
.set-mods:empty { display: none; }

/* ---------- A27: бейдж в подвкладке, кликабельный топ ---------- */
.seg button .badge { position: static; display: inline-block; vertical-align: 1px; margin-left: 4px; min-width: 15px; height: 15px; line-height: 15px; padding: 0 3px; font-size: 9px; box-shadow: none; }
.tap-open { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: filter .12s, transform .12s; }
.tap-open:active { filter: brightness(1.35); transform: scale(0.985); }
@media (hover: hover) { .trow.tap-open:hover { filter: brightness(1.15); } }

/* ---------- A38: слои ---------- */
/* Админ-кнопка 🛠 живёт в body (z 9000) и висела поверх игровых модалок и шторки чата — прячем, пока они открыты */
body:has(#modalRoot .modal) .adm-fab, body:has(.cht-sheet:not([hidden])) .adm-fab { display: none; }
/* заголовок «Банда»/«Бонусы» (social.css) — в линию с карточками */
.soc-top { padding: 2px 12px; }

/* ---------- A38: общая кнопка модулей .btn (квесты, дуэли, карта, промо) — раньше была без стиля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 12px; font-weight: 800; font-size: 14px; line-height: 1.2;
  color: #04210f; background: linear-gradient(180deg, var(--neon), var(--neon2));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); white-space: nowrap; cursor: pointer;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled, .btn[disabled] { opacity: 0.45; filter: grayscale(0.6); box-shadow: none; transform: none; cursor: default; }
.btn.ghost { color: var(--text); background: var(--card); border: 1px solid var(--card-b); box-shadow: none; }
html.theme-minimal .btn:not(.ghost) { color: #fff; }
