.cm-match-list {
  --cm-navy: var(--wp--preset--color--navy);
  --cm-panel: var(--wp--preset--color--panel);
  --cm-cyan: var(--wp--preset--color--cyan);
  --cm-soft: var(--wp--preset--color--text-soft);
  color: var(--wp--preset--color--white);
}

.cm-match-list *,
.cm-match-list *::before,
.cm-match-list *::after {
  box-sizing: border-box;
}

.cm-match-list p {
  margin: 0;
}

.cm-match-list__sport,
.cm-match-list--same-sport {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cm-match-list__head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.cm-match-list__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: min(clamp(2.25rem, 5vw, 4rem), 9.8vw);
  line-height: 0.9;
  text-transform: uppercase;
}

.cm-match-list--sport-next .cm-match-list__title,
.cm-match-list--sport-upcoming .cm-match-list__title {
  font-size: min(clamp(2.25rem, 5vw, 4rem), calc((100vw - 8.125rem) / 7.6));
}

.cm-match-list__title::after {
  content: "";
  height: 4px;
  background: var(--cm-sport, var(--cm-cyan));
}

.cm-match-list__aside {
  margin-left: auto;
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cm-soft);
  white-space: nowrap;
}

.cm-match-list__empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(24px, 3vw, 40px);
  border: 1.5px solid var(--cm-sport, var(--cm-cyan));
  background: color-mix(in srgb, var(--cm-navy) 92%, transparent);
}

.cm-match-list__empty > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 60ch;
  color: var(--wp--preset--color--text-body);
}

.cm-match-list__empty-title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--wp--preset--color--white);
}

.cm-match-list__empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cm-match-list__button,
.cm-match-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.cm-match-list__button {
  padding: 16px 20px;
  font-size: 0.875rem;
  background: var(--wp--preset--color--white);
  color: var(--cm-navy);
}

.cm-match-list__button:hover {
  background: var(--cm-sport, var(--cm-cyan));
  color: var(--cm-navy);
}

.cm-match-list__button--outline {
  padding: 15px 20px;
  border: 1px solid var(--wp--preset--color--white);
  background: transparent;
  color: var(--wp--preset--color--white);
}

.cm-match-list__button--outline:hover {
  background: var(--wp--preset--color--white);
  color: var(--cm-navy);
}

.cm-match-buy {
  background: var(--wp--preset--color--white);
  color: var(--cm-navy);
}

.cm-match-buy:hover {
  background: var(--cm-cyan);
  color: var(--cm-navy);
}

/* Card with a sport tag */

.cm-match-list__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

.cm-match-card {
  display: flex;
  flex-direction: column;
}

.cm-match-card__tag {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--cm-sport, var(--cm-cyan));
  color: var(--cm-navy);
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cm-match-card__tag::before {
  content: "";
  flex: none;
  width: 16px;
  height: 14px;
  background: var(--cm-navy);
  clip-path: polygon(0 0, 50% 40%, 100% 0, 50% 100%);
}

.cm-match-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--cm-sport, var(--cm-cyan));
  background: color-mix(in srgb, var(--cm-navy) 85%, transparent);
}

.cm-match-card__photo,
.cm-match-feature__photo {
  position: relative;
  overflow: hidden;
  background: var(--cm-panel);
}

.cm-match-card__photo {
  aspect-ratio: 2 / 1;
  border-bottom: 1.5px solid var(--cm-sport, var(--cm-cyan));
}

.cm-match-list .cm-match-card__photo > img:first-child,
.cm-match-list .cm-match-feature__photo > img:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) brightness(0.88);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.cm-match-card:hover .cm-match-card__photo > img:first-child {
  transform: scale(1.06);
}

.cm-match-card__photo::after,
.cm-match-feature__photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg in srgb, transparent 0%, color-mix(in srgb, var(--cm-navy) 85%, transparent) 100%);
}

.cm-match-card__no-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, var(--cm-panel) 0 10px, var(--wp--custom--color--stripe) 10px 20px);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cm-soft);
}

.cm-match-list img.cm-match-card__league,
.cm-match-list img.cm-match-feature__league {
  position: absolute;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - 32px);
  object-fit: contain;
}

.cm-match-list img.cm-match-card__league {
  bottom: 14px;
  height: 56px;
}

.cm-match-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px 24px;
}

.cm-match-card__teams,
.cm-match-feature__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.cm-match-card__team,
.cm-match-feature__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: center;
}

.cm-match-list .cm-match-card__team img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.cm-match-card__team span,
.cm-match-feature__team span {
  min-height: 2em;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
}

.cm-match-card__team span {
  font-size: 1.625rem;
}

.cm-match-card__vs,
.cm-match-feature__vs,
.cm-match-row__vs {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  color: var(--cm-sport, var(--cm-cyan));
}

.cm-match-card__vs {
  font-size: 0.875rem;
}

.cm-match-card__when {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--cm-panel);
}

.cm-match-card__when p:first-child {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.cm-match-card__date,
.cm-match-feature__date,
.cm-match-row__date {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
  white-space: nowrap;
}

.cm-match-card__date {
  font-size: 3rem;
}

.cm-match-card__time,
.cm-match-feature__time {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  font-size: 1.125rem;
}

.cm-match-card__venue,
.cm-match-feature__venue {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-soft);
}

.cm-match-card__venue {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-match-card__buy {
  margin-top: auto;
  padding: 16px 18px;
  font-size: 0.9375rem;
}

.cm-match-card:hover .cm-match-card__buy {
  animation: cm-buy-pulse 0.9s ease-out 1;
}

.cm-match-card:hover .cm-match-card__buy span:last-child {
  animation: cm-buy-nudge 0.6s ease-in-out 1;
}

@keyframes cm-buy-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--cm-sport, var(--cm-cyan));
  }
  100% {
    box-shadow: 0 0 0 14px transparent;
  }
}

@keyframes cm-buy-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  40% {
    transform: translateX(5px);
  }
}

/* A sport's next match */

.cm-match-feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  border: 1.5px solid var(--cm-sport, var(--cm-cyan));
  background: color-mix(in srgb, var(--cm-navy) 90%, transparent);
}

.cm-match-feature__photo {
  min-height: clamp(170px, 30vw, 260px);
}

.cm-match-list img.cm-match-feature__league {
  bottom: clamp(10px, 2vw, 20px);
  height: clamp(40px, 7vw, 96px);
}

.cm-match-feature__info {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 24px);
  padding: clamp(16px, 3vw, 40px);
}

.cm-match-list .cm-match-feature__team img {
  width: clamp(60px, 10vw, 150px);
  height: clamp(60px, 10vw, 150px);
  object-fit: contain;
}

.cm-match-feature__team span {
  font-size: clamp(1.375rem, 2.8vw, 2.5rem);
}

.cm-match-feature__vs {
  font-size: clamp(0.9375rem, 1.4vw, 1.25rem);
}

.cm-match-feature__when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding-top: 18px;
  border-top: 1px solid var(--cm-panel);
}

.cm-match-feature__date {
  font-size: clamp(2.25rem, 5vw, 4rem);
}

.cm-match-feature__time {
  font-size: 1.25rem;
}

.cm-match-feature__venue {
  flex-basis: 100%;
}

.cm-match-feature__buy {
  margin-top: auto;
  padding: 18px 20px;
  font-size: 0.9375rem;
}

/* Rows */

.cm-match-list__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px clamp(16px, 3vw, 32px);
  padding: clamp(14px, 2vw, 18px) clamp(14px, 2.4vw, 28px);
  border: 1px solid var(--cm-panel);
  background: color-mix(in srgb, var(--cm-navy) 90%, transparent);
}

.cm-match-row__when {
  flex: 0 0 auto;
  min-width: clamp(118px, 15vw, 170px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-match-row__date {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
}

.cm-match-row__meta {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-soft);
  white-space: nowrap;
}

.cm-match-row__meta strong {
  font-weight: 700;
  color: var(--wp--preset--color--white);
}

.cm-match-row__teams {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 16px);
  max-width: 460px;
  margin: 0 auto;
}

.cm-match-list .cm-match-row__teams img {
  flex: none;
  width: clamp(36px, 4vw, 56px);
  height: clamp(36px, 4vw, 56px);
  object-fit: contain;
}

.cm-match-row__vs {
  font-size: clamp(0.6875rem, 1vw, 0.875rem);
}

.cm-match-row__away {
  min-width: 0;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.cm-match-row__buy {
  flex: 1 1 180px;
  max-width: 240px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--wp--preset--color--white);
  background: transparent;
  color: var(--wp--preset--color--white);
  font-size: 0.8125rem;
}

.cm-match-row__buy:hover {
  background: var(--wp--preset--color--white);
  color: var(--cm-navy);
}

.cm-match-upcoming {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px 28px;
  padding: 18px clamp(16px, 2.4vw, 28px);
  border: 1px solid var(--cm-panel);
  background: color-mix(in srgb, var(--cm-navy) 90%, transparent);
}

.cm-match-upcoming__when {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.cm-match-upcoming__date {
  min-width: 4.6em;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 0.9;
  text-transform: uppercase;
  white-space: nowrap;
}

.cm-match-upcoming__time {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  font-size: 1rem;
}

.cm-match-upcoming__teams {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.cm-match-list .cm-match-upcoming__teams img {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.cm-match-upcoming__vs {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--cm-sport, var(--cm-cyan));
}

.cm-match-upcoming__away {
  flex: 1 1 min-content;
  overflow-wrap: break-word;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.cm-match-upcoming__venue {
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-soft);
}

.cm-match-upcoming__buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--wp--preset--color--white);
  color: var(--wp--preset--color--white);
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.cm-match-upcoming__buy:hover {
  background: var(--wp--preset--color--white);
  color: var(--cm-navy);
}

@media (min-width: 37.5em) {
  .cm-match-upcoming {
    grid-template-columns: minmax(min-content, 1fr) minmax(0, 1.6fr);
  }
}

@media (min-width: 56.25em) {
  .cm-match-upcoming {
    grid-template-columns: minmax(min-content, 1fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 40em) {
  .cm-match-row__buy {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-match-list *,
  .cm-match-list *::before {
    animation: none !important;
    transition: none !important;
  }
}
