/* shell-nav-v40: no bugs/farm tab styles */
/* Batel shared shell — Arena tokens. No Epic purple. */
@import url("./batel-kit.css");

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Vazirmatn", system-ui, sans-serif;
  font-size: 16px;
  line-height: var(--lh);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button, a, input { touch-action: manipulation; font: inherit; color: inherit; }
.batel-btn, button.batel-btn, .batel-bal {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
@media (max-width: 380px) {
  :root { --page-pad-x: 10px; }
  .batel-btn { min-height: 46px; font-size: 15px; }
}
@media (min-width: 480px) {
  :root { --app-max: 460px; }
}
button { border: 0; background: transparent; cursor: pointer; }
a { color: inherit; text-decoration: none; }
/* In-app nav buttons (replace <a href> so URL is not copyable) */
button[data-go] { color: inherit; text-align: inherit; -webkit-user-select: none; user-select: none; }
.batel-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted, #9a9aa3);
  background: transparent;
  padding: 0;
}
.batel-nav button.on,
.batel-nav button[aria-current="page"] {
  color: #fff;
  background: rgba(22,137,255,.18);
}
.batel-nav button svg { width: 20px; height: 20px; opacity: .9; }
button.batel-back,
button.batel-bal,
button.batel-btn,
button.profile-link,
button.wallet-chip,
button.brand {
  cursor: pointer;
}

#batel-lock { display: none; }
/* Overlay only — never display:none siblings (zeros #crashScroll layout → black rocket). */
html.batel-locked body > *:not(#batel-lock) {
  pointer-events: none !important;
}
html.batel-locked #batel-lock {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--bg-elev);
  color: #fff;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: auto !important;
}
/* Rocket web-reset: lock overlay never blocks crashgame. */
html.batel-rocket-web.batel-locked body > *:not(#batel-lock) {
  pointer-events: auto !important;
}
html.batel-rocket-web #batel-lock,
html.batel-rocket-web.batel-locked #batel-lock {
  display: none !important;
  pointer-events: none !important;
}

/* Legacy Close/Deposit appbar — never show (TG owns Close / ···). */
#batel-appbar { display: none !important; }

/* Soft fill behind Telegram Close/menu so the strip matches the page. */
html.batel-fs body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--tg-top, 0px);
  pointer-events: none;
  z-index: 140;
  background: #0e0e10;
}

/* Centered brand capsule — shell pages only. Outside #batel-scroll = never moves. */
.batel-brandbar {
  position: fixed;
  /* Never climb above the viewport (tg-top=0 used to put the logo at -7px = “gone”). */
  top: max(6px, calc(var(--tg-top, 0px) - 4px));
  left: 0;
  right: 0;
  z-index: 160;
  height: var(--brandbar-h, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  pointer-events: none;
  direction: ltr;
}
.batel-brandbar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  background: rgba(14, 14, 16, 0.82);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  border: 1px solid rgba(22, 137, 255, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.batel-brandbar-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(22, 137, 255, 0.28);
  opacity: 0.96;
}
.batel-brandbar-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}
.batel-brandbar-title b {
  color: var(--blue, #1689ff);
  font-weight: 800;
}
html.batel-has-brandbar {
  --chrome-top: var(--brandbar-h, 34px);
}
html.batel-has-brandbar .batel-back,
html.batel-has-brandbar a.batel-back,
html.batel-has-brandbar #batel-back {
  top: calc(var(--tg-top, 12px) + var(--brandbar-h, 34px) + 2px) !important;
}

/* Document never scrolls — content scrolls in #batel-scroll / #crashScroll.
   IMPORTANT: no transform on the scroll root — it would trap position:fixed
   children (tournament YOU bar, sheets) and make them scroll/overlap. */
html.batel-lock-scroll,
html.batel-lock-scroll body {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}
#batel-scroll.batel-scroll {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--tg-top, 0px) + var(--chrome-top, 0px));
  bottom: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  /* Just enough to clear the dock — extra +10 looked like a dead black band. */
  padding-bottom: calc(var(--nav-h, 76px) + 2px);
  box-sizing: border-box;
  scroll-behavior: auto;
}
html.batel-has-brandbar #batel-scroll.batel-scroll {
  top: calc(var(--tg-top, 0px) + var(--brandbar-h, 34px) - 4px);
}
html.batel-game #batel-scroll.batel-scroll {
  top: calc(var(--tg-top, 0px) + var(--game-chrome-h, 44px));
}
/* Legacy inline-chrome class: keep harmless if an old tab still has it. */
html.batel-game.batel-game-inline-chrome #batel-scroll.batel-scroll {
  top: calc(var(--tg-top, 0px) + var(--game-chrome-h, 44px));
}
/* Inside scroll root: chrome/nav clearance already on #batel-scroll — do NOT
   stack another --nav-h on .app (that made the huge empty black band above the dock). */
html.batel-lock-scroll #batel-scroll .app,
html.batel-lock-scroll #batel-scroll .arena-app {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
/* If hoist failed and header is still inside scroll, keep room under fixed Back/title. */
html.batel-game #batel-scroll .app > header.top:first-child:not(.batel-pinned-chrome) {
  margin-bottom: 10px;
}

/* ——— Game pages: Back + title/TON/history pinned outside scroll ——— */
html.batel-game {
  --chrome-top: var(--game-chrome-h, 44px);
}
html.batel-game .batel-back,
html.batel-game a.batel-back,
html.batel-game #batel-back {
  top: calc(var(--tg-top, 12px) + 4px) !important;
  z-index: 70 !important;
}
.batel-pinned-chrome,
html.batel-game body > .batel-back ~ header.top,
html.batel-game body > header.top.batel-pinned-chrome,
html.batel-game body > .head.batel-pinned-chrome,
html.batel-game body > .topbar.batel-pinned-chrome,
html.batel-game body > .page-head.batel-pinned-chrome {
  position: fixed !important;
  /* Sit in the top black strip under Telegram Close — same as upgrade. */
  top: calc(var(--tg-top, 12px) + 2px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 60 !important;
  margin: 0 !important;
  min-height: 44px;
  height: 44px;
  max-width: none !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  /* Physical LTR chrome: Back is always left — never use inline-start (RTL flips it). */
  direction: ltr !important;
  padding-right: 12px !important;
  /* Default tight; Back sibling rule below widens only when a back control exists. */
  padding-left: 12px !important;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(14, 14, 16, 0.92) 0%, rgba(14, 14, 16, 0.78) 70%, rgba(14, 14, 16, 0));
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  pointer-events: none;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.batel-pinned-chrome > .brand,
.batel-pinned-chrome > button.brand,
html.batel-game body > header.top > .brand {
  position: static;
  left: auto;
  transform: none;
  margin: 0 !important;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(46vw, 168px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #f4f6fb;
  /* Title mark must not steal taps from History / TON (was sending users home). */
  pointer-events: none;
}
.batel-pinned-chrome > button.brand[data-go],
.batel-pinned-chrome > a.brand[data-go] {
  pointer-events: auto;
}
/* Upgrade / farm / free / savings: title stays left, balance on the right. */
html.batel-game body > .head.batel-pinned-chrome > b,
html.batel-game body > .page-head.batel-pinned-chrome > b,
html.batel-game body > header.top.batel-pinned-chrome > .brand {
  position: static !important;
  left: auto !important;
  transform: none !important;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(46vw, 168px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #f4f6fb;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
/* Free/farm title stack: stay left of TON, never absolute-center into the board. */
html.batel-game body > header.top > .titles {
  position: relative !important;
  left: auto !important;
  transform: none !important;
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 128px);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
html.batel-game body > header.top > .titles .brand,
html.batel-game body > header.top > .titles .sub {
  position: static !important;
  left: auto !important;
  transform: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Compact pinned row — hide subtitle so chrome doesn't eat the board. */
html.batel-game body > header.top.batel-pinned-chrome > .titles .sub,
html.batel-game body > header.top.batel-pinned-chrome > div > .sub {
  display: none !important;
}
/* Nested brand/sub (mines) must not absolute-center either. */
html.batel-game body > header.top > div:not(.titles) {
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 128px);
}
html.batel-game body > header.top > div:not(.titles) > .brand {
  position: static !important;
  left: auto !important;
  transform: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.batel-game body > header.top > div:not(.titles) > .sub {
  display: none !important;
}
.batel-pinned-chrome .batel-bal,
.batel-pinned-chrome .topbar-end,
.batel-pinned-chrome .brand,
.batel-pinned-chrome .hist-btn,
.batel-pinned-chrome .phase-pill,
html.batel-game body > header.top .batel-bal {
  pointer-events: auto;
}
/* Balance always on the physical right, clear of Back. */
html.batel-game body > header.top .batel-bal,
.batel-pinned-chrome .batel-bal {
  margin-left: auto !important;
  margin-right: 0 !important;
  flex: 0 0 auto;
  max-width: min(44vw, 172px);
  min-height: 36px;
  padding: 6px 10px 6px 10px;
  border-radius: 999px;
  background: rgba(22, 24, 32, 0.88);
  border: 1px solid rgba(22, 137, 255, 0.32);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
html.batel-game body > header.top .batel-bal b,
.batel-pinned-chrome .batel-bal b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 7.5em;
  display: inline-block;
  vertical-align: bottom;
  font-size: 13px;
  font-weight: 900;
}
/* Default pinned chrome full-bleed padding; with a Back sibling, clear its width. */
body > .topbar.batel-pinned-chrome,
body > header.top.batel-pinned-chrome,
body > .head.batel-pinned-chrome,
body > .page-head.batel-pinned-chrome {
  padding-left: 12px !important;
}
body > .batel-back ~ .batel-pinned-chrome,
body > a.batel-back ~ .batel-pinned-chrome,
body > .batel-back ~ header.top,
body > a.batel-back ~ header.top {
  padding-left: min(140px, var(--tgp-back-clear, 92px)) !important;
}
/* Smoother scroll + cheaper offscreen paint inside the scroll root. */
#batel-scroll.batel-scroll,
#crashScroll.crash-scroll {
  scroll-behavior: auto;
  contain: layout style;
}
html.batel-game body > .batel-back ~ #crashScroll > div.app {
  padding-top: calc(var(--tg-top, 8px) + var(--game-chrome-h, 44px) + 8px) !important;
}
html.batel-lock-scroll #crashScroll.crash-scroll {
  top: 0;
  bottom: 0;
}

/* ——— Top chrome ——— */
.batel-back,
a.batel-back,
#batel-back,
a.back.batel-back,
.back#batel-back {
  position: fixed !important;
  top: calc(var(--tg-top, 12px) + 4px) !important;
  left: 10px !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 120 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  margin: 0;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid var(--border-hi);
  transform: none !important;
  transition: background var(--dur-fast) var(--ease-out), filter var(--dur-press) var(--ease-press);
  -webkit-transform: none !important;
}
.batel-back:active,
#batel-back:active,
a.back:active {
  filter: brightness(1.12);
  transform: none !important;
}

.batel-bal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  background: rgba(22, 24, 32, 0.92);
  border-radius: var(--r-pill);
  padding: 7px 11px 7px 10px;
  font-weight: 800;
  border: 1px solid rgba(22, 137, 255, 0.28);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform var(--dur-press) var(--ease-press), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.batel-bal:not(:has(.batel-bal-plus))::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-inline-start: 2px;
  border-radius: 50%;
  background: rgba(22, 137, 255, 0.18);
  border: 1px solid rgba(22, 137, 255, 0.45);
  color: var(--blue, #1689ff);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}
.batel-bal .batel-bal-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-inline-start: 2px;
  border-radius: 50%;
  background: rgba(22, 137, 255, 0.18);
  border: 1px solid rgba(22, 137, 255, 0.45);
  color: var(--blue, #1689ff);
  font-size: 14px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  flex: 0 0 auto;
}
.batel-bal:active { transform: scale(0.97); }
.batel-bal span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.batel-bal b {
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* Stars pill — permanent beside player name (compact; values ≥1k as 1.1k) */
.batel-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  background: var(--panel-2);
  border-radius: var(--r-pill);
  padding: 6px 10px 6px 8px;
  font-weight: 800;
  border: 1px solid rgba(255, 196, 72, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #ffe29a;
  transition: transform var(--dur-press) var(--ease-press), border-color var(--dur-fast) var(--ease-out);
  flex: 0 0 auto;
}
.batel-stars[hidden] { display: none !important; }
.batel-stars:active { transform: scale(0.97); }
.batel-stars-ico {
  color: #ffc857;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}
.batel-stars b {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  color: #ffe9b0;
  font-size: 12.5px;
  min-width: 1.2em;
}
.brand-wrap .batel-stars {
  min-height: 34px;
  padding: 5px 9px 5px 7px;
}
/* Game chrome: TON stays physical-right; stars stay with name / after Back. */
html.batel-game body > header.top .batel-stars,
.batel-pinned-chrome .batel-stars {
  margin-left: 0 !important;
  margin-right: 0 !important;
  pointer-events: auto;
  min-height: 30px;
  padding: 4px 8px 4px 6px;
  gap: 3px;
}
html.batel-game body > header.top .batel-stars-ico {
  font-size: 12px;
}
html.batel-game body > header.top .batel-stars b {
  font-size: 12px;
}
/* Telegram BackButton owns back on games — hide duplicate chip + tighten header. */
html.batel-game.batel-tg-back .batel-back,
html.batel-game.batel-tg-back a.batel-back,
html.batel-game.batel-tg-back #batel-back {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html.batel-game.batel-tg-back body > header.top,
html.batel-game.batel-tg-back body > .batel-pinned-chrome,
html.batel-game.batel-tg-back .batel-pinned-chrome {
  padding-left: 12px !important;
}
html.batel-game.batel-tg-back body > header.top > .brand,
html.batel-game.batel-tg-back .batel-pinned-chrome > .brand {
  font-size: 15px;
  font-weight: 800;
}
html.batel-game.batel-tg-back body > .batel-back ~ #crashScroll > div.app,
html.batel-game.batel-tg-back #crashScroll > div.app {
  padding-top: calc(var(--tg-top, 8px) + var(--game-chrome-h, 44px) + 6px) !important;
}
.topbar .batel-stars,
.page-head .batel-stars {
  margin: 0;
}
.page-head { gap: 8px; }
.page-head .batel-bal { margin-inline-start: auto; }

/* ——— Bottom nav — edge-docked full width (immersive, Epic-like) ——— */
.batel-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  z-index: 90;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: var(--nav-bar, 58px);
  margin: 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px) + var(--tg-bottom, 0px));
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px 18px 0 0;
  background: rgba(10, 12, 16, 0.97);
  box-shadow:
    0 -8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-sizing: border-box;
}
.batel-nav a {
  flex: 1 1 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  padding: 3px 2px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease, filter 0.1s ease;
}
.batel-nav a svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.batel-nav a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
  font-size: inherit;
}
/* Longer nav labels (ru/zh) must not overflow or wrap the dock. */
html[lang="ru"] .batel-nav a,
html[lang="zh"] .batel-nav a {
  font-size: 10px;
  letter-spacing: 0;
}
html[lang="ru"] .batel-nav a span,
html[lang="zh"] .batel-nav a span {
  font-size: 10px;
  max-width: 100%;
}
@media (max-width: 360px) {
  .batel-nav {
    gap: 2px;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px) + var(--tg-bottom, 0px));
  }
  .batel-nav a { font-size: 10px; gap: 2px; padding: 3px 1px; min-height: 50px; }
  .batel-nav a svg { width: 18px; height: 18px; }
}
.batel-nav a.on {
  color: #fff;
  background: rgba(22, 137, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(22, 137, 255, 0.28), 0 6px 16px rgba(22, 137, 255, 0.18);
}
.batel-nav a:active {
  transform: scale(0.96);
  color: #fff;
}

/* ——— Toast / success card (auto-dismiss + optional close) ——— */
#batel-money,
.batel-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h, 76px) + 10px);
  transform: translateX(-50%) translateY(10px);
  z-index: 2147483000;
  max-width: min(90vw, 360px);
  width: max-content;
  min-width: min(72vw, 220px);
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2e2f36, #1c1d22);
  color: #fff;
  font-weight: 750;
  font-size: 14px;
  text-align: center;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(22, 137, 255, 0.1);
  pointer-events: auto;
  opacity: 0;
  transition:
    opacity 0.22s cubic-bezier(.2, 0, 0, 1),
    transform 0.22s cubic-bezier(.2, 0, 0, 1);
}
#batel-money.show,
.batel-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.batel-toast--ok {
  border-color: rgba(61, 220, 132, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 24px rgba(61, 220, 132, 0.12);
}
.batel-toast--bad {
  border-color: rgba(255, 77, 106, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 77, 106, 0.1);
}
.batel-toast--card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  padding: 14px 14px 14px 12px;
  width: min(90vw, 340px);
  min-width: 0;
}
.batel-toast__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(145deg, #3ddc84, #1faa5a);
  box-shadow: 0 8px 18px rgba(61, 220, 132, 0.35);
  position: relative;
}
.batel-toast--bad .batel-toast__icon {
  background: linear-gradient(145deg, #ff6b84, #c6284a);
  box-shadow: 0 8px 18px rgba(255, 77, 106, 0.3);
}
.batel-toast__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid #0e0e10;
  border-bottom: 2.5px solid #0e0e10;
  transform: rotate(-45deg) translate(1px, -1px);
}
.batel-toast--bad .batel-toast__icon::after {
  width: 14px;
  height: 14px;
  border: 0;
  background:
    linear-gradient(#0e0e10, #0e0e10) center/2.5px 12px no-repeat,
    linear-gradient(#0e0e10, #0e0e10) center/12px 2.5px no-repeat;
  transform: rotate(45deg);
  border-radius: 0;
}
.batel-toast__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.batel-toast__title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.batel-toast__name {
  font-size: 13px;
  font-weight: 800;
  color: #e8eef8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batel-toast__bal {
  font-size: 15px;
  font-weight: 900;
  color: #3ddc84;
  font-variant-numeric: tabular-nums;
}
.batel-toast__body {
  font-size: 11px;
  font-weight: 700;
  color: #9a9aa3;
}
.batel-toast__x {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd3dc;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.batel-toast--plain-close {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-end: 10px;
  text-align: start;
}
.batel-toast--plain-close .batel-toast__x { margin-inline-start: auto; }
@media (prefers-reduced-motion: reduce) {
  #batel-money, .batel-toast { transition: none !important; }
}

/* ——— Sheet ——— */
.batel-sheet {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: none;
  z-index: 200;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.batel-sheet.show { display: block; animation: batelScrimIn var(--dur-fast) var(--ease-out); }
.batel-sheet .panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(var(--app-max), 100%);
  max-height: min(78dvh, 640px);
  overflow: auto;
  background: var(--panel);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-hi);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  animation: batelSheetUp 220ms var(--ease-out);
}
@keyframes batelScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes batelSheetUp {
  from { transform: translateX(-50%) translateY(16px); opacity: 0.85; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ——— Empty / gifts ——— */
.batel-empty {
  text-align: center;
  color: var(--muted);
  padding: 20px 12px;
  font-size: 14px;
  line-height: 1.45;
}
.batel-empty a {
  color: var(--blue);
  font-weight: 800;
}
.batel-grid-gifts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.batel-gift-card {
  background: var(--panel-2);
  border-radius: 16px;
  padding: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
  transition:
    transform var(--dur-press) var(--ease-press),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.batel-gift-card:active {
  transform: scale(0.98);
  border-color: rgba(22, 137, 255, 0.35);
}
.batel-gift-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 14px;
  background: var(--bg);
}
.batel-gift-card .acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.batel-gift-card .acts .wide { grid-column: 1 / -1; }

/* Shared page helpers used by shell consumers */
.batel-page {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: calc(var(--tg-top) + var(--chrome-top, 28px)) var(--page-pad-x, 12px) calc(var(--nav-h) + var(--page-pad-bottom, 12px));
}
/* Global clearance: never let floating #batel-nav cover page content */
.app {
  padding-bottom: calc(var(--nav-h, 76px) + var(--page-pad-bottom, 12px));
}
.betbar[style],
.betbar {
  /* Fixed betbars must sit above the floating nav */
  --betbar-clear: calc(var(--nav-h, 76px) + 6px);
}
.batel-page-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
}
.batel-panel {
  background: var(--panel-2);
  border-radius: var(--r-lg);
  padding: 10px;
  margin: 6px 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
}
.batel-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.batel-topbar .batel-bal { margin-inline-start: auto; }

/* ——— Games chrome polish (Arena blue, touch-safe) ——— */
.batel-game-chrome {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.batel-game-chrome .betbar,
.betbar {
  gap: 6px;
}
.batel-game-chrome .betbar button,
.betbar button,
.batel-game-chrome .presets button {
  min-height: var(--tap-min, 44px);
  min-width: var(--tap-min, 44px);
}
.batel-game-chrome .batel-btn.primary:active,
.betbar .go:active,
.betbar .cash:active {
  transform: scale(var(--press-scale, 0.97));
}
.batel-nav a:focus-visible,
.batel-back:focus-visible,
.batel-bal:focus-visible,
.batel-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
  .batel-nav a,
  .batel-bal,
  .batel-back,
  .batel-gift-card,
  #batel-money,
  .batel-sheet.show,
  .batel-sheet .panel,
  .batel-game-chrome .betbar .go,
  .batel-game-chrome .betbar .cash {
    transition: none !important;
    animation: none !important;
  }
  .batel-nav a:active,
  .batel-bal:active,
  .batel-back:active,
  .batel-gift-card:active {
    transform: none;
  }
}

/* ——— v41 platform fixes: iOS / Telegram Desktop / Web ONLY ———
   html.tgp-fix is set by telegram-web-app.js for every platform except android*,
   so none of this can touch Android rendering. */
/* Fixed Back button no longer sits on the page title / balance chip:
   the header row starts after the measured Back width (+8px). */
html.tgp-fix body > .batel-back ~ .app > header.top:first-child,
html.tgp-fix body > .batel-back ~ .app > .head:first-child,
html.tgp-fix body > .batel-back ~ header.top,
html.tgp-fix body > .batel-back ~ .topbar.batel-pinned-chrome,
html.tgp-fix body > .batel-back ~ .head.batel-pinned-chrome,
html.tgp-fix body > .batel-back ~ .page-head.batel-pinned-chrome {
  direction: ltr !important;
  padding-left: min(140px, var(--tgp-back-clear, 92px)) !important;
  padding-right: 12px !important;
}
/* Rocket: keep stage below the fixed Back/title row (page CSS also sets 52px for Android). */
html.tgp-fix body > .batel-back ~ #crashScroll > div.app {
  padding-top: calc(var(--tg-top, 8px) + 52px);
}
/* Wide windows (Telegram Desktop resized, browsers): Back + the fixed Rocket header
   follow the centred app column instead of the window's far-left corner. */
@media (min-width: 560px) {
  html.tgp-fix .batel-back,
  html.tgp-fix a.batel-back,
  html.tgp-fix #batel-back {
    left: max(10px, calc(50% - var(--app-max, 440px) / 2 + 12px)) !important;
  }
  html.tgp-fix body > .batel-back ~ header.top,
  html.tgp-fix body > .batel-back ~ .topbar.batel-pinned-chrome,
  html.tgp-fix body > .batel-back ~ .head.batel-pinned-chrome,
  html.tgp-fix body > .batel-back ~ .page-head.batel-pinned-chrome {
    left: max(0px, calc(50% - var(--app-max, 440px) / 2));
    right: max(0px, calc(50% - var(--app-max, 440px) / 2));
  }
}
/* Mouse/trackpad (Windows, macOS desktop): classic scrollbars ate 15–17px of the
   app width (and sat on the LEFT in RTL, clipping the Rocket row). Wheel/trackpad
   scrolling is unchanged; only the bar is hidden, like on phones. */
@media (hover: hover) and (pointer: fine) {
  html.tgp-fix,
  html.tgp-fix body,
  html.tgp-fix [data-scroll-root] {
    scrollbar-width: none;
  }
  html.tgp-fix::-webkit-scrollbar,
  html.tgp-fix body::-webkit-scrollbar,
  html.tgp-fix [data-scroll-root]::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

/* ——— v67 hook feel: soft page enter + snappier primary CTAs (all pages) ——— */
@keyframes batelPageIn {
  from { opacity: 0.72; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
html[data-batel-shell] body > .app,
html[data-batel-shell] body > main.app,
html[data-batel-shell] #crashScroll > .app {
  animation: batelPageIn 280ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}
html[data-batel-shell] .batel-btn.primary,
html[data-batel-shell] .batel-game-chrome .betbar .go,
html[data-batel-shell] .batel-game-chrome .betbar .cash {
  transition:
    transform var(--dur-press, 90ms) var(--ease-press, ease),
    filter var(--dur-fast, 140ms) var(--ease-out, ease),
    box-shadow 180ms var(--ease-out, ease);
}
html[data-batel-shell] .batel-btn.primary:active,
html[data-batel-shell] .batel-game-chrome .betbar .go:active,
html[data-batel-shell] .batel-game-chrome .betbar .cash:active {
  transform: scale(0.97);
  filter: brightness(1.06);
}
@media (prefers-reduced-motion: reduce) {
  html[data-batel-shell] body > .app,
  html[data-batel-shell] body > main.app,
  html[data-batel-shell] #crashScroll > .app {
    animation: none !important;
  }
}

/* Keep bottom nav above rocket overlays / debug panels */
html.batel-game nav.batel-nav,
html.batel-game #batel-nav,
html.batel-rocket-web nav.batel-nav {
  z-index: 120000 !important;
  pointer-events: auto !important;
}
/* Sheets (bet/gfx) sit above nav — don't let nav steal taps while a sheet is open */
html.batel-sheet-open nav.batel-nav,
html.batel-sheet-open #batel-nav {
  pointer-events: none !important;
}
