:root {
  --blue-main: #0d6efd;
  --blue-dark: #0b2e59;
  --blue-mid: #1f5faf;
  --blue-light: #eaf3ff;
  --app-bg: #f5f8fc;
  --app-text: #1f2937;
  --app-muted: #6b7280;
  --app-border: #d9e2ec;
}

body {
  background: var(--app-bg);
  color: var(--app-text);
}

.app-navbar {
  background: var(--blue-dark);
}

.app-panel {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.section-heading h2 {
  font-size: 1.15rem;
  margin: 0;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--blue-main);
  border-radius: 8px;
  min-height: 100%;
  padding: 1rem;
}

.metric-label {
  color: var(--app-muted);
  font-size: .82rem;
  margin-bottom: .35rem;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.position-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  min-height: 100%;
  padding: 1rem;
}

.position-card h3 {
  color: var(--blue-dark);
  font-size: 1.1rem;
  margin-bottom: .75rem;
}

.badge-soft {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.table {
  margin-bottom: 0;
}

.table th {
  color: var(--blue-dark);
  white-space: nowrap;
}

.status-dot {
  border-radius: 999px;
  display: inline-block;
  height: .65rem;
  margin-right: .35rem;
  width: .65rem;
}

.status-strong { background: #198754; }
.status-medium { background: #0d6efd; }
.status-weak { background: #ffc107; }
.status-low { background: #dc3545; }

.top-percent {
  color: #198754;
  font-weight: 800;
}

.floating-actions {
  bottom: 1.5rem;
  display: grid;
  gap: .75rem;
  position: fixed;
  right: 1.5rem;
  z-index: 1090;
}

.floating-action {
  align-items: center;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(11, 46, 89, .22);
  color: #fff;
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 800;
  height: 3.25rem;
  justify-content: center;
  line-height: 1;
  width: 3.25rem;
}

.floating-action:hover {
  filter: brightness(.95);
  transform: translateY(-1px);
}

.floating-action:focus-visible {
  outline: 3px solid rgba(13, 110, 253, .28);
  outline-offset: 3px;
}

.floating-action-history {
  background: #198754;
  color: #fff;
}

.floating-action-next {
  background: var(--blue-main);
  color: #fff;
}

.sample-ball-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.sample-ball {
  background: var(--blue-light);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 700;
  min-width: 2.25rem;
  padding: .25rem .55rem;
  text-align: center;
}

.play-ball-input {
  font-weight: 700;
}

.latest-plays-list {
  display: grid;
  gap: .5rem;
  max-height: 12rem;
  overflow: auto;
}

.latest-play-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  padding: .55rem .65rem;
}

.latest-play-button {
  text-align: left;
  width: 100%;
}

.latest-play-button:hover {
  background: var(--blue-light);
}

.latest-play-date {
  color: var(--app-muted);
  font-size: .78rem;
  white-space: nowrap;
}

.number-picker {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(6, minmax(2.35rem, 1fr));
  max-width: 28rem;
}

.number-pick {
  align-items: center;
  background: #fff;
  border: 1px solid #9ca3af;
  border-radius: 999px;
  color: var(--app-text);
  display: inline-flex;
  font-weight: 700;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  min-width: 2.25rem;
}

.number-pick.is-selected {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.hit-ball {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.compare-result-card {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: .75rem;
}

.history-row {
  cursor: pointer;
}

.history-row:hover td {
  background: var(--blue-light);
}

.sample-history-row {
  cursor: pointer;
}

.sample-history-row:hover td,
.sample-history-row.is-active td {
  background: var(--blue-light);
}

.sample-history-row.is-active td:first-child {
  border-left: 4px solid var(--blue-main);
}

.draw-summary-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.draw-summary-item {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: .75rem;
}

@media (max-width: 576px) {
  main.container-fluid {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  .app-panel,
  .metric-card,
  .position-card {
    padding: .85rem;
  }

  .floating-actions {
    bottom: 1rem;
    right: 1rem;
  }

  .floating-action {
    height: 3rem;
    width: 3rem;
  }

  .number-picker {
    gap: .45rem;
    grid-template-columns: repeat(6, 1fr);
  }

  .draw-summary-grid {
    grid-template-columns: 1fr;
  }
}
