:root {
  color-scheme: dark;
  --canvas: #11212d;
  --surface: #192f41;
  --raised: #20394c;
  --ink: #faf7ef;
  --muted: #b9c6d0;
  --link: #76c6ff;
  --line: #354b5b;
  --gutter: clamp(1rem, 4.5vw, 2rem);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}
button, select, input { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button, a { touch-action: manipulation; }
a { color: var(--link); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.17; text-wrap: pretty; }
h1 { font-size: clamp(1.55rem, 4.8vw, 2.35rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.2rem, 3.6vw, 1.55rem); letter-spacing: -.023em; }
h3 { font-size: 1.13rem; letter-spacing: -.015em; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.shell {
  max-width: 61rem;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.mast, .match-heading, .board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.mast {
  min-height: 4rem;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
}
.brand, .all-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
}
.brand {
  gap: .55rem;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand img { display: block; width: 1.75rem; height: 1.75rem; border-radius: .42rem; }
.all-link { font-size: .96rem; white-space: nowrap; }
main { min-width: 0; padding-block: clamp(1.15rem, 3.5vw, 2.2rem) max(3rem, env(safe-area-inset-bottom)); }
.match-heading { align-items: flex-start; }
.match-heading > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.meta, .ground, .freshness, .card-meta { color: var(--muted); font-size: .94rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; margin-top: .35rem; }
.phase {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  width: fit-content;
  padding: .1em .6em;
  border-radius: .8em;
  background: var(--raised);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
}
.share, .pin, .retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  gap: .4rem;
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: transparent;
  color: var(--link);
  font-weight: 650;
}
.share { flex-shrink: 0; }
.pin[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.icon, .share svg, .pin svg { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.18em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.score-hero { min-width: 0; margin-block: clamp(1.1rem, 3vw, 2rem) 1rem; overflow-wrap: anywhere; }
.batting { color: var(--link); font-size: clamp(1.1rem, 3vw, 1.45rem); font-weight: 700; }
.score-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .05rem .65rem; }
.runs {
  font-size: clamp(3.5rem, 14vw, 6.1rem);
  font-weight: 710;
  line-height: 1.04;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}
.overs { color: var(--muted); font-size: clamp(1rem, 2.75vw, 1.35rem); font-variant-numeric: tabular-nums; }
.opposition { margin-top: .3rem; color: var(--muted); font-size: 1.02rem; }
.opposition strong { color: var(--ink); font-weight: 600; }
.situation { margin-top: .8rem; font-size: clamp(1.05rem, 2.8vw, 1.3rem); font-weight: 580; line-height: 1.34; }
.tabs, .filters { display: flex; align-items: stretch; gap: .25rem; }
.tabs {
  margin-block: 0 1rem;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  gap: .35rem;
  padding: .45rem .3rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: .98rem;
  font-weight: 620;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.tabs a[aria-current="page"] { border-color: var(--link); color: var(--link); }
#panel { min-width: 0; }
.players, details.innings {
  margin-block: .8rem;
  border-radius: .85rem;
  background: var(--surface);
}
.players { padding: .35rem .9rem; }
.player-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .65rem;
  padding-block: .55rem;
  overflow-wrap: anywhere;
}
.player-row + .player-row { border-top: 1px solid var(--line); }
.player-row > :last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.recent { margin-block: 1rem; line-height: 1.65; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ground, .freshness { margin-top: .55rem; overflow-wrap: anywhere; }
.freshness { font-variant-numeric: tabular-nums; }
.unscored { font-size: clamp(1.45rem, 5vw, 2.6rem); font-weight: 680; }
.board-pin a, .message a { display: inline-flex; min-height: 44px; align-items: center; }
#panel .pin { margin-top: .85rem; }
th small { display: block; color: var(--muted); font-weight: 400; }
#feedback:not(:empty) { position: fixed; inset: auto 1rem max(1rem,env(safe-area-inset-bottom)) auto; border: 1px solid var(--line); border-radius: .7rem; padding: .65rem 1rem; background: var(--raised); }
#share-url { width: 100%; min-height: 44px; margin-top: .5rem; background: var(--surface); border: 1px solid var(--line); }
.alert { color: #ffd39a; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { color: var(--muted); font-weight: 650; }
td:first-child, th:first-child { min-width: 7rem; }
td.number, th.number, .number { text-align: end; font-variant-numeric: tabular-nums; }
td.number, th.number { white-space: nowrap; }
details.innings { padding-inline: .85rem; }
details.innings > summary { min-height: 44px; padding-block: .8rem; font-weight: 680; overflow-wrap: anywhere; }
details.innings[open] { padding-bottom: .85rem; }
details.innings h3 { margin: 1rem 0 .3rem; }
.commentary-list { list-style: none; padding: 0; margin: 0; }
.commentary-item { padding-block: .85rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.over { display: inline-block; margin-bottom: .18rem; color: var(--link); font-size: .94rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.comment-text { max-width: 72ch; line-height: 1.55; white-space: pre-line; }
.board-heading { margin-bottom: .85rem; }
.filters { flex-wrap: wrap; margin-bottom: 1.25rem; }
.filters button {
  min-height: 44px;
  padding: .45rem .75rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  color: var(--muted);
  background: transparent;
  font-size: .94rem;
  font-weight: 620;
}
.filters button[aria-pressed="true"] { color: var(--ink); background: var(--raised); border-color: var(--line); }
.match-group + .match-group { margin-top: 1.65rem; }
.match-group h2 { margin-bottom: .65rem; }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .7rem; }
.match-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .38rem;
  min-width: 0;
  min-height: 44px;
  padding: .95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; font-size: .875rem; }
.card-score { color: var(--ink); font-size: 1.5rem; font-weight: 700; line-height: 1.18; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card-status { color: var(--muted); line-height: 1.36; }
.empty, .message { padding-block: 1rem; line-height: 1.5; }
.empty > * + *, .message > * + * { margin-top: .6rem; }
@media (hover: hover) {
  .match-card:hover, .share:hover, .pin:hover, .retry:hover, .filters button:hover { border-color: var(--link); }
  .tabs a:hover, .all-link:hover { color: var(--ink); }
}
@media (min-width: 42rem) {
  .tabs a { flex: 0 1 auto; padding-inline: 1.1rem; }
  .players, .commentary-list { max-width: 48rem; }
}
@media (max-width: 23rem) {
  .mast { min-height: 3.3rem; }
  .brand { gap: .4rem; font-size: 1rem; }
  .tabs { gap: 0; }
  .tabs a, .filters button { font-size: .91rem; }
  .filters button { padding-inline: .5rem; }
}
/* Safari on HomeView and phones held sideways can have very little vertical room. */
@media (max-height: 29rem) {
  :root { --gutter: clamp(.85rem, 3.6vw, 1.5rem); }
  .mast { min-height: 44px; }
  .brand { font-size: 1rem; }
  .brand img { width: 1.5rem; height: 1.5rem; }
  main { padding-top: .38rem; }
  .match-heading h1, .board-heading h1 { font-size: clamp(1.2rem, 4.8vw, 1.55rem); line-height: 1.12; }
  .meta { gap: .2rem .55rem; margin-top: .16rem; font-size: .88rem; }
  .phase { font-size: .84rem; }
  .score-hero { margin-block: .35rem .2rem; }
  .batting { font-size: 1.05rem; line-height: 1.25; }
  .runs { font-size: clamp(3rem, 13vw, 4.1rem); line-height: .99; }
  .overs { font-size: 1rem; }
  .opposition { margin-top: .15rem; font-size: .95rem; line-height: 1.26; }
  .situation { margin-top: .35rem; font-size: 1.02rem; line-height: 1.24; }
  .tabs { margin-bottom: .5rem; }
  .board-heading { margin-bottom: .3rem; }
  .filters { margin-bottom: .6rem; }
}
@media (prefers-contrast: more) {
  :root { --muted: #e0e8ec; --line: #778b9b; --link: #a4dcff; }
}

.team-score { display: block; }
.team-score small { font-size: .65em; font-weight: 500; }
