/* ============================================================
   Racing — betpinnacle-racing-desktop (1440) / betpinnacle-racing-mobile (390)
   ============================================================ */

/* ---------- masthead ---------- */
.racing-masthead { background: var(--paper); overflow: hidden; }
.masthead-wrap { position: relative; padding: 40px 0; }
.masthead-bgword {
  position: absolute; left: 0; top: 20px;
  font-family: var(--font-display); font-weight: 700; font-size: 100px;
  line-height: 1; color: var(--ink); opacity: 0.05;
  pointer-events: none; user-select: none;
}
.masthead-title { font-family: var(--font-display); font-weight: 700; line-height: 1; position: relative; }
.masthead-title .mt-m {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 48px; letter-spacing: -1px; color: var(--ink);
}
.masthead-title .mt-brown { color: var(--brown); }
.masthead-text { font-size: 13px; line-height: 1.4; color: var(--ink); margin-top: 12px; }
.masthead-visual-m {
  width: calc(100% + 16px); height: 251px; object-fit: cover;
  border-radius: 8px; margin-top: 24px;
}
@media (min-width: 992px) {
  .masthead-wrap { padding: 96px 0; min-height: 645px; }
  .masthead-bgword { top: 120px; font-size: 220px; letter-spacing: -8px; line-height: 0.85; opacity: 0.06; }
  .masthead-title .mt-d {
    display: block; font-size: 96px; letter-spacing: -2px; color: var(--ink); width: 560px;
  }
  .masthead-content { width: 560px; position: relative; z-index: 1; }
  .masthead-text { font-size: 14px; line-height: 1.5; margin-top: 16px; }
  .masthead-visual {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 640px; height: 680px;
    background: url('../../img/horse-jockey.webp') center / cover no-repeat;
  }
}

/* ---------- next to jump ---------- */
.ntj {
  background: var(--card);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.ntj-header { display: flex; flex-direction: column; gap: 6px; }
.ntj-sub { font-family: var(--font-display); font-weight: 400; font-size: 14px; line-height: 1; color: var(--muted); }
.ntj-track-wrap {
  margin-top: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ntj-track-wrap::-webkit-scrollbar { display: none; }
.ntj-track { display: flex; width: max-content; }
.race-card {
  width: 160px; flex: none;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 12px; background: var(--ink-2); text-align: left;
}
.race-card:nth-child(4), .race-card:nth-child(5) { border-radius: 6px; }
.race-card.is-active { background: var(--accent); border-radius: 0; }
.rc-top { display: flex; justify-content: space-between; align-items: center; }
.rc-badge {
  width: 26px; height: 26px; flex: none; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--ink);
  font-family: var(--font-mono); font-weight: 900; font-size: 11px;
}
.race-card.is-active .rc-badge { background: var(--ink); color: var(--accent); }
.rc-time { font-family: var(--font-mono); font-weight: 700; font-size: 11px; color: #ffffff; }
.race-card.is-active .rc-time { color: var(--ink); }
.rc-track { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.33; color: #ffffff; }
.race-card.is-active .rc-track { color: var(--ink); }
.rc-meta { font-family: var(--font-ui); font-weight: 400; font-size: 10px; color: var(--slate); }
.race-card.is-active .rc-meta { color: var(--ink); opacity: 0.8; }
.rc-view {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 800; font-size: 11px; color: var(--accent);
}
.race-card.is-active .rc-view { color: var(--ink); }
@media (min-width: 992px) {
  .ntj { padding: 96px 0 0; }
  .ntj-track-wrap { margin-top: 40px; overflow: visible; }
  .ntj-track { width: auto; }
  .race-card {
    width: auto; flex: 1 1 0; min-height: 136px;
    padding: 16px; border-radius: 0; border: 1px solid var(--hairline);
  }
  .race-card:nth-child(4), .race-card:nth-child(5) { border-radius: 0; }
  .race-card.is-active { border-color: var(--accent); }
  .rc-top { justify-content: flex-start; gap: 10px; }
  .rc-badge { width: 34px; height: 34px; font-size: 14px; border-radius: 0; }
  .race-card.is-active .rc-badge { background: #000000; color: var(--accent); }
  .rc-time { font-size: 14px; }
  .race-card.is-active .rc-time { color: #000000; }
  .rc-track { font-family: var(--font-ui); font-weight: 800; font-size: 16px; line-height: 1.2; }
  .race-card.is-active .rc-track { color: #000000; }
  .rc-meta { font-size: 13px; }
  .race-card.is-active .rc-meta { color: #000000; opacity: 1; }
  .rc-view { font-size: 13px; margin-top: auto; }
  /* the source mock leaves this yellow-on-yellow (invisible); ink matches the
     mobile frame's treatment of the active card and keeps the label readable */
  .race-card.is-active .rc-view { color: var(--ink); }
  .race-card.is-active .rc-view svg { stroke: var(--ink); }
  .rc-view svg { width: 16px; height: 16px; flex: none; }
}

/* ---------- selected race workspace ---------- */
.race-workspace { background: var(--card); padding: 32px 0; }
.ws-head { display: flex; justify-content: space-between; align-items: stretch; }
.ws-head-left { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; }
.ws-kicker {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--ink);
}
.ws-title {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  line-height: 1; text-transform: uppercase; color: var(--ink);
}
.ws-meta { font-family: var(--font-display); font-weight: 400; font-size: 13px; color: var(--muted); }
.ws-head-right { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }
.ws-starts-label {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  text-transform: uppercase; color: var(--muted);
}
.ws-starts { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--ink); }
.ws-rule { height: 1px; background: var(--line); margin-top: 16px; }
.ws-toolbar { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.ws-tabs { display: flex; gap: 8px; }
.ws-tab {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border: 1px solid var(--ink); border-radius: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  line-height: 1.4; color: var(--ink); text-align: center; white-space: nowrap;
}
.ws-tabs .ws-tab:nth-child(2) { flex: 1 1 auto; }
.ws-tab.is-active { background: var(--accent); border-color: var(--accent); }
.ws-helper {
  font-family: var(--font-display); font-weight: 400; font-size: 11px;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted);
}
.runners-list { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; }
.runners-list[hidden] { display: none !important; }
.runner-row {
  border: 1px solid var(--line); border-radius: 6px; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.rr-main { display: flex; flex-direction: column; gap: 12px; }
.rr-id { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rr-name-group { display: flex; align-items: center; gap: 8px; }
.rr-num { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.35; color: var(--ink); }
.rr-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.33; color: var(--ink); }
.rr-sub { font-family: var(--font-display); font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rr-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rr-person { font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 1.4; color: var(--ink); }
.rr-form { font-family: var(--font-display); font-weight: 400; font-size: 12px; color: var(--muted); }
.rr-odds { gap: 8px; }
.rr-odds .odds-btn {
  flex: 1 1 0; min-height: 46px; padding: 6px 8px; gap: 2px;
  align-items: center; justify-content: center; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
}
.rr-odds .odds-btn .odds-label {
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted);
}
.rr-odds .odds-btn .odds-price {
  font-family: var(--font-mono); font-weight: 900; font-size: 14px; color: var(--ink);
}
.rr-odds .odds-btn.is-active { background: var(--accent); border-color: var(--accent); }
@media (min-width: 992px) {
  .race-workspace { padding: 40px 0 96px; }
  .ws-kicker { font-size: 14px; color: var(--ink-2); }
  .ws-title { font-size: 36px; }
  .ws-meta { font-size: 14px; color: var(--gray-mid); }
  .ws-head-right { gap: 6px; }
  .ws-starts-label { font-size: 12px; color: var(--gray-mid); }
  .ws-starts { font-size: 36px; color: var(--ink-2); }
  .ws-rule { margin-top: 40px; }
  .ws-toolbar { margin-top: 40px; flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; }
  .ws-tab { padding: 10px 20px; border-radius: 0; font-weight: 600; font-size: 14px; }
  .ws-tabs .ws-tab:nth-child(2) { flex: none; }
  .ws-helper { color: var(--gray-mid); }
  .runners-list { display: block; margin-top: 40px; border: 1px solid var(--line); }
  .runner-row {
    border: 0; border-radius: 0; padding: 20px 24px; min-height: 102px;
    flex-direction: row; align-items: center; gap: 24px;
  }
  .runner-row + .runner-row { border-top: 1px solid var(--line); }
  .rr-main { flex: 1 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: 24px; }
  .rr-id { width: 220px; flex: none; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; }
  .rr-name-group { gap: 12px; }
  .rr-num { font-size: 28px; line-height: 1.36; color: var(--ink-2); }
  .rr-name { font-size: 24px; }
  .rr-sub { font-size: 13px; color: var(--gray-mid); }
  .rr-info { flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
  .rr-person { font-size: 14px; }
  .rr-form { font-size: 13px; color: var(--gray-mid); }
  .rr-odds { gap: 12px; flex: none; }
  .rr-odds .odds-btn { flex: none; width: 100px; height: 56px; min-height: 56px; border-radius: 0; }
  .rr-odds .odds-btn .odds-label { font-weight: 600; color: var(--gray-mid); }
  .rr-odds .odds-btn .odds-price { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
  .rr-odds .odds-btn.is-active .odds-label { color: var(--ink); }
}

/* ---------- responsible wagering ---------- */
.responsible { background: var(--card); }
.responsible .section-title { font-size: 26px; line-height: 1.1; letter-spacing: 0; }
.rw-text { font-size: 13px; line-height: 1.4; color: var(--muted); margin-top: 20px; }
.rw-divider { height: 1px; background: var(--line); margin-top: 40px; }
.tools { margin-top: 20px; }
.tool { border-top: 1px solid var(--line); padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.tool:last-child { border-bottom: 1px solid var(--line); }
.tool-num { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--muted); }
.tool-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }
.tool-text { font-size: 13px; line-height: 1.25; color: var(--muted); }
.tool-link { font-family: var(--font-ui); font-weight: 800; font-size: 13px; color: var(--ink); margin-top: 4px; }
@media (min-width: 992px) {
  .responsible { padding-top: 0; }
  .responsible .section-title { font-size: 72px; line-height: 1; letter-spacing: -2px; }
  .rw-text { font-size: 16px; line-height: 1.5; max-width: 760px; color: var(--ink); margin-top: 40px; }
  .tools { margin-top: 40px; display: flex; flex-direction: column; gap: 24px; }
  .tool { border-top: 0; border-bottom: 1px solid var(--line); padding: 0 0 24px; gap: 12px; }
  .tool:last-child { border-bottom: 0; padding-bottom: 0; }
  .tool-num { letter-spacing: 1px; color: var(--ink-2); text-transform: uppercase; }
  .tool-title { font-size: 24px; }
  .tool-text { font-size: 14px; line-height: 1.5; color: var(--ink); }
  .tool-link { margin-top: 0; }
}

/* ---------- loss warning ---------- */
.loss-warning { background: var(--accent); padding: 40px 0; }
.lw-wrap { display: flex; flex-direction: column; gap: 24px; }
.lw-kicker { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink); }
.lw-title {
  font-family: var(--font-display); font-weight: 700; font-size: 36px;
  line-height: 1.05; color: var(--ink); margin-top: 12px; text-transform: uppercase;
}
.lw-line1 { font-size: 13px; line-height: 1.4; color: var(--ink); margin-top: 12px; }
.lw-line2 { font-weight: 700; font-size: 13px; color: var(--ink); margin-top: 12px; }
.betstop-module {
  background: var(--ink); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.bm-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: #ffffff; }
.bm-text { font-size: 13px; line-height: 1.4; color: #ffffff; opacity: 0.9; }
.bm-link { font-family: var(--font-ui); font-weight: 800; font-size: 13px; color: var(--accent); }
@media (min-width: 992px) {
  .loss-warning { padding: 96px 0; }
  .lw-wrap { flex-direction: row; gap: 24px; }
  .lw-left { flex: 1; }
  .lw-title { font-size: 64px; margin-top: 16px; }
  .lw-line1 { font-size: 14px; line-height: 1; margin-top: 16px; }
  .lw-line2 { font-size: 14px; margin-top: 16px; }
  .betstop-module { width: 360px; flex: none; border-radius: 24px; padding: 24px; gap: 12px; }
  .bm-title { font-size: 44px; letter-spacing: -1px; }
  .bm-text { font-size: 14px; line-height: 1.2; opacity: 1; }
  .bm-link { color: #ffffff; }
}

/* --- interaction polish --- */
.race-card:not(.is-active):hover { background: rgba(255, 255, 255, 0.05); }
.ws-tab:not(.is-active):hover { border-color: var(--ink); }
.ws-tab.is-active:hover { background: #eaba0b; border-color: #eaba0b; }
@media (prefers-reduced-motion: no-preference) {
  .race-card, .ws-tab { transition: background-color 0.15s cubic-bezier(0.2, 0, 0, 1), border-color 0.15s cubic-bezier(0.2, 0, 0, 1), color 0.15s cubic-bezier(0.2, 0, 0, 1); }
}
