/* Crickly public site.
   The surface, line and semantic tokens mirror the scorecard renderer's palette
   exactly (design-scorecard §9.1) so the web page and the shared PNG cannot
   drift apart. The accent is the one exception: it is the brand's own blue ramp
   rather than a renderer token, because on the web it is the site talking — a
   link, a button, the focus ring — where on a card it is only ever a stand-in
   for a team that has no colour of its own. 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;

  /* The brand blue is #0188E4, which is 3.72:1 on white: right for the mark,
     for a large figure and for a component's edge, and short of the 4.5:1 a
     link or a button label needs. --accent is the next step down the brand's
     own ramp — same hue, same saturation — and is the first that clears it,
     4.57:1 in both directions against --card. Nothing small and blue on a light
     page uses the artwork's value; the artwork itself is the only thing that
     carries it.

     It has no headroom left. Against --canvas it is 4.18:1, so accent-coloured
     text belongs on a card and not on the page behind one — which is where all
     of it is today, because every element that takes this colour as ink sits
     inside a .hero or an .innings. */
  --accent: #0179CB;
  --accent-on: #FFFFFF;

  /* One step deeper again, 7.12:1 on white. It is for the two places the accent
     has to hold up against a wash of itself: the role chip, whose label sits on
     a 14% tint of the accent, and the primary button's hover, which moves away
     from the page rather than towards it so the label gains contrast instead of
     losing it. Chrome only — nothing team-coloured reaches for it, which is why
     the eight team accents below do not redefine it. */
  --accent-ink: #015B98;

  --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;

    /* The mark's own blue is too dark to read on this ground, so the dark
       scheme climbs the same ramp instead of descending it: #71C5FE is 9.91:1
       on the canvas and 9.12:1 on a card, and --accent-ink keeps the same
       "further from the page" relationship it has in light. */
    --accent: #71C5FE;
    --accent-on: #0B1220;
    --accent-ink: #8FD1FF;

    --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: #71C5FE;
  --accent-on: #0B1220;
  --accent-ink: #8FD1FF;
  --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.

   These deliberately stay off the brand ramp. They are other clubs' colours,
   and a side that plays in blue should look like itself rather than like
   Crickly; a-blue also has to stay far enough from --accent that a page whose
   chrome and whose team accent are both visible does not read as one colour. */

.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;
}

.section-note {
  margin: -0.5rem 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-3);
  max-width: 60ch;
}

.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;
}

/* ---------- the mark ----------
   The artwork is not tintable. The ball's seam is knocked out of it, so a
   filter or a mask would fill the stitching back in and leave a plain disc,
   which is not the mark. Both cuts are therefore in the document and this
   hides the one that does not belong on the current ground.

   A display swap rather than a <picture> with a prefers-color-scheme <source>:
   <picture> can only ever follow the operating system, so it cannot see the
   [data-theme] override defined at the top of this file, and a scheme change
   after load is not reliably a trigger for re-running source selection — which
   strands a white wordmark on a white page, the one failure that matters. The
   pair costs 11 KB on the wordmark and 5 KB on the ball, and the ball's is
   lazy. The shown cut is left at `inline`, which is the <img> default and which
   blockifies by itself inside the flex row .brand sets up. */

.mark--on-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark--on-light { display: none; }
  :root:not([data-theme="light"]) .mark--on-dark { display: inline; }
}

:root[data-theme="dark"] .mark--on-light { display: none; }
:root[data-theme="dark"] .mark--on-dark { display: inline; }

/* The wordmark is artwork, not type: it is sized by height because the lockup
   is 1000 x 347 and every place it appears is constrained vertically. The
   width/height attributes on the <img> give the browser the aspect ratio, so
   the topbar does not reflow when the file lands. */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand__word {
  height: 26px;
  width: auto;
}

.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; }
/* Sits in the line rather than beside it, so the sentence stays one sentence:
   a flex row here would split "Scored with" from "Crickly" into two items. */
.sitefoot__ball {
  width: 20px;
  height: 20px;
  margin-right: 0.375rem;
  vertical-align: -0.22em;
}
.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);
}
/* Hover deepens rather than brightens. Brightening the accent moved it towards
   the label on it — the old blue had contrast to spare, this one has 0.07 —
   so the hover step goes down the ramp in light and up it in dark, and the
   label gains contrast either way. */
.btn--primary:hover { background: var(--accent-ink); }

.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__who { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.squad__name { font-weight: 640; overflow-wrap: anywhere; }
.squad--past .squad__row { background: transparent; box-shadow: inset 0 0 0 1px var(--line-subtle); }
.squad--past .squad__name { color: var(--text-2); }

/* A photograph, or the initials that stand in for one. Both are the same size
   and shape so a squad list does not jump about as images arrive. */
.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--row-alt);
  box-shadow: var(--ring);
}
.avatar--mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.avatar--lg { width: 96px; height: 96px; }
.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;
}
/* Eleven-pixel uppercase on a wash of its own colour is the tightest text pair
   the site has. --accent on that wash is 3.78:1; --accent-ink is 5.88:1 on a
   squad row and 5.46:1 on a past-players row, which has no card behind it. That
   is why the label steps down the ramp while the wash keeps the accent. */
.role-bwl, .role-ar { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); }
.role-wk { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* ---------- player page ---------- */

.hero--player .hero__body { padding-block: clamp(1.5rem, 5vw, 2.5rem); }
.hero__bio {
  margin-top: 1rem;
  max-width: 62ch;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* The dividers are drawn inside each cell rather than as gaps in a coloured
   grid, so a row that does not fill its last column ends in the card's own
   background instead of a stray block of line colour. */
.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--ring);
}
.stat {
  padding: 0.875rem 1rem;
  box-shadow: inset -1px -1px 0 var(--line-subtle);
}
/* A club's record is five figures and belongs on one line wherever it fits. */
.statgrid--record {
  margin-top: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}
.stat__value {
  margin-top: 0.2rem;
  font-size: 1.125rem;
  font-weight: 750;
  color: var(--text-2);
  white-space: nowrap;
}
.stat--lead .stat__value { font-size: 1.375rem; color: var(--text-1); }

/* ---------- 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; }
}

/* =====================================================================
   The management console.

   Everything below is for the signed-in pages. It reuses the site's tokens
   without exception — no new colours are introduced here, and the brand blue
   only ever appears through --accent, which is the step down the ramp that
   small text on white can actually pass at.

   The layout is single-column on a phone and widens on a laptop, because the
   console is used in both places: a secretary at a desk on Sunday night, and
   the same person in a clubhouse on Saturday afternoon.
   ===================================================================== */

.console { padding-block: 1.5rem 3rem; }

/* ---------- console navigation ---------- */

.connav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-subtle);
}

.connav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}

.connav__link {
  display: inline-flex;
  align-items: center;
  /* 44px is the smallest target that is reliably hit with a thumb, and this
     navigation is used one-handed at a ground. */
  min-height: 44px;
  padding-inline: 0.75rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 620;
  font-size: 0.9375rem;
  text-decoration: none;
}
.connav__link:hover { background: var(--row-alt); color: var(--text-1); }
.connav__link.is-current {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
}

.connav__out { margin: 0; }

/* A quiet button is still a button: it keeps the target size and the focus
   ring, and only loses the border. */
.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn--quiet:hover { background: var(--row-alt); color: var(--text-1); }
.btn--wide { width: 100%; }
.btn--danger {
  background: transparent;
  border-color: var(--negative);
  color: var(--negative);
}
.btn--danger:hover { background: color-mix(in srgb, var(--negative) 12%, transparent); }

/* Focus is never removed, only replaced with something visible on both
   schemes. Two rings — the accent and the canvas behind it — so the outline
   reads on a card and on a coloured chip alike. */
.console :is(a, button, input, select, textarea, [tabindex]):focus-visible,
.signin :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- flash ---------- */

.notice {
  margin-top: 1.25rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--text-1);
  /* The bar is a second signal so the outcome is not carried by colour alone;
     the sentence itself always says what happened. */
  border-left-width: 4px;
}
.notice__text { margin: 0; }
.notice--ok    { border-left-color: var(--positive); }
.notice--warn  { border-left-color: var(--warn); }
.notice--error { border-left-color: var(--negative); }

/* ---------- headings ---------- */

.conhead {
  margin-top: 1.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.conlede {
  margin-top: 0.75rem;
  max-width: 62ch;
  color: var(--text-2);
}

.crumbs { margin-top: 1.25rem; }
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-3);
}
.crumbs__item + .crumbs__item::before { content: "/"; margin-right: 0.5rem; color: var(--line-strong); }

.attention {
  margin-top: 1.25rem;
  color: var(--text-2);
}

/* ---------- cards ---------- */

.card {
  margin-top: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), var(--shadow-1);
}
.card--lead { border-left: 4px solid var(--accent); }

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1.125rem;
  font-weight: 680;
  letter-spacing: -0.005em;
}
.card__lede { margin-top: 0.5rem; color: var(--text-2); max-width: 62ch; }
.card__foot { margin-top: 1rem; font-size: 0.875rem; color: var(--text-3); max-width: 66ch; }

.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.rowcard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
  background: var(--row-alt);
}
.rowcard__body { min-width: 0; }
.rowcard__title { font-weight: 650; }
.rowcard__meta { margin-top: 0.125rem; font-size: 0.875rem; color: var(--text-2); }
.rowcard__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.inline { display: inline; margin: 0; }

/* ---------- club cards ---------- */

.clubgrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .clubgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

.club {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.875rem;
  padding: 1rem;
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
  background: var(--row-alt);
}

/* The monogram takes the club's own accent through the .a-* classes the public
   pages already use, so a side reads the same colour in both places. A stored
   hex never reaches a style attribute. */
.club__mono {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, currentColor var(--wash-strength), transparent);
  font-weight: 750;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}
.club__body { min-width: 0; }
.club__name { font-size: 1.0625rem; font-weight: 680; color: var(--text-1); }
.club__meta { margin-top: 0.125rem; font-size: 0.875rem; color: var(--text-2); }
.club__note { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--text-3); }
.club__flag { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 620; color: var(--warn); }
.club__links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-subtle);
  font-size: 0.875rem;
  font-weight: 620;
}
.club__links a { color: var(--accent); }

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

/* Wide content scrolls inside its own box; the page itself never scrolls
   sideways on a phone. */
.tablewrap { overflow-x: auto; }

.datatable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.datatable th, .datatable td {
  padding: 0.75rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: top;
}
.datatable thead th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.datatable tbody tr:last-child th,
.datatable tbody tr:last-child td { border-bottom: 0; }
.cell__sub { display: block; font-size: 0.8125rem; color: var(--text-3); font-weight: 400; }

.pill--good { color: var(--positive); }
.pill--warn { color: var(--warn); }

/* ---------- forms ---------- */

.form { margin-top: 1.5rem; max-width: 44rem; }

.fieldset {
  margin-top: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-lg);
  background: var(--card);
}
.fieldset__legend {
  padding-inline: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-1);
}

.field { margin-top: 1.125rem; }
.field:first-of-type { margin-top: 0.5rem; }

.fieldrow { display: grid; gap: 1.125rem; }
@media (min-width: 640px) {
  .fieldrow { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .fieldrow .field { margin-top: 0; }
}

.field__label {
  display: block;
  font-weight: 650;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}
.field__opt { font-weight: 400; color: var(--text-3); font-size: 0.8125rem; }
.field__hint {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  max-width: 62ch;
}

.field__input {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--text-1);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming the page on focus. */
}
.field__input--short { max-width: 14rem; }
.field__input--area { min-height: 7rem; resize: vertical; }
.field__input::placeholder { color: var(--text-3); }

.field__err {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 620;
  color: var(--negative);
}
/* The error is announced by aria-invalid and read from the message beside the
   box; the border is the third signal, never the only one. */
.field--bad .field__input { border-color: var(--negative); }

.check { display: flex; align-items: flex-start; gap: 0.625rem; font-weight: 620; }
.check input { width: 20px; height: 20px; margin-top: 0.125rem; flex: none; }

.formerr {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--negative);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--negative) 8%, transparent);
}
.formerr__title { font-weight: 700; }
.formerr__list { margin: 0.5rem 0 0 1.125rem; }
.formerr__list a { color: var(--negative); font-weight: 620; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
}

.photo img { border-radius: var(--r-md); }

/* ---------- me, and the player code ---------- */

.me { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.me__avatar { flex: none; margin: 0; }
.me__avatar img { border-radius: 50%; object-fit: cover; }
.me__initials {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-ink);
  font-weight: 750;
  font-size: 1.25rem;
}
.me__body { min-width: 0; flex: 1 1 18rem; }
.me__name { font-size: 1.125rem; font-weight: 680; }
.me__meta { margin-top: 0.25rem; font-size: 0.9375rem; color: var(--text-2); }

.code {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}
.code__label { display: block; font-weight: 650; font-size: 0.875rem; }
.code__hint { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--text-2); max-width: 52ch; }
.code__row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }
.code__value {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--text-1);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  width: 9ch;
}

/* ---------- sign in ---------- */

.signin {
  width: min(100%, 30rem);
  margin: 3rem auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--ring), var(--shadow-2);
  text-align: center;
}
.signin__title { font-size: clamp(1.375rem, 4vw, 1.75rem); font-weight: 720; letter-spacing: -0.015em; }
.signin__lede { margin-top: 0.75rem; color: var(--text-2); }
.signin__reason {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--negative);
  color: var(--negative);
  font-weight: 620;
}
.signin__form { margin-top: 1.5rem; }
.signin__note { margin-top: 1rem; font-size: 0.8125rem; color: var(--text-3); }

/* =====================================================================
   Clubs, squads and members.

   The squad page is the busiest thing in the console — a row can carry a name,
   a role chip, a shirt number, a permission select and two destructive actions
   — so it is laid out as a grid that collapses to one column rather than as a
   table that scrolls sideways. A club secretary approving a request on a phone
   should not have to pan.

   No new colours: everything below reads from the tokens at the top of this
   file, and a club's own colour arrives through the .a-* accent classes the
   public pages already use.
   ===================================================================== */

.conhead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.conhead__row .conhead { margin-top: 1.5rem; }

.club__name a { color: inherit; text-decoration: none; }
.club__name a:hover { text-decoration: underline; }
.club__quiet { color: var(--text-3); font-weight: 500; }

/* ---------- one club's own navigation ---------- */

/* Distinct from .connav: that says where you are in the console, this says
   where you are inside one club. Two levels, so the second is quieter. */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 1rem;
}
.subnav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 620;
  color: var(--text-2);
  text-decoration: none;
}
.subnav__link:hover { background: var(--row-alt); color: var(--text-1); }
.subnav__link.is-current {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
}

/* ---------- what your role does not let you do ----------
   Shown wherever a control is absent. It is a note rather than a warning: not
   being an administrator is a normal state, not a failure. */

.whocan {
  margin-top: 1.25rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--line-subtle);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--row-alt);
  color: var(--text-2);
  font-size: 0.9375rem;
  max-width: 66ch;
}

/* ---------- the last-administrator explanation ----------
   The one refusal the store makes on the console's behalf. It is not an error
   anybody made, so it is not painted like one: warn rather than negative, and
   it always carries the way out. */

.explain {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  max-width: 66ch;
}
.explain__title { font-weight: 700; }
.explain__text { margin-top: 0.5rem; color: var(--text-1); }
.explain__text a { color: var(--accent-ink); font-weight: 620; }

/* ---------- read-only values ---------- */

.factlist {
  margin-top: 1.25rem;
  display: grid;
  gap: 0;
  max-width: 44rem;
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
}
.factlist__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--line-subtle);
}
.factlist__row:last-child { border-bottom: 0; }
.factlist dt { font-size: 0.8125rem; font-weight: 700; color: var(--text-3); }
.factlist dd { margin: 0; }
@media (min-width: 640px) {
  .factlist__row { grid-template-columns: 12rem 1fr; gap: 1rem; align-items: baseline; }
}

/* ---------- the club colour picker ----------
   Radios, not a colour input: the palette is fixed so that whatever a club
   picks stays legible in both schemes, and a radio group works with a keyboard,
   a screen reader and no script. The swatch takes its colour from the .a-*
   class on the item, which is the same class the club's pages will carry — so
   what is shown here is what will be used. */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.swatch { margin: 0; }
.swatch__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.25rem 0.875rem 0.25rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--card);
  font-size: 0.875rem;
  font-weight: 620;
  cursor: pointer;
}
.swatch__chip {
  width: 22px;
  height: 22px;
  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);
  flex: none;
}
/* Checked is a ring and a heavier label, never colour alone: two of these
   swatches are close enough in hue that a tint would not read. */
.swatch__input:checked + .swatch__label {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-ink);
}
.swatch__input:focus-visible + .swatch__label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fieldset--bad { border-color: var(--negative); }

/* ---------- finding a player ---------- */

.findform { margin-top: 1rem; }
.findform__row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.findform__row .field__input { flex: 1 1 12rem; }

/* The code is a known eight characters, so the box is sized to it rather than
   stretched across the card: a field the width of its content says what belongs
   in it before the hint is read. */
.findform__row .field__input--code {
  flex: 0 0 auto;
  width: 12ch;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* The confirmation step. It is deliberately the largest thing on the page while
   it is there: the whole point is that somebody looks at it before pressing. */
.lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1.125rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.lookup__avatar { flex: none; margin: 0; }
.lookup__body { flex: 1 1 16rem; min-width: 0; }
.lookup__code {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.lookup__name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.lookup__meta { margin-top: 0.25rem; color: var(--text-2); font-size: 0.9375rem; }
.lookup__meta a { color: var(--accent-ink); font-weight: 620; }
.lookup__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.lookup__note { margin-top: 0.625rem; font-size: 0.8125rem; color: var(--text-3); max-width: 52ch; }
.lookup__already {
  margin-top: 0.875rem;
  font-weight: 620;
  color: var(--warn);
}

/* Search by name is the secondary path, so it stays folded away until it is
   wanted — and opens itself once it has an answer to show. */
.byname { margin-top: 1.5rem; }
.byname__summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 620;
  color: var(--accent-ink);
  cursor: pointer;
}
.byname__body { margin-top: 0.5rem; }
.byname__none { margin-top: 1rem; color: var(--text-2); font-size: 0.9375rem; }
.rowcard__avatar { flex: none; margin: 0; }

/* ---------- the squad ---------- */

.card__count {
  margin-left: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.card--quiet { background: var(--row-alt); box-shadow: var(--ring); }
.card--danger { border-left: 4px solid var(--negative); }

.squadlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }

/* One column on a phone, four on a laptop. A table would have been fewer rules
   and would have had to scroll sideways to fit a select and two buttons, which
   is exactly the thing this page is used one-handed to avoid. */
.member {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
  background: var(--row-alt);
  align-items: center;
}
.member--me { border-color: var(--accent); }
.member__avatar { grid-row: span 1; flex: none; margin: 0; }
.member__who { min-width: 0; }
.member__name { font-weight: 650; overflow-wrap: anywhere; }
.member__name a { color: inherit; }
.member__you {
  margin-left: 0.375rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
  font-size: 0.6875rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.member__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin-top: 0.3125rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.member__no { font-weight: 700; color: var(--text-2); }
.member__code { letter-spacing: 0.06em; }
.member__perm, .member__actions { grid-column: 1 / -1; }
.member__permlabel { font-size: 0.875rem; color: var(--text-2); }
.member__lock {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--warn);
  max-width: 44ch;
}
.member__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

@media (min-width: 900px) {
  .member {
    grid-template-columns: auto minmax(12rem, 1fr) auto auto;
    align-items: center;
  }
  .member__perm, .member__actions { grid-column: auto; }
  .member__actions { justify-content: flex-end; }
}

.roleform { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; margin: 0; }
.roleform__select { width: auto; min-width: 10rem; }
.roleform__save { min-height: 40px; }

.squadlist--past .member { background: transparent; }
.squadlist--past .member__name { color: var(--text-2); }

/* What each rung of the ladder actually allows, spelled out where the choice is
   made rather than in help somewhere else. */
.rolekey { display: grid; gap: 0.375rem; margin-top: 0.5rem; }
.rolekey__row { display: grid; grid-template-columns: 1fr; gap: 0.125rem; }
.rolekey dt { font-weight: 700; color: var(--text-2); }
.rolekey dd { margin: 0; }
@media (min-width: 640px) {
  .rolekey__row { grid-template-columns: 9rem 1fr; gap: 0.75rem; align-items: baseline; }
}
.card__foot-title { font-weight: 700; color: var(--text-2); }
.card__foot-note { margin-top: 0.75rem; }

/* ---------- confirming something destructive ----------
   A disclosure rather than a dialog: the explanation is on the page, it works
   with no script, and the button that does the thing is never the first target
   a thumb finds. The script adds a second confirm on top where it can. */

.confirm { display: inline-block; }
.confirm__summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  font-weight: 620;
  color: var(--text-2);
  cursor: pointer;
}
.confirm__summary:hover { background: var(--row-alt); color: var(--text-1); }
.confirm__summary--danger { color: var(--negative); }
.confirm__summary--danger:hover { background: color-mix(in srgb, var(--negative) 10%, transparent); }
.confirm[open] .confirm__summary { color: var(--text-1); }
.confirm__body {
  margin-top: 0.5rem;
  padding: 1rem;
  max-width: 46ch;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
}
.confirm__text { margin-bottom: 0.75rem; font-size: 0.9375rem; color: var(--text-2); }
.confirm__body form { margin: 0; }

/* ---------- one member ---------- */

.memberhead { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.5rem; }
.memberhead__avatar { flex: none; margin: 0; }
.memberhead__body { min-width: 0; flex: 1 1 18rem; }
.memberhead .conhead { margin-top: 0; }
.memberhead .conlede { margin-top: 0.25rem; font-size: 0.9375rem; }

/* ================================================================== fixtures

   The console's match pages: the fixture list, the rules form and the page a
   match is run from. Everything here is built from the same tokens as the rest
   of the site, so it follows the light and dark schemes without a second
   palette, and every control keeps the 44px target the rest of the console
   uses — these pages are worked through on a phone in a clubhouse as often as
   on a laptop.                                                              */

/* The club filter above the lists: a label, a select and a submit on one line,
   because it is a GET and has to work without a script. */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1.25rem;
}
.filter .field__label { margin-bottom: 0; }

.rowcard__quiet { font-size: 0.8125rem; color: var(--text-3); }

/* ---------- empty states ---------- */

/* An empty state is a paragraph that leads somewhere, so it is sized like one
   rather than like a table cell. */
.empty__title { font-weight: 680; color: var(--text-1); }
.empty__text { margin-top: 0.5rem; color: var(--text-2); max-width: 62ch; }

/* ---------- rule presets ---------- */

.presets {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .presets { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

/* A preset is a link that reloads the form with those values in it, so it is
   drawn as a choice rather than as a button that submits something. */
.preset {
  display: grid;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
  text-decoration: none;
  color: var(--text-1);
}
.preset:hover { border-color: var(--accent); }
.preset.is-current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.preset__name { font-weight: 680; }
.preset__note { font-size: 0.8125rem; color: var(--text-2); }

/* ---------- the rules a fixture was opened under ---------- */

.rules {
  display: grid;
  gap: 0.5rem 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .rules { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
.rules__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.375rem;
  border-bottom: 1px solid var(--line-subtle);
}
.rules__term { color: var(--text-2); font-size: 0.9375rem; }
.rules__value { font-weight: 650; text-align: right; }
.rules__line { font-size: 0.8125rem; font-weight: 620; color: var(--text-3); }

/* ---------- innings so far ---------- */

.innslist { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.375rem; }
.innsline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--row-alt);
}
.innsline__label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.innsline__team { font-weight: 620; }
.innsline__score { margin-left: auto; font-weight: 780; }
.innsline__overs { font-size: 0.8125rem; color: var(--text-3); }

/* ---------- team sheets ---------- */

/* The selection table. The three state columns are radios rather than
   checkboxes because playing, substitute and not picked cannot be true at
   once, and a pair of checkboxes would let somebody say that they are. */
.teamsheet th[scope="row"] { min-width: 11rem; font-weight: 620; }
.teamsheet td { text-align: center; vertical-align: middle; }
.teamsheet thead th:not(:first-child) { text-align: center; }

/* The whole cell is the target, not just the 20px dot. */
.pick {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0 auto;
  cursor: pointer;
}
.pick input { width: 20px; height: 20px; }

.field__input--num { width: 5rem; min-height: 40px; padding-inline: 0.5rem; }
.field__input--pick { width: 11rem; min-height: 40px; padding-inline: 0.5rem; }

.radios { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.radios .check { font-weight: 600; }

/* A member row on a laptop gives the name the room, not the controls: the
   permission column is capped so a long explanation under a select cannot
   squeeze the thing the row is actually about. */
@media (min-width: 900px) {
  .member__perm { max-width: 22rem; }
  .member__lock { max-width: 20rem; }
}

/* The disclosure holding a destructive action opens inside a flex row, so it
   is bounded by the row rather than by its own reading width on a phone. */
.confirm { max-width: 100%; }
.confirm__body { max-width: min(46ch, 100%); }

/* A team sheet is eight columns wide, which is a table on a laptop and a
   sideways scroll on a phone — and picking a side is exactly what somebody
   does on a phone, in a car park, twenty minutes before the start. Below the
   breakpoint each player becomes a stacked card with the column name beside
   each control. The controls keep their own labels either way: every radio
   carries a sentence for a screen reader ("Ada Lovelace is playing"), so the
   column headings are only ever a visual convenience and nothing is lost when
   the table stops being one. */
@media (max-width: 719px) {
  .teamsheet, .teamsheet tbody, .teamsheet tr, .teamsheet th, .teamsheet td { display: block; }
  .teamsheet thead { display: none; }
  .teamsheet tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line-subtle);
    border-radius: var(--r-md);
    background: var(--row-alt);
  }
  .teamsheet th[scope="row"] {
    min-width: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-subtle);
    font-weight: 680;
  }
  .teamsheet td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 0;
    text-align: left;
  }
  .teamsheet td::before {
    content: attr(data-label);
    font-size: 0.875rem;
    color: var(--text-2);
  }
  .teamsheet .pick { margin: 0; }
  .teamsheet .field__input--num,
  .teamsheet .field__input--pick { width: 9rem; }
}

/* --------------------------------------------------- claiming a Crickly ID */

/* The ID shown inline, in the middle of a sentence. Tabular figures so a
   column of them lines up, and a slightly cooler ground so it reads as a
   quoted value rather than as emphasis. */
.cid {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.9375em;
  letter-spacing: 0.01em;
  padding: 0.1em 0.4em;
  border-radius: var(--r-xs);
  background: var(--row-alt);
  box-shadow: var(--ring);
  white-space: nowrap;
}

/* The two doors offered at a first sign-in. Side by side where there is room,
   stacked where there is not — never narrower than a readable measure. */
.fork {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.fork__card {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), var(--shadow-1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.fork__title { font-size: 1.125rem; font-weight: 650; }
.fork__body { color: var(--text-2); max-width: 52ch; flex: 1; }

.consub {
  margin-top: 2rem;
  font-size: 1.0625rem;
  font-weight: 650;
}

/* A queue of requests: who is asking, who they say they are, and the two
   answers. */
.claims { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.claims__item {
  padding: 0.875rem 1rem;
  background: var(--raised);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
}
.claims__who { font-weight: 600; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.claims__mail { font-weight: 400; font-size: 0.875rem; color: var(--text-2); }
.claims__state { margin-top: 0.25rem; font-size: 0.875rem; color: var(--text-2); }
.claims__note {
  margin-top: 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--line-subtle);
  color: var(--text-2);
  max-width: 60ch;
}
.claims__act { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* A form kept out of the way until it is wanted. */
.reveal { margin-top: 1rem; }
.reveal__summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 0;
  border-radius: var(--r-xs);
}
.reveal__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--small { padding: 0.375rem 0.75rem; font-size: 0.875rem; }
