/* ============================================================
   match-card.css — one fixture as a match card, the grid they sit
   in, and the "Featured match" frame with its day pager.
   Markup: components/match-card.js.

   The card is an <article>. .match__open is a button stretched
   over all of it (it opens the match); the venue link sits on top
   of that button so it can be clicked on its own.
   ============================================================ */

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: var(--space-3);
}

.match {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  padding: 14px 16px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-align: left;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms, border-color 180ms;
}
.match:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.match.is-mine {
  border-color: transparent;
  box-shadow: 0 0 0 2.5px var(--tx-accent), var(--shadow-sm);
}

/* The whole card is this button's hit area. */
.match__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.match__open:focus-visible { border-radius: inherit; }

/* ---------- Top line: sport icon · sport · division · round ---------- */
.match__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.match__sport { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.match__sport .sport-glyph { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ink-2); }
.match__icon { width: 18px; height: 18px; flex: 0 0 auto; object-fit: contain; }
.match__what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match__note {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--tx-final);
  color: var(--tx-on-final);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- The row: side | box | side ---------- */
.match__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
}
.match__row--solo { grid-template-columns: minmax(0, 1fr) auto; }

.match__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}
.match__crest {
  display: block;
  width: 52px;
  height: 52px;
}
.match__crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.match__initials {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tx-primary);
  color: var(--tx-on-primary-hi);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 12px;
}
.match__team {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.match__college {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.match__side.is-loser .match__team { color: var(--muted); font-weight: 600; }

.match__solo {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
}

/* ---------- The box in the middle ---------- */
.match__mid {
  display: flex;
  flex-direction: column;
  min-width: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tx-scorebox);
  text-align: center;
}
.match__box {
  padding: 9px 12px 7px;
  font-family: var(--font-serif);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.match--upcoming .match__box { font-size: 15px; padding-block: 11px 9px; }
.match__dash { margin-inline: 6px; opacity: 0.6; }

.match__bar {
  padding: 3px 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.match__mid--ongoing  .match__bar { background: var(--tx-live);    color: var(--tx-on-live); }
.match__mid--finished .match__bar { background: var(--tx-final);   color: var(--tx-on-final); }
.match__mid--upcoming .match__bar { background: var(--tx-primary); color: var(--tx-on-primary-hi); }
.match__mid--ongoing  .match__bar::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  vertical-align: 1px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.8s ease-in-out infinite;
}

/* ---------- Bottom line: venue, day ---------- */
.match__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.match__venue { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.match__venue svg { width: 13px; height: 13px; flex: 0 0 auto; }
.match__venue span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A link to the Map, above the card's own button. */
a.match__venue {
  position: relative;
  z-index: 2;
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-weight: 600;
  transition: background 160ms, color 160ms;
}
a.match__venue:hover { background: var(--surface-2); color: var(--ink); text-decoration: underline; }
.match__day { white-space: nowrap; }

.match__mine {
  position: absolute;
  top: -10px;
  left: 16px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--tx-accent);
  color: var(--tx-on-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   FEATURED MATCH — a bar with the day pager, one larger card.
   ============================================================ */
.featured-match {
  border-radius: 24px;
  background: var(--surface-2);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-3);
}
.featured-match__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px;
  border-radius: 16px;
  background: var(--tx-tile);
  color: var(--tx-tile-ink);
}
.featured-match__step {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--tx-tile-ink);
  background: var(--tx-tile-wash);
  transition: background 160ms;
}
.featured-match__step svg { width: 16px; height: 16px; }
.featured-match__step:hover:not(:disabled) { background: var(--tx-tile-line); }
.featured-match__step:disabled { opacity: 0.3; cursor: default; }
.featured-match__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}
.featured-match__day strong {
  font-family: var(--font-serif);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 16px;
}
.featured-match__count {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-accent);
}
.featured-match__more {
  padding-inline: var(--space-2);
  font-size: 13px;
  color: var(--ink-2);
}

.match--featured { padding: 20px 24px 16px; gap: var(--space-4); }
.match--featured .match__crest { width: 88px; height: 88px; }
.match--featured .match__team { font-size: 16px; }
.match--featured .match__college { font-size: 12px; }
.match--featured .match__mid { min-width: 130px; border-radius: 14px; }
.match--featured .match__box { font-size: 30px; padding: 12px 16px 10px; }
.match--featured.match--upcoming .match__box { font-size: 22px; }
.match--featured .match__bar { font-size: 10.5px; padding: 4px 8px; }

/* ---------- Phones: the compact card ----------
   The two teams stack on the left, one line each, with the score
   box on the right, the way scores apps list a day's games. About
   two thirds the height of the wide card, so a day fits on a screen. */
@media (max-width: 560px) {
  .match,
  .match--featured { gap: 8px; padding: 10px 12px; border-radius: 16px; }
  .match__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 6px;
  }
  .match__side {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-align: left;
  }
  .match__side--home { grid-area: 1 / 1; }
  .match__side--away { grid-area: 2 / 1; }
  .match__mid { grid-area: 1 / 2 / 3 / 3; align-self: center; min-width: 76px; }
  .match__row--solo .match__mid { grid-area: auto; }
  .match__crest,
  .match--featured .match__crest { width: 30px; height: 30px; flex: 0 0 auto; }
  .match__initials { width: 30px; height: 30px; font-size: 10px; }
  .match__team,
  .match--featured .match__team {
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .match__college { display: none; }
  .match__solo { font-size: 16px; }
  .match__box,
  .match--featured .match__box { font-size: 17px; padding: 7px 8px 5px; }
  .match--upcoming .match__box,
  .match--featured.match--upcoming .match__box { font-size: 14px; padding-block: 8px 6px; }
  .match--featured .match__mid { min-width: 76px; border-radius: 12px; }
  .match--featured .match__bar { font-size: 9.5px; padding: 3px 6px; }
  .match__foot { padding-top: 6px; }
}
