/* Build a trade: the three reels in the Trade card (wheel-ticket.js). The card's own tokens (rh.css): near-black, hairline
   edges, green / red for Up / Down. Nothing here flashes; only the reels move, and only when moved. */

/* the card's header: Build (a quiet text button beside the length) and, on the wheel, a back arrow */
.rhc-build { display: inline-flex; align-items: center; gap: 6px; height: var(--ob-h-ctl, 32px); padding: 0 12px 0 10px; border: 0; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px var(--rh-edge); color: var(--rh-t2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rhc-build[hidden] { display: none; }
.rhc-build::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Crect x='1' y='2' width='3' height='10' rx='1.5'/%3E%3Crect x='5.5' y='2' width='3' height='10' rx='1.5'/%3E%3Crect x='10' y='2' width='3' height='10' rx='1.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Crect x='1' y='2' width='3' height='10' rx='1.5'/%3E%3Crect x='5.5' y='2' width='3' height='10' rx='1.5'/%3E%3Crect x='10' y='2' width='3' height='10' rx='1.5'/%3E%3C/svg%3E") center / contain no-repeat; opacity: 0.9; }
@media (hover: hover) { .rhc-build:hover { color: var(--rh-t1); } }
.rhc-build:focus-visible, .rhc-bk:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 1px; }
.rhc-bk { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--rh-t1); cursor: pointer; flex: none; }
.rhc-bk[hidden] { display: none; }
.rhc-bk svg { width: 18px; height: 18px; }
@media (hover: hover) { .rhc-bk:hover { background: rgba(255, 255, 255, 0.06); } }
@media (pointer: coarse) {
  .rhc-build { min-height: 44px; margin: -6px 0; }
  .rhc-bk { width: 44px; height: 44px; margin: -6px 0 -6px -14px; }
}

/* the reels */
#rhWheel { padding-top: 14px; }
.wt-reels { position: relative; display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.3fr) minmax(0, 0.98fr); border-radius: 12px; background: #050506; box-shadow: inset 0 0 0 1px var(--rh-edge); overflow: hidden; isolation: isolate; }
.wt-col { min-width: 0; padding-top: 10px; }
.wt-col + .wt-col { box-shadow: inset 1px 0 0 var(--rh-line); }
.wt-lab { display: block; height: 16px; text-align: center; font-size: 11px; line-height: 16px; font-weight: 500; color: var(--rh-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
/* the selection: one band across all three reels, on the middle row (16px label + 10px pad + 4px gap + one row) */
.wt-band { position: absolute; left: 0; right: 0; top: 74px; height: 44px; z-index: -1; background: rgba(255, 255, 255, 0.055); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -1px 0 rgba(255, 255, 255, 0.10); pointer-events: none; transition: box-shadow 0.18s ease; }
/* a detent: the band's edges catch the light for a moment as a row passes (a phone also gives a light tap) */
.wt-band.tk { animation: wtTick 0.12s ease-out; }
@keyframes wtTick { 0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(255, 255, 255, 0.34); } 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -1px 0 rgba(255, 255, 255, 0.10); } }
.wt-reel { margin-top: 4px; }
.wt-vp { position: relative; height: 132px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34%, #000 66%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 34%, #000 66%, transparent 100%); }
.wt-vp.grab { cursor: grabbing; }
.wt-vp:focus-visible { -webkit-mask-image: none; mask-image: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); border-radius: 8px; }
.wt-track { will-change: transform; }
.wt-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; padding: 0 4px; transform-origin: 50% 50%; backface-visibility: hidden; }
.wt-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 19px; font-weight: 600; color: var(--rh-t3); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.wt-s { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 14px; font-weight: 500; color: var(--rh-t3); }
.wt-s:empty { display: none; }
.wt-opt.on .wt-l { color: var(--rh-t1); }
.wt-opt.on .wt-s { color: var(--rh-t2); }
.wt-opt.up .wt-l { color: rgba(31, 209, 112, 0.55); }
.wt-opt.down .wt-l { color: rgba(255, 77, 90, 0.6); }
.wt-opt.up.on .wt-l { color: var(--ob-up); }
.wt-opt.down.on .wt-l { color: var(--ob-down); }
.wt-opt.na .wt-l, .wt-opt.na.on .wt-l { color: var(--rh-t3); text-decoration: none; }
.wt-opt.na .wt-s { color: var(--rh-t3); }

/* under the reels: the amount, the price, Buy Up / Buy Down and what it pays (outside the button) */
.wt-buyb { margin-top: 10px; }
.wt-amt { gap: 12px; }
.wt-chips { flex: 1 1 auto; max-width: 260px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.wt-chips .rhchip { width: 100%; min-width: 0; height: 32px; padding: 0 4px; border-radius: 999px; }
.wt-buyb .rhmsg:empty, .wt-buyb .rhmsg[hidden] { display: none; }
.wt-buyb .rhmsg { margin: 6px 0 0; }
.wt-go { margin-top: 12px; }
.wt-go[data-side="up"]:not(:disabled) { background: var(--ob-up); color: #000; }
.wt-go[data-side="down"]:not(:disabled) { background: var(--ob-down); color: #000; }
.wt-cap { margin: 8px 0 0; font-size: 13px; line-height: 18px; color: var(--rh-t2); text-align: center; text-wrap: balance; }
.wt-cap[hidden] { display: none; }
@media (pointer: coarse) { .wt-chips .rhchip { height: 44px; min-width: 0; padding: 0 4px; border-radius: 10px; } }
html.rh body.rh-sheet #rhWheel .wt-go { height: 48px; }

/* a narrow phone: the reels keep their 44px rows, the words get smaller; Build is its icon (its name is its label) */
@media (max-width: 360px) {
  .rhc-build { font-size: 0; gap: 0; width: 40px; justify-content: center; padding: 0; }
  .rhc-build::before { width: 16px; height: 16px; }
  .wt-l { font-size: 14px; }
  .wt-reels { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.32fr) minmax(0, 0.95fr); }
}
/* a phone held sideways (rh.css lays the sheet out in two columns): the reels on the left, the buying on the right */
@media (min-width: 701px) and (max-height: 500px) {
  html.rh body.rh-sheet #rhWheel:not([hidden]) { columns: auto; padding-top: 10px; }
  html.rh body.rh-sheet #rhWheel .wt { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  html.rh body.rh-sheet #rhWheel .wt-buyb { margin-top: 0; }
  html.rh body.rh-sheet #rhWheel .wt-go { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .wt-band.tk { animation: none; } }
