.match-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr .8fr auto auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 18px;
}

.match-filters label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
}

.match-filters input,
.match-filters select {
  width: 100%;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  outline: none;
}

.match-filters input:focus,
.match-filters select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 27, 45, .08);
}

.enhanced-match .match-teams {
  margin-bottom: 14px;
}

.match-teams.with-badges strong {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.match-teams.with-badges strong em {
  font-style: normal;
}

.team-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(9, 9, 11, .07);
  overflow: hidden;
}

.team-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.team-badge-fallback {
  background: #111115;
  color: #fff;
  font-weight: 950;
}

.detail-title-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.detail-title-row > div {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  font-weight: 950;
}

.detail-title-row > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111115;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}

.detail-title-row .team-badge {
  width: 62px;
  height: 62px;
}

.detail-title-row .team-badge img {
  width: 48px;
  height: 48px;
}

.final-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #111115;
  color: #fff;
}

.final-score span {
  color: #c7c7cf;
  font-size: 11px;
  font-weight: 800;
}

.final-score strong {
  font-size: 22px;
  letter-spacing: .04em;
}

.prediction-pick {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 27, 45, .18);
  background: rgba(226, 27, 45, .07);
  border-radius: 12px;
}

.prediction-pick span,
.factor-grid b {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.prediction-pick strong {
  display: block;
  margin-top: 3px;
  color: var(--red);
  font-size: 13px;
}

.match-analysis {
  margin: 10px 0 0;
  color: #52525b;
  font-size: 12px;
  line-height: 1.45;
}

.factor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.factor-grid span {
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: #f4f4f5;
  color: #18181b;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.enhanced-match {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.enhanced-match:hover,
.enhanced-match:focus {
  border-color: rgba(226, 27, 45, .45);
  box-shadow: 0 18px 45px rgba(9, 9, 11, .08);
  transform: translateY(-2px);
  outline: none;
}

.match-more {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: .04em;
}

.match-more:hover,
.match-more:focus {
  background: #bd1222;
  outline: none;
  box-shadow: 0 0 0 3px rgba(226, 27, 45, .16);
}

body.modal-open {
  overflow: hidden;
}

.match-modal[hidden] {
  display: none;
}

.match-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.match-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, .68);
  backdrop-filter: blur(4px);
}

.match-modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  padding: 28px;
}

.match-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #111115;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.match-modal-panel h2 {
  margin: 8px 42px 6px 0;
  font-size: 34px;
  letter-spacing: -.03em;
}

.match-detail-subtitle,
.provider-note,
.detail-note {
  color: var(--muted);
  line-height: 1.55;
}

.detail-score,
.detail-hero,
.detail-probabilities,
.detail-grid,
.availability-box {
  margin-top: 18px;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #111115;
  color: #fff;
}

.detail-score span {
  color: #c7c7cf;
  font-size: 12px;
  font-weight: 850;
}

.detail-score strong {
  font-size: 24px;
}

.detail-hero,
.detail-probabilities,
.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-hero {
  grid-template-columns: 1.25fr .75fr;
}

.detail-hero article {
  border-radius: 18px;
  padding: 18px;
  background: #111115;
  color: #fff;
}

.detail-hero span,
.detail-hero small,
.detail-probabilities span {
  display: block;
}

.detail-hero span,
.detail-probabilities span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-hero article span,
.detail-hero article small {
  color: #b9b9c1;
}

.detail-hero strong {
  display: block;
  margin: 6px 0;
  color: #fff;
  font-size: 28px;
}

.detail-probabilities {
  grid-template-columns: repeat(3, 1fr);
}

.detail-probabilities div {
  padding: 16px;
  border-radius: 16px;
  background: #f4f4f5;
  text-align: center;
}

.detail-probabilities strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
}

.detail-grid {
  grid-template-columns: 1fr 1fr;
}

.detail-grid article,
.availability-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.detail-grid h3,
.availability-box h3 {
  margin: 0 0 14px;
}

.comparison-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.comparison-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.comparison-list dt {
  color: var(--muted);
  font-weight: 800;
}

.comparison-list dd {
  margin: 0;
  font-weight: 950;
  text-align: right;
}

.algorithm-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.availability-grid span {
  padding: 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 850;
}

.availability-grid .available {
  background: #dcfce7;
  color: #166534;
}

.availability-grid .pending {
  background: #f4f4f5;
  color: #71717a;
}

.provider-note {
  margin: 16px 0 0;
  font-size: 12px;
}

.header-actions .logout-button {
  color: #fff !important;
  border-color: #e11d2e !important;
  background: #e11d2e !important;
}

.header-actions .logout-button:hover,
.header-actions .logout-button:focus {
  color: #fff !important;
  background: #bd1222 !important;
  border-color: #bd1222 !important;
}

.account-shell aside nav a.logout-link {
  color: #e11d2e;
  font-weight: 900;
}

.profile-edit-form .button {
  width: 100%;
}

@media (max-width: 850px) {
  .match-filters {
    grid-template-columns: 1fr;
  }

  .factor-grid {
    grid-template-columns: 1fr;
  }

  .match-modal {
    padding: 10px;
    align-items: end;
  }

  .match-modal-panel {
    max-height: 92vh;
    padding: 22px;
    border-radius: 20px 20px 0 0;
  }

  .match-modal-panel h2 {
    font-size: 25px;
  }

  .detail-hero,
  .detail-probabilities,
  .detail-grid,
  .availability-grid {
    grid-template-columns: 1fr;
  }
}
