/* Crickly public site.
   Tokens mirror the scorecard renderer's palette exactly (design-scorecard §9.1)
   so the web page and the shared PNG cannot drift apart. No external requests:
   the type is a system stack and every colour is defined here. */

/* ---------- tokens: light ---------- */

:root {
  color-scheme: light dark;

  --canvas: #F3F5F9;
  --card: #FFFFFF;
  --raised: #FFFFFF;
  --row-alt: #F7F9FC;
  --line-subtle: #E6EAF1;
  --line-strong: #D2D9E4;

  --text-1: #0B1220;
  --text-2: #4F5D73;
  --text-3: #7C8AA0;

  --accent: #1E4FD8;
  --accent-on: #FFFFFF;

  --positive: #059669;
  --negative: #DC2626;
  --warn: #B45309;
  --live: #E11D48;
  --gold: #A16207;
  --four: #2563EB;
  --six: #7C3AED;

  --wash-strength: 0.20;
  --shadow-1: 0 1px 2px rgb(11 18 32 / 0.05), 0 1px 3px rgb(11 18 32 / 0.04);
  --shadow-2: 0 2px 4px rgb(11 18 32 / 0.05), 0 8px 24px rgb(11 18 32 / 0.07);
  --ring: 0 0 0 1px var(--line-subtle);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-num: var(--font-sans);

  --fs-score: clamp(2.2rem, 8vw, 3.2rem);
  --fs-team: clamp(1.15rem, 3.4vw, 1.6rem);
  --fs-title: clamp(1.5rem, 5vw, 2.4rem);
  --fs-result: clamp(1rem, 2.6vw, 1.3rem);

  --gutter: clamp(1rem, 4vw, 2rem);
}

/* ---------- tokens: dark ---------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0B1220;
    --card: #121B2C;
    --raised: #172236;
    --row-alt: #101929;
    --line-subtle: #1E2A3E;
    --line-strong: #2B3A52;

    --text-1: #F4F7FB;
    --text-2: #93A3BA;
    --text-3: #6E8098;

    --accent: #4C7DF0;
    --accent-on: #0B1220;

    --positive: #34D399;
    --negative: #F87171;
    --warn: #FBBF24;
    --live: #FF4D5E;
    --gold: #F5C64A;
    --four: #60A5FA;
    --six: #C084FC;

    --wash-strength: 0.28;
    --shadow-1: none;
    --shadow-2: 0 12px 32px rgb(0 0 0 / 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0B1220;
  --card: #121B2C;
  --raised: #172236;
  --row-alt: #101929;
  --line-subtle: #1E2A3E;
  --line-strong: #2B3A52;
  --text-1: #F4F7FB;
  --text-2: #93A3BA;
  --text-3: #6E8098;
  --accent: #4C7DF0;
  --accent-on: #0B1220;
  --positive: #34D399;
  --negative: #F87171;
  --warn: #FBBF24;
  --live: #FF4D5E;
  --gold: #F5C64A;
  --four: #60A5FA;
  --six: #C084FC;
  --wash-strength: 0.28;
  --shadow-1: none;
  --shadow-2: 0 12px 32px rgb(0 0 0 / 0.35);
}

:root[data-theme="light"] { color-scheme: light; }

/* ---------- team accents ----------
   Team colours are mapped server-side onto this fixed set. A stored hex is
   user-controlled and must never reach a CSS context, so nothing here is
   generated per request. */

.a-cherry  { --accent: #C1123A; }
.a-amber   { --accent: #A5620A; }
.a-emerald { --accent: #047857; }
.a-teal    { --accent: #0B6E60; }
.a-blue    { --accent: #1E4FD8; }
.a-indigo  { --accent: #2E3AB8; }
.a-violet  { --accent: #6D28D9; }
.a-slate   { --accent: #4F5D73; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .a-cherry  { --accent: #FF8FA3; }
  :root:not([data-theme="light"]) .a-amber   { --accent: #FFC24D; }
  :root:not([data-theme="light"]) .a-emerald { --accent: #34D399; }
  :root:not([data-theme="light"]) .a-teal    { --accent: #5FD8C2; }
  :root:not([data-theme="light"]) .a-blue    { --accent: #4C7DF0; }
  :root:not([data-theme="light"]) .a-indigo  { --accent: #AEB8FF; }
  :root:not([data-theme="light"]) .a-violet  { --accent: #C084FC; }
  :root:not([data-theme="light"]) .a-slate   { --accent: #93A3BA; }
}

:root[data-theme="dark"] .a-cherry  { --accent: #FF8FA3; }
:root[data-theme="dark"] .a-amber   { --accent: #FFC24D; }
:root[data-theme="dark"] .a-emerald { --accent: #34D399; }
:root[data-theme="dark"] .a-teal    { --accent: #5FD8C2; }
:root[data-theme="dark"] .a-blue    { --accent: #4C7DF0; }
:root[data-theme="dark"] .a-indigo  { --accent: #AEB8FF; }
:root[data-theme="dark"] .a-violet  { --accent: #C084FC; }
:root[data-theme="dark"] .a-slate   { --accent: #93A3BA; }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* An author display rule outranks the user agent's [hidden] rule regardless of
   specificity, so a hidden button would otherwise still be laid out. The share
   button is hidden until the script confirms the browser has a share sheet. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

small { font-size: 0.8125em; }

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 650;
}
.skip-link:focus { left: 0; }

.wrap {
  width: min(100% - (var(--gutter) * 2), 1120px);
  margin-inline: auto;
}

.section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-head {
  font-size: 1.0625rem;
  font-weight: 680;
  letter-spacing: -0.005em;
  margin-bottom: 0.875rem;
}

.block { margin-block: 2.25rem; }

.empty {
  padding: 2rem 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--text-2);
  text-align: center;
}

/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-subtle);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-size: 1.0625rem;
}
.brand__mark { display: inline-flex; }
.brand__plate { fill: #1E4FD8; }
.brand__stump { fill: #FFFFFF; opacity: 0.9; }
.brand__ball { fill: #FF4D5E; }

.topnav {
  display: flex;
  gap: 0.25rem;
}
.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}
.topnav a:hover { color: var(--text-1); background: var(--row-alt); }

.sitefoot {
  margin-top: 4rem;
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--line-subtle);
  color: var(--text-3);
  font-size: 0.875rem;
}
.sitefoot__mark { color: var(--text-2); font-size: 1rem; }
.sitefoot__note { margin-top: 0.25rem; }

/* ---------- pills, badges, buttons ---------- */

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  padding-inline: 0.75rem;
  border-radius: var(--r-pill);
  background: var(--raised);
  box-shadow: var(--ring);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.pill--quiet { background: transparent; color: var(--text-3); }
.pill--live {
  background: var(--live);
  color: #fff;
  box-shadow: none;
}
.pill--live .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgb(255 255 255 / 0.6); }
  70%  { box-shadow: 0 0 0 8px rgb(255 255 255 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0); }
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  border: 0;
}
.badge--gold {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.star { color: var(--positive); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--text-1);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--row-alt); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-on);
}
.btn--primary:hover { background: var(--accent); filter: brightness(1.06); }

.disc {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: linear-gradient(170deg, rgb(255 255 255 / 0.22), rgb(0 0 0 / 0.18));
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.12);
  color: var(--accent-on);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.disc--sm { width: 30px; height: 30px; font-size: 0.75rem; }
.disc--lg { width: 66px; height: 66px; font-size: 1.375rem; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  margin-top: 1.75rem;
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--ring), var(--shadow-2);
  overflow: hidden;
  isolation: isolate;
}
.hero__wash {
  position: absolute;
  inset: 0 0 auto 0;
  height: 65%;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: var(--wash-strength);
  z-index: -1;
  pointer-events: none;
}
.hero__body { padding: clamp(1.25rem, 4vw, 2.25rem); }

.hero__title {
  margin-top: 0.875rem;
  font-size: var(--fs-title);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero__venue {
  margin-top: 0.375rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.sides {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.5rem;
}

.side {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "disc name score"
    "disc sub  overs";
  align-items: center;
  column-gap: 0.875rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-lg);
}
.side--batting { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.side .disc { grid-area: disc; }
.side__name {
  grid-area: name;
  font-size: var(--fs-team);
  font-weight: 730;
  letter-spacing: -0.02em;
  color: var(--text-2);
  min-width: 0;
  overflow-wrap: anywhere;
}
.side--won .side__name, .side--batting .side__name { color: var(--text-1); }
.side__name a { text-decoration: none; }
.side__sub {
  grid-area: sub;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  min-height: 1rem;
}
.side__score {
  grid-area: score;
  justify-self: end;
  font-size: var(--fs-score);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text-2);
}
.side--won .side__score, .side--batting .side__score { color: var(--text-1); }
.side__overs {
  grid-area: overs;
  justify-self: end;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.situation {
  margin-top: 1.5rem;
  padding-left: 0.875rem;
  border-left: 5px solid var(--text-3);
  font-size: var(--fs-result);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.situation--win  { border-left-color: var(--accent); }
.situation--live { border-left-color: var(--live); }
.situation--warn { border-left-color: var(--warn); }
.situation--plain { border-left-color: var(--line-strong); }

.chase { margin-top: 1.25rem; }
.chase__track {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--row-alt);
  box-shadow: var(--ring);
  overflow: hidden;
}
.chase__fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.chase__labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-3);
}
.chase__labels span:nth-child(2) { color: var(--text-1); }

/* ---------- sticky mini score ---------- */

.ministrip {
  display: none;
  position: sticky;
  top: 58px;
  z-index: 20;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.875rem;
  margin-inline: calc(var(--gutter) * -0.5);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  box-shadow: var(--ring);
  font-size: 0.9375rem;
  font-weight: 650;
}
.ministrip.is-on { display: flex; }
.ministrip__side { display: inline-flex; gap: 0.5rem; align-items: baseline; }
.ministrip__side b { color: var(--text-2); font-size: 0.75rem; letter-spacing: 0.06em; }
.ministrip__v { color: var(--text-3); }

/* ---------- share row + meta strip ---------- */

.sharerow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.metastrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1.25rem;
  border-radius: var(--r-lg);
  background: var(--raised);
  box-shadow: var(--ring);
  overflow: hidden;
}
.metastrip__cell {
  padding: 0.875rem 1.125rem;
  border-right: 1px solid var(--line-subtle);
}
.metastrip__cell:last-child { border-right: 0; }
.metastrip__value {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.tone-good { color: var(--positive); }
.tone-bad  { color: var(--negative); }
.tone-warn { color: var(--warn); }
.tone-gold { color: var(--gold); }

/* ---------- this-over strip ---------- */

.overstrip {
  margin-top: 1.5rem;
  padding: 1rem 1.125rem;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--ring);
}
.overstrip__balls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.ball {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 40px; height: 40px;
  padding-inline: 0.5rem;
  border-radius: var(--r-pill);
  scroll-snap-align: end;
  font-size: 0.9375rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-1);
}
.ball--dot    { background: var(--row-alt); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-subtle); }
.ball--four   { background: var(--four); color: #fff; box-shadow: none; }
.ball--six    { background: var(--six); color: #fff; box-shadow: none; }
.ball--wicket { background: var(--negative); color: #fff; box-shadow: none; }
.ball--extra  { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); font-size: 0.8125rem; }

/* ---------- innings ---------- */

.cards { margin-top: 2rem; display: grid; gap: 2rem; }

.innings {
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--ring), var(--shadow-1);
  overflow: hidden;
}

.innings__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem clamp(0.875rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  border-left: 5px solid var(--accent);
}
.innings__team {
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.innings__label { font-size: 0.8125rem; color: var(--text-2); }
.innings__score { text-align: right; }
.innings__runs {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 830;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.innings--live .innings__runs { color: var(--accent); }
.innings__overs { font-size: 0.8125rem; color: var(--text-3); }
.innings__target {
  padding: 0 clamp(0.875rem, 3vw, 1.5rem) 1.25rem;
  font-weight: 650;
  color: var(--text-2);
}

/* ---------- tables ---------- */

.card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.card-table--bowl { margin-top: 0.5rem; }

.card-table thead th {
  padding: 0.625rem clamp(0.5rem, 2vw, 0.875rem);
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: right;
  white-space: nowrap;
}
.card-table thead th.col-name { text-align: left; padding-left: clamp(0.875rem, 3vw, 1.5rem); }

.card-table tbody th,
.card-table tbody td,
.card-table tfoot th,
.card-table tfoot td {
  padding: 0.625rem clamp(0.5rem, 2vw, 0.875rem);
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: top;
  text-align: right;
  font-weight: 500;
}
.card-table tbody tr:nth-child(even) { background: var(--row-alt); }
@media (hover: hover) {
  .card-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
}
.card-table tbody tr.is-crease {
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}

.col-name {
  text-align: left !important;
  font-weight: 400;
  padding-left: clamp(0.875rem, 3vw, 1.5rem) !important;
  width: 99%;
}

.bat-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.bat-name {
  font-weight: 650;
  color: var(--text-1);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.bat-name a { text-decoration: none; }
.bat-name a:hover { text-decoration: underline; }
.bat-how {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.is-crease .bat-how { color: var(--accent); font-weight: 600; }
.bat-sub {
  display: none;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--text-3);
}

.crease-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--accent);
  flex: 0 0 auto;
}
.crease-dot--strike { background: var(--accent); }

.num--lead { font-weight: 780; color: var(--text-1); }
.num--soft { color: var(--text-2); }
.is-four { color: var(--four); font-weight: 650; }
.is-six  { color: var(--six); font-weight: 650; }
.is-good { color: var(--positive); }

.row-extras th, .row-extras td { border-top: 1px solid var(--line-strong); }
.row-extras .bat-line { font-weight: 650; color: var(--text-2); }
.row-total th, .row-total td {
  border-bottom: 0;
  background: var(--raised);
  padding-block: 0.875rem;
}
.total-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.total-value {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 850;
  letter-spacing: -0.03em;
}

.dnb {
  padding: 0.875rem clamp(0.875rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--line-subtle);
  font-size: 0.875rem;
  color: var(--text-2);
}
.dnb .section-label { margin-bottom: 0.2rem; }

.innings .block {
  margin: 0;
  padding: 1.25rem clamp(0.875rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--line-subtle);
}

/* ---------- fall of wickets ---------- */

.fow {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.fow__item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.625rem;
  align-items: baseline;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--row-alt);
  box-shadow: var(--ring);
}
.fow__score { font-weight: 780; }
.fow__who { font-size: 0.875rem; overflow-wrap: anywhere; }
.fow__meta { grid-column: 2; font-size: 0.75rem; color: var(--text-3); }

/* ---------- partnerships ---------- */

.pships { margin-top: 0.75rem; display: grid; gap: 0.625rem; }
.pship {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "who   runs"
    "bar   bar"
    "wkt   wkt";
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}
.pship__who { grid-area: who; font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.pship__runs { grid-area: runs; font-weight: 750; }
.pship__runs small { color: var(--text-3); font-weight: 500; }
.pship__wkt { grid-area: wkt; font-size: 0.75rem; color: var(--text-3); }
.pship__bar {
  grid-area: bar;
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--row-alt);
  overflow: hidden;
}
.pship__bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 55%, var(--text-3));
}
.pship--live .pship__bar i { background: var(--accent); }


/* Bar widths. Progress bars are sized with a class rather than a style
   attribute so no page needs 'unsafe-inline' in its style-src. */
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

/* ---------- match & team cards ---------- */

.mgrid, .tgrid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.mcard__link {
  display: grid;
  gap: 0.75rem;
  height: 100%;
  padding: 1.125rem;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--ring), var(--shadow-1);
  text-decoration: none;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}
.mcard__link:hover {
  box-shadow: var(--ring), var(--shadow-2);
  transform: translateY(-2px);
}
.mcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.mcard__format { font-size: 0.75rem; font-weight: 650; color: var(--text-3); }
.mcard__sides { display: grid; gap: 0.5rem; }
.mside {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.625rem;
}
.mside__name {
  font-weight: 620;
  color: var(--text-2);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.mside--won .mside__name, .mside--won .mside__score { color: var(--text-1); }
.mside__score { font-weight: 780; white-space: nowrap; }
.mside__score small { color: var(--text-3); font-weight: 500; }
.mcard__line { font-size: 0.875rem; font-weight: 620; color: var(--text-1); }
.mcard--live .mcard__line { color: var(--live); }
.mcard__meta { font-size: 0.75rem; color: var(--text-3); }

.tcard__link {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "disc name" "disc meta";
  column-gap: 0.875rem;
  align-items: center;
  padding: 1rem 1.125rem;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--ring), var(--shadow-1);
  text-decoration: none;
}
.tcard__link:hover { box-shadow: var(--ring), var(--shadow-2); }
.tcard .disc { grid-area: disc; }
.tcard__name { grid-area: name; font-weight: 680; letter-spacing: -0.015em; }
.tcard__meta { grid-area: meta; font-size: 0.8125rem; color: var(--text-3); }

/* ---------- home masthead ---------- */

.masthead { padding-block: clamp(2.5rem, 8vw, 4.5rem) 0.5rem; max-width: 46ch; }
.masthead__title {
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 830;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.masthead__lede { margin-top: 0.875rem; font-size: 1.0625rem; color: var(--text-2); }

/* ---------- team page ---------- */

.hero--team .hero__body { padding-block: clamp(1.5rem, 5vw, 2.5rem); }
.teamhead { display: flex; align-items: center; gap: 1.125rem; flex-wrap: wrap; }
.teamhead__text { min-width: 0; }
.teamhead .hero__title { margin-top: 0; }

.squad { display: grid; gap: 0.375rem; }
.squad__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--ring);
}
.squad__name { font-weight: 640; overflow-wrap: anywhere; }
.squad__style { font-size: 0.8125rem; color: var(--text-3); white-space: nowrap; }
.squad__no { font-size: 0.8125rem; color: var(--text-3); }
.role {
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-xs);
  background: var(--row-alt);
  color: var(--text-2);
  white-space: nowrap;
}
.role-bwl, .role-ar { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.role-wk { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* ---------- error pages ---------- */

.errpage { padding-block: clamp(3rem, 12vw, 7rem); max-width: 44ch; }
.errpage__code {
  font-size: clamp(3.5rem, 14vw, 6rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 45%, var(--text-3));
}
.errpage__head {
  margin-top: 0.5rem;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.errpage__body { margin-top: 0.75rem; margin-bottom: 1.75rem; color: var(--text-2); font-size: 1.0625rem; }

/* ---------- live feedback ---------- */

.flash { animation: flash 0.6s ease-out; }
@keyframes flash {
  from { background-color: color-mix(in srgb, var(--accent) 26%, transparent); }
  to   { background-color: transparent; }
}
.flash-wicket { animation: flashw 0.9s ease-out; }
@keyframes flashw {
  from { background-color: color-mix(in srgb, var(--negative) 22%, transparent); }
  to   { background-color: transparent; }
}

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  .c-opt { display: none; }
  .bat-sub { display: block; }
  .side { column-gap: 0.625rem; }
  .squad__row { grid-template-columns: 1fr auto; }
  .squad__style { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .fow { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .pship {
    grid-template-columns: minmax(0, 1fr) 160px auto auto;
    grid-template-areas: "who bar runs wkt";
    align-items: center;
    gap: 1rem;
  }
  .pship__bar { height: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .topbar, .sitefoot, .sharerow, .ministrip, .overstrip, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .innings, .hero { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
