/* ==========================================================================
   Brownz League Platform - "Honours Board"
   Baize green, engraved brass, club-noticeboard typography.
   Tenant colours arrive as :root overrides injected by the build.
   ========================================================================== */

:root {
  --bg:        #071612;
  --bg-alt:    #0B211A;
  --panel:     #0F2C22;
  --line:      #1C4433;
  --baize:     #125C42;
  --brass:     #C9A227;
  --brass-lt:  #E4C158;
  --chalk:     #F2EFE4;
  --chalk-dim: #A8B5AA;
  --red:       #B02A22;

  --ball-yellow: #E0B028;
  --ball-green:  #1E6B3A;
  --ball-brown:  #7A4A22;

  --display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --body:    'Chivo', 'Helvetica Neue', system-ui, sans-serif;
  /* Figures: Fraunces' wonky numerals are hard to read at a glance, so numbers use the sans */
  --num:     var(--body);

  --gut:   clamp(1rem, 4vw, 2.5rem);
  --maxw:  76rem;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.6;
  color: var(--chalk);
  background-color: var(--bg);
  min-height: 100vh;
}

/* Atmosphere layer: painted once, never repainted on scroll. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(70rem 40rem at 15% -10%, rgba(36,138,143,0.28), transparent 70%),
    radial-gradient(50rem 30rem at 95% 5%, rgba(255,145,71,0.14), transparent 65%),
    linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 55%);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 4.2rem); }
h2, h1.h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); }

a { color: var(--brass-lt); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--chalk); }

.eyebrow {
  font-family: var(--body);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 0.9rem;
}
.lede { font-size: 1.12rem; color: var(--chalk-dim); max-width: 46ch; }
.dim  { color: var(--chalk-dim); }
.tiny { font-size: 0.78rem; }

.plaque {
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem; margin-bottom: 1.5rem;
}
.plaque h2, .plaque h1 { margin: 0; }
.plaque .plaque-note { margin-left: auto; font-size: 0.78rem; color: var(--chalk-dim); white-space: nowrap; }
/* Live scores: the note plus its "watching now" count is too long for a phone, so it drops under the heading */
.plaque-live { flex-wrap: wrap; row-gap: 0.25rem; }
.plaque-live .plaque-note { white-space: normal; text-align: right; }
.plaque-live #liveWatching { white-space: nowrap; }

/* ---------- Layout ---------- */

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
section { padding-block: clamp(1.75rem, 3.5vw, 3rem); }
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 46rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 60rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: start; } }

/* ---------- Panels ---------- */

.board {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 12px 28px -18px rgba(0,0,0,0.9);
}
/* thin brass capping line, like a trophy plate */
.board::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0.5;
}

/* ---------- Header / nav ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(7,22,18,0.82);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4.1rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--chalk); }
.brand .mark {
  width: 2rem; height: 2rem; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #E8564C, var(--red) 55%, #6E1912);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.5);
}
.brand b { font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }

.nav { margin-left: auto; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; color: var(--chalk-dim);
  padding: 0.42rem 0.7rem; border-radius: var(--radius);
  border: 1px solid transparent;
}
.nav a:hover { color: var(--chalk); background: rgba(255,255,255,0.065); }
.nav a[aria-current='page'] { color: var(--brass-lt); border-color: var(--line); background: rgba(201,162,39,0.08); }


/* .nav is the landing page's; on phones it is one row that scrolls sideways */
@media (max-width: 52rem) {
  html:not(.js) .site-head .wrap { flex-wrap: wrap; padding-block: 0.7rem; }
  html:not(.js) .nav { margin-left: 0; width: 100%; overflow-x: auto; padding-bottom: 0.2rem; flex-wrap: nowrap; scrollbar-width: none; }
  html:not(.js) .nav::-webkit-scrollbar { display: none; }
  html:not(.js) .nav a { white-space: nowrap; }
}

/* ---------- League nav ----------
   Wide screens: tabs in the header, More as a dropdown, the scorecard as a button.
   Phones: tabs fixed along the bottom, More as a sheet above them. Works without JS (<details>). */

.tabnav { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }
.tabnav .tab {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer; list-style: none;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; color: var(--chalk-dim);
  padding: 0.42rem 0.7rem; border-radius: var(--radius); border: 1px solid transparent;
}
.tabnav .tab::-webkit-details-marker { display: none; }
.tabnav .tab svg { display: none; fill: currentColor; flex: none; }
.tabnav .tab:hover { color: var(--chalk); background: rgba(255,255,255,0.065); }
.tabnav .tab[aria-current='page'], .more[data-current] > .tab, .more[open] > .tab {
  color: var(--brass-lt); border-color: var(--line); background: rgba(201,162,39,0.08);
}
.more { position: relative; }
.more > .tab::after { content: ''; width: 0.38rem; height: 0.38rem; margin: -0.2rem 0 0 0.1rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.2s; }
.more[open] > .tab::after { transform: translateY(0.2rem) rotate(-135deg); }

.more-panel {
  position: absolute; top: calc(100% + 0.6rem); right: 0; z-index: 41;
  width: min(36rem, calc(100vw - 2 * var(--gut)));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem 1.5rem;
  padding: 1.25rem 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(2,10,8,0.55);
}
.more-group h2 {
  font-family: var(--body); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 0.5rem;
}
.more-group a {
  display: block; padding: 0.4rem 0; text-decoration: none; color: var(--chalk); font-size: 0.95rem;
}
.more-group a:hover, .more-group a[aria-current='page'] { color: var(--brass-lt); }
.more-cta { display: none; }

.head-cta {
  flex: none; padding: 0.5rem 1.05rem; border: 1px solid var(--brass); border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; color: var(--brass-lt);
}
.head-cta:hover, .head-cta[aria-current='page'] { background: rgba(201,162,39,0.12); }
.head-cta:active, .more-cta:active { transform: scale(0.98); }

@media (max-width: 52rem) {
  /* the bar along the bottom is the nav now, so the header just carries the name and scrolls away */
  .has-tabs .site-head { position: static; backdrop-filter: none; background: var(--bg); }
  .has-tabs .site-head .wrap { display: flex; justify-content: center; height: 3.6rem; min-height: 0; }
  .has-tabs .head-cta { display: none; }
  .has-tabs { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }

  .tabnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .tabnav .tab {
    flex-direction: column; justify-content: center; gap: 0.2rem; height: 4rem; padding: 0;
    font-size: 0.68rem; letter-spacing: 0.03em; border: 0; border-radius: 0; position: relative;
  }
  .tabnav .tab svg { display: block; }
  .tabnav .tab:hover { background: none; }
  .tabnav .tab[aria-current='page'], .more[data-current] > .tab, .more[open] > .tab { background: none; }
  .tabnav .tab[aria-current='page']::before, .more[data-current] > .tab::before {
    content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--brass-lt);
  }
  .more > .tab::after { display: none; }

  /* More: a sheet resting on the tab bar, over a dimmed page */
  .more { position: static; }
  .more[open] > .tab::after {
    display: block; position: fixed; inset: 0 0 calc(4rem + env(safe-area-inset-bottom)); width: auto; height: auto; margin: 0;
    border: 0; transform: none; transition: none; background: rgba(2,10,8,0.6);
  }
  .more-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: calc(4rem + env(safe-area-inset-bottom)); width: auto;
    max-height: calc(100dvh - 7rem); overflow-y: auto;
    grid-template-columns: 1fr; gap: 1.1rem; padding: 1.25rem var(--gut) 1.1rem;
    border-width: 1px 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -12px 30px rgba(2,10,8,0.5);
  }
  .more-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .more-group h2 { grid-column: 1 / -1; margin: 0; }
  .more-group a {
    padding: 0.8rem 0.85rem; font-size: 0.95rem; font-weight: 600;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .more-group a[aria-current='page'] { border-color: var(--brass); }
  .more-cta {
    display: block; text-align: center; padding: 0.85rem; text-decoration: none;
    border: 1px solid var(--brass); border-radius: 999px;
    font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-lt);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .more[open] .more-panel { animation: more-in 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
}
@keyframes more-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.hero h1 { max-width: 22ch; }
.hero h1 em { font-style: italic; color: var(--brass-lt); font-variation-settings: 'SOFT' 60, 'WONK' 1; }
.hero .lede { margin-top: 1.25rem; }

.sponsor-line {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--chalk-dim); border: 1px solid var(--line);
  padding: 0.4rem 0.85rem; border-radius: 100px; margin-bottom: 1.6rem;
}
.sponsor-line b { color: var(--brass); font-weight: 700; letter-spacing: 0.16em; }

/* sponsor.main.prominent: the main sponsor on a slim bar under the header, every page */
.sponsor-bar { position: relative; z-index: 1; border-bottom: 1px solid var(--line); background: var(--bg-alt, var(--bg)); }
.sponsor-bar a {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  padding-block: 0.45rem; text-decoration: none; color: var(--chalk-dim);
}
.sponsor-bar-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); }
.sponsor-bar img { height: 1.9rem; width: auto; border-radius: 4px; }
.sponsor-bar b { font-family: var(--display); color: var(--chalk); }
.sponsor-bar a:hover .sponsor-bar-label { color: var(--brass-lt); }
.sponsor-bar-tagline { display: none; font-family: var(--display); font-style: italic; color: var(--chalk); }
@media (min-width: 46rem) { .sponsor-bar-tagline { display: inline; } }

/* sponsor.main.tagline / .points / .cta: the sponsor's own words, on the home card and sponsors page */
.sponsor-tagline {
  margin: 1rem auto 0; max-width: 30ch;
  font-family: var(--display); font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem); line-height: 1.2;
  color: var(--chalk); font-variation-settings: 'SOFT' 60, 'WONK' 1;
}
.sponsor-points {
  list-style: none; padding: 0; margin: 1rem auto 0; max-width: 34ch; text-align: left;
  display: grid; gap: 0.45rem; font-size: 0.9rem; color: var(--chalk-dim);
}
.sponsor-points li { position: relative; padding-left: 1.5rem; }
.sponsor-points li::before { content: '\2713'; position: absolute; left: 0; color: var(--brass); font-weight: 700; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.ledger {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums; font-size: 0.9rem;
}
table.ledger caption { text-align: left; color: var(--chalk-dim); font-size: 0.8rem; padding-bottom: 0.7rem; }
table.ledger th {
  text-align: right; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass);
  padding: 0 0.55rem 0.55rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.ledger th:first-child, table.ledger th.left { text-align: left; }
table.ledger td {
  text-align: right; padding: 0.62rem 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.13); white-space: nowrap;
}
table.ledger td:first-child, table.ledger td.left { text-align: left; }
table.ledger.facts td { white-space: normal; }
table.ledger tbody tr:hover { background: rgba(255,255,255,0.07); }
table.ledger .team-name { font-weight: 600; color: var(--chalk); }
table.ledger .pts { font-weight: 700; color: var(--brass-lt); }
table.ledger .pos { color: var(--chalk-dim); width: 2.6rem; }

/* Snooker-ball position markers: top three, then the rest */
.pip { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.05em; }
.pip-1 { background: var(--ball-yellow); }
.pip-2 { background: var(--ball-green); }
.pip-3 { background: var(--ball-brown); }
.pip-x { background: var(--line); }

/* ---------- Fixtures ---------- */

.round-head {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin: 2.2rem 0 0.85rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.round-head h3 { margin: 0; }
.round-head .when { margin-left: auto; font-size: 0.78rem; color: var(--chalk-dim); }

.fixture {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,0.065); margin-bottom: 0.5rem;
}
.fixture .h { text-align: right; font-weight: 600; }
.fixture .a { text-align: left; font-weight: 600; }
.fixture .v {
  font-family: var(--display); font-size: 0.85rem; color: var(--brass);
  padding: 0.1rem 0.5rem; border: 1px solid var(--line); border-radius: 100px;
}
.fixture .score { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brass-lt); }
.fixture .venue { grid-column: 1 / -1; font-size: 0.74rem; color: var(--chalk-dim); text-align: center; }
.fixture.is-bye { grid-template-columns: 1fr; text-align: center; color: var(--chalk-dim); font-style: italic; }
.fixture.is-cup { border-color: rgba(201,162,39,0.4); background: rgba(201,162,39,0.06); }

@media (max-width: 34rem) {
  .fixture { grid-template-columns: 1fr; text-align: center; gap: 0.3rem; }
  .fixture .h, .fixture .a { text-align: center; }
}

/* ---------- Cards / stats ---------- */

.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: rgba(255,255,255,0.065); }
.stat .n { font-family: var(--num); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); color: var(--brass-lt); line-height: 1; }
.stat .k { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--chalk-dim); margin-top: 0.5rem; }

.club { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; background: rgba(255,255,255,0.065); }
.club h3 { margin-bottom: 0.35rem; }
.club ul { list-style: none; margin: 0.7rem 0 0; padding: 0; font-size: 0.88rem; }
.club li { padding: 0.28rem 0; border-top: 1px solid rgba(255,255,255,0.13); color: var(--chalk-dim); }

/* ---------- Notices ---------- */

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--radius); padding: 0.9rem 1.1rem;
  background: rgba(201,162,39,0.07); font-size: 0.9rem;
}
.notice.sample { border-left-color: var(--red); background: rgba(176,42,34,0.12); }
.notice strong { color: var(--chalk); }

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2rem 1.25rem; text-align: center; color: var(--chalk-dim);
}
.empty strong { display: block; color: var(--chalk); font-family: var(--display); font-size: 1.2rem; margin-bottom: 0.4rem; }

.news-item { border-top: 1px solid var(--line); padding: 1.4rem 0; }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-item time { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.news-item h3 { margin: 0.4rem 0 0.5rem; }
.news-item p { margin: 0 0 0.6rem; color: var(--chalk-dim); }

/* ---------- Install app banner ---------- */

.install {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 39; width: min(26rem, calc(100vw - 2rem));
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); font-size: 0.86rem; line-height: 1.35;
}
.install[hidden], .install [hidden], .install-open[hidden] { display: none; }
.install img { flex: none; border-radius: 10px; }
.install p { margin: 0; flex: 1; min-width: 0; color: var(--chalk-dim); }
.install p b { display: block; color: var(--chalk); font-weight: 600; }
.install-go {
  flex: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0.5rem 0.95rem; min-height: 2.75rem;
  color: var(--bg); background: var(--brass); border: 0; border-radius: 4px;
}
.install-go:hover { background: var(--brass-lt); }
.install-x {
  flex: none; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; width: 2.75rem; height: 2.75rem;
  color: var(--chalk-dim); background: none; border: 0; border-radius: 4px;
}
.install-x:hover { color: var(--chalk); background: rgba(255,255,255,0.065); }
.install-open { font: inherit; color: var(--chalk-dim); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.install-open:hover { color: var(--brass-lt); }
@media (max-width: 52rem) {
  /* above the tab bar */
  .install { left: 0.6rem; right: 0.6rem; width: auto; bottom: calc(4rem + env(safe-area-inset-bottom) + 0.6rem); }
}
@media print { .install { display: none; } }


/* ---------- Notifications page ---------- */

.nt-form .plaque { margin: 1.75rem 0 0.75rem; }
.nt-group { display: grid; gap: 0.15rem; }
.nt-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.15rem 1rem; margin-top: 0.25rem; }
.nt-check { display: flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; cursor: pointer; }
.nt-check input { width: 1.25rem; height: 1.25rem; accent-color: var(--brass); flex: none; margin: 0; }
.nt-check input:disabled + span { opacity: 0.45; }
.nt-form .cf-actions { margin-top: 1.25rem; }


/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 2.5rem 3rem; font-size: 0.86rem; color: var(--chalk-dim); }
.site-foot a { color: var(--chalk-dim); }
.site-foot a:hover { color: var(--brass-lt); }
.foot-grid { display: grid; gap: 1.75rem; }
@media (min-width: 52rem) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot-grid h3 { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-family: var(--body); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { padding: 0.2rem 0; }
.credit { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; font-size: 0.78rem; }
.credit .spacer { margin-left: auto; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
  .reveal:nth-child(1) { animation-delay: 0.04s; }
  .reveal:nth-child(2) { animation-delay: 0.12s; }
  .reveal:nth-child(3) { animation-delay: 0.2s; }
  .reveal:nth-child(4) { animation-delay: 0.28s; }
  .reveal:nth-child(5) { animation-delay: 0.36s; }
  .reveal:nth-child(6) { animation-delay: 0.44s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  .hero > .wrap > * { animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero > .wrap > *:nth-child(2) { animation-delay: 0.08s; }
  .hero > .wrap > *:nth-child(3) { animation-delay: 0.16s; }
  .hero > .wrap > *:nth-child(4) { animation-delay: 0.24s; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-head, .nav, .tabnav, .site-foot { display: none; }
  .board { border-color: #999; }
}

/* ---------- Sponsors ---------- */

/* Strip above the footer on every page - the visibility a sponsor is buying. */
.sponsor-strip {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(40rem 12rem at 50% 120%, rgba(201,162,39,0.14), transparent 70%),
    rgba(255,255,255,0.02);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}
.sponsor-label {
  margin: 0 0 0.7rem;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--brass);
}
.sponsor-name {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem);
  line-height: 1.1;
  color: var(--chalk);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
}
.sponsor-strip a { text-decoration: none; }
.sponsor-strip a:hover .sponsor-name { color: var(--brass-lt); }
.sponsor-logo { max-height: 4.5rem; max-width: min(100%, 22rem); width: auto; }
/* several sponsors and no main one (Sheffield): every logo, with what each sponsors */
.sponsor-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.9rem; max-width: 48rem; margin: 0 auto; }
.sponsor-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.03);
}
.sponsor-tile img { height: 4.2rem; width: 100%; object-fit: contain; border-radius: 6px; }
.sponsor-tile span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chalk-dim); }
.sponsor-tile:hover { border-color: var(--brass); }
.sponsor-also {
  margin: 0.9rem auto 0; max-width: 52ch;
  font-size: 0.82rem; color: var(--chalk-dim);
}
.sponsor-cta { margin: 1.1rem 0 0; font-size: 0.8rem; }
.sponsor-slot {
  display: block; max-width: 22rem; margin: 0 auto; padding: 1.4rem 1rem;
  border: 1px dashed var(--line); border-radius: var(--radius);
  font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--chalk-dim);
}
.sponsor-slot:hover { border-color: var(--brass); color: var(--brass); }
/* sponsor.supportersStrip: supporters (not cup sponsors) under the main sponsor, plus a slot for sale */
.sponsor-supporters { margin: 1.5rem auto 0; }
.sponsor-supporters .sponsor-tiles { grid-template-columns: repeat(auto-fit, minmax(9rem, 12rem)); justify-content: center; }
.sponsor-supporters .sponsor-wordmark { font-size: 1.05rem; }
.sponsor-tile-slot {
  border-style: dashed; min-height: 5.8rem; background: transparent;
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--chalk-dim);
}
.sponsor-tile-slot span { color: var(--brass); letter-spacing: 0.06em; text-transform: none; font-size: 0.78rem; }
.sponsor-banners { margin: 1.5rem auto 0; max-width: 20rem; }
.sponsor-banners img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.sponsor-banners a { display: block; }
.sponsor-banners a + a { margin-top: 0.75rem; }

/* Sponsors page */
.sponsor-hero {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 3.25rem);
  background: linear-gradient(180deg, rgba(201,162,39,0.10), rgba(0,0,0,0.15));
  position: relative;
}
.sponsor-hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.sponsor-hero .since { margin: 0.8rem 0 0; font-size: 0.78rem; color: var(--chalk-dim); }

.sponsor-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.sponsor-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1rem; text-align: center;
  background: rgba(255,255,255,0.065);
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 6rem;
}
.sponsor-card span { font-weight: 600; }
.sponsor-card img { max-height: 5rem; max-width: 100%; width: auto; }

.pitch-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.pitch-list li {
  padding: 0.7rem 0 0.7rem 1.6rem; position: relative;
  border-top: 1px solid rgba(255,255,255,0.13); color: var(--chalk-dim);
}
.pitch-list li::before {
  content: ''; position: absolute; left: 0; top: 1.15rem;
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brass);
}

/* ---------- Local imagery ---------- */

/* Hero photograph sits behind the type, dimmed enough to keep text legible
   at AA contrast without washing the image out entirely. */
.hero-photo { position: relative; overflow: hidden; z-index: 0; }
.hero-photo > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  object-position: 62% 30%;
  z-index: -2;
}
.hero-photo { min-height: min(78vh, 34rem); display: flex; align-items: center; }
.hero-photo > .wrap { width: 100%; }
.hero-photo::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,22,18,0.94) 0%, rgba(7,22,18,0.72) 42%, rgba(7,22,18,0.18) 100%),
    linear-gradient(180deg, rgba(7,22,18,0.35), rgba(7,22,18,0.82));
}
.hero-credit {
  position: absolute; right: 0.7rem; bottom: 0.5rem; z-index: 1;
  font-size: 0.62rem; letter-spacing: 0.04em;
  color: rgba(242,239,228,0.5);
}
.hero-credit a { color: inherit; text-decoration: none; }
.hero-credit a:hover { color: var(--brass-lt); text-decoration: underline; }

/* ---------- Competitions ---------- */

.comp-group { margin-bottom: 2.5rem; }
.comp-grid { display: grid; gap: 1rem; }
@media (min-width: 50rem) { .comp-grid { grid-template-columns: repeat(2, 1fr); } }

.comp {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; background: rgba(255,255,255,0.065);
  position: relative; transition: border-color 0.18s, background 0.18s;
}
.comp:hover { border-color: rgba(201,162,39,0.5); background: rgba(201,162,39,0.05); }
.comp h3 { margin: 0 0 0.3rem; }
.comp .fmt { font-size: 0.82rem; color: var(--chalk-dim); margin: 0; }
.comp .entry {
  display: block; margin-top: 0.75rem; padding-top: 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.13);
  font-size: 0.8rem; color: var(--chalk-dim);
}
.comp .when { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }

/* Marks the competitions whose entry list is worked out, not drawn up */
.tag {
  display: inline-block; margin-left: 0.5rem;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: 100px;
  border: 1px solid rgba(201,162,39,0.45); color: var(--brass);
  vertical-align: 0.15em;
}
.tag-auto { border-color: rgba(30,107,58,0.7); color: #6fbf7f; }

.rule {
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  background: rgba(201,162,39,0.06); font-size: 0.9rem;
}
.rule strong { color: var(--chalk); }
.rule .flow {
  display: block; margin-top: 0.6rem;
  font-family: var(--mono, ui-monospace), monospace;
  font-size: 0.78rem; color: var(--brass-lt);
}

.entrants { list-style: none; margin: 1rem 0 0; padding: 0; columns: 2; column-gap: 2rem; }
.entrants li { padding: 0.3rem 0; border-top: 1px solid rgba(255,255,255,0.13); font-size: 0.88rem; break-inside: avoid; }
@media (max-width: 34rem) { .entrants { columns: 1; } }
.entrant-n { display: inline-block; min-width: 1.6rem; font-weight: 700; opacity: 0.75; font-variant-numeric: tabular-nums; }

/* ---------- Handicaps ---------- */

.hcap-note { margin-bottom: 1.5rem; }

.hcap-team { margin-bottom: 2rem; }
.hcap-team .plaque { margin-bottom: 0.9rem; }

.hcap-grid { display: grid; gap: 0.4rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.hcap {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,0.065);
}
.hcap .nm { flex: 1; font-weight: 600; }
.hcap .capt {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brass); border: 1px solid rgba(210,112,58,0.45);
  border-radius: 100px; padding: 0.05rem 0.4rem;
}
.hcap-grid.squad .hcap { align-items: center; }
.hcap .rec { display: flex; margin-top: 0.3rem; }
.hcap .rec .form span { width: 1.2rem; height: 1.2rem; font-size: 0.6rem; }
.hcap .hv {
  font-variant-numeric: tabular-nums; font-weight: 700;
  min-width: 3.1rem; text-align: right;
}
/* A receiving player and a conceding player should read differently at a glance */
.hcap .hv.plus  { color: #7fc99a; }
.hcap .hv.minus { color: var(--brass-light, #E89055); }
.hcap .hv.zero  { color: var(--chalk-dim); }

.hcap-legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  font-size: 0.78rem; color: var(--chalk-dim);
  padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid var(--line);
}

/* ---------- Team pages ---------- */

/* Table rows become links when a team has a page behind it */
table.ledger a.team-link {
  color: inherit; text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px; text-underline-offset: 0.25em;
}
table.ledger a.team-link:hover { color: var(--brass-lt); text-decoration-color: var(--brass); }
table.ledger tr.clickable:hover { background: rgba(255,255,255,0.08); }

/* ---------- Rows and cards that open a page ----------
   The whole row is the target (data-href, handled by the script in the page
   shell), so it says so: a pointer, a chevron at the end, brass on hover. */
.clickable { cursor: pointer; }
table.ledger tr.clickable td:last-child { position: relative; padding-right: 1.9rem; }
table.ledger:has(tr.clickable) thead th:last-child { padding-right: 1.9rem; }
table.ledger tr.clickable td:last-child::after {
  content: '\203A'; position: absolute; right: 0.6rem; top: 50%; transform: translateY(-54%);
  font-size: 1.25rem; font-weight: 400; line-height: 1; color: var(--brass); opacity: 0.6;
  transition: right 0.12s ease, opacity 0.12s ease;
}
table.ledger tr.clickable:hover td:last-child::after { opacity: 1; right: 0.4rem; }
table.ledger tr.clickable:hover .team-name,
table.ledger tr.clickable:hover .team-name a { color: var(--brass-lt); }
.fixture.clickable, .hcap.clickable { transition: border-color 0.12s ease, background 0.12s ease; }
.fixture.clickable:hover, .hcap.clickable:hover { border-color: var(--brass); background: rgba(255,255,255,0.1); }
.fixture .open { color: var(--brass); white-space: nowrap; }
.fixture.clickable:hover .open { color: var(--brass-lt); }
.hcap.clickable:hover .nm, .hcap.clickable:hover .nm a { color: var(--brass-lt); }
/* a chevron on rows that open a player page - phones have no hover to give it away */
.hcap.clickable { cursor: pointer; }
.hcap.clickable::after { content: '\203A'; align-self: center; margin-left: -0.25rem; color: var(--brass); font-size: 1.3rem; line-height: 1; }
.back { margin: 0 0 0.75rem; font-size: 0.85rem; }
/* player page frame-by-frame: result pill, opponent with date and match beneath, score */
td.fr-res { width: 2.2rem; }
table.ledger td.fr-opp { white-space: normal; }
/* Phones: drop the secondary league-table columns and let long team names wrap */
@media (max-width: 40rem) {
  table.ledger .wide { display: none; }
  table.ledger th, table.ledger td { padding-left: 0.35rem; padding-right: 0.35rem; }
  table.ledger td.team-name { white-space: normal; }
  table.ledger .pos { width: auto; }
  table.ledger .pip { margin-right: 0.3rem; }
  table.ledger tr.clickable td:last-child, table.ledger:has(tr.clickable) thead th:last-child { padding-right: 1.1rem; }
  table.ledger tr.clickable td:last-child::after { right: 0.15rem; }
  .board:has(> .table-scroll), .board:has(> .division) { padding-inline: 0.6rem; }
}
.fr-sub { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--chalk-dim); }
.back a { color: var(--brass); text-decoration: none; }
.back a:hover { color: var(--brass-lt); }

.team-head { display: grid; gap: 1.25rem; margin-bottom: 2rem; }
@media (min-width: 46rem) { .team-head { grid-template-columns: 1.2fr 1fr; align-items: start; } }

.team-record { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.team-record div {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.5rem; text-align: center; background: rgba(255,255,255,0.065);
}
.team-record .v {
  font-family: var(--num); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--chalk);
  font-variant-numeric: lining-nums tabular-nums;
}
.team-record .k {
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--chalk-dim); margin-top: 0.35rem;
}
.team-record .pos .v { color: var(--brass-lt); }

.team-meta { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.team-meta li { display: flex; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid rgba(255,255,255,0.13); }
.team-meta li:first-child { border-top: 0; }
.team-meta .k { color: var(--chalk-dim); min-width: 7rem; }

.team-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2.5rem; }
.team-nav a {
  font-size: 0.8rem; text-decoration: none; color: var(--chalk-dim);
  border: 1px solid var(--line); border-radius: 100px; padding: 0.3rem 0.75rem;
}
.team-nav a:hover { color: var(--chalk); border-color: var(--brass); }
.team-nav a[aria-current] { color: var(--brass-lt); border-color: var(--brass); }

/* ---------- Knockout bracket ---------- */

.bracket { display: grid; gap: 1.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
@media (min-width: 56rem) {
  .bracket { grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); align-items: center; gap: 2rem; }
}

.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 1rem; }
.bracket-round > h3 {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brass); font-family: var(--body); margin: 0 0 0.2rem;
}
.bracket-round > h3 span { display: block; color: var(--chalk-dim); letter-spacing: 0.08em; font-weight: 600; margin-top: 0.25rem; }

.tie {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,0.065); overflow: hidden;
}
.tie .side {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.55rem 0.75rem; font-size: 0.88rem;
}
.tie .side + .side { border-top: 1px solid rgba(255,255,255,0.13); }
.tie .side .nm { flex: 1; }
.tie .side .tm { display: block; font-size: 0.72rem; color: var(--chalk-dim); font-weight: 400; }
.tie .side .hc { display: block; font-size: 0.72rem; color: var(--brass-lt); font-weight: 600; }
.tie .side .sc { font-variant-numeric: tabular-nums; font-weight: 700; }
.tie .side.won { background: rgba(255,255,255,0.07); }
.tie .side.won .nm { font-weight: 700; color: var(--chalk); }
.tie .side.won::after { content: '\2713'; color: #7fc99a; font-weight: 700; }
.tie .side.out .nm { color: var(--chalk-dim); text-decoration: line-through; text-decoration-color: var(--line); }
.tie .side.tbc .nm { color: var(--chalk-dim); font-style: italic; }
.tie .start {
  padding: 0.35rem 0.75rem; font-size: 0.74rem; color: var(--chalk-dim);
  border-top: 1px solid rgba(255,255,255,0.13);
}
.tie .start b { color: var(--brass-lt); font-weight: 600; }
.start-once {
  margin-top: 0.75rem; padding: 0.6rem 0.8rem; font-size: 0.85rem; line-height: 1.45;
  border-left: 3px solid var(--brass-lt); background: rgba(255,255,255,0.05); border-radius: 4px;
}
.start-once b { color: var(--brass-lt); }
.tie .meta {
  padding: 0.3rem 0.75rem; font-size: 0.66rem; letter-spacing: 0.06em;
  color: var(--chalk-dim); border-top: 1px solid rgba(255,255,255,0.13);
  display: flex; justify-content: space-between;
}
.tie.next { border-color: var(--brass); box-shadow: 0 0 0 1px rgba(255,145,71,0.25); }

/* League crest in the masthead, where a league has one */
.brand .crest {
  width: 2.6rem; height: 2.6rem; flex: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
@media (max-width: 30rem) { .brand .crest { width: 2.2rem; height: 2.2rem; } }

/* ---------- Scorecards ---------- */

.fixture a.score-link {
  text-decoration: none; padding: 0.1rem 0.55rem;
  border: 1px solid var(--line); border-radius: 100px;
}
.fixture a.score-link:hover { border-color: var(--brass); color: var(--chalk); }

.sc-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  margin: 1.25rem 0 1.5rem; text-align: center;
}
.sc-team { font-family: var(--display); font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem); font-weight: 600; }
.sc-team.h { text-align: right; }
.sc-team.a { text-align: left; }
.sc-team a { color: var(--chalk); text-decoration: none; }
.sc-team a:hover { color: var(--brass-lt); }
.sc-team span {
  display: block; font-family: var(--body); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--chalk-dim); margin-top: 0.2rem;
}
.sc-team.won a, .sc-team.won { color: var(--brass-lt); }
.sc-final {
  font-family: var(--num); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1;
  color: var(--brass-lt); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap;
}
.sc-final i { font-style: normal; color: var(--chalk-dim); margin: 0 0.3rem; }
.sc-venue { grid-column: 1 / -1; font-size: 0.78rem; color: var(--chalk-dim); }

.scorecard { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sc-row {
  display: grid; grid-template-columns: 4.2rem 1fr 7.5rem 1fr; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border-top: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.04);
}
.sc-row:first-child { border-top: 0; }
.sc-row.sc-cols {
  background: transparent; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brass); padding-top: 0.55rem; padding-bottom: 0.55rem;
}
.sc-row.sc-total { background: rgba(255,255,255,0.08); }
.sc-n { font-family: var(--num); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; font-size: 1.1rem; color: var(--chalk-dim); }
.sc-n span {
  display: block; font-family: var(--body); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.1rem;
}
.sc-cols .sc-n, .sc-total .sc-n { font-family: var(--body); font-size: inherit; }
.sc-total .sc-n { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.sc-side { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.sc-side.h { justify-content: flex-end; text-align: right; }
.sc-side.h .sc-hc { order: 2; }
.sc-side.a { justify-content: flex-start; }
.sc-side.a .sc-hc { order: -1; }
.sc-names { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.sc-nm { color: var(--chalk-dim); overflow-wrap: anywhere; }
.sc-nm a { color: inherit; text-decoration: none; }
.sc-nm a:hover { color: var(--brass-lt); text-decoration: underline; }
.sc-side.won .sc-nm { color: var(--chalk); font-weight: 700; }
.sc-hc {
  flex: none; font-size: 0.74rem; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 100px;
}
.sc-hc.plus { color: #7fc99a; } .sc-hc.minus { color: var(--brass-light, #E89055); } .sc-hc.zero { color: var(--chalk-dim); }
.sc-score { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-score b { font-weight: 600; color: var(--chalk-dim); font-size: 1.05rem; }
.sc-score b.w { color: var(--brass-lt); font-weight: 800; }
.sc-score i { font-style: normal; color: var(--chalk-dim); margin: 0 0.3rem; }
.sc-run { display: block; font-size: 0.64rem; letter-spacing: 0.1em; color: var(--chalk-dim); margin-top: 0.1rem; }
.sc-note { font-size: 0.8rem; margin-top: 0.9rem; }

/* Live scores: tonight's cards in progress */
.live-match { margin: 0 0 2.5rem; }
.live-match .sc-head { margin-top: 1rem; }
.sc-row.live-todo { opacity: 0.55; }
.sc-run.live-bk { letter-spacing: 0.02em; color: var(--brass-lt); }

@media (max-width: 40rem) {
  .sc-row { grid-template-columns: 2.2rem 1fr 4.6rem 1fr; gap: 0.45rem; padding: 0.6rem 0.55rem; font-size: 0.86rem; }
  .sc-n { font-size: 0.95rem; }
  .sc-n span { display: none; }
  .sc-side { flex-direction: column; align-items: flex-end; gap: 0.25rem; }
  .sc-side.a { align-items: flex-start; }
  .sc-side.h .sc-hc, .sc-side.a .sc-hc { order: 2; }
  .sc-head { gap: 0.5rem; }
  .sc-team { font-size: 0.98rem; }
  .sc-final { font-size: 2.1rem; }
  .sc-row.sc-cols { font-size: 0.56rem; letter-spacing: 0.08em; }
}

/* ---------- Player pages ---------- */

.player-stats { grid-template-columns: repeat(2, 1fr); margin-top: 1.25rem; }
@media (min-width: 46rem) { .player-stats { grid-template-columns: repeat(4, 1fr); } }
.player-stats .stat .n .dim { font-size: 0.6em; }
.form { display: inline-flex; gap: 0.25rem; vertical-align: middle; }
.form span {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  font-size: 0.66rem; font-weight: 800; color: #0b1a12;
}
.form .fw { background: #7fc99a; }
.form .fl { background: var(--red); color: var(--chalk); }
.form .fd { background: var(--chalk-dim); }
.team-recent { margin-top: 1.25rem; }
.hv-inline.plus { color: #7fc99a; } .hv-inline.minus { color: var(--brass-light, #E89055); }
table.ledger td.res-w { color: #7fc99a; font-weight: 700; }
table.ledger td.res-l { color: var(--chalk-dim); }
a.player-link { color: inherit; text-decoration: none; }
a.player-link:hover { color: var(--brass-lt); text-decoration: underline; }
.hcap .nm a.player-link:hover { color: var(--brass-lt); }

.sc-breaks { margin-top: 1.25rem; }
.sc-breaks h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.sc-breaks-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sc-breaks .k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.sc-breaks ul { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.9rem; }
.sc-breaks li { padding: 0.2rem 0; }
.sc-breaks li b { color: var(--brass-lt); font-variant-numeric: tabular-nums; margin-left: 0.3rem; }

/* ---------- Captains' scorecard ---------- */

.cf-help-toggle {
  display: flex; align-items: center; gap: 0.4rem; margin: 1rem 0 0.4rem;
  background: none; border: 1px solid var(--line); border-radius: 100px; padding: 0.4rem 0.9rem;
  color: var(--brass-lt); font: 600 0.85rem var(--body); cursor: pointer;
}
.cf-video { margin: 1rem 0 0.4rem; }
.cf-video summary {
  display: inline-flex; align-items: center; gap: 0.45rem; list-style: none; cursor: pointer;
  border: 1px solid var(--brass); border-radius: 100px; padding: 0.45rem 1rem;
  color: var(--brass-lt); font: 600 0.9rem var(--body);
}
.cf-video summary::-webkit-details-marker { display: none; }
.cf-video summary::before { content: "\25B6"; font-size: 0.7rem; }
.cf-video summary span { color: var(--chalk-dim); font-weight: 400; }
.cf-video video { display: block; width: 100%; max-width: 20rem; height: auto; margin: 0.75rem auto 0; border-radius: 12px; background: #000; }
.cf-help { margin: 0.5rem 0 1rem; padding-left: 1.3rem; font-size: 0.9rem; color: var(--chalk-dim); }
.cf-help li { margin: 0.35rem 0; }
.cf-help b { color: var(--chalk); }

.cf-field { display: grid; gap: 0.35rem; margin: 1rem 0; }
.cf-field label, .cf-lab {
  display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass);
}
.cf-field select, .cf-frame select, .cf-frame input, .cf-panel input, .cf-panel textarea {
  width: 100%; min-width: 0; font: 500 1rem var(--body); color: var(--chalk);
  background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.7rem;
}
.cf-frame select:focus, .cf-frame input:focus, .cf-field select:focus, .cf-panel input:focus, .cf-panel textarea:focus {
  outline: 2px solid var(--brass); outline-offset: 1px;
}
/* team PIN: four big boxes, one digit each */
.cf-pin { display: flex; gap: 0.6rem; margin: 0.35rem 0 0.9rem; }
.cf-pin .cf-pin-d {
  width: 3.4rem; height: 3.8rem; flex: none; padding: 0; text-align: center;
  font: 700 2rem/1 var(--body); color: var(--chalk); caret-color: var(--brass);
  background: rgba(0,0,0,0.32); border: 2px solid var(--line); border-radius: 10px;
}
.cf-pin .cf-pin-d::selection { background: transparent; }
.cf-pin .cf-pin-d:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201,162,39,0.25); }
@media (max-width: 22rem) { .cf-pin .cf-pin-d { width: 3rem; height: 3.4rem; } }
.cf-frame select:disabled, .cf-frame input:disabled { opacity: 1; color: var(--chalk); background: rgba(255,255,255,0.04); border-color: transparent; }

.cf-status { min-height: 1.2rem; margin: 0.6rem 0; font-size: 0.92rem; border-radius: 6px; }
.cf-status:not(:empty) { padding: 0.75rem 0.9rem; border: 1px solid var(--line); }
.cf-status.info { background: rgba(255,255,255,0.05); }
.cf-status.good { background: rgba(127,201,154,0.12); border-color: #3f8f63; color: #b7e4c7; }
.cf-status.warn { background: rgba(201,162,39,0.12); border-color: var(--brass); color: var(--brass-lt); }
.cf-status.bad  { background: rgba(176,42,34,0.16); border-color: var(--red); color: #f2b8b2; }

.cf-matchbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.6rem; text-align: center;
  padding: 0.9rem; border: 1px solid var(--line); border-bottom: 3px solid var(--brass);
  border-radius: 10px 10px 0 0; background: linear-gradient(135deg, var(--bg-alt), var(--panel));
  font-family: var(--display); font-size: 1.15rem; font-weight: 600;
}
.cf-matchbar .h { text-align: right; } .cf-matchbar .a { text-align: left; }
.cf-matchbar .v { color: var(--brass); font-size: 0.9rem; }
.cf-matchbar .when { grid-column: 1 / -1; font: 0.78rem var(--body); color: var(--chalk-dim); }

.cf-hp { position: absolute; left: -200vw; }
.cf-actions { display: flex; gap: 0.5rem; padding: 0.75rem 0; }
.cf-btn {
  flex: 1; padding: 0.75rem 0.6rem; border-radius: 6px; cursor: pointer;
  font: 700 0.9rem var(--body); letter-spacing: 0.02em;
  background: transparent; color: var(--chalk); border: 1px solid var(--line);
}
.cf-btn:hover { border-color: var(--brass); }
.cf-btn.send { background: var(--brass); color: #10231a; border-color: var(--brass); }
.cf-btn.send:hover { background: var(--brass-lt); }
.cf-btn.save { background: var(--baize); border-color: var(--baize); }
.cf-btn.reset { color: #f0a39b; border-color: rgba(224,112,112,0.6); }
.cf-btn.share { color: var(--chalk); border-color: var(--brass); }
.cf-btn:disabled { opacity: 0.6; cursor: wait; }

.cf-frame { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.75rem; overflow: hidden; background: rgba(255,255,255,0.05); }
.cf-head {
  display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.85rem;
  background: var(--panel); color: var(--brass); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.cf-pts { display: flex; gap: 0.35rem; align-items: center; }
.cf-pts b {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: var(--chalk-dim); font-size: 0.72rem;
}
.cf-pts b.won { background: var(--brass); color: #10231a; }
.cf-pts i { font-style: normal; color: var(--chalk-dim); }
.cf-players, .cf-breaks { display: grid; grid-template-columns: 1fr 1fr; }
.cf-side, .cf-break { display: grid; gap: 0.35rem; padding: 0.65rem 0.75rem; min-width: 0; align-content: start; }
.cf-side.away, .cf-break.away { border-left: 1px solid rgba(255,255,255,0.1); }
.cf-hc { font-size: 0.78rem; font-weight: 600; color: var(--chalk-dim); min-height: 1rem; }
/* blind picks: the team-sheet bar, and each frame's pick status */
.cf-blind { border: 1px solid var(--brass); border-radius: 10px; padding: 0.75rem 0.85rem; margin-bottom: 0.75rem; background: rgba(201,162,39,0.07); }
.cf-blind .cf-actions { padding-bottom: 0.25rem; }
.cf-bp-lead { margin: 0 0 0.5rem; font-size: 0.92rem; }
.cf-bp { font-size: 0.76rem; font-weight: 600; color: var(--brass-lt); }
.cf-bp[hidden] { display: none; }
.cf-frame.bp-open .cf-scores, .cf-frame.bp-open .cf-breaks { opacity: 0.4; }
.cf-blind[hidden] { display: none !important; }
.cf-hc.second { color: var(--brass-lt); }
.cf-rec { font-size: 0.74rem; color: var(--chalk-dim); }
.cf-rec:empty { display: none; }
.cf-start { padding: 0.45rem 0.75rem; font-size: 0.8rem; color: var(--chalk-dim); border-top: 1px solid rgba(255,255,255,0.1); }
.cf-start b { color: var(--brass-lt); }
.cf-start:empty { display: none; }
.cf-given-row { padding: 0.5rem 0.75rem 0; }
.cf-given { width: 100%; }
.cf-frame.given .cf-players, .cf-frame.given .cf-scores, .cf-frame.given .cf-breaks, .cf-frame.given .cf-start { display: none; }
.cf-scores {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.12);
}
.cf-frame .cf-score { width: 4.4rem; text-align: center; font-size: 1.35rem; font-weight: 800; padding: 0.45rem 0.3rem; }
.cf-breaks { border-top: 1px solid rgba(255,255,255,0.1); }
.cf-frame .cf-bval { width: 5rem; text-align: center; font-weight: 700; }
.cf-frame .cf-bval.has { border-color: var(--brass); color: var(--brass-lt); }
.cf-break.away { justify-items: end; }
.cf-frame .cf-bwho { font-size: 0.85rem; padding: 0.4rem 0.5rem; }
.cf-warn:not(:empty) { padding: 0.5rem 0.85rem; font-size: 0.82rem; font-weight: 600; color: #f2b8b2; background: rgba(176,42,34,0.14); }
/* double entry: a frame the two captains' cards disagree on */
.cf-frame.cf-diff { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.cf-diffnote { padding: 0.55rem 0.85rem; font-size: 0.85rem; line-height: 1.5; color: #f6cdc8; background: rgba(176,42,34,0.2); }
.cf-diffnote b { color: #fff; }
/* a frame that has just come in from the other phone */
.cf-frame { transition: border-color 0.6s, box-shadow 0.6s; }
.cf-frame.cf-updated { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass); }

.cf-totals { border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: 10px; padding: 0.6rem 0.85rem; background: linear-gradient(135deg, var(--bg-alt), var(--panel)); }
.cf-totals div { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; }
.cf-totals span { flex: 1; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.cf-totals b { min-width: 2.2rem; text-align: center; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cf-totals i { font-style: normal; color: var(--chalk-dim); }
.cf-totals .cf-points { border-top: 1px solid var(--line); margin-top: 0.2rem; padding-top: 0.55rem; }
.cf-totals .cf-points b { color: var(--brass-lt); }
.cf-totals #cupRule { margin: 0.4rem 0 0; }
.cf-decider { border: 0; border-top: 1px solid var(--line); margin: 0.5rem 0 0; padding: 0.6rem 0 0; display: grid; gap: 0.35rem; }
.cf-decider[hidden] { display: none; }
.cf-decider legend { padding: 0 0 0.35rem; font-weight: 700; }
.cf-decider label { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.cf-decider input { width: auto; }
.cf-totals .cf-decider span { flex: 1; font-size: inherit; font-weight: 400; letter-spacing: 0; text-transform: none; color: inherit; }

.cf-panel { margin-top: 1rem; padding: 1rem; border: 1px solid var(--brass); border-radius: 10px; background: rgba(201,162,39,0.07); display: grid; gap: 0.5rem; }
.cf-panel h3 { margin: 0; }
.cf-panel p { margin: 0; color: var(--chalk-dim); font-size: 0.9rem; }
.cf-panel ul { margin: 0; padding-left: 1.2rem; color: #f2b8b2; }
.cf-panel.cf-try { margin: 0 0 1.25rem; }
.cf-teams { display: grid; gap: 0.35rem; }
.cf-teams label { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.cf-teams input { width: auto; }
.cf-small { font-size: 0.8rem; }
.cf-small .cf-btn { flex: none; padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.cf-foot { font-size: 0.8rem; margin-top: 1.5rem; }
.cf-sheet-note { margin: -0.4rem 0 0.5rem; }

@media (max-width: 30rem) {
  .cf-side, .cf-break { padding: 0.55rem 0.5rem; }
  .cf-frame select, .cf-frame input { font-size: 0.92rem; padding: 0.5rem; }
  .cf-matchbar { font-size: 1rem; }
}
/* the captains' page hides and shows these with the hidden attribute */
.cf-actions[hidden], .cf-panel[hidden], .cf-help[hidden], #card[hidden], .cf-panel textarea[hidden] { display: none !important; }
.cf-frame select:disabled { appearance: none; -webkit-appearance: none; }

/* ---------- Documents, live, past seasons ---------- */
/* ---------- The rule book ---------- */
.rules-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 2rem; }
.rules-toc a {
  font-size: 0.85rem; text-decoration: none; color: var(--chalk);
  padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 100px;
}
.rules-toc a:hover { border-color: var(--brass); color: var(--brass-lt); }
.rules-section { margin-top: 2.25rem; scroll-margin-top: 5rem; }
.rules-section h3 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.rules-no {
  display: block; font-family: var(--body); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.2rem;
}
ol.rules { margin: 1rem 0 0; padding-left: 2.1rem; }
ol.rules li { padding: 0.55rem 0 0.55rem 0.35rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
ol.rules li::marker { color: var(--brass); font-weight: 700; font-variant-numeric: tabular-nums; }
ol.rules li p { margin: 0; max-width: 68ch; }
ol.rules li p + p { margin-top: 0.4rem; color: var(--chalk-dim); }
/* league documents (docs/*.json): the label is written out, so it can be "4.2" or "a)" */
ol.doc-rules { list-style: none; padding-left: 0; }
ol.doc-rules li { display: flex; gap: 0.75rem; padding-left: 0; }
ol.doc-rules .rule-n { flex: 0 0 auto; min-width: 2.6rem; color: var(--brass); font-weight: 700; font-variant-numeric: tabular-nums; }
ol.doc-rules li > div { min-width: 0; }
ol.doc-rules li p + p { color: var(--chalk); }
ol.doc-rules li p + p, ol.doc-rules li ul + p, ol.doc-rules li p + ul { margin-top: 0.4rem; }
.rule-title { font-weight: 700; color: var(--brass-lt); }
.doc-list-items { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.doc-list-items li { display: list-item; border: 0; padding: 0.1rem 0; }

.doc-list { display: grid; gap: 0.75rem; }
.doc { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.05); color: var(--chalk); text-decoration: none; }
.doc:hover { border-color: var(--brass); }
.doc-kind { flex: none; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); border: 1px solid var(--brass); padding: 0.2rem 0.45rem; margin-top: 0.15rem; }
.doc-body { display: grid; gap: 0.2rem; }
.live-card { display: block; color: var(--chalk); text-decoration: none; }
.live-card:hover { border-color: var(--brass); }
.photo-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin-top: 1rem; }
.photo-grid a { display: block; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.photo-grid img { display: block; width: 100%; height: auto; }
.week-fold { border-top: 1px solid var(--line); padding: 0.6rem 0; }
.week-fold summary { cursor: pointer; font-family: var(--display); font-size: 1.05rem; }
.week-fold[open] summary { color: var(--brass-lt); }
/* Home page photo: full-bleed behind the header and the top of the page, fading
   into the background colour so the table over its lower half stays legible.
   Sits above the body::after atmosphere (z -2) and below the content. */
.page-backdrop {
  position: absolute; top: 0; left: 0; right: 0; z-index: -1;
  height: min(100vh, 60rem, 150vw);
  pointer-events: none;
}
.page-backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
.page-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 30%, transparent) 0%,
    color-mix(in srgb, var(--bg) 45%, transparent) 35%,
    color-mix(in srgb, var(--bg) 85%, transparent) 65%,
    var(--bg) 100%);
}
.backdrop-window { position: relative; height: clamp(10rem, 28vw, 22rem); margin-bottom: 1.25rem; }
.backdrop-window .hero-credit { margin: 0; right: 0; bottom: 0; }
/* the result card captains post to the league WhatsApp group */
.cf-share { margin: 1rem 0 1.5rem; display: grid; gap: 0.75rem; }
.cf-share[hidden], .cf-share [hidden] { display: none !important; }
.cf-share img { width: 100%; max-width: 26rem; height: auto; border: 1px solid var(--line); }
.cf-share-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cf-share-actions .cf-btn { flex: 1 1 9rem; text-align: center; text-decoration: none; }

/* ---------- Divisions (a league with A, B and C tables) ---------- */

.division + .division { margin-top: 2.25rem; }
.plaque-sub { margin-bottom: 0.9rem; }
.plaque-sub h3 { margin: 0; }
.division-nav { margin: -0.6rem 0 1.5rem; font-size: 0.85rem; }
.division-head {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brass);
}
.round-head + .division-head { margin-top: 0.2rem; }
.division-head-sponsor { letter-spacing: 0.06em; text-transform: none; color: var(--chalk-dim); font-weight: 400; }
/* a division's own sponsor, under its table heading */
.division-sponsor {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin: -0.35rem 0 0.9rem; text-decoration: none;
}
.division-sponsor .sponsor-label { margin: 0; }
.division-sponsor img { height: 2.6rem; width: auto; max-width: 14rem; border-radius: 6px; object-fit: contain; }
.division-sponsor .sponsor-wordmark { font-family: var(--display); font-size: 1.1rem; color: var(--chalk); }
.pts .adj { color: var(--brass); margin-left: 0.1em; }
.adj-note { margin: 0.6rem 0 0; }

/* ---------- Sponsor offers and cards ---------- */

.sponsor-facts {
  list-style: none; padding: 0; margin: 1.6rem auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem;
}
.sponsor-facts li {
  min-width: 8.5rem; padding: 0.8rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(0,0,0,0.2);
}
.sponsor-facts b {
  display: block; font-family: var(--num); font-weight: 700; font-size: 1.9rem; line-height: 1;
  color: var(--brass-lt); font-variant-numeric: lining-nums tabular-nums;
}
.sponsor-facts span { display: block; margin-top: 0.35rem; font-size: 0.72rem; color: var(--chalk-dim); }

.sponsor-offer {
  margin: 1.75rem auto 0; max-width: 34rem; padding: 1.1rem 1.25rem;
  border: 1px dashed var(--brass); border-radius: var(--radius);
  background: rgba(0,0,0,0.25);
}
.sponsor-offer .sponsor-label { margin-bottom: 0.4rem; }
.sponsor-offer .offer-text {
  margin: 0; font-family: var(--display); color: var(--chalk);
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); line-height: 1.25;
}
.sponsor-offer.compact { margin-top: 1rem; padding: 0.85rem 1rem; }
.sponsor-offer.compact .offer-text { font-size: 1.05rem; }

.sponsor-feature {
  display: block; margin-top: 1rem; text-align: center; text-decoration: none; color: inherit;
  transition: border-color 0.2s;
}
.sponsor-feature:hover { border-color: var(--brass); }
.sponsor-feature .sponsor-logo { max-height: 2.6rem; }

.sponsor-offer-line {
  margin: 0.9rem auto 0; max-width: 40ch;
  font-family: var(--display); font-size: 1.05rem; color: var(--chalk);
}

.sponsor-wordmark {
  font-family: var(--display); font-weight: 600 !important;
  font-size: 1.3rem; line-height: 1.15; color: var(--chalk);
}
.sponsor-blurb { margin: 0.6rem 0 0; font-size: 0.85rem; max-width: 30ch; }
.sponsor-call {
  display: inline-block; margin-top: 0.9rem; padding: 0.45rem 0.95rem;
  border: 1px solid var(--brass); border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--brass-lt);
}
.sponsor-call:hover { background: rgba(201,162,39,0.12); }
.sponsor-logo { border-radius: 6px; }
.sponsor-space { border-style: dashed; text-decoration: none; color: inherit; background: transparent; }
.sponsor-space:hover { border-color: var(--brass); }

/* ---------- Printable fixtures (fixtures-print) ---------- */

/* On screen the A4 sheet is shown as paper; printed, it is the only thing on the page. */
.print-link { margin: 1rem 0; }
.pf-btn {
  display: inline-block; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: none;
  color: var(--chalk); background: none; border: 1px solid var(--brass); border-radius: 999px;
  padding: 0.45rem 1rem;
}
.pf-btn:hover { background: rgba(255,255,255,0.06); }
.pf-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0 1rem; }
.pf-sheet {
  background: #fff; color: #111; border-radius: var(--radius); padding: 1.25rem;
  max-width: 210mm; margin: 0 auto 2rem; font-size: 0.8rem; line-height: 1.35;
}
.pf-head { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid #1E6B40; padding-bottom: 0.6rem; }
.pf-head img { width: 64px; height: 64px; flex: none; }
.pf-head h1, .pf-head h2 { font-family: var(--display, Georgia, serif); font-size: 1.45rem; margin: 0; color: #111; }
.pf-head p { margin: 0.15rem 0 0; font-weight: 600; color: #6b5414; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.45rem; margin-top: 0.8rem; }
.pf-night { border: 1px solid #c9cbc2; border-radius: 4px; padding: 0.35rem 0.5rem; break-inside: avoid; }
.pf-night h3 { display: flex; justify-content: space-between; margin: 0 0 0.2rem; font-size: 0.78rem; color: #1E6B40; font-family: inherit; }
.pf-night h3 span { color: #555; font-weight: 600; }
.pf-night ul { list-style: none; margin: 0; padding: 0; }
.pf-night li { margin: 0.05rem 0; }
.pf-night .pf-bye { color: #666; font-style: italic; }
.pf-night.is-cup { background: #f6f1e2; }
.pf-night.is-cup p { margin: 0; }
.pf-foot { margin-top: 0.8rem; border-top: 1px solid #c9cbc2; padding-top: 0.5rem; }
.pf-foot p { margin: 0.2rem 0; }
.pf-note { color: var(--chalk-dim); margin: 0 0 1rem; }
.pf-clubs { list-style: none; margin: 0.3rem 0; padding: 0; columns: 2; column-gap: 1.5rem; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body:has(.pf-sheet) > :not(main), body:has(.pf-sheet)::after, .pf-actions { display: none !important; }
  html:has(.pf-sheet), body:has(.pf-sheet), body:has(.pf-sheet) main { background: #fff !important; min-height: 0; }
  body:has(.pf-sheet), body:has(.pf-sheet) main { padding: 0 !important; margin: 0 !important; }
  .pf-screen, .pf-screen .wrap { padding: 0; margin: 0; max-width: none; }
  /* Printed on club and home printers: a sturdy system face, solid black, no pale greys. */
  .pf-sheet { padding: 0; margin: 0; max-width: none; border-radius: 0; font-size: 9.6pt; color: #000;
    font-family: Arial, Helvetica, sans-serif; }
  .pf-night { border: 0.4mm solid #555; }
  .pf-night h3 { color: #000; font-size: 1em; border-bottom: 0.25mm solid #555; padding-bottom: 0.4mm; margin-bottom: 0.6mm; }
  .pf-night h3 span { color: #000; font-weight: 700; }
  .pf-night .pf-bye { color: #000; }
  .pf-head { border-bottom-width: 0.6mm; }
  .pf-head p { color: #000; }
  .pf-foot { border-top: 0.3mm solid #555; }
  .pf-grid { grid-template-columns: repeat(3, 1fr); gap: 2mm; }
  .pf-night { padding: 1.2mm 2mm; }
  .pf-head img { width: 18mm; height: 18mm; }
  .pf-note { display: none; }
  .pf-sheet + .pf-sheet { break-before: page; }
  .pf-sheet.is-four { font-size: 9.2pt; line-height: 1.22; }
  .pf-sheet.is-four .pf-grid { grid-template-columns: repeat(4, 1fr); gap: 1.8mm; }
  .pf-sheet.is-four .pf-night { padding: 1mm 1.6mm; }
  .pf-sheet.is-dense { font-size: 8.2pt; line-height: 1.16; }
  .pf-sheet.is-dense .pf-grid { grid-template-columns: repeat(4, 1fr); gap: 1.3mm; }
  .pf-sheet.is-dense .pf-night { padding: 0.7mm 1.5mm; }
  .pf-sheet.is-dense .pf-night h3 { padding-bottom: 0.2mm; margin-bottom: 0.3mm; }
  .pf-sheet.is-dense .pf-night li { margin: 0; }
  .pf-sheet.is-dense .pf-clubs { columns: 3; margin: 0.6mm 0; }
  .pf-sheet.is-dense .pf-foot { margin-top: 2mm; padding-top: 1mm; font-size: 7.2pt; }
  .pf-sheet.is-dense .pf-grid { margin-top: 2mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Live scores: match chat (captains.liveChat) ---------- */
.live-chat { margin-top: 2rem; }
.live-chat-note { font-size: 0.85rem; margin: 0 0 0.6rem; max-width: 60ch; }
.live-chat-log {
  height: min(16rem, 45vh); overflow-y: auto; overscroll-behavior: contain; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,0.22);
}
.live-chat-line { margin: 0 0 0.45rem; line-height: 1.4; overflow-wrap: anywhere; }
.live-chat-line b { color: var(--brass-lt); margin-right: 0.15rem; }
.live-chat-time { font-size: 0.72rem; color: var(--chalk-dim); margin-right: 0.45rem; }
.live-chat-form { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.live-chat-row { display: flex; gap: 0.5rem; }
.live-chat-form input {
  min-width: 0; font: 500 1rem var(--body); color: var(--chalk);
  background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.7rem;
}
.live-chat-form input:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.live-chat-name { max-width: 14rem; }
.live-chat-row input { flex: 1; }
.live-chat-row .cf-btn { flex: none; padding-inline: 1.1rem; }
