/* Shared Rush game shell. This file loads last so each fullscreen game has one
   finite scroll owner instead of allowing its stage to grow behind the dialog. */
.rush-liquidity-dialog[open],
.rush-hunter-dialog[open],
.rush-game-dialog[open],
.rush-predictor-dialog[open],
.rush-tap-markets-dialog[open],
.rush-apex-dialog[open],
.rush-scalper-dialog[open] {
  overflow: hidden !important;
}

.rush-liquidity-dialog[open] .rush-liquidity-stage,
.rush-game-dialog[open] .rush-game-stage,
.rush-game-dialog[open] .rush-asset-race-stage,
.rush-tap-markets-dialog[open] .rush-tap-markets-stage,
.rush-apex-dialog[open] .rush-apex-stage,
.rush-scalper-dialog[open] .rush-scalper-stage,
.rush-hunter-dialog[open] .rush-hunter-stage {
  box-sizing: border-box;
  width: min(960px, 100%);
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh !important;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

/* Zone Rush keeps its bottom wager dock in a separate grid row. */
.rush-predictor-dialog[open]:not(.is-chart-expanded) .rush-predictor-stage {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

/* The game no longer uses hold controls, so vertical drags beginning on these
   controls remain regular page scrolls. */
#rushApexOverdrive,
.rush-apex-sides button {
  touch-action: manipulation !important;
}

/* One compact header across the Rush catalogue. */
.rush-unified-topbar,
.rush-asset-race-stage > .rush-unified-topbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 53px !important;
  margin: 0 !important;
  padding: 0 0 7px !important;
  border-bottom: 1px solid rgba(255, 255, 255, .085) !important;
  color: #f4f5f6;
}

.rush-unified-topbar > .rush-unified-brand {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  pointer-events: none;
}

.rush-unified-topbar > .rush-unified-brand > img {
  display: block;
  width: min(78px, 23vw);
  max-height: 35px;
  object-fit: contain;
}

.rush-unified-topbar > .rush-unified-brand > h2 {
  max-width: 138px;
  margin: 0 !important;
  overflow: hidden;
  color: #f5f6f7;
  font: 800 10px/1.05 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: .075em !important;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rush-unified-topbar > .rush-unified-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  min-width: 0;
}

.rush-unified-topbar > .rush-unified-actions:empty { min-width: 34px; min-height: 34px; }
.rush-unified-topbar > button { grid-column: 1; grid-row: 1; justify-self: start; }
.rush-unified-topbar .rush-unified-chevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.rush-unified-topbar .rush-apex-close,
.rush-unified-topbar .rush-liquidity-close,
.rush-unified-topbar .rush-scalper-close,
.rush-unified-topbar .rush-dialog-close { justify-self: auto; }

.rush-unified-topbar .rush-predictor-account {
  width: clamp(116px, 30vw, 156px);
  min-height: 36px;
  box-sizing: border-box;
  grid-column: auto;
  grid-row: auto;
  margin: 0;
  padding: 5px 8px;
}

.rush-unified-topbar .rush-hunter-total,
.rush-unified-topbar .rush-tap-markets-bank { justify-items: end; text-align: right; }
.rush-unified-topbar .rush-hunter-total span,
.rush-unified-topbar .rush-tap-markets-bank > span { font-size: 7px; }
.rush-unified-topbar .rush-hunter-total strong,
.rush-unified-topbar .rush-tap-markets-bank strong { font-size: 13px; }

/* Header controls are intentionally identical across every Rush game. The
   first control in a dialog must also not look selected just because a modal
   gave it programmatic focus on entry. */
.rush-unified-topbar > button,
.rush-unified-topbar .rush-screen-back,
.rush-unified-topbar .rush-game-back,
.rush-unified-topbar .rush-liquidity-back,
.rush-unified-topbar .rush-apex-back,
.rush-unified-topbar .rush-scalper-back {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-width: 76px !important;
  height: 34px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 11px !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #f5f6f7 !important;
  font: 750 12px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

.rush-unified-topbar > button:hover { background: rgba(255, 255, 255, .075) !important; }
.rush-unified-topbar > button:focus,
.rush-unified-topbar > button:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
}

/* Legacy close controls are deliberately suppressed. Back is the only way
   out of a Rush game, so every header has one clear action. */
.rush-unified-topbar .rush-apex-close,
.rush-unified-topbar .rush-liquidity-close,
.rush-unified-topbar .rush-scalper-close,
.rush-unified-topbar .rush-dialog-close { display: none !important; }

.rush-unified-topbar .rush-apex-sound {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

/* Titles are in the header now; leave each game’s next block for live data. */
.rush-apex-heading { min-height: 0; justify-content: flex-end; padding: 7px 0 5px !important; }
.rush-apex-heading .rush-apex-balance { margin-left: auto; }
.rush-hunter-heading { justify-content: flex-end; min-height: 0; padding: 6px 0 8px !important; }
.rush-asset-race-heading { margin: 10px 0 12px; }
.rush-asset-race-heading p { margin: 0; }
.rush-game-dialog .rush-game-intro { padding: 8px 0 5px; }
.rush-game-dialog .rush-game-intro #rushGameDialogCopy { margin: 0; }
.rush-scalper-heading { min-height: 0; padding-top: 8px; }
.rush-scalper-heading h2 { display: none; }
.rush-tap-markets-heading { min-height: 0; padding-top: 8px; }
.rush-tap-markets-heading h2 { display: none; }

/* Apex lobby card uses the supplied poster as the complete card; its old copy
   is still retained in the DOM for translations and screen readers. */
.rush-game-card--apex-poster .rush-apex-surfer-art {
  aspect-ratio: 286 / 389;
  background: #11131a url("/static/cube-trader-poster-v1.png?v=20261009-poster01") center / cover no-repeat;
}
.rush-game-card--apex-poster .rush-game-copy { display: none; }

/* Rush lobby is a visual game gallery: posters first, no copy under tiles.
   Until an individual poster exists, its card deliberately stays a clean
   coloured placeholder rather than pretending to be finished artwork. */
.rush-game-rail { gap: 8px; }
.rush-game-card { border-radius: 13px; background: transparent; }
.rush-game-art { aspect-ratio: 286 / 389; }
.rush-game-card .rush-game-copy,
.rush-game-card .rush-game-art-label { display: none !important; }
.rush-game-card:not(.rush-game-card--hunter-poster):not(.rush-game-card--apex-poster) .rush-game-art::before,
.rush-game-card:not(.rush-game-card--hunter-poster):not(.rush-game-card--apex-poster) .rush-game-art::after { display: none !important; }
.rush-game-card--hunter-poster .rush-candle-hunter-art {
  background: #b8e6c8 url("/static/rush-candle-hunter-poster-v1.png?v=20261009-hunter-poster01") center / cover no-repeat;
}
.rush-game-card--hunter-poster .rush-candle-hunter-art::before,
.rush-game-card--hunter-poster .rush-candle-hunter-art::after { display: none; }
.rush-candle-sprint-art { background: linear-gradient(145deg,#31101a,#d24659 55%,#f18b88); }
.rush-one-tap-scalper-art { background: linear-gradient(145deg,#071b17,#0f855b 58%,#57d9a0); }
.rush-asset-race-art {
  background: #37b7cf url("/static/rush-asset-race-poster-v1.png?v=20261010-cover-fix-delta-v2") center / cover no-repeat;
}
.rush-predictor-art { background: linear-gradient(145deg,#211033,#7436a9 56%,#d395ff); }
.rush-market-grid-art { background: linear-gradient(145deg,#33200a,#a6671b 58%,#ffd173); }
.rush-liquidity-racer-art { background: linear-gradient(145deg,#071421,#116477 55%,#56d7df); }
.rush-lobby-note { display: none; }

@media (max-width: 420px) {
  .rush-unified-topbar,
  .rush-asset-race-stage > .rush-unified-topbar { min-height: 49px !important; gap: 6px !important; padding-bottom: 6px !important; }
  .rush-unified-topbar > .rush-unified-brand > img { width: 70px; max-height: 31px; }
  .rush-unified-topbar > .rush-unified-brand > h2 { max-width: 112px; font-size: 9px !important; letter-spacing: .06em !important; }
  .rush-unified-topbar .rush-predictor-account { width: 106px; min-height: 33px; padding: 4px 6px; }
  .rush-unified-topbar .rush-predictor-account .rush-predictor-wallet-icon,
  .rush-unified-topbar .rush-predictor-account small { display: none; }
  .rush-unified-topbar .rush-hunter-total span,
  .rush-unified-topbar .rush-tap-markets-bank > span { display: none; }
}

@media (max-width: 360px) {
  .rush-unified-topbar > .rush-unified-brand > img { width: 62px; max-height: 28px; }
  .rush-unified-topbar > .rush-unified-brand > h2 { max-width: 96px; font-size: 8px !important; }
  .rush-unified-topbar .rush-predictor-account { width: 88px; }
}

/* Rush games can fall back from showModal() to the regular document stack on
   Telegram WebViews. Keep those screens above fixed navigation and make every
   primary control a direct tap target instead of a scroll gesture. */
.rush-liquidity-dialog[open],
.rush-hunter-dialog[open],
.rush-game-dialog[open],
.rush-predictor-dialog[open],
.rush-tap-markets-dialog[open],
.rush-apex-dialog[open],
.rush-scalper-dialog[open] {
  z-index: 10000;
  pointer-events: auto;
}

.rush-game-card,
.rush-carousel-button,
.rush-liquidity-dialog[open] button,
.rush-hunter-dialog[open] button,
.rush-game-dialog[open] button,
.rush-predictor-dialog[open] button,
.rush-tap-markets-dialog[open] button,
.rush-apex-dialog[open] button,
.rush-scalper-dialog[open] button,
.rush-predictor-advanced > summary {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* Rush lobby uses a deliberately quieter, measured chrome. The catalogue is
   the product here, not a second oversized campaign banner. */
body.rush-page-active:not(.admin-page) .topbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 56px !important;
  margin: 0 0 12px !important;
  padding: 9px 12px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .09) !important;
  border-radius: 0 !important;
  background: #0a0b0e !important;
  box-shadow: none !important;
}

body.rush-page-active:not(.admin-page) .topbar .brand-lockup {
  display: block !important;
  grid-column: 1 !important;
  justify-self: start !important;
  min-width: 0 !important;
}

html.miniapp-dashboard body.rush-page-active:not(.admin-page) .topbar .brand-logo,
body.rush-page-active:not(.admin-page) .topbar .brand-logo {
  display: block !important;
  width: auto !important;
  max-width: 104px !important;
  height: 34px !important;
  max-height: 34px !important;
  object-fit: contain !important;
}

body.rush-page-active:not(.admin-page) .topbar .brand-award,
body.rush-page-active:not(.admin-page) .topbar .language-switch,
body.rush-page-active:not(.admin-page) .topbar .user-menu-trigger-copy {
  display: none !important;
}

body.rush-page-active:not(.admin-page) .topbar .topbar-tools {
  grid-column: 3 !important;
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  min-height: 36px !important;
  gap: 6px !important;
}

body.rush-page-active:not(.admin-page) .topbar .support-launch-button,
body.rush-page-active:not(.admin-page) .topbar .user-menu-trigger {
  display: grid !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, .13) !important;
  border-radius: 9px !important;
  background: #14161b !important;
  box-shadow: none !important;
}

body.rush-page-active:not(.admin-page) .topbar .support-launch-button svg {
  width: 18px !important;
  height: 18px !important;
}

body.rush-page-active:not(.admin-page) .topbar .user-avatar {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  box-shadow: none !important;
}

body.rush-page-active:not(.admin-page) .topbar .user-menu.is-open .user-avatar,
body.rush-page-active:not(.admin-page) .topbar .user-menu.is-enabled .user-menu-trigger:hover .user-avatar {
  box-shadow: none !important;
}

.rush-games-section {
  margin-top: 0 !important;
}

.rush-section-heading {
  align-items: center !important;
  margin-bottom: 12px !important;
}

.rush-section-heading h2 {
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  line-height: 1 !important;
  text-transform: uppercase;
}

.rush-carousel-button {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(255, 255, 255, .1) !important;
  border-radius: 9px !important;
  background: #14161b !important;
}

@media (max-width: 768px) {
  html.telegram-miniapp body.rush-page-active:not(.admin-page) .topbar {
    min-height: calc(56px + var(--ff-telegram-header-clearance, 72px)) !important;
    padding-top: calc(var(--ff-telegram-header-clearance, 72px) + 9px) !important;
  }
}
