/* ═══ §8 · TAB: RACE ══════════════════════════════════════════════════════════════════ */

/* the header — title left, the labelled REWIND pill right. #202: this is an accepted design. */
.race-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 6px;
  gap: 8px;
}
.race-header-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0.75;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ★ IT IS A CONTROL BESIDE A HEADING, AND IT MUST NOT COMPETE WITH ONE (operator 2026-08-11:
   "rewind button looks ugly, make it better match the theme"). It was a FILLED GOLD pill with a
   gold border, six pixels from a gold Orbitron title — the only heavy element on the surface, and
   two golds side by side read as two headings rather than a heading and its affordance.
   The PILL SHAPE stays, because that is this surface's own idiom: the scanner chip, the belief
   chip, the `?` and the rank badge are all low-alpha tinted pills, and a bare text link here would
   stop looking pressable. What changes is the REGISTER — glass at rest, exactly the card border
   every panel on this board wears, and the nav's own silver→gold transition on press. The gold is
   now the RESPONSE, not the resting state, which is the same grammar `.holo-btn` uses (#201).
   ⚠ Geometry is untouched: tap-targets.css grows the 44px hit box and #442 measured this control,
   so a padding change here changes a number that is checked. */
.race-rewind-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(192, 192, 192, 0.78);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.race-rewind-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
  filter: drop-shadow(0 0 5px rgba(192, 192, 192, 0.35));
  transition: filter 0.3s ease;
}
.race-rewind-btn:hover,
.race-rewind-btn:active {
  color: var(--accent-gold);
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
}
.race-rewind-btn:hover svg,
.race-rewind-btn:active svg {
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.85))
          drop-shadow(0 0 18px rgba(212, 175, 55, 0.45));
}
.race-rewind-btn:active { transform: scale(0.97); }

.race-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.race-bar {
  padding: var(--sp-md) var(--sp-lg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  position: relative;
  overflow: hidden;
}
.race-bar.rank-1 {
  border-color: rgba(255, 215, 0, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 215, 0, 0.1);
}
.race-bar.rank-1::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), transparent 60%);
  pointer-events: none;
}
.race-bar.entering { animation: barEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes barEnter {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.race-bar.flash-up   { animation: flashUp 0.65s ease-out; }
.race-bar.flash-down { animation: flashDown 0.65s ease-out; }
@keyframes flashUp {
  0%   { box-shadow: 0 0 0 0 rgba(33, 133, 75, 0); background: var(--glass-bg); }
  20%  { box-shadow: 0 0 24px 4px rgba(33, 133, 75, 0.45); background: rgba(33, 133, 75, 0.18); }
  100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); background: var(--glass-bg); }
}
@keyframes flashDown {
  0%   { box-shadow: 0 0 0 0 rgba(199, 78, 10, 0); background: var(--glass-bg); }
  20%  { box-shadow: 0 0 24px 4px rgba(199, 78, 10, 0.45); background: rgba(199, 78, 10, 0.15); }
  100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); background: var(--glass-bg); }
}

.race-bar-header {
  display: flex;
  align-items: center;
  /* the scanner + belief chips WRAP under the ticker at 390px instead of clipping the
     %change/price off the edge */
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xs);
}
/* the chip group — the scanner-attribution chip and the belief chip travel together, so they
   wrap as ONE unit rather than the belief chip stranding on its own line. */
.race-bar-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}
.race-bar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.rank-badge.rank-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 160, 0, 0.2));
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}
.rank-badge.rank-top5 {
  background: rgba(192, 192, 192, 0.12);
  border-color: rgba(192, 192, 192, 0.3);
  color: var(--accent-silver);
}

.ticker-symbol {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  letter-spacing: 0.03em;
}
.pct-change {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
}
.pct-change.positive { color: var(--accent-green-bright); }
.pct-change.negative { color: var(--accent-red-bright); }
.last-price {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  min-width: 60px;
}
.volume-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: right;
  min-width: 45px;
}

/* the "?" affordance on every row — opens the Why modal */
.race-why-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(58, 255, 138, 0.18);
  color: var(--outcome-win);
  border: 1px solid rgba(58, 255, 138, 0.4);
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.race-why-btn:hover { background: rgba(58, 255, 138, 0.32); }

