/* المواجهات المباشرة (H2H) — متناسق مع match-board */

.match-h2h-block .section-title {
  margin-bottom: 10px;
}

.match-h2h-card {
  padding: 12px;
  border-radius: var(--mb-radius, 8px);
  background: var(--mb-row-bg, #191d2d);
  border: 1px solid var(--mb-row-line, rgba(255, 255, 255, 0.05));
}

.match-h2h-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 6px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--mb-row-line, rgba(255, 255, 255, 0.06));
}

.match-h2h-summary__team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.match-h2h-summary__team--away {
  justify-content: flex-end;
}

.match-h2h-summary__logo {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: var(--mb-radius-xs, 5px);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.match-h2h-summary__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.match-h2h-summary__stat,
.match-h2h-summary__draw {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--mb-text-dim, #707488);
  line-height: 1.2;
}

.match-h2h-summary__stat b,
.match-h2h-summary__draw b {
  font-size: 18px;
  font-weight: 800;
  color: var(--mb-text-strong, #fff);
  line-height: 1;
}

.match-h2h-summary__draw {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mb-panel-bg, #151825);
  border: 1px solid var(--mb-center-line, #252a3d);
}

.match-h2h-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-h2h-row {
  padding: 10px 10px 9px;
  border-radius: var(--mb-radius-sm, 6px);
  background: var(--mb-panel-bg, #151825);
  border: 1px solid var(--mb-row-line, rgba(255, 255, 255, 0.04));
}

.match-h2h-row__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.match-h2h-row__team {
  font-size: 12px;
  font-weight: 700;
  color: var(--mb-text-muted, #b8bfd4);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-h2h-row__team--home {
  text-align: start;
}

.match-h2h-row__team--away {
  text-align: end;
}

.match-h2h-row__team.is-winner {
  color: var(--mb-text-strong, #fff);
  font-weight: 800;
}

.match-h2h-row--equal .match-h2h-row__team {
  color: var(--mb-text-strong, #fff);
}

.match-h2h-row__score {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--mb-accent, #39dbbf);
  background: rgba(57, 219, 191, 0.12);
  white-space: nowrap;
}

.match-h2h-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  line-height: 1.3;
}

.match-h2h-row__date {
  color: var(--mb-text-dim, #707488);
  font-weight: 600;
  white-space: nowrap;
}

.match-h2h-row__league {
  color: var(--mb-text-dim, #707488);
  font-weight: 600;
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.light:not(.dark) .match-h2h-card {
  background: #f8f9fc;
  border-color: #e3e5f0;
}

html.light:not(.dark) .match-h2h-summary {
  border-bottom-color: #e3e5f0;
}

html.light:not(.dark) .match-h2h-summary__stat,
html.light:not(.dark) .match-h2h-summary__draw {
  color: #7a8299;
}

html.light:not(.dark) .match-h2h-summary__stat b,
html.light:not(.dark) .match-h2h-summary__draw b {
  color: #1a1f33;
}

html.light:not(.dark) .match-h2h-summary__draw {
  background: #fff;
  border-color: #e0e5ef;
}

html.light:not(.dark) .match-h2h-row {
  background: #fff;
  border-color: #e8ebf3;
}

html.light:not(.dark) .match-h2h-row__team {
  color: #6c7288;
}

html.light:not(.dark) .match-h2h-row__team.is-winner,
html.light:not(.dark) .match-h2h-row--equal .match-h2h-row__team {
  color: #1a1f33;
}

html.light:not(.dark) .match-h2h-row__score {
  color: #10816e;
  background: rgba(22, 174, 148, 0.12);
}

html.light:not(.dark) .match-h2h-row__date,
html.light:not(.dark) .match-h2h-row__league {
  color: #7a8299;
}

@media (max-width: 575px) {
  .match-h2h-card {
    padding: 10px;
  }

  .match-h2h-summary {
    gap: 6px;
    padding-inline: 2px;
  }

  .match-h2h-summary__logo {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .match-h2h-summary__stat b,
  .match-h2h-summary__draw b {
    font-size: 16px;
  }

  .match-h2h-row {
    padding: 8px;
  }

  .match-h2h-row__main {
    gap: 6px;
  }

  .match-h2h-row__team {
    font-size: 11px;
  }

  .match-h2h-row__score {
    font-size: 11px;
    padding: 2px 6px;
  }

  .match-h2h-row__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .match-h2h-row__league {
    text-align: start;
    white-space: normal;
  }
}
