/*
 * Multiplier / Candle Sprint only.
 *
 * This deliberately scopes every rule to the live Rush Credits dialog. It is
 * loaded after the older Rush ticket styles and must not change Apex, Asset
 * Race, Zone Rush, or the non-credit legacy view.
 */
#rushGameDialog[data-rush-credits="true"] {
  --rush-ios-surface: #1c1c1e;
  --rush-ios-group: #2c2c2e;
  --rush-ios-selected: #3a3a3c;
  --rush-ios-separator: rgba(255, 255, 255, .11);
  --rush-ios-copy: #f2f2f7;
  --rush-ios-secondary: #a1a1aa;
  --rush-ios-purple: #a855f7;
  --rush-ios-green: #30d158;
  --rush-ios-red: #ff6961;
}

#rushGameDialog[data-rush-credits="true"] .rush-game-order-panel {
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: var(--rush-ios-surface);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .035);
}

/* Preserve one calm reading path on both the desktop grid and mobile stack. */
#rushGameDialog[data-rush-credits="true"] .rush-order-heading { order: 1; }
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map { order: 2; }
#rushGameDialog[data-rush-credits="true"] .rush-direction-buttons { order: 3; }
#rushGameDialog[data-rush-credits="true"] .rush-stake-field { order: 4; }
#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts { order: 5; }
#rushGameDialog[data-rush-credits="true"] .rush-margin-requirement { order: 6; }
#rushGameDialog[data-rush-credits="true"] #rushGameStartButton { order: 7; }
#rushGameDialog[data-rush-credits="true"] .rush-trade-disclosure { order: 8; }

#rushGameDialog[data-rush-credits="true"] .rush-order-heading h3 {
  margin: 0;
  color: var(--rush-ios-copy);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -.035em;
}

/* Market selector: a compact iOS segmented group rather than two cards. */
#rushGameDialog[data-rush-credits="true"] .rush-game-market-controls {
  align-items: stretch;
}

#rushGameDialog[data-rush-credits="true"] .rush-game-asset-list {
  display: grid;
  width: min(100%, 352px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 15px;
  background: var(--rush-ios-group);
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button {
  min-width: 0;
  min-height: 50px;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--rush-ios-secondary);
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, opacity 160ms ease;
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button.is-active {
  border-color: transparent;
  background: var(--rush-ios-selected);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .33), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--rush-ios-copy);
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button.is-unavailable {
  opacity: .44;
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button b {
  color: inherit;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: -.012em;
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button small {
  color: var(--rush-ios-secondary);
  font-size: 8px;
  font-weight: 620;
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-token {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* Direction stays a two-way, thumb-sized segmented control. */
#rushGameDialog[data-rush-credits="true"] .rush-direction-buttons {
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: var(--rush-ios-group);
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button {
  min-height: 64px;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--rush-ios-secondary);
  box-shadow: none;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button.is-long.is-active {
  border-color: transparent;
  background: rgba(48, 209, 88, .14);
  box-shadow: inset 0 0 0 1px rgba(48, 209, 88, .18);
  color: #84e5a0;
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button.is-short.is-active {
  border-color: transparent;
  background: rgba(255, 105, 97, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 105, 97, .17);
  color: #ffaaa4;
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button .rush-direction-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .075);
  color: currentColor;
  font-size: 18px;
  line-height: 1;
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button b {
  color: inherit;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .02em;
}

#rushGameDialog[data-rush-credits="true"] .rush-direction-button small {
  color: var(--rush-ios-secondary);
  font-size: 9px;
  font-weight: 620;
}

/* One grouped amount field and attached preset row. */
#rushGameDialog[data-rush-credits="true"] .rush-stake-field {
  gap: 8px;
  padding: 11px 11px 0;
  border: 1px solid var(--rush-ios-separator);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: var(--rush-ios-group);
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-field > span:first-child > span {
  color: var(--rush-ios-copy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-field small {
  color: var(--rush-ios-secondary);
  font-size: 9px;
  font-weight: 620;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-input-wrap {
  min-height: 54px;
  gap: 9px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: var(--rush-ios-surface);
  color: var(--rush-ios-secondary);
  font-size: 11px;
  font-weight: 760;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-input-wrap input {
  color: var(--rush-ios-copy);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.035em;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-input-wrap:focus-within {
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .72);
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: -13px;
  overflow: hidden;
  border: 1px solid var(--rush-ios-separator);
  border-top-color: rgba(255, 255, 255, .08);
  border-radius: 0 0 16px 16px;
  background: var(--rush-ios-group);
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--rush-ios-secondary);
  font-size: 11px;
  font-weight: 720;
  transition: background 160ms ease, color 160ms ease;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button + button {
  border-left: 1px solid rgba(255, 255, 255, .09);
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button.is-active {
  background: rgba(168, 85, 247, .2);
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .48);
  color: #f5edff;
}

#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button:active:not(:disabled) {
  background: rgba(255, 255, 255, .09);
}

#rushGameDialog[data-rush-credits="true"] .rush-margin-requirement {
  margin: -2px 1px 0;
  color: var(--rush-ios-secondary);
  font-size: 10px;
  font-weight: 590;
  line-height: 1.38;
}

/* Keep the primary action unmistakable without a web-form treatment. */
#rushGameDialog[data-rush-credits="true"] #rushGameStartButton {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #b460ff 0%, #8b20df 100%);
  box-shadow: 0 9px 20px rgba(116, 26, 195, .27), inset 0 1px 0 rgba(255, 255, 255, .24);
  color: #fff;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -.012em;
}

#rushGameDialog[data-rush-credits="true"] #rushGameStartButton:hover:not(:disabled) {
  background: linear-gradient(180deg, #bd73ff 0%, #9629e8 100%);
  box-shadow: 0 11px 24px rgba(116, 26, 195, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}

#rushGameDialog[data-rush-credits="true"] #rushGameStartButton:active:not(:disabled) {
  transform: scale(.985);
}

#rushGameDialog[data-rush-credits="true"] #rushGameStartButton:disabled {
  background: #3a3a3c;
  color: rgba(242, 242, 247, .47);
  box-shadow: none;
}

/* The compact live round map remains calm; progression lives beneath it. */
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map {
  gap: 10px;
  padding: 12px;
  border-color: rgba(255, 255, 255, .10);
  border-radius: 17px;
  background: var(--rush-ios-group);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map-head strong {
  color: var(--rush-ios-copy);
  font-size: 13px;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map-head span {
  color: #d7b5ff;
  font-size: 10px;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps {
  gap: 3px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .16);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li {
  min-height: 58px;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 6px;
  padding: 8px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-current {
  border-color: transparent;
  background: var(--rush-ios-selected);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .05);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-complete {
  border-color: transparent;
  background: rgba(168, 85, 247, .14);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li > i {
  border-color: rgba(255, 255, 255, .17);
  background: rgba(255, 255, 255, .06);
  color: var(--rush-ios-secondary);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-current > i {
  border-color: transparent;
  background: var(--rush-ios-purple);
  color: #fff;
}

/* The final iOS surface also owns settlement feedback, so success, loss and
   flat never disappear beneath the neutral card style. */
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map[data-state="win"] {
  border-color: rgba(48, 209, 88, .48);
  background: linear-gradient(135deg, rgba(30, 122, 76, .24), var(--rush-ios-group) 66%);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map[data-state="loss"] {
  border-color: rgba(255, 105, 97, .45);
  background: linear-gradient(135deg, rgba(139, 45, 51, .24), var(--rush-ios-group) 66%);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map[data-state="flat"] {
  border-color: rgba(161, 161, 170, .36);
  background: linear-gradient(135deg, rgba(89, 89, 96, .23), var(--rush-ios-group) 66%);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-positive {
  background: rgba(48, 209, 88, .15);
  box-shadow: inset 0 0 0 1px rgba(48, 209, 88, .32);
  color: #9cedb5;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-positive > i {
  border-color: transparent;
  background: #1d8d49;
  color: #fff;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-negative {
  background: rgba(255, 105, 97, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 105, 97, .29);
  color: #ffb0aa;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-negative > i {
  border-color: transparent;
  background: #a44247;
  color: #fff;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-neutral {
  background: rgba(161, 161, 170, .15);
  box-shadow: inset 0 0 0 1px rgba(161, 161, 170, .25);
  color: #dddddf;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li.is-neutral > i {
  border-color: transparent;
  background: #66666c;
  color: #fff;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps b {
  color: var(--rush-ios-copy);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps small,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-map > p {
  color: var(--rush-ios-secondary);
}

/* New server-owned 2× → 5× → 10× → 20× progression. The markup may use
   either is-complete/is-current/is-locked or semantic unlocked/current/locked
   classes, so both state names are intentionally supported here. */
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadder {
  display: grid;
  gap: 9px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-head strong,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderTitle {
  color: var(--rush-ios-copy);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: -.012em;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-head span,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderStatus {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(168, 85, 247, .18);
  color: #e9d7ff;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .01em;
  white-space: nowrap;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li {
  display: grid;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(0, 0, 0, .14);
  color: var(--rush-ios-secondary);
  text-align: center;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > strong,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > b,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > strong,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > b {
  overflow: hidden;
  color: inherit;
  font-size: 16px;
  font-weight: 790;
  letter-spacing: -.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > small,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > span,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > small,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > span {
  color: inherit;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  text-wrap: balance;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-complete,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-unlocked,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-complete,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-unlocked {
  border-color: rgba(168, 85, 247, .31);
  background: rgba(168, 85, 247, .12);
  color: #ddc2ff;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-current,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-active,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-current,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-active {
  border-color: rgba(201, 145, 255, .8);
  background: linear-gradient(180deg, rgba(168, 85, 247, .43), rgba(126, 45, 210, .28));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 4px 10px rgba(90, 20, 152, .16);
  color: #fff;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-next,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-next {
  border-color: rgba(201, 145, 255, .28);
  background: rgba(255, 255, 255, .045);
  color: #c9b4df;
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li.is-locked,
#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li[aria-disabled="true"],
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li.is-locked,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li[aria-disabled="true"] {
  background: rgba(0, 0, 0, .10);
  color: rgba(161, 161, 170, .66);
}

#rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder > p,
#rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderNote {
  margin: 0;
  color: var(--rush-ios-secondary);
  font-size: 9px;
  font-weight: 590;
  line-height: 1.38;
}

#rushGameDialog[data-rush-credits="true"] .rush-asset-button:focus-visible,
#rushGameDialog[data-rush-credits="true"] .rush-direction-button:focus-visible,
#rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button:focus-visible,
#rushGameDialog[data-rush-credits="true"] #rushGameStartButton:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #d5b5ff;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  #rushGameDialog[data-rush-credits="true"] .rush-game-order-panel {
    gap: 12px;
    padding: 13px;
    border-radius: 19px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-game-asset-list {
    width: 100%;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-asset-button {
    min-height: 48px;
    gap: 7px;
    padding: 7px 8px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-direction-button {
    min-height: 58px;
    gap: 8px;
    padding: 8px 9px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-direction-button .rush-direction-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-multiplier-round-steps li {
    min-height: 55px;
    padding: 7px 5px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li,
  #rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li {
    min-height: 53px;
    padding: 7px 3px;
    border-radius: 10px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > strong,
  #rushGameDialog[data-rush-credits="true"] .rush-multiplier-ladder-steps > li > b,
  #rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > strong,
  #rushGameDialog[data-rush-credits="true"] #rushMultiplierLadderSteps > li > b {
    font-size: 14px;
  }
}

@media (max-width: 370px) {
  #rushGameDialog[data-rush-credits="true"] .rush-asset-button b {
    font-size: 10px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-asset-button small {
    font-size: 7px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-direction-button b {
    font-size: 11px;
  }

  #rushGameDialog[data-rush-credits="true"] .rush-direction-button small {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #rushGameDialog[data-rush-credits="true"] .rush-asset-button,
  #rushGameDialog[data-rush-credits="true"] .rush-direction-button,
  #rushGameDialog[data-rush-credits="true"] .rush-stake-shortcuts button {
    transition: none;
  }
}
