/* Historiales hípico y deportivo: superficies y jerarquía de resultados hípicos. */
.jugadas-section,
#jugada-detail-sheet {
  --jt-surface: #101a31;
  --jt-row: #202b43;
  --jt-row-highlight: linear-gradient(90deg, #293750, #1b263c 60%);
  --jt-line: #46536b;
  --jt-divider: #334155;
  --jt-value-bg: #1e293b;
  --jt-text: #ffffff;
  --jt-muted: #b8c5d8;
  --jt-success: #76dfad;
  --jt-paid: #8bcfff;
  --jt-cancelled: #ffb4b4;
}
html[data-theme="light"] :is(.jugadas-section, #jugada-detail-sheet) {
  --jt-surface: #f2f5fb;
  --jt-row: #e8edf5;
  --jt-row-highlight: linear-gradient(90deg, #dce6f2, #e6ebf5 60%);
  --jt-line: #b6c3d5;
  --jt-divider: #ccd6e4;
  --jt-value-bg: #f7f9fd;
  --jt-text: #17458f;
  --jt-muted: #49617d;
  --jt-success: #126544;
  --jt-paid: #175d9d;
  --jt-cancelled: #9e303d;
}
.jugadas-section .jugadas-history-block {
  background: var(--jt-surface);
  border-color: var(--jt-divider);
  border-radius: 12px;
  box-shadow: none;
}
.jugadas-section .sports-history-block__header {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.jugadas-section :is(.jugadas-list, .sports-history-list) { gap: 8px; }
.jugadas-section .jugada-card {
  --jt-ticket-line: var(--jt-line);
  background: var(--jt-surface);
  border: 1px solid var(--jt-ticket-line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  min-width: 0;
  box-shadow: none;
  transition: border-color .18s ease;
}
.jugadas-section .jugada-card:hover { border-color: #8ba3c5; }
.jugadas-section .jugada-card:active { transform: none; }
.jugadas-section .jugada-card__header {
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--jt-divider);
}
.jugadas-section .jugada-card .jugada-card__code--header {
  min-width: 0;
  color: var(--jt-text);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: none;
  overflow-wrap: anywhere;
}
.jugadas-section .jugada-card__body {
  margin: 8px;
  padding: 10px;
  gap: 9px;
  border: 1px solid var(--jt-line);
  border-radius: 11px;
  background: var(--jt-row);
  align-items: center;
}
.jugadas-section .jugada-card__bets { min-width: 0; flex: 1; gap: 4px; }
.jugadas-section .jugada-card .jugada-card__bet-chip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--jt-text);
  font-size: .82rem;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
.jugadas-section .jugada-card :is(.jugada-card__bet-meta, .jugada-card__bet-meta-sm) {
  color: var(--jt-muted);
  font-size: .72rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.jugadas-section .jugada-card__amount {
  flex: 0 1 auto;
  min-width: 70px;
  max-width: 46%;
  padding: 5px 8px;
  gap: 2px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--jt-line);
  border-radius: 8px;
  background: var(--jt-value-bg);
  overflow-wrap: anywhere;
}
.jugadas-section .jugada-card .jugada-card__simbolo {
  color: var(--jt-muted);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.jugadas-section .jugada-card .jugada-card__monto {
  color: var(--jt-text);
  font-size: .92rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.jugadas-section .jugada-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 12px 10px;
  border: 0;
  color: var(--jt-muted);
  font-size: .68rem;
}
.jugadas-section .jugada-card__ver-mas { color: var(--jt-text); }
.jugadas-section .jugada-card--ganado { --jt-ticket-line: var(--jt-success); box-shadow: none; }
.jugadas-section .jugada-card--ganado .jugada-card__body { background: var(--jt-row-highlight); }
.jugadas-section .jugada-card--pagado { --jt-ticket-line: var(--jt-paid); }
.jugadas-section .jugada-card--anulado { --jt-ticket-line: var(--jt-cancelled); }
.jugadas-section .jugada-card--pendiente-cobro { border-color: var(--jt-success); box-shadow: none; }
.jugadas-section .jugada-card__status.jugada-status--pendiente {
  color: #ffd09a;
  background: rgba(249, 153, 55, .16);
  border-color: rgba(249, 153, 55, .48);
}
/* Los estados de cada apuesta y de cada selección dentro del detalle de ticket
   también conservan el indicador naranja translúcido del ticket principal. */
.jugadas-section .sports-detail :is(.sports-detail__bet-meta, .sports-detail__selection-side) .jugada-card__status.jugada-status--pendiente {
  color: #ffd09a;
  background: rgba(249, 153, 55, .18);
  border-color: rgba(249, 153, 55, .56);
}
html[data-theme="light"] .jugadas-section .jugada-card__status.jugada-status--pendiente {
  color: #914900;
  background: rgba(217, 119, 6, .12);
  border-color: rgba(217, 119, 6, .42);
}
html[data-theme="light"] .jugadas-section .sports-detail :is(.sports-detail__bet-meta, .sports-detail__selection-side) .jugada-card__status.jugada-status--pendiente {
  color: #914900;
  background: rgba(217, 119, 6, .12);
  border-color: rgba(217, 119, 6, .42);
}
.jugadas-section .sports-detail :is(.sports-detail__bet-meta, .sports-detail__selection-side) .jugada-card__status.jugada-status--perdido {
  color: #ffb4b4;
  background: rgba(239, 68, 68, .16);
  border-color: rgba(248, 113, 113, .52);
}
.jugadas-section .jugada-card__header > .jugada-card__status.jugada-status--perdido {
  color: #d1d5db;
  background: rgba(148, 163, 184, .16);
  border-color: rgba(148, 163, 184, .42);
}
.jugadas-section .sports-detail__selection--perdido {
  padding: .5rem .6rem;
  border: 1px solid rgba(248, 113, 113, .38);
  border-radius: 10px;
  background: rgba(239, 68, 68, .09);
}
html[data-theme="light"] .jugadas-section .sports-detail :is(.sports-detail__bet-meta, .sports-detail__selection-side) .jugada-card__status.jugada-status--perdido {
  color: #b4232e;
  background: rgba(220, 38, 38, .1);
  border-color: rgba(220, 38, 38, .38);
}
html[data-theme="light"] .jugadas-section .jugada-card__header > .jugada-card__status.jugada-status--perdido {
  color: #5b6574;
  background: rgba(100, 116, 139, .12);
  border-color: rgba(100, 116, 139, .34);
}
html[data-theme="light"] .jugadas-section .sports-detail__selection--perdido {
  border-color: rgba(220, 38, 38, .28);
  background: rgba(220, 38, 38, .06);
}
.jugadas-section .jugada-card__pending-label {
  color: var(--jt-success);
  background: var(--jt-value-bg);
  border-color: var(--jt-success);
}
/* Las reglas antiguas apagan todo el ticket perdido/anulado con !important.
   Mantener la lectura; el badge y el borde siguen comunicando su estado. */
.jugadas-section :is(.jugada-card--perdido, .jugada-card--anulado) :is(
  .jugada-card__code--header, .jugada-card__monto, .jugada-card__bet-chip, .jugada-card__ver-mas
) { color: var(--jt-text) !important; }
.jugadas-section :is(.jugada-card--perdido, .jugada-card--anulado) :is(
  .jugada-card__simbolo, .jugada-card__footer
) { color: var(--jt-muted) !important; }
.jugadas-section :is(.jugada-card--perdido, .jugada-card--anulado) .jugada-card__bet-chip {
  background: transparent !important;
  border-color: transparent !important;
}
/* El detalle comparte superficies con la lista sin alterar botones de cobro/anulación. */
#jugada-detail-sheet {
  background: var(--jt-surface);
  color: var(--jt-text);
}
#jugada-detail-sheet :is(.sports-detail__ticket, .sports-detail__summary > div, .sports-detail__bet,
  .jugada-detail__info, .hip-detail__ejemplar, .hex-detail-pos, .hex-detail-box-horse) {
  background: var(--jt-row);
  border-color: var(--jt-line);
  border-radius: 11px;
}
#jugada-detail-sheet :is(.sports-detail__ticket strong, .sports-detail__summary strong,
  .sports-detail__selection strong, .sports-detail__selection b, .sports-detail h3,
  .jugada-detail__info-val, .hex-detail-pos__nombre, .hex-detail-box-horse__nombre) { color: var(--jt-text); }
#jugada-detail-sheet :is(.sports-detail__ticket span, .sports-detail__summary span,
  .sports-detail__selection small, .sports-detail__muted, .jugada-detail__info-label,
  .hex-detail-pos__jinete) { color: var(--jt-muted); }
#jugada-detail-sheet .sports-detail__selection-side > b {
  padding: 4px 7px;
  border: 1px solid var(--jt-line);
  border-radius: 8px;
  background: var(--jt-value-bg);
  color: var(--jt-text);
  font-family: 'Courier New', monospace;
}
@media (max-width: 359px) {
  .jugadas-section .jugada-card__body { flex-wrap: wrap; }
  .jugadas-section .jugada-card__amount { margin-left: auto; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .jugadas-section .jugada-card { transition: none; }
}
