/* Horse member odds boards aligned with the Korean reference workbench. */
.racing-reference-odds-panel > .racing-odds-board {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.racing-reference-runner-table-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #ecece7;
  scrollbar-color: #6d756f #d2d4ce;
}

.racing-reference-runner-table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #171a17;
  font-variant-numeric: tabular-nums;
}

.racing-reference-runner-table th,
.racing-reference-runner-table td {
  height: 29px;
  padding: 0 5px;
  overflow: hidden;
  border-right: 1px solid #afb4ae;
  border-bottom: 1px solid #b8bcb6;
  font-size: 9px;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.racing-reference-runner-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 31px;
  background: #333936;
  color: #f3f5f2;
  font-weight: 800;
}

.racing-reference-runner-table th:nth-child(1) { width: 48px; }
.racing-reference-runner-table th:nth-child(2) { width: 150px; }
.racing-reference-runner-table th:nth-child(3) { width: 54px; }
.racing-reference-runner-table th:nth-child(4) { width: 66px; }
.racing-reference-runner-table th:nth-child(5) { width: 88px; }
.racing-reference-runner-table th:nth-child(6) { width: 110px; }
.racing-reference-runner-table th:nth-child(7),
.racing-reference-runner-table th:nth-child(8) { width: 84px; }
.racing-reference-runner-table tbody tr:nth-child(2n) { background: #e1e3de; }
.racing-reference-runner-table tbody tr:hover { background: #fff3cb; }
.racing-reference-runner-table tbody tr.cancelled { background: #d5d7d2; color: #777d78; }

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table .racing-reference-runner-number {
  background: #343a36;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table :where(.racing-reference-runner-name, .racing-reference-runner-jockey) {
  text-align: left;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table td {
  color: #171a17;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table .racing-reference-runner-name {
  color: #222622;
  font-weight: 750;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table td.racing-reference-runner-odds-cell {
  padding: 0;
}

.racing-reference-runner-odd,
.racing-reference-empty-odd {
  width: 100%;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-content: center;
  border: 0;
  border-radius: 0;
  background: #f7f7f2;
  color: #b12f34;
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.racing-reference-runner-odd:hover:not(:disabled) { background: #fff0ba; }
.racing-reference-runner-odd.selected {
  background: #bd3d40;
  color: #ffffff;
  box-shadow: inset 0 0 0 2px #7a1f22;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-standard strong {
  color: #272b28;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-two-digit strong {
  color: #1665b5;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-three-digit strong {
  color: #111411;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-minimum strong {
  color: #d22630;
  animation: racing-minimum-odds-pulse 0.8s steps(2, end) infinite;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-missing strong {
  color: #777d78;
}

body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).selected strong {
  color: #ffffff;
  animation: none;
}

@keyframes racing-minimum-odds-pulse {
  50% { opacity: 0.28; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-matrix-cell.odds).odds-minimum strong {
    animation: none;
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}

.racing-reference-runner-odd:disabled,
.racing-reference-runner-table tr.cancelled .racing-reference-empty-odd {
  background: #d3d5d0;
  color: #898e89;
  cursor: default;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table .racing-reference-runner-empty {
  height: 180px;
  color: #747b75;
}

.racing-reference-pair-matrix .racing-matrix-cell.diagonal,
.racing-reference-triple-matrix .racing-matrix-cell.diagonal {
  background: #303633;
  color: #ffffff;
  font-weight: 900;
}

.racing-reference-pair-matrix.ordered .racing-matrix-cell:not(.diagonal),
.racing-reference-triple-matrix .racing-matrix-cell:not(.diagonal) {
  background: #f5f5f0;
  color: #747a75;
}

body[data-role="MEMBER"] .member-view-racing .racing-reference-pair-matrix.ordered .racing-matrix-cell.odds,
body[data-role="MEMBER"] .member-view-racing .racing-reference-triple-matrix .racing-matrix-cell.odds {
  background: #f7f7f2;
  color: #141714;
}

.racing-reference-triple-board {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 31px minmax(0, 1fr);
  overflow: hidden;
  background: #ecece7;
}

.racing-reference-anchor-strip {
  min-width: 0;
  padding: 2px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow-x: auto;
  border-bottom: 1px solid #aeb3ad;
  background: #f7f7f3;
  scrollbar-width: thin;
}

.racing-reference-anchor-strip > strong {
  min-width: 48px;
  color: #555c56;
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
}

.racing-reference-anchor-strip button {
  width: 28px;
  min-width: 28px;
  height: 23px;
  padding: 0;
  border: 1px solid #a8ada7;
  border-radius: 1px;
  background: #ffffff;
  color: #343a35;
  font-size: 9px;
  font-weight: 850;
}

.racing-reference-anchor-strip button:hover { border-color: #8e292c; color: #8e292c; }
.racing-reference-anchor-strip button.active {
  border-color: #202522;
  background: #303633;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 #bd3d40;
}

.racing-reference-triple-board > .racing-matrix-scroll {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.racing-reference-triple-matrix .racing-matrix-cell.blocked,
.racing-reference-triple-matrix .racing-matrix-cell.cancelled,
.racing-reference-pair-matrix .racing-matrix-cell.cancelled {
  background: #d9dbd6;
  color: #858a85;
}

.racing-reference-utility-panel > .racing-broadcast-panel {
  grid-template-rows: minmax(0, 1fr);
}

.racing-reference-utility-panel .racing-provider-player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000000;
}

.racing-reference-utility-panel,
.racing-reference-utility-panel > .racing-broadcast-panel,
.racing-reference-utility-panel .racing-broadcast-media,
.racing-reference-utility-panel .racing-broadcast-frame,
.racing-reference-utility-panel .racing-provider-player {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 1181px) {
  body[data-role="MEMBER"] .member-view-racing .racing-reference-workbench {
    height: min(742px, calc(100dvh - 82px));
    min-height: 660px;
    grid-template-rows: minmax(365px, 56fr) minmax(285px, 44fr);
  }
}

@media (min-width: 1181px) and (max-height: 760px) {
  body[data-role="MEMBER"] .member-view-racing .racing-reference-workbench {
    height: auto;
    min-height: 0;
    grid-template-rows: clamp(300px, 48dvh, 340px) auto;
    overflow: visible;
  }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-odds-panel {
    grid-template-rows: 34px minmax(0, 1fr);
  }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table th { height: 27px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-runner-table td { height: 25px; }
  body[data-role="MEMBER"] .member-view-racing :where(.racing-reference-runner-odd, .racing-reference-empty-odd) {
    height: 24px;
    min-height: 24px;
  }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-event-bar { min-height: 32px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-play-tabs {
    min-height: 35px;
    padding: 2px;
  }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-play-tabs button { min-height: 29px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-controls .racing-runner-picker { padding: 2px 4px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-controls .racing-runner-picker-lane { min-height: 25px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-controls .racing-runner-picker-lane > strong { min-height: 23px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-controls .racing-runner-picker-controls button { height: 23px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip {
    padding: 3px 4px;
    grid-template-rows: 30px minmax(0, 1fr);
  }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip .racing-reference-asset-selector button { min-height: 26px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip > .member-slip-body { grid-template-rows: 30px minmax(0, 1fr); }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip .member-amount-field { min-height: 30px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip .member-amount-field input { height: 27px; }
  body[data-role="MEMBER"] .member-view-racing .racing-reference-slip .member-stake-presets button { min-height: 25px; }
}

@media (max-width: 760px) {
  .racing-reference-runner-table { min-width: 650px; }
  .racing-reference-anchor-strip { justify-content: flex-start; }
}
