/* Candle Sprint: make the first move self-explanatory before exposing
   account mechanics. This stylesheet intentionally overrides only the
   Candle Sprint dialog so the other Rush games keep their own layouts. */
.rush-game-dialog .rush-game-hud {
  grid-template-areas:
    "run live"
    "wallet wallet";
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 11px 0 12px;
}

.rush-game-dialog .rush-game-hud-run {
  grid-area: run;
  gap: 3px;
  text-align: left;
}

.rush-game-dialog .rush-game-hud-run > span {
  color: #c59af4;
  font-size: 8px;
  letter-spacing: .11em;
}

.rush-game-dialog .rush-game-hud-run > strong {
  color: #f0edf6;
  font-size: 14px;
}

.rush-game-dialog .rush-game-hud-live {
  grid-area: live;
  gap: 4px;
}

.rush-game-dialog .rush-game-hud-live > strong {
  color: #d8bdff;
  font-size: 12px;
}

.rush-game-dialog .rush-game-wallet-summary {
  display: grid;
  grid-area: wallet;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(177, 111, 245, .2);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(74, 38, 104, .32), #15161b 58%);
}

/* The global Rush dialog styles use a grid declaration with higher specificity.
   Respect the native hidden state until a real signed-in balance exists. */
.rush-game-dialog .rush-game-wallet-summary[hidden] {
  display: none !important;
}

.rush-game-dialog .rush-game-wallet-summary > span {
  color: #bdb2ca;
  font-size: 8px;
  font-weight: 790;
  letter-spacing: .09em;
  white-space: nowrap;
}

.rush-game-dialog .rush-game-wallet-summary #rushGameScore {
  min-width: 0;
  overflow: hidden;
  color: #f3eff8;
  font-size: 13px;
  font-weight: 790;
  letter-spacing: -.02em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rush-game-dialog .rush-game-wallet-summary small {
  color: #9892a3;
  font-size: 9px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.rush-game-dialog .rush-game-account-balance > span {
  display: none;
}

.rush-game-dialog .rush-game-intro {
  gap: 0;
  padding: 14px 0 12px;
}

.rush-game-dialog .rush-game-intro #rushGameDialogCopy {
  max-width: 62ch;
  color: #d0ccd8;
  font-size: 12px;
  font-weight: 590;
  line-height: 1.46;
}

.rush-game-dialog .rush-sprint-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 13px 0 0;
}

.rush-game-dialog .rush-sprint-brief[hidden] {
  display: none !important;
}

.rush-game-dialog .rush-sprint-brief-title {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  grid-column: 1 / -1;
  color: #b884eb;
  font-size: 9px;
  font-weight: 830;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.rush-game-dialog .rush-sprint-brief > span:not(.rush-sprint-brief-title) {
  min-height: 64px;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(174, 102, 244, .18);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(62, 39, 80, .55), rgba(22, 22, 28, .96));
}

.rush-game-dialog .rush-sprint-brief i {
  color: #c796ff;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.rush-game-dialog .rush-sprint-brief b {
  color: #ebe8f0;
  font-size: 10px;
  font-weight: 710;
  line-height: 1.34;
  white-space: normal;
}

.rush-game-dialog .rush-game-feedback {
  margin-bottom: 13px;
  color: #aaa5b2;
}

.rush-game-dialog .rush-game-order-panel {
  gap: 11px;
  padding: 16px;
  border-color: rgba(163, 92, 232, .34);
  background: radial-gradient(ellipse at 100% 0%, rgba(137, 56, 213, .17), transparent 58%), #141419;
}

.rush-game-dialog .rush-order-heading > div > span {
  color: #bb82ef;
}

.rush-game-dialog .rush-order-heading h3 {
  max-width: 26ch;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.14;
}

.rush-game-dialog .rush-direction-buttons {
  gap: 9px;
}

.rush-game-dialog .rush-direction-button {
  justify-content: flex-start;
  min-height: 64px;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
}

.rush-game-dialog .rush-direction-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .055);
  font-size: 19px;
}

.rush-game-dialog .rush-direction-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

.rush-game-dialog .rush-direction-button b {
  font-size: 13px;
  letter-spacing: .045em;
}

.rush-game-dialog .rush-direction-button small {
  color: #97939f;
  font-size: 9px;
  font-weight: 650;
}

.rush-game-dialog .rush-direction-button.is-long.is-active .rush-direction-icon {
  background: rgba(97, 202, 126, .14);
}

.rush-game-dialog .rush-direction-button.is-short.is-active .rush-direction-icon {
  background: rgba(239, 89, 85, .14);
}

.rush-game-dialog .rush-stake-field > span:first-child > span {
  color: #efecf4;
  font-size: 10px;
  font-weight: 790;
  letter-spacing: .045em;
}

.rush-game-dialog .rush-margin-requirement {
  order: 5;
  margin-top: -2px;
}

.rush-game-dialog .rush-trade-disclosure {
  order: 6;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 196, 93, .17);
  border-left: 2px solid rgba(255, 196, 93, .8);
  border-radius: 9px;
  background: rgba(91, 67, 21, .15);
  color: #c5bb9d;
  font-size: 9px;
  line-height: 1.4;
}

.rush-game-dialog .rush-game-order-panel .rush-dialog-done {
  order: 7;
  min-height: 54px;
}

/* Telegram desktop often gives the web app an ~800px canvas. At that width a
   two-column trading ticket looks accidental, so keep one obvious path. */
@media (max-width: 940px) {
  .rush-game-dialog .rush-game-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .rush-game-dialog .rush-market-workspace {
    display: contents;
  }

  .rush-game-dialog .rush-game-order-panel { order: 1; width: 100%; box-sizing: border-box; }
  .rush-game-dialog .rush-game-market-controls { order: 2; }
  .rush-game-dialog .rush-market-chart-card { order: 3; }
  .rush-game-dialog .rush-live-position { order: 4; }
  .rush-game-dialog .rush-round-outcome { order: 5; }
  .rush-game-dialog .rush-run-status { order: 6; }
  .rush-game-dialog .rush-game-history { order: 7; }
}

@media (max-width: 560px) {
  .rush-game-dialog .rush-game-hud {
    gap: 7px 9px;
  }

  .rush-game-dialog .rush-game-hud-run > strong {
    font-size: 12px;
  }

  .rush-game-dialog .rush-game-wallet-summary {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 42px;
    gap: 7px;
    padding: 7px 9px;
  }

  .rush-game-dialog .rush-game-wallet-summary small {
    display: none;
  }

  .rush-game-dialog .rush-sprint-brief {
    gap: 6px;
  }

  .rush-game-dialog .rush-sprint-brief > span:not(.rush-sprint-brief-title) {
    min-height: 70px;
    padding: 8px;
    border-radius: 10px;
  }

  .rush-game-dialog .rush-sprint-brief b {
    font-size: 9px;
  }

  .rush-game-dialog .rush-game-order-panel {
    padding: 14px;
  }

  .rush-game-dialog .rush-order-heading h3 {
    font-size: 16px;
  }

  .rush-game-dialog .rush-direction-button {
    min-height: 60px;
    gap: 8px;
    padding: 0 10px;
  }

  .rush-game-dialog .rush-direction-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    font-size: 17px;
  }

  .rush-game-dialog .rush-direction-button b {
    font-size: 12px;
  }

  .rush-game-dialog .rush-direction-button small {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rush-game-dialog .rush-direction-button {
    transition: none;
  }
}

/* Final Candle Sprint shell: one live market, one compact ticket and one
   server-backed action.  This intentionally removes the former prop-account
   ladder rather than adding another layer on top of it. */
.rush-game-dialog[data-rush-credits="true"] .rush-game-hud {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "run live"
    "wallet wallet";
  align-items: end;
  padding: 7px 0 11px;
  border-top: 0;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-account-summary,
.rush-game-dialog[data-rush-credits="true"] .rush-sprint-brief,
.rush-game-dialog[data-rush-credits="true"] .rush-round-outcome,
.rush-game-dialog[data-rush-credits="true"] .rush-run-status {
  display: none !important;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-wallet-summary {
  border-color: rgba(177, 111, 245, .24);
  background: linear-gradient(135deg, rgba(90, 35, 142, .28), #14151a 64%);
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-intro {
  padding: 7px 0 10px;
}

.rush-game-dialog[data-rush-credits="true"] #rushGameDialogCopy {
  max-width: 46ch;
  color: #b7b8c0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-layout {
  align-items: start;
  gap: 12px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel {
  gap: 11px;
  border: 1px solid rgba(169, 91, 249, .3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(117, 0, 181, .22), transparent 44%),
    #14151a;
  box-shadow: none;
}

.rush-game-dialog[data-rush-credits="true"] .rush-order-heading > div > span,
.rush-game-dialog[data-rush-credits="true"] .rush-live-position-eyebrow,
.rush-game-dialog[data-rush-credits="true"] .rush-game-history-head span {
  color: #c697ff;
}

.rush-game-dialog[data-rush-credits="true"] .rush-order-heading h3 {
  font-size: 18px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-direction-buttons {
  gap: 8px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-direction-button {
  min-height: 70px;
  border-radius: 13px;
  background: #101116;
}

.rush-game-dialog[data-rush-credits="true"] .rush-direction-button.is-active {
  border-color: #9700e8;
  background: linear-gradient(135deg, rgba(104, 0, 168, .33), rgba(23, 21, 32, .96));
  box-shadow: inset 0 0 0 1px rgba(205, 137, 255, .16);
}

.rush-game-dialog[data-rush-credits="true"] .rush-stake-input-wrap {
  min-height: 54px;
  border-radius: 12px;
  background: #0e0f13;
}

.rush-game-dialog[data-rush-credits="true"] .rush-stake-input-wrap input {
  font-size: 22px;
  font-weight: 780;
}

.rush-game-dialog[data-rush-credits="true"] .rush-stake-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 10px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-stake-shortcuts button.is-active {
  color: #f5ebff;
  background: rgba(118, 0, 181, .42);
  box-shadow: inset 0 0 0 1px #9a41de;
}

.rush-game-dialog[data-rush-credits="true"] .rush-margin-requirement {
  margin: -2px 0 0;
  color: #989ba4;
  font-size: 10px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-trade-disclosure {
  display: none;
}

.rush-game-dialog[data-rush-credits="true"] .rush-dialog-done,
.rush-game-dialog[data-rush-credits="true"] .rush-live-position .rush-game-cashout {
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #7600b5, #9d10e8);
  box-shadow: 0 10px 28px rgba(118, 0, 181, .2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.rush-game-dialog[data-rush-credits="true"] .rush-dialog-done:disabled,
.rush-game-dialog[data-rush-credits="true"] .rush-live-position .rush-game-cashout:disabled {
  opacity: .5;
  box-shadow: none;
}

.rush-game-dialog[data-rush-credits="true"] .rush-live-position {
  border-color: rgba(164, 88, 239, .28);
  border-radius: 16px;
  background: #111217;
}

.rush-game-dialog[data-rush-credits="true"] .rush-live-position-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rush-game-dialog[data-rush-credits="true"] .rush-live-position-stats > div:first-child {
  display: grid;
}

.rush-game-dialog[data-rush-credits="true"] .rush-live-position-stats > div:nth-child(2) {
  border-left: 1px solid rgba(255, 255, 255, .075);
}

.rush-game-dialog[data-rush-credits="true"] .rush-live-position-stats > div:nth-child(3) strong {
  font-size: 11px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-feedback[hidden] {
  display: none;
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-feedback:not([hidden]) {
  display: block;
  margin: 0 0 11px;
  padding: 9px 11px;
  border: 1px solid rgba(202, 142, 255, .22);
  border-radius: 10px;
  background: rgba(74, 21, 110, .16);
  color: #d9d4e2;
  font-size: 11px;
  line-height: 1.35;
}

/* Multiplier has one independent, server-settled round. Keep that path in
   the ticket at every state instead of surfacing the retired 2→5→10→20 rail. */
.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(205, 146, 255, .21);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(74, 21, 110, .24), rgba(18, 18, 23, .82) 62%);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map-head strong {
  min-width: 0;
  color: #f5effa;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: -.015em;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map-head span {
  flex: 0 0 auto;
  color: #d2a7ff;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .015em;
  white-space: nowrap;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 56px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 10px;
  background: rgba(10, 11, 15, .5);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li > i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: #90929a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps b {
  color: #dcdee5;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: -.01em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  white-space: normal;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps small {
  display: -webkit-box;
  overflow: hidden;
  color: #8b8d97;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-complete {
  border-color: rgba(164, 104, 230, .32);
  background: rgba(84, 35, 122, .17);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-complete > i {
  border-color: #9361c7;
  background: #7436ad;
  color: #fff;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-current {
  border-color: #a13bea;
  background: linear-gradient(135deg, rgba(112, 17, 173, .42), rgba(29, 20, 37, .88));
  box-shadow: inset 0 0 0 1px rgba(218, 156, 255, .12);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-current > i {
  border-color: #d3a3ff;
  background: #9700e8;
  color: #fff;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-positive {
  border-color: rgba(67, 209, 143, .44);
  background: rgba(17, 93, 63, .19);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-positive > i {
  border-color: #4bd79a;
  background: #18744d;
  color: #ecfff7;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-negative {
  border-color: rgba(239, 99, 119, .45);
  background: rgba(109, 27, 41, .2);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-negative > i {
  border-color: #f47d8e;
  background: #9d3342;
  color: #fff4f5;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-neutral {
  border-color: rgba(186, 192, 209, .34);
  background: rgba(80, 84, 94, .2);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-neutral > i {
  border-color: #c5c9d3;
  background: #666b78;
  color: #fff;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map > p {
  margin: 0;
  color: #aeb0bb;
  font-size: 9px;
  font-weight: 610;
  line-height: 1.35;
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map[data-state="win"] {
  border-color: rgba(67, 209, 143, .45);
  background: linear-gradient(135deg, rgba(19, 95, 65, .25), rgba(18, 23, 23, .84) 62%);
}

.rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map[data-state="loss"] {
  border-color: rgba(239, 99, 119, .4);
  background: linear-gradient(135deg, rgba(104, 26, 41, .22), rgba(24, 19, 23, .84) 62%);
}

.rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel[data-round-state="live"] > :not(.rush-order-heading):not(.rush-multiplier-round-map),
.rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel[data-round-state="checking"] > :not(.rush-order-heading):not(.rush-multiplier-round-map) {
  display: none;
}

@media (min-width: 1024px) {
  .rush-game-dialog[data-rush-credits="true"] .rush-game-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-market-workspace {
    display: grid;
    gap: 12px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel {
    position: sticky;
    top: 12px;
  }
}

@media (max-width: 940px) {
  .rush-game-dialog[data-rush-credits="true"] .rush-game-layout {
    display: flex;
    flex-direction: column;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-market-workspace {
    display: contents;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-market-chart-card { order: 1; }
  .rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel { order: 2; }
  .rush-game-dialog[data-rush-credits="true"] .rush-live-position { order: 3; }
  .rush-game-dialog[data-rush-credits="true"] .rush-game-history { order: 4; }
}

@media (max-width: 560px) {
  .rush-game-dialog[data-rush-credits="true"] .rush-game-stage {
    padding-bottom: 18px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-game-intro {
    display: none;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-market-chart-card .rush-chart-canvas {
    height: min(42vh, 248px);
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-game-order-panel {
    width: 100%;
    padding: 13px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-order-heading h3 {
    font-size: 17px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-direction-button {
    min-height: 60px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-map {
    gap: 8px;
    padding: 10px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps {
    gap: 4px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li {
    min-height: 52px;
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 5px;
    padding: 7px 5px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps li > i {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps b {
    font-size: 9px;
  }

  .rush-game-dialog[data-rush-credits="true"] .rush-multiplier-round-steps small {
    font-size: 7px;
  }
}
