/* ─────────────────────────────────────────────────────────────
   Race-Toolbar Control (RTC) — three-tier mobile-first toolbar.
   ─────────────────────────────────────────────────────────────
   Replaces the old .rp-inline + .rp-chip + .rp-switch + .rp-upnext
   mob-hero block with a strict hierarchy:

      TIER 1   .rtc-anchor       full-width "Next race" anchor card
                                 (DOMINANT — dark fill, gold rail)

      TIER 2   .rtc-actions      paired primary + secondary buttons
                                 (50/50 row, solid dark fill)

      TIER 3   .rtc-picker       picker chip (SUBDUED — text-link
                                 weight, opens the sheet)

   All three live inside .race-toolbar > .race-toolbar__inner so
   the existing sticky/blur chrome still wraps them. The old
   ribbon styles (`.rp-inline`, `.rp-next-pill`, `.rp-chip`,
   `.rp-switch`, `.rp-upnext`, `.race-toolbar__explorer`) are
   dead — kept in race_picker.css for now but no longer rendered.

   Mobile (< 720px) is the design target — feedback was "Mobile
   hero usability: 6.5/10". Desktop tweaks at the bottom.
   ───────────────────────────────────────────────────────────── */

/* ── Layout stack — the three tiers are stacked vertically ──── */
.race-toolbar.rtc {
  /* Override the legacy flex/horizontal layout so the three
     tiers can stack cleanly. */
}
.rtc__stack {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 14px;
  min-height: 0;
  align-items: stretch;
}

/* ────────────────────────────────────────────────────────────
   TIER 1 — Next-race anchor card
   ────────────────────────────────────────────────────────────
   Dark fill matching the Race Card Explorer hero. Gold accent
   rail on the left, pulsing dot, course · time as the headline,
   countdown top-right. Full-width tap target. */
.rtc-anchor {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 20px;
  background: linear-gradient(180deg, #11151f 0%, #1a2030 100%);
  color: #fafaf7;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 20px -8px rgba(11, 14, 21, 0.45);
  transition: border-color 0.15s ease, transform 0.15s ease,
              box-shadow 0.15s ease;
  overflow: hidden;
}
.rtc-anchor:hover,
.rtc-anchor:focus-visible {
  border-color: rgba(212, 175, 55, 0.55);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px -8px rgba(212, 175, 55, 0.18),
    0 12px 28px -8px rgba(11, 14, 21, 0.55);
  outline: none;
}

/* Gold accent rail down the left edge — the anchor's signature. */
.rtc-anchor__rail {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #e8c659 0%, #b48a14 100%);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
}

.rtc-anchor__lead {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.rtc-anchor__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(241, 215, 123, 0.75);
}
.rtc-anchor__pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1A7D4A;
  box-shadow: 0 0 0 0 rgba(26, 125, 74, 0.6);
  animation: rtc-pulse 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes rtc-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(26, 125, 74, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(26, 125, 74, 0); }
  100% { box-shadow: 0 0 0 0   rgba(26, 125, 74, 0); }
}
.rtc-anchor__headline {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: #fafaf7;
}
.rtc-anchor__course {
  text-transform: capitalize;
}
.rtc-anchor__dot {
  color: rgba(212, 175, 55, 0.5);
  font-weight: 800;
}
.rtc-anchor__time {
  font-variant-numeric: tabular-nums;
  color: #f1d77b;
}

.rtc-anchor__tail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rtc-anchor__countdown {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1d77b;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rtc-anchor__chev {
  font-size: 16px;
  color: rgba(250, 250, 247, 0.55);
  line-height: 1;
  transition: transform 0.15s ease;
}
.rtc-anchor:hover .rtc-anchor__chev,
.rtc-anchor:focus-visible .rtc-anchor__chev {
  color: #f1d77b;
  transform: translateX(2px);
}

/* ────────────────────────────────────────────────────────────
   TIER 2 — Action pair (Browse races + AI Explorer)
   ────────────────────────────────────────────────────────────
   Equal-weight, solid dark fill (no outlines), strict 50/50 row.
   They read as a paired choice — never compete. */
.rtc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rtc-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: #fafaf7;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  min-height: 48px;            /* mobile tap-target floor */
  transition: background 0.15s ease, border-color 0.15s ease,
              transform 0.15s ease;
}
.rtc-btn:hover,
.rtc-btn:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  outline: none;
}
.rtc-btn:active { transform: translateY(0); }

.rtc-btn__icon {
  font-size: 18px;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.rtc-btn--primary  .rtc-btn__icon { color: #fafaf7; }
.rtc-btn--explorer .rtc-btn__icon { color: #f1d77b; }

.rtc-btn__body {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}
.rtc-btn__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #fafaf7;
  line-height: 1.2;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rtc-btn__sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.5);
  line-height: 1;
}
.rtc-btn__beta {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #0c1018;
  background: linear-gradient(135deg, #e8c659 0%, #b48a14 100%);
  padding: 1px 4px 0;
  border-radius: 3px;
  vertical-align: super;
  line-height: 1;
  margin-left: 2px;
}

/* ────────────────────────────────────────────────────────────
   TIER 3 — Picker chip
   ────────────────────────────────────────────────────────────
   Subdued tertiary — text-link weight, opens the sheet. */
.rtc-picker {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(250, 250, 247, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  margin: 2px auto 0;
  transition: color 0.15s ease, border-color 0.15s ease,
              background 0.15s ease;
}
.rtc-picker:hover,
.rtc-picker:focus-visible {
  color: #f1d77b;
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.06);
  outline: none;
}
.rtc-picker__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rtc-picker__course {
  text-transform: capitalize;
}
.rtc-picker__dot {
  color: rgba(212, 175, 55, 0.45);
}
.rtc-picker__time {
  font-variant-numeric: tabular-nums;
  color: #fafaf7;
}
.rtc-picker__chev {
  font-size: 10px;
  opacity: 0.6;
}

/* ────────────────────────────────────────────────────────────
   Desktop — keep the same vertical 3-tier stack but tighten so
   we don't waste horizontal real estate on wide viewports.
   The structure is intentionally identical to mobile so the
   visual language is consistent; only sizing adjusts.
   ──────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .rtc__stack {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .rtc-anchor {
    flex: 1 1 360px;
    min-width: 0;
    padding: 10px 14px 10px 18px;
  }
  .rtc-anchor__headline { font-size: 15px; }
  .rtc-actions {
    flex: 0 0 auto;
    grid-template-columns: auto auto;
    gap: 8px;
  }
  .rtc-btn { padding: 8px 14px; min-height: 44px; }
  .rtc-picker {
    flex: 0 0 auto;
    margin: 0;
  }
}
