
/*
 * THE BET GENERATOR
 * Shared Selection Page Styles
 * Version 1.0
 *
 * Used by all Trifecta and Superfecta selection pages.
 */

.tbg-selection {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #d9dee5;
  border-radius: 14px;
  background: #fff;
  color: #172033;
  font-family: inherit;
  box-sizing: border-box;
}

.tbg-selection * {
  box-sizing: border-box;
}

.tbg-selection .tbg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.tbg-selection h2 {
  margin: 0;
  font-size: 25px;
  color: #172033;
}

.tbg-selection .tbg-race-info {
  margin-bottom: 28px;
  padding: 18px;
  background: #f5f7f9;
  border: 1px solid #d9dee5;
  border-radius: 10px;
}

.tbg-selection .tbg-field {
  min-width: 0;
  margin-bottom: 15px;
}

.tbg-selection .tbg-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 700;
  color: #172033;
}

.tbg-selection .tbg-field input,
.tbg-selection .tbg-field select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 50px;
  padding: 10px 12px;
  border: 2px solid #a5afbc;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 17px;
}

.tbg-selection .tbg-track-search {
  position: relative;
}

.tbg-selection .tbg-track-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 99999;
  max-height: 290px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid #a5afbc;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  -webkit-overflow-scrolling: touch;
}

.tbg-selection .tbg-track-suggestions[hidden] {
  display: none !important;
}

.tbg-selection .tbg-track-option {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.tbg-selection .tbg-track-option:last-child {
  border-bottom: 0;
}

.tbg-selection .tbg-track-option:hover,
.tbg-selection .tbg-track-option.is-active {
  background: #e7f5ec;
  color: #07582d;
}

.tbg-selection .tbg-track-empty {
  padding: 12px 14px;
  color: #64748b;
  font-size: 14px;
}

.tbg-selection .tbg-track-status {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
}

.tbg-selection .tbg-race-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 18px;
}

.tbg-selection .tbg-date-field {
  flex: 0 1 230px;
  width: 230px;
  max-width: 100%;
  margin-bottom: 0;
}

.tbg-selection .tbg-number-field {
  flex: 0 0 105px;
  width: 105px;
  margin-bottom: 0;
}

.tbg-selection #tbg-race-number {
  width: 105px;
  max-width: 105px;
  padding-left: 10px;
  padding-right: 5px;
}

.tbg-selection .tbg-session-heading {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
}

.tbg-selection .tbg-session-heading span {
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.tbg-selection .tbg-session-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tbg-selection .tbg-session {
  flex: 1 1 95px;
  min-height: 46px;
  padding: 9px 12px;
  border: 2px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.tbg-selection .tbg-session.is-selected {
  background: #168047;
  border-color: #07582d;
  color: #fff;
}

.tbg-selection .tbg-question {
  margin-bottom: 25px;
}

.tbg-selection .tbg-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.tbg-selection .tbg-count {
  padding: 3px 10px;
  border-radius: 20px;
  background: #edf0f3;
  font-size: 13px;
  white-space: nowrap;
}

.tbg-selection .tbg-dogs {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}

.tbg-selection .tbg-dog {
  min-height: 65px;
  border: 2px solid #64748b;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}

.tbg-selection .tbg-dog.is-selected {
  border: 3px solid #07582d;
  background: #168047;
  color: #fff;
}

.tbg-selection .tbg-dog.is-unavailable {
  border: 1px solid #a3a3a3;
  background: #d4d4d4;
  color: #777;
  cursor: not-allowed;
  opacity: 1;
}

.tbg-selection .tbg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 6px 0 20px;
  font-size: 13px;
}

.tbg-selection .tbg-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tbg-selection .tbg-key {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.tbg-selection .tbg-key.available {
  background: #fff;
  border: 2px solid #64748b;
}

.tbg-selection .tbg-key.selected {
  background: #168047;
}

.tbg-selection .tbg-key.unavailable {
  background: #d4d4d4;
  border: 1px solid #a3a3a3;
}

.tbg-selection #tbg-reset {
  padding: 8px 15px;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  cursor: pointer;
}

.tbg-selection #tbg-message {
  margin: 14px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tbg-selection button:focus-visible,
.tbg-selection input:focus-visible,
.tbg-selection select:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* Betting level heading */

.tbg-selection .tbg-level-heading {
  margin: 0 0 7px;
  text-align: center;
  font-size: 23px;
  font-weight: 700;
  color: #172033;
  line-height: 1.3;
}

.tbg-selection .tbg-level-subtitle {
  margin: 0 0 18px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: #475569;
}

/* Help Me Choose */

.tbg-selection .tbg-help-button {
  display: block;
  margin: 0 auto 18px;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid #334155;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.tbg-selection .tbg-help-button:hover {
  background: #f1f5f9;
}

.tbg-selection .tbg-help-overlay[hidden] {
  display: none !important;
}

.tbg-selection .tbg-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15,23,42,.72);
}

.tbg-selection .tbg-help-dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  color: #172033;
  box-shadow: 0 12px 48px rgba(0,0,0,.28);
  font-size: 17px;
  line-height: 1.5;
}

.tbg-selection .tbg-help-dialog h3 {
  margin: 0 0 18px;
  font-size: 23px;
  line-height: 1.25;
  color: #172033;
}

.tbg-selection .tbg-help-item {
  margin-bottom: 16px;
}

.tbg-selection .tbg-help-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 18px;
}

.tbg-selection .tbg-help-item p {
  margin: 0;
}

.tbg-selection .tbg-help-footer {
  margin: 10px 0 20px;
  font-size: 15px;
  color: #475569;
}

.tbg-selection .tbg-help-close {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 9px;
  background: #168047;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Betting level buttons */

.tbg-selection #tbg-level-selection {
  margin-top: 22px;
}

.tbg-selection .tbg-level:disabled {
  opacity: .58;
  filter: grayscale(.35);
  cursor: not-allowed !important;
}

.tbg-selection .tbg-level:not(:disabled) {
  cursor: pointer;
}

/* Responsive layouts */

@media (min-width:600px) {
  .tbg-selection .tbg-dogs {
    grid-template-columns: repeat(8,minmax(0,1fr));
  }
}

@media (max-width:420px) {
  .tbg-selection {
    padding: 14px;
  }

  .tbg-selection .tbg-race-info {
    padding: 12px;
  }

  .tbg-selection .tbg-race-row {
    gap: 12px;
  }

  .tbg-selection .tbg-date-field {
    flex: 1 1 155px;
    width: auto;
    min-width: 0;
  }

  .tbg-selection .tbg-number-field {
    flex: 0 0 90px;
    width: 90px;
  }

  .tbg-selection #tbg-race-number {
    width: 90px;
    max-width: 90px;
  }

  .tbg-selection .tbg-session-buttons {
    gap: 6px;
  }

  .tbg-selection .tbg-session {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 3px;
    font-size: 13px;
  }
}

@media (max-width:330px) {
  .tbg-selection .tbg-race-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tbg-selection .tbg-date-field {
    flex: none;
    width: 100%;
  }
}
