/* Self-hosted fonts (latin subsets, OFL — see assets/fonts/LICENSE.txt).
   URLs are relative to this CSS file, so no base-path plumbing; the
   ?v=filemtime buster on the stylesheet covers invalidation. Work Sans is a
   variable font — one file serves weights 400-600. */
@font-face {
    font-family: 'Marcellus';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/marcellus-400-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;
}
@font-face {
    font-family: 'Work Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/work-sans-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;
}
@font-face {
    font-family: 'Work Sans';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/work-sans-italic-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 {
    /* Brackenhurst brand palette (from the Style Guide) */
    --ink: #0C3A2B;        /* Bottle Green — headings / darkest ink */
    --primary: #14523B;    /* Green — primary actions, links */
    --fairway: #1A6047;    /* Fairway — accent */
    --cream: #F4F1E9;      /* Cream — cards / panels */
    --sand: #E9E7DE;       /* Sand — page background */
    --text: #24352D;       /* Ink Body — body text */
    --muted: #646453;      /* Muted — captions (AA: 4.9:1 on sand, 6:1 on white) */
    /* Brass is the club's gilt, and on this site it carries exactly ONE meaning:
       this person won. It appears on the honours board (every line there is a
       champion) and on the winning side of a scorecard — nowhere else. Section
       rules and eyebrows stay --border/--muted so the signal is not diluted.
       ⚠️ Brass on cream/sand is 2.5:1 — NEVER text on a light ground. On light
       surfaces it may only be a non-text edge or rule. */
    --brass: #B99653;      /* Brass — 6.1:1 on --board, AA for body text */
    --brass-dim: rgba(var(--brass-rgb), .18);  /* hairline separators inside the board */
    --board: #082018;      /* Varnished-board ground — the honours board only */
    --jack: #F2C14E;       /* The jack is yellow: the live/now state. Reserved for
                              it — brass means "won", so a game in progress must
                              never borrow brass and a finished one never this. */
    --field-bg: #FBFAF6;   /* Input background */

    /* The palette again as bare channels, for the see-through panels:
       rgba(var(--cream-rgb), .72). Comma form on purpose: color-mix() and
       relative colours are dropped silently by the older phones members
       carry, and the rule goes with them. A club's theme sets each of
       these alongside the colour it mirrors. */
    --ink-rgb: 12, 58, 43;
    --primary-rgb: 20, 82, 59;
    --fairway-rgb: 26, 96, 71;
    --cream-rgb: 244, 241, 233;
    --bottle-900-rgb: 7, 29, 20;
    --overlay-rgb: 8, 30, 22;      /* the lightbox ground, the club's darkest */
    --brass-rgb: 185, 150, 83;
    --fairway-deep: #175840;       /* the second masthead stripe */
    --brass-light: #dcc08a;        /* brass lifted — a champion's link on hover */

    /* Bottle-green scale (kept for existing selectors) */
    --bottle-900: #071d14;
    --bottle-800: var(--ink);
    --bottle-700: var(--primary);
    --bottle-600: var(--fairway);
    --bottle-500: #1f6e52;
    --bottle-400: #2f8468;
    --bottle-300: #5aa98d;
    --bottle-100: #e4ede9;

    /* Semantic aliases used across the site */
    --green-dark: var(--ink);
    --green-mid: var(--primary);
    --green-light: var(--bottle-400);
    --green-accent: var(--bottle-500);
    --green-pale: var(--bottle-100);

    --border: #d8d3c4;
    --danger: #c0392b;
    --success: var(--primary);

    /* Two measures. Prose and forms keep the 960 column; grids and boards get
       the wider one, because at 1440 the old single measure left ~480px of
       empty sand either side of one narrow column of cards. */
    --measure: 960px;
    --measure-wide: 1140px;

    --radius: 6px;
    --radius-sm: 4px;
    --radius-pill: 999px;
    --shadow: 0 10px 30px -22px rgba(var(--ink-rgb), .5);

    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Marcellus', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--sand);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    color: var(--ink);
}
/* 2.6 / 1.85 / 1.4 / 1.15 was a flat ~1.3 ratio the whole way down, which reads
   as a gradient rather than a hierarchy. More contrast at the top, less in the
   middle — and Marcellus is an inscriptional Roman face, so it earns the size. */
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }

/* [hidden] must actually hide. The browser's own rule is `[hidden]{display:none}`
   at specificity (0,1,0), and ANY author rule that sets display at the same
   specificity beats it — `.chip{display:inline-block}` and
   `.ls-note{display:flex}` both did. That is not a cosmetic slip: this whole
   codebase's progressive-enhancement rule is "the control ships hidden and JS
   reveals it", so a silently ineffective [hidden] means a no-JS visitor sees
   every JS-only control at once — on the live board, both the Live AND Final
   chips, plus "Auto-refreshing live" on a page that is not refreshing.
   !important rather than relying on source order, because order is a trap that
   springs the next time a component is moved. */
[hidden] { display: none !important; }

/* Keyboard focus: brass ring, visible on both light panels and the dark nav.
   A focus indicator is chrome, not content — it is the one brass thing that is
   not saying "won", and it never appears in the same layer as one that is. */
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 2px; }

/* Off-screen but announced. For a fact carried visually that has no text
   equivalent — the brass edge marking the winning side of a scorecard. NOT
   display:none, which would drop it from the accessibility tree as well. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* The utility role — Work Sans 600 in letterspaced caps, the "engraved plate".
   Three near-identical versions of this existed at three different sizes
   (.overline, .notice-meta, form labels); this is the one they now share. */
.label, .overline, .notice-meta, .section-head {
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    line-height: 1.4;
    text-transform: uppercase;
}
.overline { color: var(--primary); }

/* Section heading: label-cased text with a rule running out to the right.
   Deliberately NOT brass — brass means "won" and nothing else. */
/* Case, size, weight and tracking come from the shared rule above — this adds
   only the layout and the colour. */
.section-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 2.25rem 0 1rem;
    color: var(--ink);
}
.section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.section-head:first-child { margin-top: .5rem; }

.container { max-width: var(--measure); margin: 0 auto; padding: 1rem; }
.container--wide { max-width: var(--measure-wide); }

/* Interior page hero — the masthead's gradient vocabulary on inner pages. */
.page-hero {
    background: linear-gradient(155deg, var(--primary) 0%, var(--ink) 100%);
    color: var(--cream);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2rem 1.5rem;
    margin: 1.25rem 0 1.5rem;
}
.page-hero-overline {
    font-size: .75rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: rgba(var(--cream-rgb), .72);
    margin-bottom: .6rem;
}
.page-hero-title { color: var(--cream); margin: 0; }
.page-hero-meta { color: rgba(var(--cream-rgb), .85); margin-top: .35rem; }
.page-hero-rule {
    width: 56px;
    height: 2px;
    background: rgba(var(--cream-rgb), .5);
    border: 0;
    margin: 1.1rem 0 0;
}

/* Nav */
/* Off-screen until focused, then pinned over the nav. First stop on Tab. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 60;
    background: var(--cream);
    color: var(--ink);
    padding: .6rem 1rem;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600;
}
.skip-link:focus { left: 0; }
.site-nav {
    background: linear-gradient(180deg, var(--bottle-800), var(--bottle-900));
    color: #fff;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    gap: .5rem;
    /* Under .lightbox (z-index 100), which is the only other stacked element. */
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-brand {
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}
.nav-brand:hover { text-decoration: none; color: #fff; }
.nav-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(var(--cream-rgb), .4); background: #fff; }
/* A crest wider than 1.3 : 1 (SiteBranding::logoIsWide) — a pill it is fitted
   into, never a circle it is cropped to. */
.nav-logo--wide { width: auto; max-width: 104px; border-radius: 999px; object-fit: contain; padding: 3px 10px; background: var(--cream); }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.15rem; margin-left: auto; }
.nav-links a { color: rgba(var(--cream-rgb), .82); font-size: 1rem; font-weight: 500; }
.nav-links a.active, .nav-links a:hover { color: #fff; text-decoration: none; }

/* --- Grouped nav -----------------------------------------------------------
   Native <details>, so a group opens with no JavaScript and is keyboard and
   screen-reader operable out of the box. js/app.js only ADDS closing behaviour.
   On desktop the panel floats; inside the mobile drawer it becomes an inline
   accordion, which is what makes a fourteen-item nav readable on a phone. */
.nav-group { position: relative; }

.nav-group > summary {
    color: rgba(var(--cream-rgb), .82);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;         /* the default marker; ::marker below covers Firefox */
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    /* A summary is the tap target, so it gets a real one even in a dense bar. */
    padding: .35rem 0;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::marker { content: ''; }

/* The caret is drawn here rather than typed into the markup, so it rotates on
   open and is never read aloud as a character. */
.nav-group > summary::after {
    content: '';
    width: .4rem;
    height: .4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s ease;
}
.nav-group[open] > summary::after { transform: translateY(1px) rotate(-135deg); }

.nav-group > summary:hover,
.nav-group[open] > summary { color: #fff; }

/* The group holding the current page says so, the same way a link does. */
.nav-group--current > summary { color: #fff; }

.nav-group-menu {
    position: absolute;
    top: 100%;
    /* Anchored RIGHT, not left. .nav-links carries margin-left:auto, so every
       group sits in the right half of the bar — "The Club" and "Member" are
       hard against the edge, and a left-anchored panel opened off-screen with
       no way to scroll to it. Opening leftward is correct for all of them. */
    right: -.5rem;
    left: auto;
    /* 10.5rem, not 12: four short words did not need the extra width, and the
       narrower panel sits visibly under the label that opened it instead of
       drifting away to the left. */
    min-width: 10.5rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .4rem;
    margin-top: .35rem;
    background: var(--bottle-900);
    border: 1px solid rgba(var(--cream-rgb), .14);
    border-radius: var(--radius);
    /* Enough to lift it off the page, not enough to announce itself. */
    box-shadow: 0 10px 24px -14px rgba(0,0,0,.65);
    /* Above the page but under .lightbox (100) and level with the bar itself. */
    z-index: 51;
}

.nav-group-menu a {
    padding: .5rem .6rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.nav-group-menu a:hover,
.nav-group-menu a.active { background: rgba(var(--cream-rgb), .10); color: #fff; }

.nav-toggle { display: none; background: none; border: none; color: var(--cream); font-size: 1.5rem; cursor: pointer; min-width: 44px; min-height: 44px; }

/* 1080, not 700: the brand takes ~250px and fourteen links need ~1000px, so
   anywhere below ~1290px the bar wrapped to two rows — and it is sticky, so
   that second row ate ~45px of every screen. A drawer is the better trade.
   ⚠️ The admin sidebar's own collapse rules must STAY in a 700px block;
   tests/admin-nav-test.php looks for them there. Only this one moved.

   Everything here is gated on .site-nav--js, which only js/app.js sets — the
   same shape the admin sidebar already uses. Widening the drawer to 1080px
   without it would have handed every no-JS visitor between 700 and 1080px a
   visible hamburger that does nothing and no route off the page. Without JS
   the links stay put and wrap, which is ugly and works. */
@media (max-width: 1080px) {
    .site-nav--js .nav-toggle { display: block; }
    .site-nav--js .nav-links { display: none; width: 100%; flex-direction: column; }
    /* The bar is sticky, so a 15-item drawer can outgrow a short viewport with
       no way to reach the bottom of it. Scroll the drawer, not the page. */
    .site-nav--js .nav-links.open { display: flex; max-height: calc(100vh - 4.5rem); overflow-y: auto; }

    /* In the drawer a group is an ACCORDION, not a floating panel: the panel
       has nowhere to float to in a one-column list, and an inline expand is
       what makes seven groups shorter than fourteen links instead of longer. */
    .site-nav--js .nav-group-menu {
        position: static;
        min-width: 0;
        margin: .2rem 0 .4rem;
        padding: .3rem 0 .3rem .9rem;
        background: none;
        border: none;
        border-left: 2px solid rgba(var(--cream-rgb), .18);
        border-radius: 0;
        box-shadow: none;
    }
    /* Full-width targets in the drawer: a summary is the thing being tapped and
       a thumb should not have to find the text. */
    .site-nav--js .nav-group > summary { justify-content: space-between; width: 100%; }
    .site-nav--js .nav-group-menu a { white-space: normal; padding: .5rem .2rem; }
}

/* Landing masthead — split hero card (layout 1b) */
.masthead {
    background: var(--cream);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 60px -30px rgba(var(--ink-rgb), .55);
    margin: 1.5rem 0;
}
.masthead-top {
    display: flex;
    min-height: 380px;
}
.masthead-intro {
    flex: 1.1;
    background: linear-gradient(155deg, var(--primary) 0%, var(--ink) 100%);
    color: var(--cream);
    padding: 3.25rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.masthead-overline {
    color: rgba(var(--cream-rgb), .72);
    font-size: .75rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
}
.masthead-title {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--cream);
    /* Guide spec is a 52px hero H1; clamp scales it down smoothly on phones
       and replaces the old fixed 2.9rem + 2.2rem breakpoint pair. */
    font-size: clamp(2.4rem, 6vw, 3.25rem);
    line-height: 1.08;
    margin: 0;
    /* The wider measure let "Brackenhurst Bowling / Club" break with one word
       stranded on the second line. Balance evens the lines where supported and
       is ignored where it isn't. */
    text-wrap: balance;
}
.masthead-tagline {
    color: rgba(var(--cream-rgb), .88);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: .9rem;
    max-width: 34ch;
}
.masthead-rule {
    width: 56px;
    height: 2px;
    background: rgba(var(--cream-rgb), .5);
    border: 0;
    margin: 1.75rem 0;
}
/* A returning member's first question — "what's on?" — answered above the fold,
   before they scroll. Jack yellow (the target ball is yellow) is the live/now
   state and this is the only place on the site it appears. */
.masthead-next {
    margin: 0 0 1.4rem;
    color: var(--jack);
    font-size: 1rem;
    line-height: 1.45;
}
.masthead-next .label {
    display: block;
    margin-bottom: .2rem;
    /* .72, matching the other overlines on this gradient: at .6 the blend
       against the lighter --primary stop is ~4.0:1, under the 4.5:1 floor for
       11.5px text. .72 measures ~5.0:1. */
    color: rgba(var(--cream-rgb), .72);
}

.masthead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .875rem;
}

/* Photo panel (top-left) — full-bleed carousel that crossfades */
.masthead-photo {
    flex: .9;
    order: -1;                 /* sit to the left of the intro panel */
    position: relative;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, var(--fairway) 0 22px, var(--fairway-deep) 22px 44px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.masthead-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 1.1s ease-in-out;
    pointer-events: none;
}
.masthead-slide.is-active { opacity: 1; }
.masthead-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (prefers-reduced-motion: reduce) {
    .masthead-slide { transition: none; }
}
/* No photo yet: the crest, on the stripes. Disc or pill by the same rule as the nav. */
.masthead-crest { width: 96px; height: 96px; border-radius: 50%; object-fit: contain; background: #fff; padding: 12px; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.masthead-crest--wide { width: auto; max-width: 70%; height: 64px; border-radius: 999px; padding: 10px 22px; background: var(--cream); }
.masthead-photo-empty {
    color: rgba(var(--cream-rgb), .6);
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-align: center;
}

.masthead-body {
    padding: 2.75rem 2.75rem 3rem;
}
.masthead-body .home-welcome {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Buttons on a dark panel */
.btn-on-dark { background: var(--cream); color: var(--ink); }
.btn-on-dark:hover { background: #fff; color: var(--ink); }
.btn-outline-light { background: transparent; border-color: rgba(var(--cream-rgb), .55); color: var(--cream); }
.btn-outline-light:hover { background: rgba(var(--cream-rgb), .12); color: var(--cream); }

@media (max-width: 700px) {
    .masthead-top { flex-direction: column; }
    .masthead-intro { padding: 2.5rem 1.75rem; }
    .masthead-photo { min-height: 220px; }
    .masthead-body { padding: 2rem 1.5rem 2.25rem; }
}

/* The full-width 16:9 showcase that used to sit here is gone: it crossfaded the
   same rotation set as .masthead-photo directly above it, so the landing page
   opened with two carousels of the same green. The photos are not lost —
   SiteBranding::mastheadImages() folds the rotation into the masthead carousel. */

/* Two audiences, two columns. The returning member's weekly business (results,
   what's on) gets the wider one because that is who visits most; the club's
   standing content sits beside it. Below 900px it stacks, and source order
   already puts the results column first. */
/* Row gap matters only in the stacked case — with one row it is inert — and
   without it the club column's first heading butts straight up against the end
   of the results column on a phone. */
.home-grid { display: grid; gap: 2rem 3rem; }
@media (min-width: 900px) {
    /* minmax(0, …), not a bare fr: an fr track's implicit minimum is auto, so a
       long unbroken competition name in the letterspaced .scorecard-meta could
       push its track past its share and scroll the whole page sideways under
       the sticky nav. */
    .home-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}
.home-col > :first-child { margin-top: .5rem; }

.home-intro p + p { margin-top: 1rem; }
.home-welcome {
    font-size: 1.1rem;
    line-height: 1.7;
}
.home-welcome p:last-child {
    margin-bottom: 0;
}
.home-section-title {
    margin: 1.75rem 0 .75rem;
    color: var(--green-dark);
}

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-body { padding: 1.25rem; }
.card-body h3 { margin-bottom: .35rem; }
/* A card title's heading LEVEL follows the document outline — h2 where the card
   sits directly under the page h1, h3 where a section heading comes between —
   so the size cannot come from the tag. This class carries it either way. */
.card-title { font-size: 1.3rem; margin-bottom: .35rem; }
.card img { width: 100%; height: 160px; object-fit: cover; }
/* ⚠️ A POSTER IS THE MESSAGE, so it is never cropped — the same rule
   .notice-image already follows, and for the same reason. The club posts wide
   banner graphics ("FRIDAY NIGHT AT THE CLUB · Spaghetti Bolognese · R80"),
   roughly 4:1, and the 160px cover box above is 1.8:1 — so cover sliced both
   ends off and the card read "RIDAY NIGHT AT THE CLU" over "OKER JACKPOT".
   Cropping stays correct for an album cover, where a thumbnail IS a thumbnail;
   this modifier is only for cards whose image carries words.
   max-height with contain, not a bare height:auto, so a tall portrait poster
   is letterboxed rather than allowed to run the length of the page. */
.card--poster img {
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: var(--sand);
}
/* One poster per row, sized to the source. The auto-fill grid squeezed two
   banners to ~240px each, narrower than the words printed on them; but at the
   full 1140px container a 4:1 banner is 285px tall and two of them push the
   results and the week's fixtures off the screen entirely.

   ⚠️ 560px is not arbitrary. The club's posters are about 550px wide at source
   (549x124 and 554x214 as uploaded), and stretching a 549px JPEG across 720px
   upscales it 31% — a soft, blurred banner, on the one image whose whole job is
   to be read. Sized to the source it stays sharp. Raise this only alongside
   bigger uploads; ImageUploadService already allows up to 1600px wide. */
.card-grid--stack { grid-template-columns: minmax(0, 560px); }
/* The direct child only — the "Read more" button is an <a> too, and it lives
   inside .card-body. */
.card--poster > a { display: block; cursor: zoom-in; }
.card--poster > a img { transition: opacity .15s ease; }
.card--poster > a:hover img,
.card--poster > a:focus-visible img { opacity: .92; }
/* Whole-card links (e.g. the admin How-To index) */
a.card { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -20px rgba(var(--ink-rgb), .65); }
a.card .card-body p { color: var(--muted); font-size: .9rem; }

/* Forms */
/* Base select styling — keeps options readable (dark on white) everywhere,
   including bare selects outside a .form-group. */
select {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background-color: #fff;
    padding: .55rem .75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}
select option {
    color: var(--text);
    background-color: #fff;
}
.form-group { margin-bottom: 1rem; }
/* Sentence case and lower contrast than the label above it: a hint explains,
   it does not shout. Sits under the input it describes. */
.form-hint { display: block; margin-top: .3rem; font-size: .85rem; color: var(--muted); }
.form-group label {
    display: block;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: .4rem;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--field-bg);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .12);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* Extracted utilities (replace repeated inline styles) */
/* Capped at the old 2.6rem h1 size on purpose. The new h1 clamp tops out at
   3.6rem, and .page-title is worn by 19 pages this redesign did not look at —
   including admin/login.php, which loads this stylesheet from ../ and is out of
   scope. The bigger scale reaches .page-hero-title and .masthead-title, which
   were designed against it. */
.page-title { margin: 1.5rem 0; color: var(--green-dark); font-size: clamp(2rem, 4vw, 2.6rem); }
.section-title { margin: 1.5rem 0 .75rem; color: var(--green-mid); }
.form-subhead { margin-top: 1.25rem; }
.admin-form { margin-top: 1rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.container-narrow { max-width: 400px; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.nowrap { white-space: nowrap; }
.hidden-form { display: none; }
.mt-05 { margin-top: .25rem; }
.list-plain { list-style: none; }
/* A whole card as one link: keep card text colours, never underline. */
.card-link, .card-link:hover { text-decoration: none; color: inherit; }
.gallery-caption { font-size: .85rem; color: var(--muted); }
.mt-3 { margin-top: 3rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .8rem 1.5rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--cream); }
.btn-primary:hover { background: var(--ink); color: var(--cream); }
.btn-secondary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: var(--cream); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: rgba(var(--primary-rgb), .08); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9e2f22; color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1eb356; color: #fff; }
.btn-sm { padding: .5rem 1rem; font-size: .82rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .95rem; }
th { background: var(--green-dark); color: var(--cream); font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; }
tr:last-child td { border-bottom: none; }

/* Flash */
.flash { padding: .75rem 1rem; margin: 1rem; border-radius: var(--radius); }
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

/* Notices */
.notice-item { background: #fff; padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: .75rem; box-shadow: var(--shadow); }
/* Ink, not brass: on the home page a pinned notice sits in the right column
   while a winning scorecard side sits in the left, and both painted a brass
   left edge — the same token carrying two meanings side by side, which is
   exactly the dilution the note on --brass forbids. Pinned means "kept at the
   top", not "won". */
.notice-item.pinned { border-left: 4px solid var(--ink); }
/* The club posts AI-generated message images — the poster IS the notice, not
   decoration — so it is NEVER cropped. No object-fit: cover here, unlike
   .shop-card img which crops on purpose (a product thumbnail is a thumbnail).
   A poster with its bottom third cut off has lost the message. */
.notice-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: .75rem 0;
}
/* List and homepage: cap the height so five posters are not a five-screen page.
   `contain` letterboxes rather than crops — height:auto with max-height alone
   would squash the picture instead. Anchored top-left so the poster's heading,
   which is where its text usually starts, is the part that stays visible. */
.notice-image--preview {
    max-height: 360px;
    object-fit: contain;
    object-position: left top;
}
/* Admin edit-form preview. Small on purpose — it confirms which image is
   attached, it is not the presentation. */
.admin-image-preview { max-width: 240px; border-radius: var(--radius); display: block; }
/* Two or more checkboxes on one line. Named for what it holds rather than
   reusing .btn-row, which is the same flexbox but would read as a lie. */
.checkbox-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
/* Case, size and tracking come from the shared .label rule above. */
.notice-meta { color: var(--muted); margin-bottom: .3rem; }

/* Scorecard — one recorded result, as the card the club actually keeps.
   It used to borrow .notice-item, which is also the carrier for notices,
   fixtures, tabs sessions and my-club panels: five kinds of thing in one box.
   Both sides are always shown, and the winner is marked by weight plus a brass
   edge rather than the word "beat" — a scorecard does not narrate. */
.scorecard {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
}
.scorecard-meta { color: var(--muted); margin-bottom: .75rem; }
.scorecard-side {
    display: grid;
    /* minmax(0, …) for the same reason as .home-grid: a long team string must
       wrap inside its track rather than widen it and overflow the card. */
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .75rem;
    padding: .35rem 0 .35rem .85rem;
    /* Transparent, not absent: both sides keep the same indent so the names
       line up and only the colour distinguishes them. */
    border-left: 3px solid transparent;
}
.scorecard-side--won {
    border-left-color: var(--brass);
    font-weight: 600;
    color: var(--ink);
}
.scorecard-name { line-height: 1.35; overflow-wrap: break-word; }
.scorecard-score {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    /* Tabular figures: scores stack down a column on results.php and a 1 has to
       occupy the same width as a 9 or the units drift. */
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.scorecard-side--won .scorecard-score { color: var(--ink); }
.scorecard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.gallery-grid figure { margin: 0; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); display: block; }
/* Anything that opens in the lightbox. .gallery-zoom adds the square crop mask
   and the hover the album grid wants; other surfaces take the bare affordance.
   NEITHER is a behaviour hook — js/app.js reads [data-lightbox-item]. */
.gallery-zoom, .zoom-link { display: block; cursor: zoom-in; }
.gallery-zoom { border-radius: var(--radius); overflow: hidden; }
.gallery-zoom img { transition: transform .3s ease; }
.gallery-zoom:hover img { transform: scale(1.06); }

/* Lightbox — ONE overlay, built by js/app.js, shared by every [data-lightbox]
   group on the page. Nothing here is emitted by PHP, so there is no dead control
   for a no-JS visitor to find: the page ships plain links to the image files and
   clicking one opens the picture. z-index 100 keeps it over the sticky nav (50)
   and the skip link (60). */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    background: rgba(var(--overlay-rgb), .94);
}
/* Grid, not flex: the arrows get COLUMNS OF THEIR OWN, so they can never sit on
   top of the picture. On a phone that is the difference between a control and
   something you hit by accident while looking at a photo. */
.lightbox.is-open {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    gap: .5rem;
    padding: 3.5rem .5rem 1rem;   /* top gutter clears the close button */
}
.lightbox img {
    grid-column: 2;
    grid-row: 1;
    /* NO upscaling. A small original stays small and sharp rather than being
       blown up into a blurry one — the point of the overlay for those is that
       the grid's square crop is gone, not that they got bigger. That is what
       makes dropping gallery.php's old 600px gate safe. */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
}
.lightbox-prev, .lightbox-next, .lightbox-close {
    background: rgba(0, 0, 0, .35);
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
}
.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover { background: rgba(0, 0, 0, .6); }
.lightbox-prev { grid-column: 1; grid-row: 1; }
.lightbox-next { grid-column: 3; grid-row: 1; }
.lightbox-close {
    position: absolute;
    top: .75rem;
    right: 1rem;
    font-size: 2.25rem;
    background: none;
    border-radius: 0;
}
/* Counter and caption, and the live region that announces both on every move. */
.lightbox-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    max-width: 60ch;
    color: var(--cream);
    text-align: center;
    font-size: .9rem;
}
.lightbox-counter {
    display: block;
    /* Tabular figures: "9 of 24" must not shift when it becomes "10 of 24". */
    font-variant-numeric: tabular-nums;
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
}
.lightbox-caption { display: block; }

/* Phone: the picture takes the full width and the controls drop to a bottom bar,
   where a thumb already is. Side arrows on a 360px screen either overlap the
   photo or squeeze it to nothing — and a 44px target halfway up the left edge is
   exactly where nobody's thumb reaches one-handed. */
@media (max-width: 640px) {
    .lightbox.is-open { padding: 3rem .25rem .75rem; }
    .lightbox img { grid-column: 1 / -1; }
    .lightbox-prev { grid-column: 1; grid-row: 2; }
    .lightbox-next { grid-column: 3; grid-row: 2; }
    .lightbox-meta { grid-column: 2; grid-row: 2; font-size: .85rem; }
}

/* Scroll lock. Without it a swipe or a wheel scrolls the album behind the
   overlay, and closing lands you somewhere you never chose to be. */
body.lightbox-open { overflow: hidden; }

/* Bracket */
.bracket-round { margin-bottom: 1.5rem; }
.bracket-round h3 { color: var(--green-dark); margin-bottom: .5rem; text-transform: capitalize; }
.match-card {
    background: #fff; padding: .85rem; border-radius: var(--radius);
    margin-bottom: .5rem; box-shadow: var(--shadow); font-size: .9rem;
}
.match-card .winner { font-weight: 700; color: var(--green-mid); }

/* Calendar */
.calendar-month { font-size: 1.4rem; margin: 0 .25rem; }
.event-item { background: #fff; padding: 1rem; border-radius: var(--radius); margin-bottom: .75rem; box-shadow: var(--shadow); display: flex; gap: 1rem; }
.event-date { background: var(--green-dark); color: var(--cream); padding: .5rem .75rem; border-radius: var(--radius); text-align: center; min-width: 60px; }
.event-date .day { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.event-date .month { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px; background: linear-gradient(180deg, var(--bottle-800), var(--bottle-900)); color: #fff; padding: 1rem 0; flex-shrink: 0;
}
.admin-brand { padding: 0 1rem 1rem; font-family: var(--font-display); font-size: 1.1rem; color: var(--cream); border-bottom: 1px solid rgba(var(--cream-rgb), .2); margin-bottom: .5rem; display: flex; align-items: center; gap: .6rem; }
.admin-brand-logo { margin-bottom: .5rem; }
/* Hidden on desktop, where the sidebar is always open. */
.admin-nav-toggle { display: none; margin-left: auto; background: none; border: none; color: var(--cream); font-size: 1.5rem; cursor: pointer; min-width: 44px; min-height: 44px; }
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-navgroup { padding: .9rem 1rem .25rem; margin: 0; font-family: var(--font-body); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(var(--cream-rgb), .5); }
.admin-sidebar a { color: rgba(var(--cream-rgb), .82); padding: .55rem 1rem; font-size: .9rem; }
.admin-sidebar a:hover { background: rgba(var(--cream-rgb), .1); color: #fff; text-decoration: none; }
/* Active was byte-identical to hover, so the sidebar never showed where you
   were — only where the pointer happened to be. */
.admin-sidebar a.active { background: rgba(var(--cream-rgb), .16); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--cream); text-decoration: none; }
.admin-main { flex: 1; padding: 1.5rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.6rem; color: var(--green-dark); }

@media (max-width: 700px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    /* The sidebar stacks above the content here, so all 29 links sat between
       the admin and the page they had opened. Collapse them behind a toggle —
       but only once the script has armed it, so a no-JS admin keeps the full
       list rather than losing the nav entirely. */
    .admin-sidebar--js .admin-nav-toggle { display: block; }
    .admin-sidebar--js nav { display: none; }
    .admin-sidebar--js nav.open { display: flex; max-height: 70vh; overflow-y: auto; }
    .admin-brand { margin-bottom: 0; padding-bottom: .75rem; }
}

.site-footer { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text); }
.empty-state-art { display: block; margin: 0 auto .75rem; color: var(--border); }
.empty-state-message { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.empty-state-hint { font-size: .95rem; margin-top: .35rem; }
.empty-state .btn { margin-top: 1rem; }

.badge { display: inline-block; padding: .25rem .7rem; border-radius: var(--radius-pill); font-size: .8rem; font-weight: 600; letter-spacing: .03em; }
.badge-open { background: var(--green-pale); color: var(--bottle-800); }
.badge-closed { background: #f8d7da; color: #721c24; }
.badge-pending { background: #fff3cd; color: #856404; }
/* Draft is not a warning, so it stays neutral rather than borrowing the amber
   "pending" pill — amber is reserved for "scheduled", which IS waiting on
   something. Sand matches .chip--closed, the public equivalent of "not now". */
.badge-draft { background: var(--sand); color: var(--text); }

/* Status chips on public competition cards (admin tables keep .badge). */
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .35rem 0; }
.chip { display: inline-block; padding: .25rem .7rem; border-radius: var(--radius-pill); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.chip--open { background: var(--green-pale); color: var(--bottle-800); }
/* New-member welcome names. Deliberately NOT .chip--open: these are people,
   not a state anybody can act on, and an "entries open" pill sitting beside
   the real status chips further down the same page would read as one. */
.welcome-list { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .6rem; padding: 0; list-style: none; }
.welcome-name { display: inline-block; padding: .3rem .85rem; border-radius: var(--radius-pill); background: var(--bottle-100); color: var(--bottle-800); font-weight: 600; font-size: .9rem; }
.chip--closed { background: var(--sand); color: var(--text); }
.chip--soon { background: #fff3cd; color: #856404; }
.chip--done { background: var(--ink); color: var(--cream); }
/* Champion is the one chip that means "won", so it wears the board's colours
   rather than the pale-green "open" pill it used to borrow — a second, competing
   victory signal sitting next to the brass edge. Brass on board is 6.1:1. */
.chip--champion { background: var(--board); color: var(--brass); }
/* Live scoring. These three sit here rather than in css/pages/live.css because
   the homepage strip uses them and index.php does not load that file.
   The jack is the live/now colour — brass already means "won" everywhere on
   this site, so a game in progress must not borrow it. */
.chip--live { background: var(--jack); color: var(--ink); }
.chip--watching { background: var(--cream); color: var(--muted); }
/* ⚠️ NOT cream. This chip is drawn INSIDE .md-done, whose ground is
   --green-pale, and cream on that is 1.06:1 — the pill shape disappears
   entirely and it reads as plain bold text, which is the one thing a chip is
   for. --bottle-600 gives 6.26:1 against that row with cream text at 6.63:1,
   and stays visibly lighter than .chip--done's near-black so provenance is not
   mistaken for a result. Check any new chip against the ground it actually
   lands on, not against the page. */
.chip--phone { background: var(--bottle-600); color: var(--cream); }
.chip-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    margin-right: .35rem;
    border-radius: var(--radius-pill);
    background: currentColor;
    animation: chip-pulse 1.6s ease-in-out infinite;
}
@keyframes chip-pulse { 50% { opacity: .25; } }
/* The pip is decoration on top of the word "Live", never the only signal, so
   dropping the animation loses nothing. */
@media (prefers-reduced-motion: reduce) {
    .chip-dot { animation: none; }
}

/* The homepage "something is on right now" strip. Four rules, in this file
   rather than live.css, because index.php loads no per-page stylesheet. */
.ls-strip {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: .7rem 1rem;
    border-left: 4px solid var(--jack);
    border-radius: var(--radius-sm);
    background: var(--cream);
}
.ls-strip p { margin: 0; font-weight: 600; color: var(--bottle-800); }
.card-deadline { font-size: .9rem; color: var(--text); margin: .25rem 0 0; }
.card-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.score-input { width: 80px; }
/* .form-group input is width:100% and outranks .score-input on specificity, so
   a seed or score box inside a labelled form group stretches the full width of
   the page without this. */
.form-group .score-input { width: 5.5rem; }

/* Match-day mode (admin/matchday.php) — phone-first result capture.
   One row per entrant: the name is a visible label, not a placeholder, so it
   stays readable while a score is being typed. The winner is derived from the
   scores server-side, hence one Save rather than a button per entrant. */
.md-round { margin: 1.5rem 0 .5rem; }
/* Capped, not full-bleed: phone-first means the card is the whole width on a
   phone, but stretched across a desktop the name and its score box end up at
   opposite edges and Save becomes a metre-wide bar. */
.md-match { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin: .75rem 0; max-width: 32rem; }
.md-when { margin: 0 0 .6rem; }
.md-scores { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.md-row { display: flex; align-items: center; gap: .75rem; }
.md-name { flex: 1 1 auto; font-weight: 600; }
/* Fixed basis, not 1 1 50%: the boxes sit beside a name now, not beside each other. */
.md-scores .score-input { flex: 0 0 5.5rem; width: auto; min-height: 44px; font-size: 1.1rem; text-align: center; }
.md-save { display: block; width: 100%; padding: .9rem .75rem; font-size: 1rem; min-height: 48px; }
.md-walkover { margin-top: .6rem; font-size: .9rem; }
.md-walkover summary { cursor: pointer; color: var(--muted); }
/* Live-scoring controls on the match-day pages. Here rather than in
   css/pages/live.css because adminLayoutStart() hardcodes an empty $css array —
   admin pages cannot load per-page stylesheets at all. */
.md-live { margin-top: .6rem; font-size: .9rem; }
.md-live summary { cursor: pointer; color: var(--muted); }
.md-live-on { margin-top: .6rem; }
.md-live-links { margin-top: .4rem; }
.md-live-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5rem .75rem;
    align-items: center;
    margin-bottom: .6rem;
    max-width: 28rem;
}
.md-live-grid label { font-weight: 600; }
/* The handicap note is ordinary muted text until the competition actually is a
   handicap, when it becomes the one thing on the form that can be silently
   wrong — a start left at 0 advances the wrong bowler. */
.md-live-warn--on {
    border-left: 3px solid var(--jack);
    padding-left: .6rem;
    color: var(--text);
}
.md-done { background: var(--green-pale); color: var(--bottle-800); border-radius: var(--radius-sm); padding: .6rem .8rem; margin: .5rem 0; max-width: 32rem; }
.md-fix { margin-top: .5rem; font-size: .9rem; }
.md-fix summary { cursor: pointer; }
.md-fix-name { font-weight: 600; }
.md-fix-locked { display: block; margin-top: .4rem; opacity: .75; }

/* Where a result came from, and the card behind it, drawn inside the match's
   own row on Match Day. Extends the .md-fix / .md-walkover disclosure idiom
   already on that page — admin loads no js/app.js, so a native <details> is the
   correct tool here rather than a fallback. */
.md-provenance { margin: .4rem 0 0; align-items: baseline; }
.md-provenance-when { font-size: .8rem; }
.md-card { margin-top: .5rem; font-size: .9rem; }
.md-card summary { cursor: pointer; }
/* The photograph sits in the row so it can be read against the scoreline
   printed directly above it. Wider than .admin-image-preview's 240px default,
   because a scorecard is a grid of small handwritten numbers, and capped at the
   row so it can never push the page sideways. */
.md-card-shot { max-width: min(100%, 30rem); margin-top: .5rem; }

/* Roll-up times on the Social Bowls page.
   Lives here rather than in a per-page file because the markup is authored in
   admin > Pages (the 'tabs' slug) — a committee member changing the summer
   times must not need a stylesheet change too, so the classes have to exist
   whatever they type. */
/* `.prose > *` caps every child at 68ch — the readable line length for TEXT.
   A grid of cards has no line-length problem, so it opts out; without this the
   cards fill only two thirds of the panel and look like a layout accident.
   Two equal columns, stacked on a phone; a third card the club adds later
   wraps onto its own row. */
.prose > .rollup { max-width: none; }

.rollup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
}

@media (min-width: 34rem) {
    .rollup { grid-template-columns: 1fr 1fr; }
}

.rollup-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* Green, not brass or jack: those two already mean "won" and "live now". */
    border-left: 4px solid var(--primary);
    padding: 1rem 1.15rem 1.15rem;
}

.prose .rollup-days {
    margin: 0 0 .7rem;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Season on the left, time on the right, baseline-aligned so the numbers form a
   column however long the season word is. */
.rollup-times {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .45rem .9rem;
    margin: 0;
    align-items: baseline;
}

.rollup-times dt {
    font-weight: 600;
    color: var(--bottle-700);
}

.rollup-times dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* The two times are the whole point of the card, so they carry the weight and
   the "for" between them recedes. */
.rollup-times dd strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bottle-800);
}

.prose .rollup-note {
    margin-top: .25rem;
    color: var(--muted);
    font-size: .92rem;
}

@media (max-width: 480px) {
    .rollup-times dd strong { font-size: 1.1rem; }
}

/* Drawn tabs rink card: the two sides of a rink, each read lead-first. */
.tab-side { margin: 0 0 .5rem; padding: .4rem .6rem; background: var(--green-pale); border-radius: var(--radius-sm); }
.tab-side + .tab-side { border-top: 2px solid #fff; }
.tab-seat { display: inline-block; min-width: 3.6rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* Competition setup guide — the numbered rail on admin/comp-setup.php.
   ⚠️ It lives HERE, not in css/pages/, because admin/_layout.php calls
   Template::pageHead($title, [], '', '../') with an EMPTY css array: no admin
   page loads a per-page stylesheet, so a class defined in css/pages/ renders as
   nothing at all with no error (admin/orders.php:203 emits .chip--cancelled,
   defined only in css/pages/shop.css, and has rendered unstyled for exactly
   that reason). This is a port of .manual-steps in css/pages/manual.css, which
   dresses the same six steps on the PUBLIC manual page and must stay there for
   that page's sake. */
.setup-steps { list-style: none; padding: 0; counter-reset: setup-step; }
.setup-steps > li {
    counter-increment: setup-step;
    position: relative;
    padding: 0 0 1.5rem 3.1rem;
    margin: 0 0 0 1.1rem;
    border-left: 2px solid var(--border);
}
.setup-steps > li:last-child { border-left-color: transparent; padding-bottom: .25rem; }
.setup-steps > li::before {
    content: counter(setup-step);
    position: absolute; left: -1.15rem; top: -.15rem;
    width: 2.1rem; height: 2.1rem;
    border-radius: 50%;
    background: var(--primary); color: var(--sand);
    font-family: var(--font-display); font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center;
}
/* A tick, drawn from a glyph rather than an emoji — the site uses none. */
.setup-steps > li.is-done::before { content: '✓'; background: var(--fairway); font-size: 1.15rem; }
/* #fff, not the inherited --sand: sand on --danger is 4.39:1 and fails AA at
   this size. White is 5.44:1. */
.setup-steps > li.is-blocked::before { background: var(--danger); color: #fff; }
.setup-steps > li.is-todo::before { background: #fff; color: var(--muted); border: 2px solid var(--border); }
/* Dashed, because "does not apply" is a real answer and not a fault. The step
   is still SHOWN — one that vanished would read as one that was missed. */
.setup-steps > li.is-na::before { background: var(--sand); color: var(--muted); border: 2px dashed var(--border); }
.setup-steps > li > strong:first-child {
    display: block;
    font-family: var(--font-display); font-weight: 400;
    font-size: 1.15rem; color: var(--ink);
    margin-bottom: .25rem;
}
.setup-step-detail { display: block; font-size: .9rem; color: var(--muted); }
.setup-step-actions { margin-top: .5rem; }

/* Collapsible admin sections. Scoped to .admin-main so any future public
   <details> keeps the browser default; .md-fix / .md-walkover set their own. */
.admin-main summary { cursor: pointer; }
.collapse-section { margin-top: 1.25rem; }
.collapse-section > summary { font-family: var(--font-display); font-size: 1.1rem; padding: .4rem 0; }
.collapse-section[open] > summary { margin-bottom: .5rem; }
.collapse-count { color: var(--muted); font-size: .85rem; font-weight: 400; }

/* Draw lock — admin knockout manager */
.draw-lock { align-items: center; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--green-pale); }
.draw-lock--on { background: #fdf3d4; }
.draw-lock span { flex: 1 1 16rem; font-size: .9rem; }

/* Per-match play date/time editor */
/* Round schedule rows (admin/knockout.php). Fixed label column: these sit in a
   .btn-row flex, so an unsized label made every row's date box start at a
   different x depending on the length of the stage name. */
.round-row { margin-bottom: .5rem; }
.round-row-label { flex: 0 0 12rem; font-weight: 600; }

/* Knockout match cards (admin/knockout.php) */
.match-card p { margin: 0; }
.match-head { margin-bottom: .35rem; }
.match-result { margin-top: .5rem; }
/* A name and its box travel as ONE flex item. Loose in a wrapping .btn-row a
   narrow window breaks between them, putting one player's name over another's
   score — which is the mistake this labelling exists to prevent. */
.match-score { display: flex; align-items: center; gap: .4rem; }
.match-score label { font-weight: 600; }
.match-amend { margin-top: .5rem; }
.match-walkover { margin-top: .4rem; font-size: .85rem; }
.match-walkover > summary { color: var(--muted); }
.match-note { display: block; margin-top: .35rem; color: var(--muted); font-size: .85rem; }

/* Per-match play date/time editor — collapsed, with the resolved time in the
   summary so the closed state still answers "when is this?". */
.match-when { margin-top: .5rem; font-size: .85rem; }
.match-when > summary { color: var(--muted); }
.match-when-now { font-weight: 600; color: var(--text); }
.match-when small { flex: 1 1 100%; color: var(--muted); }

@media (max-width: 560px) {
    /* Label onto its own line rather than crushing the inputs — .btn-row wraps. */
    .round-row-label { flex: 1 1 100%; }
}

.page-content { background: #fff; padding: 1.75rem; border-radius: var(--radius); box-shadow: var(--shadow); margin: 1rem 0; }

/* Long-form reading text inside a card: the `pages.body` HTML a committee
   member types into the Pages editor, and the admin How-To guides.
 *
 * Neither had any typography. The reset at the top of this file zeroes every
 * margin, and .page-content styles the CARD but never its contents, so a page
 * with four paragraphs and two headings rendered as one unbroken wall: no gap
 * between paragraphs, headings sitting flush on the text above them.
 *
 * It cannot go on .page-content itself — that class is also on 20-odd admin
 * forms, contact/entry/login panels and even a bare <p>, and giving all of
 * those paragraph margins would move spacing across most of the site. So the
 * reading text gets its own class, applied only where prose actually lands. */
.prose > * { max-width: 68ch; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin-bottom: 1.1em; }
/* The opening paragraph is the page's lead, so it is set one step up — matching
   .home-welcome, which had already reached for exactly this on the homepage. */
.prose > p:first-of-type { font-size: 1.1rem; line-height: 1.7; }
/* Far more space above than below: a heading belongs to the section it opens,
   and equal margins leave it floating between two blocks belonging to neither.
   Marcellus sets at line-height 1.15, so it also needs the room above to clear
   the previous paragraph's descenders. */
.prose h2 { margin: 2.5rem 0 .65rem; }
.prose h3 { margin: 1.9rem 0 .5rem; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.35rem; }
.prose li { margin-bottom: .35rem; }
/* Underlined in running prose. Site-wide links rely on colour alone, which is
   fine for nav and buttons where position signals the affordance, but inside a
   paragraph an underline is what makes a link findable. */
.prose p a, .prose li a { text-decoration: underline; text-underline-offset: .15em; }
.prose a.btn { text-decoration: none; }
.prose strong { font-weight: 600; color: var(--ink); }

/* Print: noticeboard-ready pages (draw sheets, honours board). */
.print-only { display: none; }
@media print {
    .site-nav, .site-footer, .nav-toggle, .btn, .flash, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    .page-hero { background: none; box-shadow: none; color: #000; padding: 0; }
    .page-hero-title { color: #000; }
    /* Elements that set their own colour are not blackened by the body rule
       above. bracket.php and standings.php both ship a print button and both
       title with .page-title, so without this a draw sheet prints its heading
       in bottle green. */
    .page-title { color: #000; }
    /* Browsers drop backgrounds when printing, which would leave the champion
       chip as brass on white — 2.5:1, the exact thing the note on --brass says
       must never happen. Outline it instead. */
    .chip--champion { background: none; color: #000; border: 1px solid #000; }
    .page-hero-overline, .page-hero-meta { color: #333; }
    .page-hero-rule { background: #000; }
    .container { max-width: none; padding: 0; }
    .print-only { display: block; }
    .print-head { font-size: .95rem; margin-bottom: .75rem; border-bottom: 2px solid #000; padding-bottom: .35rem; }
    a { color: #000; text-decoration: none; }
}

/* ── Marker popover ──────────────────────────────────────────────────────────
   The pencil beside a game that opens who is marking it. A native <details>,
   not a scripted modal, because admin pages load no js/app.js — the same markup
   has to work on the public draw AND on the match-day screen, and this does,
   with no JavaScript on either. Same reasoning as .nav-group above.

   The panel is absolutely positioned so opening one does not shove the rest of
   a bracket column down the page; .marker-pop is the containing block. */
.marker-pop { position: relative; display: inline-block; vertical-align: middle; }

.marker-pop > summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    /* A real tap target even though the glyph is small — this sits in dense
       bracket rows where a 12px hit area is unusable on a phone. */
    padding: .25rem .4rem;
    border-radius: 999px;
    font-size: .85rem;
    line-height: 1;
    color: var(--bottle-600);
    background: rgba(var(--fairway-rgb), .08);
}
.marker-pop > summary::-webkit-details-marker { display: none; }
.marker-pop > summary::marker { content: ''; }
.marker-pop > summary:hover,
.marker-pop[open] > summary { background: rgba(var(--fairway-rgb), .18); color: var(--bottle-800); }
.marker-pop > summary:focus-visible { outline: 2px solid var(--bottle-600); outline-offset: 2px; }

.marker-pop__count { font-weight: 600; font-size: .75rem; }

.marker-pop__panel {
    position: absolute;
    z-index: 40;              /* under .lightbox (100) and the sticky nav (50) */
    top: calc(100% + .35rem);
    /* Anchored LEFT here, unlike .nav-group: these sit at the START of a game
       row rather than hard against the right edge of a bar, so opening
       rightward is what stays on screen. */
    left: 0;
    min-width: 12rem;
    max-width: min(18rem, 80vw);
    padding: .6rem .75rem;
    background: var(--cream);
    border: 1px solid rgba(var(--ink-rgb), .18);
    border-radius: .4rem;
    box-shadow: 0 6px 18px rgba(var(--bottle-900-rgb), .16);
    text-align: left;
}

.marker-pop__head {
    margin: 0 0 .3rem;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bottle-600);
}
.marker-pop__list { margin: 0; padding-left: 1.1rem; }
.marker-pop__list li { margin: .1rem 0; }
.marker-pop__note {
    margin: .45rem 0 0;
    font-size: .78rem;
    line-height: 1.35;
    color: rgba(var(--ink-rgb), .75);
}

/* Printing a draw should print who is marking, not a row of collapsed pencils
   nobody can open on paper. */
@media print {
    .marker-pop > summary { display: none; }
    .marker-pop__panel {
        position: static;
        display: block;
        border: 0;
        box-shadow: none;
        padding: 0;
        background: none;
        min-width: 0;
    }
}

/* Shop order queue (admin). Admin pages load no per-page stylesheet, so the
   few classes admin/orders.php needs live here beside the other admin rules. */
.admin-stat { font-family: var(--font-display); font-size: 2rem; color: var(--ink); line-height: 1.1; }
.admin-sub { font-size: .85rem; color: var(--muted); }
.admin-warn { font-size: .82rem; color: var(--danger); }
.admin-lines { font-size: .88rem; padding-left: 0; margin-top: .5rem; display: flex; flex-direction: column; gap: .45rem; }
.admin-settle { margin-top: .7rem; padding: .85rem; background: var(--field-bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); min-width: 15rem; }
/* A <summary> styled as a button. list-style:none on both properties because
   Safari uses the -webkit- pseudo-element rather than list-style. */
.admin-summary-btn { display: inline-block; list-style: none; }
.admin-summary-btn::-webkit-details-marker { display: none; }

/* ── Club forms (form.php) ───────────────────────────────────────────────────
   The public sign-up sheet: a list of priced choices with a quantity each.
   Reuses .form-group/.form-hint for the text fields; only the option rows and
   the running total need anything of their own. */
.form-options { border: 0; padding: 0; margin: 1.25rem 0; }

/* Guided form steps (form.php). Every one of these classes is applied by
   js/app.js and by nothing in PHP: with scripting off none of them exist and
   the form renders as one ordinary page, which is the whole contract. Sizes
   here are deliberately generous — this flow exists for members who are mostly
   65+ reading a phone at arm's length. */
.form-step-title { font-size: 1.35rem; margin: 0 0 .15rem; }
.form-step-title:focus-visible { outline: 3px solid var(--fairway); outline-offset: 3px; }
.form-step-count { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
/* Mobile FIRST, and meant literally: the default here is a member holding a
   phone at arm's length, and the wider screen is the exception below. Buttons
   fill the width and are 52px tall — above the 44px floor, because reduced fine
   motor control is the norm in this audience, not an edge case. */
.form-step-nav { margin-top: 1.5rem; }
.form-step-nav .btn { flex: 1 1 auto; min-height: 52px; font-size: 1.05rem; padding-left: 1.25rem; padding-right: 1.25rem; }
.form-showall { display: block; width: 100%; min-height: 48px; }
@media (min-width: 560px) {
    .form-step-nav .btn { flex: 0 0 auto; padding-left: 1.75rem; padding-right: 1.75rem; }
    .form-showall { width: auto; }
}
.form-step-error { margin: .4rem 0 0; color: var(--danger); font-weight: 600; }
.form-review-list { margin: 0 0 1.25rem; }
.form-review-list dt { margin-top: .75rem; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.form-review-list dd { margin: .2rem 0 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-weight: 600; }
.form-showall { margin-top: 1.75rem; }
.form-options legend {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    margin-bottom: .5rem;
}
/* Label left, spinner right, on one line at every width — a meal list read on a
   phone at the bar. The number box is deliberately generous: a 44px target is
   the minimum that can be tapped accurately. */
.form-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--sand);
}
.form-option:last-child { border-bottom: 0; }
.form-option label {
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1rem;
    flex: 1 1 auto;
}
.form-option-price { display: block; font-size: .85rem; color: var(--muted); }
.form-option input[type="number"] {
    flex: 0 0 auto;
    width: 5rem;
    min-height: 44px;
    text-align: center;
    /* ⚠️ 16px minimum, not for looks: these boxes sit outside .form-group so they
       miss its 1rem rule, and iOS Safari ZOOMS the whole page when a focused
       input is under 16px. Mid-form, on the step this sheet exists for, that
       reads as the page breaking. */
    font-size: 1rem;
}
/* Ships hidden and is revealed by js/app.js. With no JavaScript there is no
   total at all, rather than one frozen at R0.00 that contradicts the order. */
.form-total {
    margin: 1rem 0;
    padding: .75rem 1rem;
    background: var(--green-pale);
    border-radius: var(--radius);
    font-size: 1.1rem;
}
.form-total-line { font-size: 1.15rem; margin-top: .75rem; }
.form-summary { margin: .75rem 0 0; padding-left: 1.25rem; }
.form-summary li { margin-bottom: .3rem; }
