/*
 * Candle Hunter — strict game-board pass
 *
 * This file intentionally sits after the older Rush layers.  It does not
 * change the game or create new visual assets: it only gives the live market,
 * round terms and entry controls one calm, compact trading-game hierarchy.
 */

#rushCandleHunterDialog[open] {
  --hunter-surface: #11151b;
  --hunter-surface-raised: #151a21;
  --hunter-line: rgba(178, 190, 207, .17);
  --hunter-line-strong: rgba(178, 190, 207, .27);
  --hunter-muted: #8e98a8;
  --hunter-text: #f5f7fb;
  --hunter-violet: #8a28dc;
  --hunter-green: #58db9a;
  --hunter-red: #ff747d;
  background:
    radial-gradient(900px 460px at 76% -18%, rgba(111, 45, 181, .12), transparent 58%),
    #0c0f13;
  color: var(--hunter-text);
}

#rushCandleHunterDialog[open] .rush-hunter-stage {
  gap: 0;
  background: transparent;
}

#rushCandleHunterDialog[open] .rush-hunter-topbar {
  min-height: 58px;
  border-bottom-color: var(--hunter-line);
}

#rushCandleHunterDialog[open] .rush-screen-back {
  min-width: 82px;
  height: 36px;
  border-color: var(--hunter-line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .018);
  color: #e9edf5;
  font-size: 12px;
  font-weight: 760;
}

#rushCandleHunterDialog[open] .rush-screen-back:hover {
  border-color: rgba(218, 225, 236, .42);
  background: rgba(255, 255, 255, .055);
}

#rushCandleHunterDialog[open] .rush-unified-brand {
  gap: 2px;
}

#rushCandleHunterDialog[open] .rush-unified-brand > img {
  width: min(94px, 25vw);
  max-height: 42px;
}

#rushCandleHunterDialog[open] .rush-unified-brand > h2 {
  margin: 0;
  color: #f2f4f8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1.1;
  text-transform: uppercase;
}

#rushCandleHunterDialog[open] .rush-hunter-total {
  min-width: 96px;
  gap: 4px;
}

#rushCandleHunterDialog[open] .rush-hunter-total span,
#rushCandleHunterDialog[open] .rush-hunter-run-head > div > span,
#rushCandleHunterDialog[open] .rush-hunter-history > div > span {
  color: #8e98a8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
}

#rushCandleHunterDialog[open] .rush-hunter-total strong {
  color: #f4f6fb;
  font-size: 15px;
  font-weight: 800;
}

#rushCandleHunterDialog[open] .rush-hunter-heading {
  min-height: 46px;
  padding: 10px 0;
}

#rushCandleHunterDialog[open] .rush-hunter-heading-actions {
  gap: 8px;
}

#rushCandleHunterDialog[open] .rush-hunter-market-chip {
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--hunter-line);
  border-radius: 8px;
  background: #121720;
  color: #e5eaf2;
  font-size: 10px;
  font-weight: 800;
}

#rushCandleHunterDialog[open] .rush-hunter-market-chip b {
  color: #8f99a8;
  font-size: 8px;
}

#rushCandleHunterDialog[open] .rush-hunter-chip-coin,
#rushCandleHunterDialog[open] .rush-hunter-btc-mark {
  background: #242c37;
}

#rushCandleHunterDialog[open] .rush-hunter-sfx {
  width: 32px;
  height: 32px;
  border-color: rgba(164, 93, 235, .48);
  border-radius: 8px;
  background: rgba(111, 41, 178, .15);
  color: #d8b7ff;
}

#rushCandleHunterDialog[open] .rush-hunter-market,
#rushCandleHunterDialog[open] .rush-hunter-run,
#rushCandleHunterDialog[open] .rush-hunter-play,
#rushCandleHunterDialog[open] .rush-hunter-history {
  border-color: var(--hunter-line);
  border-radius: 14px;
  background: var(--hunter-surface);
  box-shadow: none;
}

#rushCandleHunterDialog[open] .rush-hunter-market {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(70, 86, 109, .075), transparent 31%),
    var(--hunter-surface);
}

#rushCandleHunterDialog[open] .rush-hunter-price-line {
  gap: 9px;
}

#rushCandleHunterDialog[open] .rush-hunter-price-line > strong {
  color: #f5f7fb;
  font-size: clamp(23px, 2.3vw, 30px);
  font-weight: 780;
  letter-spacing: -.045em;
}

/* The renderer uses a 900 × 280 SVG canvas. Keep the slot in that proportion
   so the live candle bodies never get stretched by a tall responsive card. */
#rushCandleHunterDialog[open] .rush-hunter-chart,
#rushCandleHunterDialog[open] .rush-hunter-chart-status {
  min-height: 0;
}

#rushCandleHunterDialog[open] .rush-hunter-chart {
  aspect-ratio: 900 / 280;
  height: auto;
  margin-top: 12px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, .035);
  border-bottom: 1px solid rgba(255, 255, 255, .035);
}

#rushCandleHunterDialog[open] .rush-hunter-chart svg {
  width: 100%;
  height: 100%;
}

#rushCandleHunterDialog[open] .rush-hunter-chart-status {
  height: 100%;
  min-height: 0;
  padding: 14px;
  color: #8993a3;
  font-size: 11px;
}

#rushCandleHunterDialog[open] .rush-hunter-market-foot {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 0;
  color: var(--hunter-muted);
  font-size: 9px;
}

#rushCandleHunterDialog[open] .rush-hunter-market-foot span:last-child {
  color: #c3cad5;
}

#rushCandleHunterDialog[open] .rush-hunter-round-status {
  gap: 8px;
  margin-top: 8px;
  padding: 8px 9px;
  border-color: rgba(143, 90, 203, .25);
  border-radius: 9px;
  background: #12141b;
}

#rushCandleHunterDialog[open] .rush-hunter-round-status > span {
  color: #cbb0ee;
  font-size: 8px;
}

#rushCandleHunterDialog[open] .rush-hunter-round-status > b {
  color: #aeb7c5;
  font-size: 8px;
}

#rushCandleHunterDialog[open] .rush-hunter-round-track {
  background: #292d36;
  box-shadow: none;
}

#rushCandleHunterDialog[open] .rush-hunter-round-track i {
  background: linear-gradient(90deg, #8b28de, #bb72f3);
  box-shadow: none;
}

#rushCandleHunterDialog[open] .rush-hunter-run {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: #10151b;
}

#rushCandleHunterDialog[open] .rush-hunter-run-head {
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
}

#rushCandleHunterDialog[open] .rush-hunter-run-head > div {
  gap: 5px;
}

#rushCandleHunterDialog[open] .rush-hunter-run-head strong {
  color: #f2f5fb;
  font-size: 17px;
  font-weight: 770;
}

#rushCandleHunterDialog[open] .rush-hunter-potential strong {
  color: #cdaaf7;
}

#rushCandleHunterDialog[open] .rush-hunter-ladder {
  grid-auto-columns: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
  margin-top: 0;
  padding: 0;
}

#rushCandleHunterDialog[open] .rush-hunter-ladder > span {
  min-height: 48px;
  padding: 6px 8px;
}

#rushCandleHunterDialog[open] .rush-hunter-ladder small {
  color: #7f8998;
  font-size: 7px;
}

#rushCandleHunterDialog[open] .rush-hunter-ladder b {
  color: #dde3ec;
  font-size: 13px;
}

#rushCandleHunterDialog[open] .rush-hunter-ladder .is-current {
  background: rgba(136, 42, 218, .08);
  box-shadow: inset 0 -2px #8a28dc;
}

#rushCandleHunterDialog[open] .rush-hunter-play {
  margin-top: 12px;
  padding: 14px;
  background: var(--hunter-surface-raised);
}

#rushCandleHunterDialog[open] .rush-hunter-play-head {
  align-items: flex-start;
}

#rushCandleHunterDialog[open] .rush-hunter-play-head strong {
  max-width: 290px;
  color: #f4f6fa;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.15;
}

#rushCandleHunterDialog[open] .rush-hunter-countdown {
  flex: 0 0 auto;
  color: #d3b5f6;
  font-size: 18px;
  font-weight: 830;
  line-height: 1;
  white-space: nowrap;
}

#rushCandleHunterDialog[open] .rush-hunter-picks {
  gap: 9px;
  margin-top: 13px;
}

#rushCandleHunterDialog[open] .rush-hunter-picks button {
  min-height: 54px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 780;
  letter-spacing: -.01em;
}

#rushCandleHunterDialog[open] .rush-hunter-picks button[data-pick="green"] {
  border-color: rgba(88, 219, 154, .36);
  background: rgba(34, 102, 75, .16);
  color: #a7f3ca;
}

#rushCandleHunterDialog[open] .rush-hunter-picks button[data-pick="red"] {
  border-color: rgba(255, 116, 125, .36);
  background: rgba(124, 49, 57, .15);
  color: #ffc0c4;
}

#rushCandleHunterDialog[open] .rush-hunter-picks button[data-pick="green"].is-active {
  border-color: #58db9a;
  background: rgba(28, 128, 85, .28);
  box-shadow: inset 0 0 0 1px rgba(88, 219, 154, .18);
}

#rushCandleHunterDialog[open] .rush-hunter-picks button[data-pick="red"].is-active {
  border-color: #ff747d;
  background: rgba(156, 47, 57, .27);
  box-shadow: inset 0 0 0 1px rgba(255, 116, 125, .18);
}

#rushCandleHunterDialog[open] .rush-hunter-stake {
  gap: 7px;
  margin-top: 12px;
}

#rushCandleHunterDialog[open] .rush-hunter-stake > div:first-child {
  color: #c7ced8;
  font-size: 10px;
}

#rushCandleHunterDialog[open] .rush-hunter-stake > div:first-child b {
  color: #939dab;
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 46px;
  border-color: var(--hunter-line-strong);
  border-radius: 9px;
  background: #0d1117;
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field > span {
  padding-left: 13px;
  color: #8792a2;
  font-size: 9px;
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field > input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f3f5fa;
  font: 800 18px/1 inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field > div {
  grid-template-columns: repeat(3, minmax(39px, 1fr));
  border-left-color: var(--hunter-line);
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field button {
  min-width: 39px;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .07);
  background: #1d232c;
  color: #c4ccd8;
  font: 800 9px/1 inherit;
}

#rushCandleHunterDialog[open] .rush-hunter-stake-field button:hover {
  background: #272f3a;
  color: #fff;
}

#rushCandleHunterDialog[open] .rush-hunter-lock {
  min-height: 48px;
  margin-top: 11px;
  border-radius: 9px;
  background: #7b21cd;
  color: #fff;
  font-size: 13px;
  font-weight: 820;
  box-shadow: none;
}

#rushCandleHunterDialog[open] .rush-hunter-lock:not(:disabled):hover {
  background: #932fe8;
}

#rushCandleHunterDialog[open] .rush-hunter-lock:disabled {
  background: #29303a;
  color: #929ba8;
}

#rushCandleHunterDialog[open] .rush-hunter-disclaimer {
  margin-top: 10px;
  color: #8993a2;
  font-size: 9px;
}

#rushCandleHunterDialog[open] .rush-hunter-history {
  margin-top: 12px;
  padding: 11px 13px;
  background: rgba(17, 21, 27, .72);
}

#rushCandleHunterDialog[open] .rush-hunter-history > div:first-child > b {
  color: #b3bcc9;
  font-size: 9px;
}

#rushCandleHunterDialog[open] .rush-hunter-history-item {
  border-color: rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: #1a2028;
}

#rushCandleHunterDialog[open] button:focus-visible,
#rushCandleHunterDialog[open] input:focus-visible {
  outline: 2px solid #c58bff;
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  #rushCandleHunterDialog[open] .rush-hunter-stage {
    display: grid;
    grid-template-areas:
      "top top"
      "controls controls"
      "market status"
      "market ticket"
      "history history";
    grid-template-columns: minmax(0, 1.48fr) minmax(360px, .72fr);
    align-content: start;
    column-gap: clamp(18px, 2.1vw, 30px);
    row-gap: 12px;
    width: min(1440px, 100%);
    max-width: none;
    height: auto;
    min-height: 100dvh;
    padding: 22px clamp(28px, 4vw, 66px) 40px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-topbar { grid-area: top; }
  #rushCandleHunterDialog[open] .rush-hunter-heading { grid-area: controls; }
  #rushCandleHunterDialog[open] .rush-hunter-market { grid-area: market; align-self: start; }
  #rushCandleHunterDialog[open] .rush-hunter-run { grid-area: status; align-self: stretch; margin: 0; }
  #rushCandleHunterDialog[open] .rush-hunter-play { grid-area: ticket; margin: 0; }
  #rushCandleHunterDialog[open] .rush-hunter-history { grid-area: history; }

  #rushCandleHunterDialog[open] .rush-hunter-chart {
    margin-top: 16px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-play-head strong {
    max-width: 250px;
  }
}

@media (max-width: 620px) {
  #rushCandleHunterDialog[open] {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  #rushCandleHunterDialog[open] .rush-hunter-stage {
    max-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top, 0px) + 10px) 13px max(24px, env(safe-area-inset-bottom, 0px) + 16px);
  }

  #rushCandleHunterDialog[open] .rush-hunter-topbar {
    grid-template-columns: 80px minmax(0, 1fr) 80px;
    min-height: 54px;
    gap: 4px;
    padding-bottom: 8px;
  }

  #rushCandleHunterDialog[open] .rush-screen-back {
    min-width: 70px;
    height: 33px;
    padding: 0 8px;
    font-size: 10px;
  }

  #rushCandleHunterDialog[open] .rush-unified-brand > img {
    width: 81px;
    max-height: 35px;
  }

  #rushCandleHunterDialog[open] .rush-unified-brand > h2 {
    font-size: 8px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-total {
    min-width: 70px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-total span {
    display: none;
  }

  #rushCandleHunterDialog[open] .rush-hunter-total strong {
    font-size: 15px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-heading {
    min-height: 43px;
    padding: 9px 0;
  }

  #rushCandleHunterDialog[open] .rush-hunter-market,
  #rushCandleHunterDialog[open] .rush-hunter-run,
  #rushCandleHunterDialog[open] .rush-hunter-play,
  #rushCandleHunterDialog[open] .rush-hunter-history {
    border-radius: 12px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-market {
    padding: 12px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-price-line > strong {
    font-size: 24px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-chart {
    margin-top: 10px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-market-foot {
    margin-top: 7px;
    padding-top: 7px;
    font-size: 8px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-round-status {
    grid-template-columns: auto minmax(30px, 1fr) auto;
    gap: 6px;
    padding: 7px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-round-status > span,
  #rushCandleHunterDialog[open] .rush-hunter-round-status > b {
    font-size: 7px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-run,
  #rushCandleHunterDialog[open] .rush-hunter-play {
    margin-top: 10px;
    padding: 12px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-run {
    gap: 10px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-run-head strong {
    font-size: 15px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-ladder > span {
    min-height: 44px;
    padding: 5px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-ladder small {
    font-size: 6px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-ladder b {
    font-size: 12px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-play-head strong {
    max-width: 244px;
    font-size: 16px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-countdown {
    font-size: 17px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-picks button {
    min-height: 51px;
    font-size: 12px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-stake-field > div {
    grid-template-columns: repeat(3, minmax(34px, 1fr));
  }

  #rushCandleHunterDialog[open] .rush-hunter-stake-field button {
    min-width: 34px;
    padding: 0 5px;
    font-size: 8px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-lock {
    min-height: 47px;
  }
}

/* A 900 × 280 desktop canvas becomes a thin stripe on a phone. The renderer
   switches its viewBox to the same 16:9 shape at this breakpoint, so this
   taller frame fills with correctly proportioned candles rather than a
   stretched or horizontally scrolling chart. */
@media (max-width: 420px) {
  #rushCandleHunterDialog[open] .rush-hunter-chart {
    aspect-ratio: 16 / 9;
    min-height: 150px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-chart svg {
    display: block;
    max-width: 100%;
  }
}

@media (max-width: 370px) {
  #rushCandleHunterDialog[open] .rush-hunter-topbar {
    grid-template-columns: 66px minmax(0, 1fr) 66px;
  }

  #rushCandleHunterDialog[open] .rush-screen-back {
    min-width: 60px;
    font-size: 9px;
  }

  #rushCandleHunterDialog[open] .rush-unified-brand > img {
    width: 70px;
  }

  #rushCandleHunterDialog[open] .rush-hunter-play-head strong {
    max-width: 210px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #rushCandleHunterDialog[open] .rush-hunter-round-track i { transition: none; }
}
