/* League Manager design system.
   One stylesheet for public site, console and scoring app. Mobile-first;
   the public surfaces are the ones pilot leagues see, so they get the care.

   The look (Oct 2026, the owner's choice): light grey pages, white cards, a
   bold green menu bar under a white bar that carries the logo in its own
   colours; red for live, blue for links and results, amber for what waits. */

/* Figtree, served from the site itself: the scoring app works offline, and
   the site's security policy loads fonts from nowhere else (OFL, see fonts/). */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pitch-900: #053d2a;
  --pitch-800: #065f42;
  --pitch-700: #087a54;
  --pitch-600: #0a8a5f;
  --pitch-500: #1fa673;
  --pitch-100: #e6f4ee;
  --pitch-50: #f2faf6;

  --ink-900: #1c2421;
  --ink-700: #3d4844;
  --ink-500: #66716c;
  --ink-400: #8a948f;
  --ink-200: #d5dcd8;
  --ink-100: #e0e5e2;

  --paper: #ffffff;
  --paper-2: #f5f7f6;
  --canvas: #eef1ef;

  --ball: #d9332f;
  --ball-soft: #fdecec;
  --amber: #9a5b00;
  --amber-soft: #fff4de;
  --sky: #1f63c6;
  --sky-soft: #e8f0fb;
  --six: #6f35b8;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 36, 33, 0.05);
  --shadow: 0 4px 14px rgba(28, 36, 33, 0.08);
  --shadow-lg: 0 16px 40px rgba(28, 36, 33, 0.14);

  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* How wide a page may grow, and the space kept at the screen's edges.
     The public site stops at a width that still reads well on a big monitor;
     the console and club portal (.app-wide) are working screens of lists and
     boards, so they use the screen up to a very wide one. */
  --maxw: 1440px;
  --gutter: clamp(0.75rem, 2vw, 1.5rem);
}
.app-wide { --maxw: 1920px; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 0.5rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: 800; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 0.85rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-500); }
.tiny { font-size: 0.8rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
/* Read by a screen reader, not shown. For the label on a control whose purpose
   is obvious to someone who can see the page and to nobody who cannot. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- header / nav ---------- */

/* A white bar with the logo in its own colours and the person's links, over
   a green bar with the section's menu. */
.topbar { background: var(--paper); color: var(--ink-900); border-bottom: 1px solid var(--ink-100); }
.topbar a { color: var(--ink-700); }
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.55rem var(--gutter);
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; letter-spacing: -0.01em; font-size: 1rem; color: var(--ink-900); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--pitch-700); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: 0.94rem; font-weight: 600; }
.nav a { padding: 0.2rem 0; }
.nav a:hover { color: var(--pitch-700); text-decoration: none; }
.nav-signin { padding: 0.45rem 1rem !important; border-radius: 999px; background: var(--pitch-700); color: #fff !important; }
.nav-signin:hover { background: var(--pitch-800); color: #fff !important; }

.topbar-search { max-width: 520px; min-width: 180px; }
.topbar-search input {
  width: 100%; padding: 0.5rem 1rem 0.5rem 2.3rem; border-radius: 999px; border: 1px solid var(--ink-100); background: var(--paper-2) no-repeat 0.85rem 50% / 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366716c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  font-size: 0.92rem;
}
.topbar-search input:focus { background-color: var(--paper); }

.menubar { background: var(--pitch-700); }
.menubar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none;
}
.menubar a {
  color: #e3f5ec; padding: 0.75rem 0.85rem 0.6rem; border-bottom: 3px solid transparent;
  font-size: 0.95rem; font-weight: 700; white-space: nowrap;
}
.menubar a:hover { color: #fff; text-decoration: none; border-bottom-color: rgba(255,255,255,0.45); }
.menubar a.active { color: #fff; border-bottom-color: #fff; }

.subbar { background: var(--pitch-900); color: rgba(255,255,255,0.85); font-size: 0.85rem; }
.subbar .wrap { display: flex; gap: 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; flex-wrap: wrap; }
.subbar a { color: rgba(255,255,255,0.85); }

/* ---------- cards & surfaces ---------- */

main { padding: 1.5rem 0 4rem; }
.card {
  background: var(--paper); border: 1px solid var(--ink-100);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.card-lg { padding: 1.5rem; border-radius: var(--radius-lg); }
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--ink-100); background: var(--paper);
}
.card-head h2 { font-size: 1.08rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1.1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: 0.15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 800; color: var(--pitch-700); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.16rem 0.55rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--ink-100); color: var(--ink-700); white-space: nowrap;
}
/* Live: solid red, the way a score strip says it. */
.badge-live { background: var(--ball); color: #fff; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; animation: pulse 1.6s infinite;
}
.badge-done { background: var(--pitch-100); color: var(--pitch-700); }
.badge-soon { background: var(--sky-soft); color: var(--sky); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  background: var(--pitch-700); color: #fff; border: 1px solid var(--pitch-700);
  font: inherit; font-weight: 700; font-size: 0.94rem; cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--pitch-800); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--paper); color: var(--ink-900); border-color: var(--ink-200); }
.btn-secondary:hover { background: var(--paper-2); border-color: var(--ink-400); }
.btn-danger { background: var(--ball); border-color: var(--ball); }
.btn-danger:hover { background: #8f2c23; }
.btn-sm { padding: 0.32rem 0.65rem; font-size: 0.84rem; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

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

label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.25rem; color: var(--ink-700); }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"],
select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; font: inherit; font-size: 0.95rem;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink-900);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pitch-500); box-shadow: 0 0 0 3px var(--pitch-100);
}
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 0.9rem; }
.field-hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.25rem; }
.field-row { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
fieldset { border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 0.4rem; font-size: 0.9rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.check input { width: auto; }

/* ---------- alerts ---------- */

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.92rem; border: 1px solid; }
.alert-error { background: var(--ball-soft); border-color: #f2c9c5; color: #8f2c23; }
.alert-ok { background: var(--pitch-100); border-color: #bfe0cd; color: var(--pitch-800); }
.alert-info { background: var(--sky-soft); border-color: #cfe3ef; color: var(--sky); }
.alert-warn { background: var(--amber-soft); border-color: #f0dfbc; color: var(--amber); }

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

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--ink-100); }
th {
  font-size: 0.8rem; color: var(--ink-700); font-weight: 700; background: var(--paper-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--pitch-50); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-plain tbody tr:hover { background: transparent; }

/* ---------- scorecard ---------- */

.scorecard th { background: var(--paper-2); }
.scorecard .dismissal { color: var(--ink-500); font-size: 0.84rem; }
.scorecard .striker::after { content: "*"; color: var(--ball); font-weight: 700; }
.innings-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.75rem 1.1rem; background: var(--pitch-700); color: #fff; flex-wrap: wrap;
}
.innings-head h3 { margin: 0; font-size: 1rem; }
.innings-score { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.scoreline { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.scoreline .runs { font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.scoreline .overs { color: var(--ink-500); font-variant-numeric: tabular-nums; }

/* over timeline */
.over-strip { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.ball-chip {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; background: var(--ink-100); color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.ball-chip.dot { background: var(--ink-100); color: var(--ink-500); }
.ball-chip.runs { background: var(--canvas); color: var(--ink-900); }
.ball-chip.four { background: var(--sky); color: #fff; }
.ball-chip.six { background: var(--six); color: #fff; }
.ball-chip.wicket { background: var(--ball); color: #fff; }
.ball-chip.extra { background: var(--amber-soft); color: var(--amber); font-size: 0.7rem; }
.scorecard .striker::after { color: var(--ball); }
.over-sep { width: 1px; height: 20px; background: var(--ink-200); margin: 0 0.15rem; }

/* ---------- match list ---------- */

.match-card {
  display: block; background: var(--paper); border: 1px solid var(--ink-100);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.match-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--pitch-500); }
.match-card .teams { display: grid; gap: 0.3rem; margin: 0.6rem 0; }
.match-team { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.match-team .name { font-weight: 800; color: var(--ink-900); }
.match-team.lost .name, .match-team.lost .score { color: var(--ink-500); font-weight: 600; }
.match-team .score { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink-900); }
.match-result { font-size: 0.88rem; color: var(--sky); font-weight: 700; }

/* ---------- stat tiles ---------- */

.tile { background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 0.9rem 1rem; }
.tile .label { font-size: 0.82rem; color: var(--ink-700); font-weight: 700; }
.tile .value { font-size: 1.85rem; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.tile .sub { font-size: 0.82rem; color: var(--ink-500); }

/* ---------- the home page's matches strip ---------- */

/* Across the top of the public home: every live, just-finished and next
   match as a small card in one row that scrolls sideways. */
.home-strip { background: var(--paper); border-bottom: 1px solid var(--ink-100); padding: 0.9rem 0 1rem; }
.home-strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.home-strip-head h1 { font-size: 1.15rem; margin: 0; }
.home-stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.88rem; color: var(--ink-500); }
.home-stats strong { color: var(--ink-900); font-weight: 800; }
.strip { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; scroll-snap-type: x proximity; }
.strip-card {
  flex: 0 0 250px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.35rem;
  border: 1px solid var(--ink-100); border-radius: 12px; padding: 0.7rem 0.85rem; background: var(--paper); color: var(--ink-900);
}
.strip-card:hover { border-color: var(--pitch-500); text-decoration: none; }
.strip-card .series { font-size: 0.76rem; font-weight: 600; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-card .side { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.strip-card .side.lost { color: var(--ink-500); font-weight: 600; }
.strip-card .status { font-size: 0.82rem; font-weight: 700; color: var(--amber); }
.strip-card .status.live { color: var(--ball); }
.strip-card .status.done { color: var(--sky); }

.strip-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.strip-filters a { font-size: 0.82rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--ink-100); color: var(--ink-900); }
.strip-filters a:hover { border-color: var(--ink-400); text-decoration: none; }
.strip-filters a.active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }

/* The home page under the strip: the main column, and the tables beside it. */
.home-body { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; padding-top: 1.25rem; padding-bottom: 2.5rem; }
.home-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.home-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }

.featured-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 1.1rem; background: var(--pitch-100); border-bottom: 1px solid #d3eadf; font-size: 0.88rem; font-weight: 700; color: var(--pitch-800); }
.featured-body { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1.1rem; }
.featured-score { flex: 1 1 300px; display: flex; flex-direction: column; gap: 0.55rem; }
.featured-players { flex: 1 1 300px; min-width: 0; }
.featured-players th, .featured-players td { padding: 0.4rem 0.45rem; }
.featured-side { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.featured-side .name { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; font-weight: 800; }
.featured-side .score { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.featured-side .ov { font-size: 0.95rem; font-weight: 600; color: var(--ink-500); }
.featured-side.waiting .name { color: var(--ink-700); font-weight: 600; }
.featured-side.waiting .score { font-size: 0.95rem; font-weight: 600; color: var(--ink-500); }
.featured-line { font-size: 0.92rem; font-weight: 700; color: var(--ball); }
.featured-links { display: flex; gap: 1.25rem; flex-wrap: wrap; padding: 0.7rem 1.1rem; border-top: 1px solid var(--ink-100); font-size: 0.9rem; font-weight: 700; }
.team-mark { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2rem; padding: 0 0.3rem; border-radius: 8px; background: var(--pitch-700); color: #fff; font-size: 0.72rem; font-weight: 800; }

/* A row in a card that opens its item: a result, a fixture, a leader. */
.list-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--ink-100); color: var(--ink-900); }
.card-head + .list-row, .segmented + .list-row { border-top: 0; }
.list-row:hover { background: var(--paper-2); text-decoration: none; }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.list-row-result { font-size: 0.88rem; font-weight: 700; color: var(--sky); text-align: right; }

/* Two or three choices side by side, the one shown filled. */
.segmented { display: inline-flex; margin: 0.75rem 1.1rem 0.25rem; border: 1px solid var(--ink-200); border-radius: 8px; overflow: hidden; font-size: 0.84rem; font-weight: 700; }
.segmented a { padding: 0.35rem 0.85rem; color: var(--ink-900); }
.segmented a + a { border-left: 1px solid var(--ink-200); }
.segmented a.active { background: var(--pitch-700); color: #fff; }
.segmented a:hover { text-decoration: none; }

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

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-500); }
.empty .icon { font-size: 2rem; opacity: 0.5; display: block; margin-bottom: 0.5rem; }
.empty h3 { color: var(--ink-700); }

/* Dialog: a short form used now and then, kept off the page until asked for. */
.modal {
  border: 0; border-radius: var(--radius-lg); padding: 1.5rem;
  width: min(440px, calc(100vw - 2rem)); background: var(--paper); color: var(--ink-900);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(28, 36, 33, 0.5); }
.modal h2 { margin: 0 0 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

/* ---------- footer ---------- */

.footer { background: var(--pitch-900); padding: 1.5rem 0; color: #cfe9dd; font-size: 0.88rem; margin-top: 1rem; }
.footer a { color: #fff; }
.footer .muted { color: #cfe9dd; }
.copyright { margin: 1.5rem 0 1rem; text-align: center; font-size: 0.8rem; color: var(--ink-500); }
.auth-shell .copyright { margin: 1rem 0 0; color: #cfe9dd; }
.footer .copyright { margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.15); color: #cfe9dd; }

/* ---------- console shell ---------- */

/* minmax(0, 1fr), not 1fr: a wide kanban board must scroll inside its own box
   rather than stretch the column and push the page header off-screen. */
.console-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.console-layout > * { min-width: 0; }
.side-nav { position: sticky; top: 1rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 0.4rem; }
.side-nav a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 8px;
  color: var(--ink-900); font-size: 0.93rem; font-weight: 600;
}
.side-nav a:hover { background: var(--paper-2); text-decoration: none; }
.side-nav a.active { background: var(--pitch-100); color: var(--pitch-800); font-weight: 800; }
.side-nav .group { margin-top: 0.75rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); font-weight: 800; padding: 0 0.7rem 0.3rem; }
.side-nav .group:first-child { margin-top: 0.3rem; }
@media (max-width: 800px) {
  .console-layout { grid-template-columns: minmax(0, 1fr); }
  .side-nav { position: static; }
  .side-nav nav { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.35rem; }
  .side-nav .group { display: none; }
  .side-nav a { white-space: nowrap; }
}

/* ---------- auth pages ---------- */

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background: var(--pitch-700); }
.auth-card { width: 100%; max-width: 400px; background: var(--paper); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-lg); }
.auth-card .brand { color: var(--pitch-700); justify-content: center; margin-bottom: 1.25rem; font-size: 1.15rem; }
.auth-card .brand-mark { background: var(--pitch-700); color: #fff; box-shadow: none; }

@media (max-width: 560px) {
  h1 { font-size: 1.55rem; }
  .card { padding: 0.9rem; }
}

@media print {
  .topbar, .menubar, .subbar, .footer, .btn { display: none; }
  body { background: #fff; }
}

/* ---------- match page hero ---------- */

.match-hero {
  background: var(--pitch-800);
  color: #fff; padding: 1.5rem 0 1.75rem;
}
.match-sides { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0; }
.match-sides .side { flex: 1; }
.match-sides .side:last-child { text-align: right; }
.match-sides .club { font-size: 1.05rem; font-weight: 650; }
.match-sides .score { font-size: 2.1rem; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.match-sides .ov { font-size: 0.82rem; opacity: 0.75; }
.match-sides .vs { opacity: 0.5; font-size: 0.85rem; }
.match-line { font-size: 1rem; font-weight: 700; color: #d5efe2; margin-top: 0.5rem; }

@media (max-width: 480px) {
  .match-sides .score { font-size: 1.6rem; }
  .match-sides .club { font-size: 0.95rem; }
}

/* The paper scorecard entry: dense rows, narrow number boxes. */
.scorecard-entry td { padding: 0.3rem 0.35rem; vertical-align: middle; }
.scorecard-entry select { min-width: 9rem; padding: 0.3rem 0.4rem; font-size: 0.88rem; }
.scorecard-entry .num-in { width: 4.2rem; padding: 0.3rem 0.4rem; font-size: 0.9rem; text-align: right; }
.scorecard-entry .inline-num { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.6rem; }
.scorecard-entry .extras-row td, .scorecard-entry .total-row td { background: var(--paper-2); }
.fow-entry { padding: 0.75rem 1rem 0.9rem; border-top: 1px solid var(--ink-100); }
.fow-entry .field-hint { margin: 0.15rem 0 0.5rem; }
.fow-table th[scope="row"] { font-size: 0.82rem; font-weight: 600; white-space: nowrap; padding-right: 0.6rem; }
.fow-table select { min-width: 7.5rem; }
.scorecard-key { padding: 0.4rem 0.75rem 0.6rem; }
/* On a phone each scorecard row becomes a small form of its own, every box
   under its name, instead of a grid wider than the screen whose headings
   scroll out of sight. */
@media (max-width: 640px) {
  .scorecard-entry:not(.fow-table) thead { display: none; }
  .scorecard-entry:not(.fow-table) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.6rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--ink-100); }
  .scorecard-entry:not(.fow-table) td { display: block; padding: 0; border: 0; }
  .scorecard-entry:not(.fow-table) td[colspan] { grid-column: 1 / -1; }
  .scorecard-entry td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; color: var(--ink-500); margin-bottom: 0.1rem; }
  .scorecard-entry:not(.fow-table) select, .scorecard-entry:not(.fow-table) .num-in { width: 100%; min-width: 0; text-align: left; }
}
.btn.needs-result { background: var(--amber); border-color: var(--amber); }
.modal-wide { width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }

/* The view switch, right of every page title: Kanban (o) List. */
.view-switch { display: inline-flex; align-items: center; gap: 0.55rem; user-select: none; font-size: 0.88rem; }
.view-switch a { text-decoration: none; }
.view-switch-track { position: relative; display: inline-block; width: 50px; height: 28px; border-radius: 14px; background: var(--ink-200); transition: background 0.2s ease; flex: none; box-shadow: inset 0 1px 2px rgba(0,0,0,0.08); }
.view-switch-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s ease; }
.view-switch.is-list .view-switch-track { background: var(--pitch-600); }
.view-switch.is-list .view-switch-knob { transform: translateX(22px); }
.view-switch-track:hover { filter: brightness(0.96); }
.view-switch-track:focus-visible { outline: 2px solid var(--pitch-500); outline-offset: 2px; }
.view-switch-label { color: var(--ink-400); transition: color 0.2s ease; }
a.view-switch-label:hover { color: var(--ink-700); }
.view-switch-label.on { color: var(--ink-900); font-weight: 650; }
/* The page header: the title shrinks, the controls stay at the right. */
.page-head.row-between { align-items: flex-start; flex-wrap: nowrap; }
.page-head.row-between > :first-child { flex: 1 1 auto; min-width: 0; }
.page-head.row-between > .row, .page-head.row-between > .view-switch { flex: none; margin-left: auto; margin-top: 0.45rem; }
/* On a phone the title gets the full width and the switch and create button
   drop to their own line, still at the right. */
@media (max-width: 640px) {
  .page-head.row-between { flex-wrap: wrap; }
  .page-head.row-between > :first-child { flex-basis: 100%; }
  .page-head.row-between > .row { flex-wrap: wrap; justify-content: flex-end; }
}

/* The kanban board: a column per state, cards in each. */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; align-items: start; }
.kanban-col { background: var(--paper-2); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 0.75rem; min-height: 8rem; }
.kanban-col.attention { border-color: var(--amber); }
.kanban-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.kanban-head h2 { font-size: 0.95rem; margin: 0; }
.kanban-card { position: relative; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--radius-sm); padding: 0.75rem; box-shadow: var(--shadow-sm); margin-bottom: 0.6rem; }
/* The card opens its item through its title link, stretched over the whole
   card: a real link, so it can be opened in a new tab and reached by
   keyboard. The controls inside the card sit above it and stay their own. */
.kanban-card .title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kanban-card .actions a, .kanban-card .actions button, .kanban-card form, .kanban-card .meta a,
.kanban-card details, .kanban-card select, .kanban-card input { position: relative; z-index: 1; }
.kanban-card:focus-within { box-shadow: var(--shadow); }
.kanban-card:last-child { margin-bottom: 0; }
.kanban-card .title { font-weight: 650; }
.kanban-card .meta { font-size: 0.82rem; color: var(--ink-500); margin-top: 0.2rem; }
.kanban-card .actions { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.85rem; }
.kanban-card form:not(.move-form) { display: inline; }
.kanban-card details { width: 100%; }
.kanban-card details summary { cursor: pointer; color: var(--pitch-700); }
.move-form { display: grid; gap: 0.3rem; margin-top: 0.5rem; }
.move-form label { margin: 0.2rem 0 0; }
.move-form input, .move-form select { width: 100%; padding: 0.35rem 0.5rem; font-size: 0.88rem; }
.move-form .btn { justify-self: start; margin-top: 0.2rem; }
/* The fixture just moved, or the one a "move" link pointed at. */
.kanban-card:target, tr:target td { outline: 2px solid var(--amber); outline-offset: 2px; }
tr:target td { outline: none; background: var(--amber-soft); }
.kanban-empty { margin: 0.5rem 0 0; }

/* State tabs: a tab per state with its count; the one that needs you is lit. */
.state-tabs { display: flex; flex-wrap: wrap; gap: 0.15rem; border-bottom: 1px solid var(--ink-100); margin-bottom: 0.85rem; }
.state-tab { padding: 0.5rem 0.75rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-500); font-size: 0.9rem; text-decoration: none; white-space: nowrap; }
.state-tab:hover { color: var(--ink-900); text-decoration: none; }
.state-tab.active { color: var(--pitch-700); border-bottom-color: var(--pitch-600); font-weight: 650; }
.state-tab .count { display: inline-block; min-width: 1.4em; padding: 0 0.4em; margin-left: 0.3rem; border-radius: 999px; background: var(--ink-100); color: var(--ink-700); font-size: 0.76rem; font-weight: 600; text-align: center; vertical-align: 1px; }
.state-tab.attention .count { background: var(--amber-soft); color: var(--amber); }
.state-tab.active .count { background: var(--pitch-100); color: var(--pitch-800); }

/* Filter bars: labelled choices that apply as they change, with the active ones as chips. */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; margin-bottom: 1rem; padding: 0.65rem 0.85rem; background: var(--paper-2); border: 1px solid var(--ink-100); border-radius: var(--radius-sm); }
.filter-bar .field { margin: 0; }
.filter-bar label.tiny { display: block; color: var(--ink-500); margin-bottom: 0.2rem; }
.filter-bar > label { margin: 0; }
.filter-bar select { padding: 0.4rem 0.55rem; font-size: 0.9rem; }
.filter-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.filter-chip { border: 1px solid var(--ink-200); background: var(--paper); color: var(--ink-700); border-radius: 999px; padding: 0.15rem 0.65rem; font-size: 0.8rem; cursor: pointer; }
.filter-chip:hover { border-color: var(--pitch-500); color: var(--pitch-700); }

/* Anything that opens its item: a kanban card, a dashboard card, a table row, a tile. */
[data-href] { cursor: pointer; }
.kanban-card[data-href], .card[data-href] { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.kanban-card[data-href]:hover, .card[data-href]:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
[data-href]:focus-visible { outline: 2px solid var(--pitch-500); outline-offset: 2px; }
tr[data-href]:hover td { background: var(--paper-2); }
.kanban-card .title a { text-decoration: none; }
a.tile { display: block; color: inherit; text-decoration: none; transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.tile.attention { border-color: var(--amber); background: var(--amber-soft); }
.tile.attention .value { color: var(--amber); }
.tile .sub { margin-top: 0.15rem; }

/* ---------- match achievements ---------- */

.achievement-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.achievement-list li { margin: 0.2rem 0; }

/* The overview's next steps: each a full-width row, so the whole card is
   made of things to click. */
.next-steps a { display: flex; justify-content: space-between; padding: 0.7rem 1rem; border-top: 1px solid var(--ink-100); color: var(--ink-700); font-size: 0.92rem; text-decoration: none; }
.next-steps a:hover { background: var(--pitch-50); color: var(--pitch-800); }

/* A button that reads as a link inside a sentence. */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--pitch-700); text-decoration: underline; cursor: pointer; }

/* The clubs to invite: one tick each, in a box that scrolls when there are many. */
.club-picker { display: grid; gap: 0.35rem; max-height: 260px; overflow-y: auto; padding: 0.25rem 0.1rem; }
.club-pick { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 500; margin: 0; }
.club-pick > span { display: flex; flex-direction: column; }
.warn-text { color: var(--amber); }

/* A row in a card that is a link to its item. */
.list-link { display: flex; padding: 0.6rem 1rem; border-top: 1px solid var(--ink-100); color: var(--ink-700); text-decoration: none; }
.list-link:hover { background: var(--pitch-50); text-decoration: none; }

/* ---------- the CrickMax logo ---------- */

/* The owner's logo, in its own navy and red, on the white bar: beside the
   name across the top of every page, the batsman above the name on the
   sign-in card. */
.brand-logo { display: block; height: 40px; width: auto; }
.brand-section {
  padding: 0.2rem 0.55rem; border-radius: 6px; background: var(--pitch-100); color: var(--pitch-800);
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.2;
}
.auth-card .brand-logo { height: 150px; margin: 0 auto; }
@media (max-width: 560px) { .brand-logo { height: 34px; } }

/* An on/off switch. Where it can be changed it is a form's submit button: the
   knob slides across as it is pressed, and the page comes back with the new
   setting. Where it cannot, the same switch, shown and not pressable. */
.switch { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0; border: 0; background: none; font: inherit; color: var(--ink-700); cursor: pointer; }
.switch[aria-disabled="true"] { cursor: default; opacity: 0.75; }
.switch-track { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--ink-200); transition: background 0.2s ease; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-sm); transition: transform 0.2s ease; }
.switch[aria-checked="true"] .switch-track { background: var(--pitch-600); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
.switch:focus-visible { outline: none; }
.switch:focus-visible .switch-track { outline: 2px solid var(--pitch-500); outline-offset: 2px; }
.switch-text { min-width: 2.2em; font-size: 0.85rem; font-weight: 600; }
.switch[aria-checked="true"] .switch-text { color: var(--pitch-700); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-knob { transition: none; } }
