.match-h2h-stats {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: opacity 120ms ease;
}

.match-h2h-stats--loading {
  opacity: 0.6;
  pointer-events: none;
}

.match-h2h-stats__filter-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.match-h2h-stats__filter-input:checked + .match-h2h-stats__filter-box {
  background: #9345d8;
  border-color: #9345d8;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.match-h2h-stats__filter-input:focus-visible + .match-h2h-stats__filter-box {
  outline: 2px solid #9345d8;
  outline-offset: 2px;
}

.match-h2h-stats__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.match-h2h-stats__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #232323;
}

.match-h2h-stats__filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #232323;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.match-h2h-stats__filter-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
}

.match-h2h-stats__bar {
  display: flex;
  width: 100%;
  gap: 8px;
  margin-bottom: 16px;
}

.match-h2h-stats__bar-seg {
  display: block;
  height: 8px;
  border-radius: 100px;
  min-width: 4px;
}

.match-h2h-stats__bar-seg--a {
  background: #9345d8;
}

.match-h2h-stats__bar-seg--draw {
  background: #7d7d7d;
}

.match-h2h-stats__bar-seg--b {
  background: #34b945;
}

.match-h2h-stats__legend {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.match-h2h-stats__legend-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.match-h2h-stats__legend-item--a {
  grid-column: 1 / 2;
  align-items: flex-start;
  text-align: left;
  padding-left: 66px;
  position: relative;
}

.match-h2h-stats__legend-item--draw {
  grid-column: 2 / 3;
  align-items: center;
  text-align: center;
}

.match-h2h-stats__legend-item--b {
  grid-column: 3 / 4;
  align-items: flex-end;
  text-align: right;
  padding-right: 66px;
  position: relative;
}

.match-h2h-stats__legend-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.match-h2h-stats__legend-item--a .match-h2h-stats__legend-logo {
  left: 0;
}

.match-h2h-stats__legend-item--b .match-h2h-stats__legend-logo {
  right: 0;
}

.match-h2h-stats__legend-pct {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.match-h2h-stats__legend-item--a .match-h2h-stats__legend-pct {
  color: #9345d8;
}

.match-h2h-stats__legend-item--draw .match-h2h-stats__legend-pct {
  color: #7d7d7d;
}

.match-h2h-stats__legend-item--b .match-h2h-stats__legend-pct {
  color: #34b945;
}

.match-h2h-stats__legend-count {
  font-size: 14px;
  line-height: 1.3;
  color: #232323;
}

.match-h2h-stats__legend-item--draw .match-h2h-stats__legend-count {
  color: #7d7d7d;
}

.match-h2h-stats__summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.match-h2h-stats__summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  min-height: 50px;
  background: #f4f4f4;
  border-radius: 10px;
}

.match-h2h-stats__summary-label {
  font-size: 14px;
  color: #232323;
}

.match-h2h-stats__summary-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 8px 16px;
  border: 1px solid #9345d8;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #9345d8;
}

.match-h2h-stats__compare {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  min-height: 50px;
  background: #f4f4f4;
  border-radius: 10px;
  margin-top: 16px;
}

.match-h2h-stats__compare:first-of-type {
  margin-top: 0;
}

.match-h2h-stats__compare-a,
.match-h2h-stats__compare-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.match-h2h-stats__compare-a {
  background: #9345d8;
  justify-self: start;
}

.match-h2h-stats__compare-b {
  background: #34b945;
  justify-self: end;
}

.match-h2h-stats__compare-label {
  text-align: center;
  font-size: 14px;
  color: #232323;
}

@media (max-width: 768px) {
  .match-h2h-stats {
    padding: 16px 14px;
    border-radius: 12px;
  }

  .match-h2h-stats__title {
    font-size: 16px;
  }

  .match-h2h-stats__filter {
    font-size: 12px;
  }

  .match-h2h-stats__legend-item--a {
    padding-left: 42px;
  }

  .match-h2h-stats__legend-item--b {
    padding-right: 42px;
  }

  .match-h2h-stats__legend-logo {
    width: 36px;
    height: 36px;
  }

  .match-h2h-stats__legend-pct {
    font-size: 18px;
  }

  .match-h2h-stats__summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
