/* ── TeamAutocompleteInput ─────────────────────────────── */
.tp-root {
  position: relative;
}

.tp-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a9da2;
}

.tp-input-wrap {
  position: relative;
}

.tp-input-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #e4e7ed;
  color: #31404b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.tp-input-clear:hover {
  background: #cdd2da;
}

.tp-selected-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f1f4f7;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.tp-selected-display:hover,
.tp-selected-display:focus-visible {
  background: #e7edf3;
}

.tp-selected-display__logo-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-selected-display__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.tp-selected-display__initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #9a9da2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tp-selected-display__content {
  flex: 1;
  min-width: 0;
}

.tp-selected-display__name {
  font-size: 14px;
  font-weight: 600;
  color: #31404b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0;
}

.tp-dropdown {
  position: absolute;
  z-index: 400;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  border-radius: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  max-height: 260px;
  overflow-y: auto;
}

.tp-dropdown__hint {
  padding: 12px 0;
  color: #9a9da2;
  font-size: 13px;
  text-align: center;
}

.tp-option {
  width: 100%;
  border: none;
  background: #eef2f6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 4px;
}

.tp-option:hover {
  background: #dfe6ee;
}

.tp-option--active {
  background: #dfe6ee;
}

.tp-option__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.tp-option__name {
  font-size: 14px;
  font-weight: 600;
  color: #31404b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Labels ──────────────────────────────────────────────── */
.h2h-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a9da2;
}

/* ── Filter controls in matches card header ──────────── */
.h2h-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.h2h-filters .form-control {
  width: auto;
  min-width: 110px;
}

/* ── Select teams card spacing ─────────────────────────── */
.h2h-select-card {
  overflow: visible;
}

.h2h-select-card__content {
  padding-bottom: 1rem;
  min-height: 158px;
}

/* ── Matchup card content ────────────────────────────────── */
.h2h-matchup {
  background: linear-gradient(135deg, #1a2736 0%, #2a3d52 100%);
  color: #fff;
  padding: 24px 20px 20px !important;
  border-radius: 0 0 6px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.h2h-matchup__teams {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-align: center;
  margin-bottom: 24px;
}

.h2h-matchup__team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.h2h-matchup__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.h2h-matchup__name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h2h-matchup__record {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-top: auto;
}

.h2h-matchup__record--a {
  color: #38a9ff;
}

.h2h-matchup__record--b {
  color: #ff7e1f;
}

.h2h-matchup__center {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.h2h-matchup__total {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.h2h-matchup__total-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.h2h-matchup__draws {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
}

.h2h-matchup__bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 8px;
}

.h2h-matchup__bar-a {
  background: #38a9ff;
  border-radius: 3px 0 0 3px;
  transition: width 0.5s ease;
}

.h2h-matchup__bar-d {
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.5s ease;
}

.h2h-matchup__bar-b {
  background: #ff7e1f;
  border-radius: 0 3px 3px 0;
  transition: width 0.5s ease;
}

.h2h-matchup__bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.h2h-matchup__bar-legend--a {
  color: #38a9ff;
}

.h2h-matchup__bar-legend--d {
  color: rgba(255, 255, 255, 0.45);
}

.h2h-matchup__bar-legend--b {
  color: #ff7e1f;
}

/* ── Summary stat cards ──────────────────────────────────── */
.h2h-stat-card {
  border-top: 3px solid #38a9ff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(17, 36, 58, 0.06);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
  margin-bottom: 0;
  height: 100%;
}

.h2h-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(17, 36, 58, 0.1);
}

.h2h-stat-card__body {
  padding: 18px !important;
}

.h2h-stat-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9da2;
  margin-bottom: 10px;
}

.h2h-stat-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed #edf1f6;
}

.h2h-stat-card__row:last-child {
  border-bottom: 0;
}

.h2h-stat-card__row span {
  font-size: 0.8rem;
  color: #8f9aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.h2h-stat-card__row strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #2b394c;
  white-space: nowrap;
}

/* ── Match table rows ─────────────────────────────────── */
.h2h-match-row {
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

.h2h-match-row:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 999px rgba(255, 255, 255, 0.18),
    0 1px 8px rgba(30, 41, 59, 0.08);
}

.h2h-score-inline {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #1f2d3d;
  min-width: 0;
}

.h2h-score-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.h2h-score-team {
  font-weight: 500;
  min-width: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.h2h-score-team--home {
  text-align: right;
}

.h2h-score-team--away {
  text-align: left;
}

.h2h-score-team--winner {
  font-weight: 700;
}

.h2h-score-numbers {
  color: #334155;
  font-weight: 700;
  min-width: 58px;
  text-align: center;
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 576px) {
  .h2h-select-card__content {
    min-height: 206px;
  }

  .h2h-matchup {
    padding: 20px 14px 16px !important;
  }
  .h2h-matchup__logo {
    width: 44px;
    height: 44px;
  }
  .h2h-matchup__total {
    font-size: 2rem;
  }
  .h2h-matchup__name {
    font-size: 0.8rem;
  }
  .h2h-matchup__center {
    padding: 0 10px;
  }

  .h2h-score-grid {
    column-gap: 6px;
  }

  .h2h-score-numbers {
    min-width: 52px;
  }
}
