/* CricLens match page — v0.9 */

.match-page-head {
  padding: 2.2rem 0 1.5rem;
}

.match-back {
  display: inline-block;
  margin-bottom: 1.4rem;
  color: var(--muted, #667085);
  text-decoration: none;
  font-weight: 700;
}

.match-hero {
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid var(--line, #dde3ea);
  border-radius: 22px;
  background: var(--panel, #fff);
}

.match-loading {
  min-height: 190px;
  display: grid;
  place-items: center;
  color: var(--muted, #667085);
}

.match-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  color: var(--muted, #667085);
  font-size: .86rem;
}

.match-status {
  text-transform: capitalize;
}

.match-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(.8rem, 3vw, 2rem);
  align-items: center;
  margin: clamp(1.5rem, 4vw, 2.8rem) 0 1.3rem;
  font-size: inherit;
  font-weight: inherit;
}

.match-team-title {
  display: grid;
  gap: .35rem;
  color: inherit;
  text-decoration: none;
}

.match-team-title-away {
  text-align: right;
}

.match-team-label,
.match-card-kicker,
.match-player-role {
  color: var(--muted, #667085);
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.match-team-title strong {
  font-size: clamp(1.65rem, 4vw, 3.5rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.match-vs {
  color: var(--muted, #667085);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.match-venue {
  color: var(--muted, #667085);
}

.match-content {
  padding: 0 0 4rem;
}

.match-disclaimer {
  margin: 1rem 0 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line, #dde3ea);
  border-radius: 14px;
  color: var(--muted, #667085);
  background: var(--panel, #fff);
  line-height: 1.55;
}

.match-disclaimer strong {
  color: var(--ink, #101828);
}

.match-section {
  padding: clamp(2.8rem, 6vw, 5rem) 0 0;
}

.match-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.15rem;
}

.match-section-head h2 {
  margin: .35rem 0 0;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -.04em;
}

.match-section-note {
  max-width: 430px;
  margin: 0;
  color: var(--muted, #667085);
  font-size: .9rem;
  line-height: 1.5;
  text-align: right;
}

.match-section-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.match-two-col,
.match-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.match-team-card,
.match-context-card,
.match-player-side,
.match-error-card {
  padding: clamp(1.15rem, 2.5vw, 1.55rem);
  border: 1px solid var(--line, #dde3ea);
  border-radius: 18px;
  background: var(--panel, #fff);
}

.match-team-card-head,
.match-player-side-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.match-team-card h3,
.match-context-card h3,
.match-player-side h3 {
  margin: .3rem 0 0;
  font-size: 1.4rem;
  letter-spacing: -.025em;
}

.match-team-card h3 a {
  color: inherit;
  text-decoration: none;
}

.match-record {
  font-size: 1.2rem;
}

.match-form {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 1.1rem 0 1.2rem;
}

.match-form-dot {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 800;
}

.match-form-dot.win {
  background: rgba(16, 185, 129, .12);
}

.match-form-dot.loss {
  background: rgba(239, 68, 68, .10);
}

.match-form-dot.other {
  background: rgba(148, 163, 184, .16);
}

.match-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.match-metric {
  min-width: 0;
  padding: .72rem .78rem;
  border-radius: 12px;
  background: var(--bg, #f8fafc);
}

.match-metric span,
.match-metric strong {
  display: block;
}

.match-metric span {
  margin-bottom: .2rem;
  color: var(--muted, #667085);
  font-size: .72rem;
}

.match-metric strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.match-context-card h3 {
  margin-bottom: 1.2rem;
}

.match-venue-team {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-top: 1px solid var(--line, #dde3ea);
}

.match-venue-team span {
  color: var(--muted, #667085);
  text-align: right;
}

.match-muted {
  color: var(--muted, #667085);
  line-height: 1.55;
}

.match-phase-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #dde3ea);
  border-radius: 18px;
  background: var(--panel, #fff);
}

.match-phase-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.match-phase-table th,
.match-phase-table td {
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--line, #dde3ea);
  text-align: right;
}

.match-phase-table th:first-child,
.match-phase-table td:first-child {
  text-align: left;
}

.match-phase-table thead th {
  color: var(--muted, #667085);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.match-phase-table tbody tr:last-child th,
.match-phase-table tbody tr:last-child td {
  border-bottom: 0;
}

.match-player-side-head span {
  color: var(--muted, #667085);
  font-size: .8rem;
}

.match-player-list {
  display: grid;
  gap: .7rem;
  margin-top: 1rem;
}

.match-player-card {
  display: grid;
  grid-template-columns: minmax(130px, .75fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid var(--line, #dde3ea);
  border-radius: 14px;
}

.match-player-card h4 {
  margin: .25rem 0 0;
  font-size: 1rem;
}

.match-player-projections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}

.match-player-projections .match-metric {
  padding: .55rem .6rem;
}

.match-player-projections .match-metric span {
  font-size: .66rem;
}

.match-error-card {
  margin-top: 2rem;
}

.match-error-card h1 {
  margin-top: 0;
}

.match-error-card a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .match-two-col,
  .match-context-grid {
    grid-template-columns: 1fr;
  }

  .match-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-player-card {
    grid-template-columns: 1fr;
  }

  .match-section-head {
    align-items: start;
    flex-direction: column;
  }

  .match-section-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .match-versus {
    grid-template-columns: 1fr;
    gap: .8rem;
  }

  .match-team-title-away {
    text-align: left;
  }

  .match-vs {
    display: none;
  }

  .match-metrics,
  .match-player-projections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* CricLens v0.12 — completed match fallback from Competition pages */
.match-final-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 0 0 1rem;
  padding: .8rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
}

.match-final-score div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}

.match-final-score span {
  color: var(--muted, #667085);
  font-size: .82rem;
}

.match-final-score strong {
  font-size: 1.15rem;
}

.match-final-score p {
  grid-column: 1 / -1;
  margin: .1rem 0 0;
  color: var(--muted, #667085);
  font-size: .82rem;
  font-weight: 700;
}

@media (max-width: 620px) {
  .match-final-score {
    grid-template-columns: 1fr;
  }
  .match-final-score p {
    grid-column: auto;
  }
}


/* CricLens v0.12.4 — clickable player profiles on Match pages */
.match-player-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color .16s ease,
    background .16s ease,
    transform .16s ease;
}

.match-player-card-link:hover {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .18);
  transform: translateY(-1px);
}

.match-player-card-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.match-player-card-link h4 {
  color: inherit;
}


/* CricLens v0.13 — distinct historical match detail */
.match-section-first { padding-top: 1.25rem; }
.match-footer { padding-top: 0; }

.match-history-innings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .8rem;
  margin-bottom: .8rem;
}

.match-history-score-card,
.match-history-card {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  border-radius: 16px;
}

.match-history-score-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem .8rem;
  align-items: baseline;
  padding: 1rem 1.05rem;
}

.match-history-score-card span {
  grid-column: 1 / -1;
  color: var(--muted, #667085);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.match-history-score-card a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.match-history-score-card strong { font-size: 1.5rem; }

.match-history-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: .65rem;
}

.match-history-card { padding: 1rem; min-width: 0; }
.match-history-table-wrap { overflow-x: auto; margin-top: .85rem; }
.match-history-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.match-history-table th,
.match-history-table td { padding: .72rem .65rem; border-bottom: 1px solid rgba(255,255,255,.09); text-align: right; }
.match-history-table th:first-child,
.match-history-table td:first-child { text-align: left; }
.match-history-table th { color: rgba(245,248,251,.72); font-size: .7rem; text-transform: uppercase; letter-spacing: .055em; }
.match-history-table td { color: #f8fafc; }
.match-history-table tbody tr:last-child td { border-bottom: 0; }
.match-history-table a { color: #f8fafc; text-decoration: none; font-weight: 750; }
.match-history-table a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .match-history-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .match-history-innings-grid,
  .match-history-metrics { grid-template-columns: 1fr; }
}

#matchContent, #historicalMatchContent { padding-bottom: 0; }


/* CricLens v0.14 — dedicated historical scorecards */
.match-scorecard-innings { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); gap:18px; margin-bottom:20px; }
.match-scorecard-card { min-width:0; }
.match-scorecard-table th,.match-scorecard-table td { white-space:nowrap; }
.match-scorecard-table th:first-child,.match-scorecard-table td:first-child { white-space:normal; min-width:130px; }
.match-scorecard-table .match-dismissal { white-space:normal; min-width:145px; color:rgba(245,248,251,.68); font-size:12px; }
.match-scorecard-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.match-scorecard-meta span { padding:7px 10px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.035); border-radius:10px; color:rgba(245,248,251,.70); font-size:12px; }
.match-scorecard-meta strong { color:#f8fafc; }
@media (max-width:900px){ .match-scorecard-innings{grid-template-columns:1fr;} }
