:root {
  /* Ruckit's colours, from the logo: a dark pitch green for the bars, a mid green for buttons
     and links (white on it is 5.45:1), and the logo's lime for fills on the dark green. */
  --brand: #053b22;
  --accent: #0f7a34;
  --lime: #b4f000;
  --red: #c0392b;
  --grey: #f4f4f6;
  --text: #2c2c2c;
  --border: #e8e8ec;
  --muted: #68686f;
  /* Text greens dark enough to read (4.5:1) on white and on the pale tints they sit on;
     lime is never text on a light background. */
  --green-text: #0a7a3c;
  --accent-text: #0f7a34;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Headings and the numbers that matter (design review, 30 Nov 2026). The fallbacks are
     condensed faces a phone may already have, then the plain sans-serif. */
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;

  /* Roles that differ in dark mode (30 Nov 2026), each set here to the colour it replaced,
     so light mode is unchanged. The dark values are in the prefers-color-scheme block near
     the end of the file. --brand stays the bars' green in both; where it was text it is
     --brand-ink, where it is a fill a card sits beside, --brand-fill. --red stays a fill;
     red words are --red-text. */
  --page: #f4f4f6;
  --surface: #fff;
  --brand-ink: #053b22;
  --brand-fill: #053b22;
  --red-text: #c0392b;
  --label: #555;
  --nav-ink: #5d5d66;
  --focus: #053b22;
  /* Faint pitch markings for the dark-green panels (dashboard and Me heroes, sign-in and
     sign-up header, reminders welcome), laid over their gradients. White at 7%, one CSS
     pixel at any size; test/pitch-markings.test.js keeps it a whisper. */
  --pitch-markings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='600' viewBox='0 0 1000 600'%3E%3Cg fill='none' stroke='white' stroke-opacity='0.07' stroke-width='1'%3E%3Cpath vector-effect='non-scaling-stroke' d='M20 20H980V580H20ZM90 20V580M910 20V580M270 20V580M730 20V580M500 20V580'/%3E%3Cpath vector-effect='non-scaling-stroke' stroke-dasharray='10 12' d='M416 20V580M584 20V580M132 20V580M868 20V580M90 140H910M90 460H910'/%3E%3C/g%3E%3C/svg%3E");
  /* The browser's own parts (form fields, default links, scrollbars) follow the phone too. */
  color-scheme: light dark;
}

/* Barlow Condensed Bold, served from this site (public/fonts, SIL Open Font License in
   OFL.txt there), so no third party sees who opens a page. Two files split by character, as
   Google Fonts does: a browser fetches the second only for a page using a character in it
   (Welsh w and y with a circumflex, for one). The basic one is preloaded in the page head at
   the same address, ?v= and all, or the browser fetches it twice. Bump ?v= when a file
   changes: the address is what the year-long cache keys on. swap: the text shows at once in
   a fallback and changes face when the font arrives, rather than staying blank. */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/barlow-condensed-latin-700.woff2?v=1) 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: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/barlow-condensed-latin-ext-700.woff2?v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}
/* Animated on .container (the main content area) rather than body. .bottom-nav is a DOM
   child of body too, so animating body's own opacity dragged the fixed bottom nav along
   with it on every single page navigation, making it visibly flicker each time — even
   though it's the same nav bar on both pages and shouldn't be fading at all. Kept short
   and fade-only (no delay before navigating, no fade-out) — just enough to take the harsh
   edge off a fresh page appearing, without adding a perceptible pause first.
 */
.container {
  animation: page-fade-in 0.1s ease;
}
@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

a, button, input[type=submit] {
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}
/* A link with no colour of its own was the browser's blue (lavender in dark mode): the footer,
   Me's best and worst round, the league page's way back (design pass, 30 Nov 2026). :where()
   keeps this at an element's weight, so any rule with a class still decides. */
a:where(:not(.btn, .btn-sm)) { color: var(--accent-text); }
.site-footer a { color: var(--muted); }
button:active, .btn:active, .btn-sm:active {
  transform: scale(0.97);
}

/* Keyboard focus: one ring for everything that can take it. Left to the browser it was a
   different ring in each one, and :focus-visible keeps it off a mouse click or a tap. Text
   fields show focus in their border and a halo instead (further down); their :focus rules
   are more specific than this and turn the outline off. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* A purple ring cannot be seen on the purple bars and banners. */
nav:not(.bottom-nav) :focus-visible,
.dashboard-hero :focus-visible,
.push-banner :focus-visible {
  outline-color: var(--lime);
}
/* The first thing Tab reaches, and out of sight until it does. */
.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--brand-ink);
  font-weight: 700;
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
/* It sits on the purple bar, so its ring is the bar's colour of ring. */
.skip-link:focus-visible { outline-color: var(--lime); }
/* Focus lands on the page's content after the skip link; it is not something to ring. */
main:focus { outline: none; }

/* A control smaller than 44px that keeps its drawn size and takes taps in a 44px area
   around its middle. The area is
   the element's own ::after, so it draws nothing and moves nothing. Where two of these are
   closer than that, the later one in the page is on top in the overlap. */
.btn-sm, .tab-nav a, .push-banner-dismiss, .fixture-predict-link, .still-open-link,
.player-cell a.stat-note, .stat-note > a, p > a:only-child, .league-footer > a, .user-cell > a,
.fixture-manage summary, .purge-details summary, .qr-details > summary {
  position: relative;
}
.btn-sm::after, .tab-nav a::after, .push-banner-dismiss::after,
.fixture-predict-link::after, .still-open-link::after, .player-cell a.stat-note::after,
/* ::before on the last two: their ::after is the open-and-closed arrow. */
.stat-note > a::after, p > a:only-child::after, .league-footer > a::after, .user-cell > a::after,
.fixture-manage summary::after, .purge-details summary::after,
.qr-details > summary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
}

nav {
  background: var(--brand);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}
nav .brand span { color: var(--lime); }
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

nav .links a, nav .links button {
  color: white;
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
  /* The base button rule's 44px, which belongs to the phone menu below, not to this bar. */
  min-height: 0;
  /* A label never breaks inside itself: "Support the app" did, at 681px. */
  white-space: nowrap;
}
nav .links a:hover, nav .links button:hover { color: var(--lime); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  /* 44px either way to tap; the three bars stay where they were, at its right-hand edge. */
  min-width: 44px;
  min-height: 44px;
  align-items: flex-end;
  /* Anchors the unread notification dot, which is absolutely positioned within. */
  position: relative;
}
/* :not(.notification-dot) so the dot doesn't inherit the 22px white bar styling meant for
   the three hamburger lines — it's a span inside the same button. */
.nav-toggle span:not(.notification-dot) {
  width: 22px;
  height: 2px;
  background: white;
  display: block;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: block;
}
.notice-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* The menu button and its panel, up to 1199px (18 Nov 2026; was 680px). The row of links
   does not fit beside the logo until about 1,100 to 1,150px ("Log out (username)" and the
   admin's Admin link set it; usernames run to 16 letters), and between 681px and there it
   fell under the logo, making the header 124 to 142px tall on every tablet
   (test/header-menu-width.test.js). The bottom tab bar still stops at 680px. */
@media (max-width: 1199px) {
  nav { position: relative; }
  .nav-toggle { display: flex; }
  /* The logo centred in the bar, the menu button kept at the right (asked for 29 Nov 2026).
     Taken out of the row so the button alone sets the bar's 76px; top matches nav's padding.
     The row of links on a wider screen leaves no room to centre it there. */
  nav[aria-label="Main"] { justify-content: flex-end; }
  nav .brand { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); }
  nav .links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand);
    padding: 0 24px;
    z-index: 20;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    /* The menu fades and settles 8px into place: opacity and transform only. It used to
       animate max-height up to the ceiling below, which is more than twice the panel's real
       height, so the reveal was over in the first 100ms of 250 and closing showed nothing
       for the first 50 (measured, 2 Oct 2026).
       visibility takes a closed menu's links out of the tab order; clipped by max-height
       alone they could still be focused, unseen. visibility, max-height and padding are not
       animated: they switch in one step once the fade has finished, and max-height and
       padding still collapse the closed panel so it adds no height to a short page. */
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.2s var(--ease-out), visibility 0s linear 0.2s, max-height 0s linear 0.2s, padding 0s linear 0.2s;
  }
  nav .links.open {
    /* Raised from 600px: the grouped menu is taller, and at 600 the last entries — Log out
       among them — were cut off with no indication anything was missing. This is a
       ceiling, not a layout constraint, so it only needs to exceed the tallest the panel
       can get. */
    max-height: 900px;
    padding: 10px 24px 16px;
    pointer-events: auto;
    opacity: 1;
    transform: none;
    visibility: visible;
    /* Opening: the steps above happen at once, then the fade plays. */
    transition-delay: 0s;
  }
  nav .links a, nav .links button {
    margin-left: 0;
    padding: 10px 0;
    width: 100%;
    text-align: left;
  }
  /* nav .links .nav-group-label, not .nav-group-label: the default display:none rule is
     added near .nav-support, which sits LATER in the stylesheet than this media block. At
     equal specificity the later rule wins, so a plain class selector here computed to none
     and no headings appeared at any width. */
  nav .links .nav-group-label {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  /* Slightly tighter than the old 10px, because the panel is now taller — see the
     max-height note below. */
  nav .links a, nav .links button { padding: 8px 0; }
  /* Each row is 44px to tap. The text does not move: the rows were 34px with a 2px gap, so
     the menu is taller by 10px a row and nothing else. */
  nav .links a, nav .links button { min-height: 44px; display: flex; align-items: center; }
  nav .links form.inline { width: 100%; }
  nav .links form.inline button { width: 100%; text-align: left; }
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

h1 { font-size: 1.7rem; margin: 0 0 4px; line-height: 1.15; letter-spacing: 0.2px; }
h2 { font-size: 1.05rem; margin: 28px 0 0; }
.subtitle { color: var(--muted); font-size: 0.88rem; margin: 0 0 20px; line-height: 1.6; }
/* Between "Create an account" and the login form on a page opened from an invite link. */
.invite-create { display: block; width: 100%; text-align: center; }
.invite-or { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 14px 0 10px; }

.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.flash {
  background: #fff2e0;
  /* Thicker bar and larger text: people were missing these entirely, and on a join attempt
     the message IS the outcome — there's nothing else on screen telling them what happened. */
  border-left: 6px solid var(--accent);
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
/* Colour carries the outcome at a glance, so it doesn't rely on reading the wording. */
.flash-positive {
  background: #e7f7ed;
  border-left-color: #1a9e5c;
}
.flash-negative {
  background: #fde8e8;
  border-left-color: #c0392b;
}
.error {
  background: #fde8e8;
  border-left: 4px solid #c0392b;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ---- Fixture row: two stacked lines, fixed-width columns so everything lines up ---- */
.fixture-row {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: 6px;
}
.fixture-row:last-child { border-bottom: none; }

/* Row status: green once a prediction is saved, red if the deadline passed with nothing entered */
/* A saved fixture should read as done at a glance, not on inspection: a 3px edge and a
   5%-opacity wash was close to invisible on a phone in daylight. There was a tick as well;
   it was removed on 23 Oct 2026 at Crinks's request, the colour being enough. */
.fixture-row.entered {
  border-left-color: var(--lime);
  background: rgba(180,240,0,0.12);
}
/* An edited row drops the completed look immediately — it is no longer what is stored. */
.fixture-row.is-unsaved.entered {
  background: rgba(255,193,7,0.10);
  border-left-color: #f7941e;
}

/* The transition into .entered, played once on the rows the last save changed. just-saved is a
   server-side one-shot (req.session.justSaved), because the save is a POST and redirect and
   .entered alone can't tell "saved just now" from "saved last week". Resting look is .entered's. */
.fixture-row.just-saved { animation: wash-in 0.34s ease both; }
/* The fill mode holds the green wash after the animation, which would otherwise beat the amber
   of a row edited again before the next save. */
.fixture-row.is-unsaved.just-saved { animation: none; }

@keyframes wash-in {
  from { background: transparent; border-left-color: transparent; }
  to   { background: rgba(180,240,0,0.12); border-left-color: var(--lime); }
}

.save-confirmed {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-text);
}
.save-confirmed[hidden] { display: none; }
.fixture-row.missed {
  border-left-color: var(--red);
  background: rgba(231,76,60,0.05);
}
/* A finished row the player entered is coloured by what it earned, in the points badge's
   colours, so a round reads at a glance (24 Oct 2026). It replaces .entered's green, which
   after the result only said "saved". */
.fixture-row.outcome-exact {
  border-left-color: var(--lime);
  background: rgba(180,240,0,0.16);
}
.fixture-row.outcome-correct {
  border-left-color: #e0b400;
  background: rgba(255,224,138,0.32);
}
.fixture-row.outcome-miss {
  border-left-color: #c9c9d1;
  background: var(--grey);
}

.fixture-main {
  display: flex;
  /* stretch (not flex-end) so both sides are the same height even when one team name wraps
     — see .side's row sizing below, which is what actually top-aligns the names. */
  align-items: stretch;
  justify-content: center;
  gap: 14px;
}

.team {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.team.home { text-align: right; }
.team.away { text-align: left; }

/* Stacked side used on the predict page: team name on top, crest + score box in a row below */
/* Each side is a 2x2 grid: label sits directly above the score box, sharing that box's
   own column — the crest lives in its own adjacent column so it never shifts what the
   label/box pair is centered against. */
:root {
  --score-box-col: clamp(48px, 15vw, 76px);
  --crest-size:    clamp(48px, 16.5vw, 80px);
}

.side {
  --crest-col: var(--crest-size);
  display: grid;
  grid-template-columns: var(--crest-col) minmax(0, var(--score-box-col));
  /* Label row takes the slack (1fr) and the box row stays its natural height at the bottom,
     so names start at the top while the score boxes still line up across both sides. */
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
  justify-content: center;
  /* 0 1 auto, not 1 1 0: as a half-row-wide flex item the grid was centred inside it, which
     pushed the boxes further from the centre line the wider the screen got. Sized to content,
     the gap between the two boxes is now the same at every width. Shrink is 1 rather than 0
     so that, below ~440px, the sides give way instead of overflowing .fixture-main — whose
     justify-content: center splits any overflow evenly, spilling it left over the border. */
  flex: 0 1 auto;
  min-width: 0;
}
.side.home {
  /* label sits over the crest column only, so the name centres on the badge. It's allowed to
     overflow that column (see .team-label width rules) — nothing else occupies that row, so
     a name wider than the badge simply extends symmetrically either side of it. */
  grid-template-areas:
    "label ."
    "crest box";
}
.side.away {
  grid-template-columns: minmax(0, var(--score-box-col)) var(--crest-col);
  grid-template-areas:
    ". label"
    "box crest";
}

.crest {
  grid-area: crest;
  width: var(--crest-size);
  height: var(--crest-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.01rem;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.team-label {
  grid-area: label;
  justify-self: center;
  /* Top of its row, so a one-line name sits level with the FIRST line of a wrapped one. */
  align-self: start;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.2;
  /* max-content so a single long word (NEWCASTLE) stays on one line even though the badge
     column beneath it is only ~53px, with max-width stopping a genuinely long two-word name
     from stretching far enough to collide with the other side's label. */
  width: max-content;
  max-width: 130px;
  /* normal, not break-word — break-word is what let NEWCASTLE split mid-word. This still
     wraps multi-word names between words, it just never breaks inside one. */
  overflow-wrap: normal;
}

.score-sep {
  /* Darker than the old #ccc as well as larger — at this weight and size a very light grey
     read as washed out rather than deliberate. */
  color: var(--muted);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  flex: 0 0 auto;
}
/* .fixture-main is align-items:flex-end, so by default the separator's bottom edge lands on
   the score box's bottom edge, leaving the glyph sitting below the box's vertical centre.
   Giving it the box's own height and centring the glyph inside lines the two up exactly.
   Scoped to .fixture-main because the admin result-entry row is a plain centred flex row
   that already aligns correctly and would be broken by this. */
.fixture-main > .score-sep {
  /* Explicit now that the parent is align-items:stretch — this keeps it level with the
     score boxes rather than stretching over the full row height. */
  align-self: flex-end;
  /* Crest height, NOT the score box height: the badge and the box share one grid row, and
     the badge is the taller of the two, so the row's height (and therefore the box's centre
     line) is set by the crest. */
  height: var(--crest-size);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hides the "-" TEXT. A glyph's ink doesn't sit at the centre of its own line box — with
     line-height:1 it renders low — so no amount of centring the box centres what you
     actually see. The bar below is drawn instead, which is centred geometrically and
     therefore lands exactly on the boxes' centre line. */
  font-size: 0;
}
.fixture-main > .score-sep::before {
  content: "";
  display: block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
}
.score-cell {
  grid-area: box;
  position: relative;
  /* flex, not inline-flex: as an inline box it sat on a text baseline, which left a few px of
     descender space below it. That made the row taller than the box and pushed the bottom-
     aligned "-" separator below the box's true centre line. */
  display: flex;
  align-items: center;
}

/* Inner edge of its column on each side, so the two boxes sit closer to the middle. */
.side.home .score-cell { justify-self: end; }
.side.away .score-cell { justify-self: start; }

.score-cell input {
  width: 46px;
  height: 42px;
  padding: 0;
  text-align: center;
  border: 3.5px solid var(--border);
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.score-cell input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,122,52,0.15);
}
.score-cell input:disabled {
  background: var(--grey);
  color: var(--muted);
  border-color: var(--border);
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.score-inputs input {
  width: 42px;
  height: 40px;
  padding: 0;
  text-align: center;
  border: 3.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.score-inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,122,52,0.15);
}
.score-inputs input:disabled {
  background: var(--grey);
  color: var(--muted);
  border-color: var(--border);
}
/* The admin result-entry separator now uses .score-sep like the predictions page, so it's
   styled from one place — this rule would otherwise override it, coming later in the file. */

.fixture-meta {
  display: flex;
  /* The kickoff time does not shrink or wrap, so on a narrow phone whatever sits beside it
     (the "To predict" pill, the result and its points) was pushed out past the row's edge,
     and at 320px past the screen's. It takes the next line instead. */
  flex-wrap: wrap;
  align-items: center;
  /* Centred like the lock line above it (23 Oct 2026); a result and its points sit beside
     the kickoff as one centred group. */
  justify-content: center;
  gap: 4px 8px;
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--muted);
}

/* The league page's season chart (views/partials/season-chart.ejs). */
.season-chart-figure { margin: 8px 0 0; }
.season-chart { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; }
.sc-grid { stroke: var(--border); stroke-width: 1; }
.sc-axis { font-size: 10px; fill: var(--muted); }
.sc-line path { fill: none; stroke: #c9c9d1; stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.sc-line circle { stroke: var(--surface); stroke-width: 1; }
.sc-leader path { stroke: var(--brand-fill); stroke-width: 2; }
.sc-leader circle, .sc-leader .sc-end { fill: var(--brand-fill); }
.sc-viewer path { stroke: var(--accent); stroke-width: 3; }
.sc-viewer circle, .sc-viewer .sc-end { fill: var(--accent-text); }
.sc-end { font-size: 10px; font-weight: 700; }
.season-chart-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.sc-key { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 2px; background: #c9c9d1; }
.sc-key.sc-viewer { background: var(--accent); }
.sc-key.sc-leader { background: var(--brand-fill); }

/* How the league predicted a locked fixture (services/crowdPicks.js). */
.crowd-picks { margin: 10px auto 0; max-width: 420px; font-size: 0.74rem; color: var(--muted); text-align: center; }
.crowd-picks p { margin: 0; }
.crowd-title { font-weight: 700; color: var(--text); }
.crowd-total { font-weight: 400; color: var(--muted); }
.crowd-bar { display: flex; gap: 2px; height: 8px; margin: 6px 0; border-radius: 4px; overflow: hidden; }
.crowd-seg { flex-basis: 0; min-width: 4px; }
.crowd-home { background: var(--brand-fill); }
.crowd-draw { background: #a8a8b3; }
.crowd-away { background: var(--accent); }
.crowd-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; }
.crowd-counts strong, .crowd-top strong { color: var(--text); }
.crowd-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.crowd-top { margin-top: 2px; }

.kickoff-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--label);
  font-weight: 700;
  white-space: nowrap;
}
.kickoff-time svg { flex: 0 0 auto; opacity: 0.6; }

.deadline-value {
  font-weight: 700;
  color: var(--text);
}

.fixture-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  white-space: nowrap;
}

.status-pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.to-predict { background: #eefbd0; color: var(--accent-text); }
.status-pill.missed-week { background: #fde8e8; color: var(--red-text); }
.status-pill.postponed { background: #fff3cd; color: #8a6d1a; }
.status-pill.cancelled { background: #f1f1f3; color: var(--muted); text-decoration: line-through; }

.fixture-status-note {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 4px 0 0;
  font-style: italic;
}

.fixture-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.fixture-manage {
  margin-top: 8px;
}
.fixture-manage summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-ink);
  list-style: none;
}
.fixture-manage summary::-webkit-details-marker { display: none; }
.fixture-manage summary::before { content: '⚙ '; }
.fixture-manage-body {
  margin-top: 10px;
  padding: 12px;
  background: var(--grey);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.manage-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.manage-form-row select,
.manage-form-row input[type=text],
.manage-form-row input[type=datetime-local] {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
  padding: 7px 9px;
  /* Compact in padding only: under 16px, iOS zooms the page when one is focused. */
  font-size: 1rem;
}
.btn-danger { background: var(--red); }

.purge-details summary { list-style: none; }
.purge-details summary::-webkit-details-marker { display: none; }
.purge-confirm-form {
  margin-top: 8px;
  padding: 10px;
  border: 1.5px solid var(--red);
  border-radius: 8px;
  background: #fff5f5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.purge-confirm-form input[type=text] { margin-bottom: 0; }

.total-badge {
  background: var(--brand-fill);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.missed-text {
  color: var(--red-text);
  font-weight: 700;
}

.history-gw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

/* My Predictions on a phone. Four columns need about 350px and a 375px screen leaves the
   table 311, so it scrolled sideways with Result and Points off the edge. Each row is
   stacked instead: the fixture on its own line, then prediction, result and points beneath,
   each under its data-label. The header row is hidden from sight only, so it is still read
   out; the labels are what a sighted player has in its place. */
@media (max-width: 480px) {
  .history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .history-table tbody tr {
    display: grid;
    /* Each row is a grid of its own, so Result and Points get fixed widths (a "Pending"
       badge, the word "Points") or they would sit somewhere different on every row. The
       prediction takes what they leave, and can shrink below its content. */
    grid-template-columns: minmax(0, 1fr) 4.125rem 2.625rem;
    column-gap: 12px;
    align-items: start;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
  }
  .history-table td {
    padding: 0;
    border-bottom: none;
  }
  .history-table td:first-child {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    font-weight: 700;
  }
  .history-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
}

/* The admin user list (21 Oct 2026). The page column is 640px even on a desktop, and this
   table ran 29px past its card there and up to 345px past a phone. The email breaks (the
   view puts a <wbr> before the @), Last seen and Joined stay on one line, and below 640px each row is
   stacked as My Predictions' is: the account on its own line, then the four values two by
   two under their data-labels. */
.user-email { overflow-wrap: anywhere; }
.user-table .user-seen, .user-table .user-joined { white-space: nowrap; }
@media (max-width: 640px) {
  .user-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .user-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
  }
  .user-table td {
    padding: 0;
    border-bottom: none;
  }
  .user-table td.numeric { text-align: left; }
  .user-table td:first-child { grid-column: 1 / -1; }
  .user-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
}

/* The admin leagues table and the wording editor's variables table (admin walkthrough,
   17 Nov 2026). At 375px the leagues table was 418px in 311 and the variables table 471px,
   so both scrolled inside their boxes and a league's buttons started off-screen. Below 640px
   each row is stacked as the user list's is: the league or variable on its own line, its
   values under their data-labels, and a league's buttons side by side on a line of their own.
   On a wider screen the buttons stay one above the other in their column. */
.league-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.league-actions form { margin: 0; }
@media (max-width: 640px) {
  .league-admin-table thead, .variables-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .league-admin-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
  }
  .variables-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
  }
  .league-admin-table td, .variables-table td {
    padding: 0;
    border-bottom: none;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .league-admin-table td.numeric { text-align: left; }
  .league-admin-table td:first-child, .variables-table td:first-child { grid-column: 1 / -1; }
  .league-admin-table td.league-actions { grid-column: 1 / -1; }
  .league-actions { flex-direction: row; flex-wrap: wrap; }
  .league-admin-table td[data-label]::before, .variables-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
}

/* Admin tables that scrolled inside their box on a phone (walkthrough, 18 Nov 2026): the
   deleted rounds and fixtures, a user's recent predictions and activity, the published
   notices and the audit log. One rule for all of them. Below 640px each row is a block: the
   title cell (td.stack-head) on top and bold whatever its column, the other cells side by
   side under their data-labels as many as fit, an empty cell hidden, and anything long or an action
   (td.stack-full) on a line of its own. A new table opts in with the class and the three
   kinds of cell; test/admin-users-narrow.test.js checks every cell is one of them. */
@media (max-width: 640px) {
  .stack-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  /* Flex, not grid: a full-width cell in a grid keeps every track, so a row of two values
     was split four ways and its dates broke mid-word. Each value starts at 66px (the widest
     label, PREDICTED, with a little over; four fit across at 375px) and shares the rest. */
  .stack-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
  }
  .stack-table td:empty { display: none; }
  .stack-table td {
    flex: 1 1 4.125rem;
    padding: 0;
    border-bottom: none;
    min-width: 0;
    overflow-wrap: break-word;
  }
  .stack-table td.numeric { text-align: left; }
  .stack-table td.stack-head { flex-basis: 100%; order: -1; font-weight: 700; }
  .stack-table td.stack-full { flex-basis: 100%; }
  .stack-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
}

/* ---- "N fixtures to predict" banner ---- */
.info-banner {
  background: #fdece0;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.88rem;
}
.info-banner strong { color: var(--accent-text); }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 1.85rem; }

.gw-heading {
  font-size: 1.35rem;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.save-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 8px 0 0;
}
/* Empty once predictions are saved (the saved line beneath says it); no gap left for it.
   Not display: none, which would take the live region out of the accessibility tree and
   risk the "N fixtures changed" that the script writes into it going unannounced. */
.save-hint:empty { margin: 0; }

.deadline-note {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  margin: 14px 0 18px;
}

/* ---- Scoring rules + row-status legend ---- */
.legend-card h3 {
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.legend-points {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.legend-points .legend-item {
  flex: 1 1 140px;
}
.legend-points .points-badge {
  display: inline-block;
  margin-bottom: 6px;
}
.legend-points p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.legend-divider {
  border-top: 1px solid var(--border);
  margin: 18px 0;
}
.legend-status {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.legend-status .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.legend-line.red { background: var(--red); }
.legend-line.green { background: var(--lime); }
.legend-line.grey { background: var(--border); }
/* The finished rows' edges (.outcome-correct, .outcome-miss). */
.legend-line.yellow { background: #e0b400; }
.legend-line.grey-dark { background: #c9c9d1; }

.points-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.points-exact { background: var(--lime); color: var(--brand); }
.points-correct { background: #ffe08a; color: #6b5100; }
.points-0 { background: var(--grey); color: var(--muted); }
/* A finished fixture's points on the predict page, in its status line. The grey of 0 is the
   miss row's own wash, so it takes a border to stay a badge. */
.points-badge.points-lg {
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}
.points-lg.points-0 { background: var(--surface); box-shadow: inset 0 0 0 1px #c9c9d1; }

button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
  /* The smallest thing a finger hits reliably. A button with a shape of its own sets its own. */
  min-height: 44px;
}
/* A <button> centres its label in that height by itself; a link drawn as one does not. */
a.btn:not(.btn-sm):not(.btn-sign-in) { padding-top: 13px; padding-bottom: 13px; }
button:hover, .btn:hover { opacity: 0.9; }
/* White set here too: a link drawn as one (`a.btn-sm.btn-secondary`) is not `.btn`. */
.btn-secondary { background: var(--brand-fill); color: white; }
/* A button that is there but is not the page's next step: the recap's way on, leaving or
   deleting a league (red). Its ring is its text colour, so dark mode comes with it. */
.btn-outline { background: transparent; color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-outline.btn-outline-danger { color: var(--red-text); }
.btn-sm {
  padding: 5px 14px;
  font-size: 0.76rem;
  border-radius: 6px;
  /* An `a.btn-sm` is not `.btn`, which is where the underline was turned off. */
  text-decoration: none;
  /* Drawn small on purpose; its 44px is the tap area near the top of this file. */
  min-height: 0;
}

/* "Sign in with <provider>": the app's own button with the vendor's mark on the left. The
   marks are trademarks served as supplied (public/img) — size them here, never in the SVG.
   The mark is taller than a line of text, so the vertical padding moves into a min-height
   that works out to exactly what .btn's 11px padding gives the submit button above it. */
.btn-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: max(44px, calc(1.2em + 22px));
  margin-top: 12px;
  padding: 0 12px;
  white-space: nowrap;
}
.sign-in-mark { display: block; flex: none; }
/* Google's file is a 40px tile with the G at half its width; Microsoft's is the bare symbol. */
.sign-in-mark-google { width: 30px; height: 30px; }
.sign-in-mark-microsoft { width: 21px; height: 21px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
}
.pagination-status {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.pagination-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

form.inline { display: inline; }

textarea, input[type=search], input[type=date],
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=number] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 14px;
  min-height: 44px;
}
/* The score boxes are sized by their own rules. */
.score-cell input, .score-inputs input { min-height: 0; }
/* Here, not in the base .score-cell rule, which this generic rule overrides: 16px plus 1pt.
   44px high because the box is the tap target itself now there are no steppers (29 Nov
   2026), and wide enough for two digits. */
.score-cell input { font-size: 1.5rem; width: 52px; height: 44px; padding: 0; margin-bottom: 0; }
/* It opens a picker, so it is tapped, not typed in. */
input[type=file] { min-height: 44px; padding: 11px 0; }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=datetime-local]:focus, input[type=number]:focus, textarea:focus,
input[type=search]:focus, input[type=date]:focus {
  outline: none;
  border-color: var(--accent);
  /* The same halo the score boxes have: a border changing colour is easy to miss. */
  box-shadow: 0 0 0 3px rgba(15,122,52,0.15);
}
/* A textarea takes the text inputs' box and size (under 16px, iOS zooms the page on focus).
   Left to the browser it was 150px wide in 13.3px monospace. It grows downwards only, so it
   cannot be dragged wider than its form. */
textarea {
  display: block;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
}
/* Safari draws a search field as a rounded pill and ignores the border above unless told
   not to. */
input[type=search] {
  appearance: none;
  -webkit-appearance: none;
}
label { font-size: 0.82rem; color: var(--label); font-weight: 600; display: block; margin-bottom: 5px; }

/* Scoped rather than a blanket `select { }` rule — there were no other <select> elements in
   the site when this was added, so keeping it deliberate avoids silently restyling anything
   that gets added later without this same inline, compact context in mind. */
.season-select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  /* 16px, like every control that takes focus: under it, iOS zooms the page. */
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 10px center;
  background-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-height: 44px;
}
/* The predict page's round dropdown, above the round's card. */
/* The predict page's "ROUND N" and its round dropdown share a row: name left, dropdown right.
   The heading's own bottom margin moves to the row so the two centre on each other. */
.round-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.round-head .gw-heading { margin: 0; }
/* At 320px "ROUND 12 All locked" leaves no room, and the dropdown takes the next line: still
   on the right. */
.round-head .season-select { margin-left: auto; }
.season-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,122,52,0.15);
}

table { width: 100%; border-collapse: collapse; }
/* Wraps every table in the app — without this, a table wider than the viewport (common on
   mobile with several columns, e.g. the leaderboard's rank/player/exact/correct/points) would
   overflow the whole page horizontally instead of just scrolling within its own bounds. */
/* overflow-y: with overflow-x set, the browser makes the other axis scroll as well, and a
   link's 44px tap area reaching a couple of pixels past the last row was enough to make the
   table drag up and down. */
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.table-wrap table { margin-bottom: 0; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3px; }
tr.me { background: #f3fef8; box-shadow: inset 4px 0 0 var(--lime); }
/* padding-left clears the 4px inset bar on tr.me. Applied to every row so the rank column
   stays aligned — indenting only the highlighted row would swap one misalignment for
   another, and the bar is drawn inside the row so it cannot simply sit outside it. */
.rank { color: var(--muted); width: 34px; padding-left: 10px; }
/* The "=" is a qualifier on the number, not part of it, so it is set smaller and tucked in.
   At full size "=15" does not fit the rank column on a phone; at this size it does. */
.rank .tie-mark {
  font-size: 0.72em;
  letter-spacing: -0.5px;
  margin-right: 0.5px;
  vertical-align: 1px;
}
.leaderboard-table th:first-child { padding-left: 10px; }

/* ---- League table extras: scoring legend, player avatars, points pill, callout ---- */
.scoring-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.legend-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 160px;
}
.legend-col strong { font-size: 0.88rem; display: block; }
.legend-col p { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.legend-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid currentColor;
}
.legend-icon.exact { color: var(--green-text); }
.legend-icon.correct { color: #f5a623; }
.legend-icon.none { color: var(--muted); }
.legend-divider-v {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}
@media (max-width: 560px) {
  .legend-divider-v { display: none; }
}

/* Star of the round: the gold star beside a name in a table, and the card's heading. */
.round-star { color: #d4a017; display: inline-flex; align-items: center; flex: 0 0 auto; }
.round-star-heading { display: flex; align-items: center; gap: 6px; }
.round-star-heading .star-icon { color: #d4a017; flex: 0 0 auto; }

/* Star of the round card (dashboard, league page, recap): one name a line, a joint win a short list.
   The table's names end in an ellipsis; here there is room, so a long one wraps. */
.round-winners-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.round-winners-list .player-cell > span:not(.player-avatar) {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
/* The name itself, on both the leaderboard and league standings (they share .player-cell).
   Scoped to exclude the avatar so the initials keep their own sizing, and targeted rather
   than raising the whole table, which would enlarge points and stats columns too.
   Base is the 0.9rem inherited from th/td; this is roughly +2px. */
.player-cell > span:not(.player-avatar) { font-size: 1.03rem; }
/* Flex items default to min-width:auto, which means a long display name cannot shrink
   below its own intrinsic width and instead forces the entire table wider than its card.
   min-width:0 on both the container and the name restores the ability to shrink, and the
   ellipsis makes the truncation deliberate rather than a clip. Applies to league standings
   too, which share .player-cell and have the same six-column squeeze. */
.player-cell { min-width: 0; }
.player-cell > span:not(.player-avatar) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-fill);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex: 0 0 auto;
}
/* A profile picture in place of the initials. Same class, so every size the initials are
   given in a narrower table applies to the picture too. */
.player-avatar-photo { object-fit: cover; }

/* ---- Account page: the profile picture and its upload form ---- */
.avatar-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}
.avatar-edit form { flex: 1 1 220px; min-width: 0; }
.avatar-edit input[type="file"] { max-width: 100%; }
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-fill);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.avatar-preview[hidden] { display: none; }
/* Choosing the square that is kept (avatar-upload.js). The frame is the square; the shade
   outside the circle shows how the picture sits in a table, where it is drawn round. The
   photo is moved with transform only, and only while the player drags it. */
.avatar-crop { margin: 12px 0 16px; }
.avatar-crop[hidden] { display: none; }
.avatar-crop-frame {
  position: relative;
  width: 240px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #222;
  touch-action: none;
  cursor: grab;
  margin-bottom: 12px;
}
.avatar-crop-frame:active { cursor: grabbing; }
.avatar-crop-frame img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  pointer-events: none;
}
.avatar-crop-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.avatar-zoom { display: block; width: 240px; max-width: 100%; min-height: 44px; margin: 0; }

.trophy-icon {
  color: #d4a017;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.trend svg { flex: 0 0 auto; }
.trend-up { color: var(--green-text); }
.trend-down { color: var(--red-text); }
.trend-same { color: var(--muted); font-weight: 700; }

.points-pill {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 800;
  background: var(--grey);
  color: var(--text);
}
.points-pill.me {
  background: #d9fbe7;
  color: var(--green-text);
}
/* Points and rank are what a player looks for; Exact and Error only break ties (design
   review, 30 Nov 2026). They were all one size and weight. The tiebreaks are grey (5.3:1 on
   the highlighted row), the points a size up in em so large text scales them too, and the
   rank bold. Shared by the leaderboard and the league table. */
.leaderboard-table td.rank { color: var(--brand-ink); font-weight: 800; font-size: 1.15rem; }
.leaderboard-table td.tiebreak { color: var(--muted); }
.leaderboard-table .points-pill { font-size: 1.3em; }
.leaderboard-table .points-pill:not(.me) { color: var(--brand-ink); }

/* Scoped to the leaderboard specifically — shrinks to fit the viewport instead of needing
   to scroll, since 6 columns including wordy headers ("Exact Scores", "Correct Results")
   otherwise don't comfortably fit a narrow phone screen. */
.col-short { display: none; }
@media (max-width: 480px) {
  .leaderboard-table th, .leaderboard-table td { padding: 8px 4px; font-size: 0.78rem; }
  .leaderboard-table .player-cell > span:not(.player-avatar) { font-size: 0.9rem; }
  .leaderboard-table th { font-size: 0.62rem; }
  .leaderboard-table .col-full { display: none; }
  .leaderboard-table .col-short { display: inline; }
  .leaderboard-table .player-avatar { width: 26px; height: 26px; font-size: 0.58rem; }
  /* 5px a side, not 8: the larger points must still fit a three-digit World Cup total
     in the 46px column. */
  .leaderboard-table .points-pill { padding: 3px 5px; min-width: 22px; }
  .leaderboard-table .trend { font-size: 0.68rem; }
  /* The one fixed-width thing in the table, and the reason it only started overflowing
     once results existed: the sparkline is a 60px SVG that renders only for players with
     scored-gameweek history. The viewBox is left intact so the polyline scales down
     proportionally rather than being clipped. */
  /* 40x14 inside a 46px cell. Shrinking to 22px would also fit and cost no truncation, but
     at that size the line is unreadable — a trend you cannot read is not a trend. */
  .leaderboard-table .form-sparkline { width: 40px; height: 14px; }

  /* Fixed layout so the NAME column absorbs the remainder. With auto layout the number
     columns take their natural width, the table becomes 436px inside a 318px wrapper, and
     POINTS ends up off-screen behind a horizontal scroll — measured, not guessed. Fixed
     layout also makes the name truncation actually engage; with a scrolling wrapper there
     is no pressure on the name to shrink and it simply took 246px. */
  .leaderboard-table { width: 100%; table-layout: fixed; }
  .leaderboard-table th, .leaderboard-table td { padding: 8px 2px; }

  /* Rank. padding-left clears the 4px inset bar on tr.me.

     This has to be this specific and this late: `.rank { padding-left: 10px }` earlier in
     the file computed to 4px, because `.leaderboard-table th, .leaderboard-table td` above
     is two selectors to its one AND uses the `padding` shorthand, which resets padding-left
     outright. The rank digit sat underneath the green bar the whole time. */
  /* 30px, not 24. A tied double-digit position ("=15") measured 31px against a 24px cell
     and spilled 7px underneath the initials badge in the next column. The extra 6px comes
     out of the player name, which is why the tie marker is shrunk below rather than the
     column being widened to fit it comfortably — the name needs that space more. */
  .leaderboard-table th:nth-child(1),
  .leaderboard-table td:nth-child(1) { width: 30px; padding-left: 10px; }

  /* Trend, Exact, Correct, Points. Explicit widths, sized to the widest HEADER rather than
     the values — the values are one or two digits, but "CORRECT" is not. */
  /* 46px, not 28: wide enough for the sparkline to sit inside its own cell. At 28 the 38px
     SVG overflowed 16px into the Exact column and only looked acceptable because that
     column happens to be empty there. The 18px comes out of the name, costing one extra
     truncation across twelve real names — measured, not estimated. */
  /* 32px since 30 Nov 2026: the sparkline that needed 46 is off (SHOW_FORM_SPARKLINE in
     leaderboard.ejs), and an arrow and a digit need 24. Turn the sparkline back on and this
     goes back to 46. Exact and Error narrower too, now their numbers are smaller (below):
     the 30px saved all goes to the names, which at 320px were getting 11px. */
  .leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 32px; }
  /* 38 and 42 since the design pass (30 Nov 2026): at 34 and 40 "EXACT" overflowed its cell
     by 2px and met "ERROR", reading as one word. The 6px comes from the name; at 320px,
     where Error is hidden, only 4px of it. */
  .leaderboard-table th:nth-child(4), .leaderboard-table td:nth-child(4) { width: 38px; }
  .leaderboard-table th:nth-child(5), .leaderboard-table td:nth-child(5) { width: 42px; }
  .leaderboard-table td.tiebreak { font-size: 0.7rem; }
  /* The rank is in the condensed display face, which at the table's 0.78rem here read
     smaller than the old digits did. "=15" still fits the 30px column at this size. */
  .leaderboard-table td.rank { font-size: 1.05rem; }
  .leaderboard-table th:nth-child(6), .leaderboard-table td:nth-child(6) { width: 46px; }
  .leaderboard-table thead th { font-size: 0.58rem; }

  /* A smaller avatar buys the name ~10px. Scoped to the leaderboard rather than applied to
     .player-avatar globally, because league standings share the class and are not under the
     same width pressure — shrinking them too would be a change nobody asked for. */
  .leaderboard-table .player-avatar { width: 20px; height: 20px; font-size: 0.55rem; }
  .leaderboard-table .player-cell { gap: 6px; }


  /* The label spans the whole side here rather than centring on the crest column.
       Centred on a 53px column, a 130px name overhangs ~38px each way — outward, that is
       past the row padding and over the accent border. Spanning both columns gives it the
       whole side's width, but that alone does NOT stop outward overflow: it was measured
       still spilling at 440px and below, because the sides themselves stopped fitting the
       row. What contains it is the shrinkable .side (flex: 0 1 auto, minmax(0, ...) box
       column) together with the truncating label below. The badge-centred version above
       480px is unaffected, and still preferred where the room exists. */
    .side.home {
      grid-template-areas:
        "label label"
        "crest box";
    }

  .side.away {
      grid-template-areas:
        "label label"
        "box crest";
    }

  /* Wraps between words rather than truncating (23 Oct 2026): at the larger label size
     "CRYSTAL PALACE" was cut at 390px. overflow: hidden stays as the guard for a single
     word too long for its side, which still never breaks mid-word. */
  .team-label {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .leaderboard-table .rank { width: 26px; }
}

/* Very narrow phones. The sparkline is a decoration and the name is not, so below this the
   decoration goes. At 320px with it shown, every one of twelve real names truncated. */
@media (max-width: 359px) {
  .leaderboard-table .form-sparkline { display: none; }
  .leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 28px; }
  /* Margin Error, the third tiebreak, goes too (30 Nov 2026): at 320px names were getting
     two or three letters. It is the fifth column on both tables
     (test/narrow-table-error.test.js). */
  .leaderboard-table th:nth-child(5), .leaderboard-table td:nth-child(5) { display: none; }
}

/* The league page's table is a .leaderboard-table too, so up to 480px it takes the fixed
   layout above. Before 14 Nov 2026 it had neither that nor the short headings, and at 375px
   it was 584px inside 311px with Points behind a sideways swipe. What it has that the
   leaderboard does not, up to 640px (above 480 it overflowed too, measured at 481):
   the name gets the column's width beside the avatar and badges. The owner's Paid buttons
   are a card of their own under the table (.payments-card), not a seventh column.
   A player's name is the way to compare (design pass, 30 Nov 2026); "Compare" on a second
   line doubled every row. The name keeps the table's text colour, and its tap area is the
   whole name cell, 44px tall. */
.league-table .player-cell { position: relative; }
.league-table a.compare-name { color: inherit; text-decoration: none; }
.league-table a.compare-name::after { content: ''; position: absolute; inset: -10px 0; }
.table-hint { margin: 10px 0 0; }
@media (max-width: 640px) {
  .league-table .player-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 6px;
    align-items: center;
  }
}
@media (max-width: 480px) {
  /* No sparkline here, so the arrow's width is enough; the 18px goes to the name. */
  .league-table th:nth-child(3), .league-table td:nth-child(3) { width: 28px; }
}
/* Between phone and desktop: the same fixed layout, with a little more room per column. */
@media (min-width: 481px) and (max-width: 640px) {
  .league-table { width: 100%; table-layout: fixed; }
  .league-table th, .league-table td { padding: 8px 4px; }
  .league-table .col-full { display: none; }
  .league-table .col-short { display: inline; }
  .league-table th:nth-child(1), .league-table td:nth-child(1) { width: 40px; padding-left: 10px; }
  .league-table th:nth-child(3), .league-table td:nth-child(3) { width: 36px; }
  .league-table th:nth-child(4), .league-table td:nth-child(4) { width: 56px; }
  .league-table th:nth-child(5), .league-table td:nth-child(5) { width: 64px; }
  .league-table th:nth-child(6), .league-table td:nth-child(6) { width: 60px; }
}
.payments-list { list-style: none; margin: 0; padding: 0; }
.payments-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.payments-list li:first-child { border-top: none; }
.payments-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* Past seasons' pots on the league page: one season a row, the owner's list of names under
   it, free to wrap (a season's payers can be a long line on a phone). */
.payment-history-list { list-style: none; margin: 0; padding: 0; }
.payment-history-list li { padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.payment-history-list li:first-child { border-top: none; }
.payment-history-names { display: block; margin-top: 2px; }

/* The Ko-fi link in the nav menu. Deliberately quieter than the navigation around it —
   it should be findable by someone looking for it and easy to ignore for everyone else. */
/* Section headings in the nav menu.

   Hidden by default: from 1200px the menu is a horizontal row, and a row of section
   headings interleaved with links would read as more clutter, not less. They appear only
   in the narrow vertical panel, where grouping is what makes a long list scannable. */
.nav-group-label { display: none; }

.nav-support {
  opacity: 0.75;
  font-size: 0.85rem;
}
.nav-support:hover { opacity: 1; }

/* ---- Gameweek recap ---- */
/* One statement per line with a leading glyph, rather than a table or stat cards: the
   recap reads as a short summary of your week, and a grid would make five one-line facts
   look like data to be scanned instead of a story to be read. */
/* The recap's opening (design review, 30 Nov 2026): the round's verdict, then the points
   large against the most possible, the "/ 18" quieter than the player's own number. */
.recap-score { text-align: center; padding: 4px 0 6px; }
.recap-tier { margin: 0; font-size: 1.6rem; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.3px; color: var(--brand-ink); }
.recap-tier-message { margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); }
.recap-points { margin: 12px 0 0; font-size: 3.6rem; line-height: 1; color: var(--brand-ink); }
.recap-of { font-size: 0.55em; color: var(--muted); }
.recap-points-label { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.recap-lines { margin-top: 14px; }
/* "Share your round" (public/js/share-round.js). The width of the card on a phone, like the
   other primary buttons there. [hidden] is restated because .btn sets display, which would
   otherwise show a button that has no script behind it. */
.share-round-wrap { margin-top: 18px; }
.share-round { width: 100%; }
.share-round[hidden], .share-fallback[hidden] { display: none; }
.share-status { margin: 8px 0 0; font-size: 0.86rem; color: var(--green-text); }
.share-status:empty { display: none; }
/* The message itself, when neither sharing nor copying worked: selectable, line by line. */
.share-fallback {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-line;
  user-select: all;
  font-size: 0.9rem;
}
.recap-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.recap-line:last-child { margin-bottom: 0; }
/* Fixed width so the text lines up regardless of how wide each emoji renders — they vary
   between platforms and a ragged left edge is very obvious over five lines. */
.recap-icon { flex: 0 0 auto; width: 22px; text-align: center; }
/* The icons are drawings now, not emoji (partials/recap-icon.ejs, 30 Nov 2026): the bottom
   bar's outlined style at 20px, in the colour of what they mean. Level with the line's FIRST
   row, as a bullet is: centred on the whole line, a two-row one put the icon between rows.
   The margin is half of (row height, 1.5em, less the icon), so it holds at any text size. */
.recap-icon { align-self: flex-start; margin-top: calc((1.5em - 20px) / 2); display: inline-flex; justify-content: center; color: var(--muted); }
.recap-icon svg { width: 20px; height: 20px; }
.recap-icon.is-good { color: var(--green-text); }
.recap-icon.is-bad { color: var(--red-text); }
.recap-icon.is-brand { color: var(--brand-ink); }
.recap-icon.is-gold { color: #d4a017; }

/* ---- Sync log runs table ---- */
@media (max-width: 480px) {
  /* Fixed layout so Detail absorbs the remainder rather than the fixed-width columns
     pushing it off the edge — the same reasoning as the leaderboard. */
  .sync-log-table { width: 100%; table-layout: fixed; }
  .sync-log-table th, .sync-log-table td {
    padding: 8px 5px;
    font-size: 0.76rem;
    vertical-align: top;
  }
  .sync-log-table thead th { font-size: 0.56rem; }

  .sync-log-table th:nth-child(1), .sync-log-table td:nth-child(1) { width: 66px; }
  .sync-log-table th:nth-child(2), .sync-log-table td:nth-child(2) { width: 64px; }

  /* Trigger: "Scheduled" on all but a handful of rows, so it earns none of its 75px here. */
  .sync-log-table th:nth-child(3), .sync-log-table td:nth-child(3) { display: none; }

  /* padding-right keeps this off the Detail column, whose header otherwise reads as
     RESULTSDETAIL with no gap between them. */
  .sync-log-table th:nth-child(4), .sync-log-table td:nth-child(4) {
    width: 34px;
    text-align: right;
    padding-right: 10px;
  }

  /* Took: only interesting when a run is slow, and the summary says so in words. */
  .sync-log-table th:nth-child(5), .sync-log-table td:nth-child(5) { display: none; }
}

/* The unread-notices dot on the Me tab. Positioned against the tab rather than the icon so
   it does not move when the icon changes, and sized to read as a signal rather than a
   count — the number itself is on the Notices link inside /me. */
.bottom-nav .tab-dot {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- Prediction save state ---- */
.save-bar { margin-top: 18px; }

/* Sticky only once there is something to save. A permanent bar would take a slice of a
   small screen for a button that is usually irrelevant — most visits to this page are to
   look, not to change something. */
.save-bar.is-active {
  position: fixed;
  left: 0;
  right: 0;
  /* Above the bottom nav, not over it. The nav is 60 to 62px tall. */
  bottom: 64px;
  z-index: 15;
  margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}
.save-bar.is-active button { width: 100%; }
.save-bar.is-active .save-hint { margin: 8px 0 0; text-align: center; }

/* Amber, not red. An unsaved prediction is pending, not wrong — red here would sit beside
   the red already used for a missed fixture and mean something entirely different. */
.fixture-row.is-unsaved { border-left-color: #d29200; }

/* The script injects this element rather than decorating existing markup, so it does not
   depend on which lock-state elements a given fixture happens to render. */
/* "Saved" (predictions.ejs) is the same kind of word, in the saved green, and hides while
   the row is being changed: then "Unsaved" is the truth. The amber was #d29200, 2.5:1 on
   the unsaved row's tint; #8a5d00 is 5.5:1 (dark mode has its own, below). */
.unsaved-flag,
.lock-lost-flag,
.saved-flag {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a5d00;
  margin-top: 4px;
}
.saved-flag { color: var(--green-text); }
.fixture-row.is-unsaved .saved-flag { display: none; }

/* ---- Me hero ---- */
.me-hero h1 { font-size: 2rem; letter-spacing: -0.5px; }

/* Full bleed to the hero padding: the chart is the hero, not an inset diagram. Fixed
   height with preserveAspectRatio="none" so a 38-gameweek season and a 2-gameweek one
   both fill the same band — the shape is the point, not the bar width. */
.hero-chart {
  display: block;
  width: 100%;
  height: 54px;
  margin: 14px 0 4px;
  overflow: visible;
}
/* Green on purple. A fill attribute in the markup loses to a stylesheet rule, so the same
   bars can be purple on white elsewhere without the route knowing where it is rendered. */
.hero-chart rect { fill: var(--lime); }
.hero-chart-note {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

/* Three across, and STAYING three across on a phone — unlike .quick-stats, which stacks
   below 640px. These values are single digits; stacking them would give three full-width
   cards each holding one character, which is how the flat version got flat. */
.me-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.me-stats .stat-card { padding: 14px 10px; text-align: center; }
.me-stats .stat-value { font-size: 1.7rem; }

/* The one table on this page that does not fit. Five columns in 286px overflows by 13px,
   so it scrolls sideways inside its wrapper and the last column — the average, which is
   the point of the table — is the part that disappears. Only this one: the other three
   have three or four columns and fit already. */
@media (max-width: 480px) {
  .me-payoff-table { width: 100%; table-layout: fixed; }
  .me-payoff-table th, .me-payoff-table td { padding: 8px 3px; font-size: 0.78rem; }
  .me-payoff-table thead th { font-size: 0.56rem; }
}

/* The insight card. Given the green accent so the eye lands on it before the tables — it
   is the one sentence that answers "so what?", and it was previously the third row of the
   third table. */
.insight-card { border-left: 4px solid var(--lime); }

/* The disclosure holding everything else. Styled as a control rather than a heading, so it
   reads as something to open rather than a section that failed to render. */
.more-insights { margin-bottom: 18px; }
.more-insights > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-ink);
}
.more-insights > summary::-webkit-details-marker { display: none; }
.more-insights[open] > summary { margin-bottom: 12px; }

/* Bar rows. One device used across all four breakdowns, so the disclosure reads as a set
   rather than four unrelated tables — and so a reader who understands the first
   understands the rest.

   Grid rather than a table: the label and value size themselves, the bar takes the rest,
   and the note drops to a second line on narrow screens. The tables these replaced needed
   fixed widths and still overflowed at 320px. */
.insight-rows { display: flex; flex-direction: column; gap: 12px; }
.insight-row {
  display: grid;
  /* Fixed label and value columns, so the bars of every row in a card start and end
     together: each row is its own grid, and "You predict" over "Actually" started 20px apart. */
  grid-template-columns: 6.25rem 1fr 2.75rem;
  grid-template-areas: "label bar value" "note note note";
  align-items: center;
  gap: 4px 10px;
}
.insight-row-label {
  grid-area: label;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  font-weight: 600;
}
.insight-row-value {
  grid-area: value;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.insight-row-note {
  grid-area: note;
  font-size: 0.72rem;
  color: var(--muted);
}

.insight-bar {
  grid-area: bar;
  display: block;
  height: 10px;
  border-radius: 5px;
  background: #ececf1;
  overflow: hidden;
}
/* Purple is the resting state and green marks beating your own average. Two colours only:
   colouring every bar would make the highlight mean nothing. */
.insight-bar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--brand-fill);
  min-width: 3px;
}
.insight-bar-fill.is-good { background: #00c853; }
.insight-bar-fill.is-neutral { background: var(--muted); }

/* Admin analytics funnel. Each bar's width is that stage's share of the FIRST stage, not of the
   one above, so the bars narrow down the page and the drop-off reads without the numbers.
   No min-width on the fill, unlike .insight-bar-fill: a stage nobody reached should look empty. */
.funnel { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.funnel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.funnel-label { font-weight: 600; font-size: 0.9rem; min-width: 0; }
.funnel-count { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel-pct { font-weight: 600; font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.funnel-bar {
  height: 14px;
  border-radius: 7px;
  background: #ececf1;
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  border-radius: 7px;
  background: var(--brand-fill);
}
.funnel-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }

/* ---- Me hub ---- */
/* Stacked rows rather than a grid: each entry is a title plus a line of explanation, and
   at that shape two columns on a phone would give neither enough width to be readable. */
.me-links { display: flex; flex-direction: column; gap: 2px; }
.me-links a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.me-links a:last-child { border-bottom: none; }
.me-links a strong { display: block; font-size: 0.97rem; }
.me-links a span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}
.me-links a:hover strong { color: var(--accent-text); }

/* ---- Achievements ---- */
/* auto-fit rather than a fixed column count: one badge on a phone, three on a desktop,
   without a media query for each. minmax stops a single badge stretching the full width
   and looking like a banner. */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.badge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.badge-earned { background: #f7fdf9; border-color: rgba(180,240,0,0.35); }
/* A locked badge reads as available-but-not-yet through its outline shield and a dashed
   edge, not by dimming: at 62% opacity its rules fell to 2.56:1 (30 Nov 2026). */
.badge-locked { border-style: dashed; }
/* The shields (partials/badge-shield.ejs), in place of emoji. Earned: the brand green filled,
   a lime rim and glyph. Still to earn: a grey outline. The variables carry dark mode. */
.badge-icon { flex: 0 0 auto; line-height: 0; }
.shield { width: 40px; height: 47px; }
.shield-body { stroke-width: 2.5; stroke-linejoin: round; }
.shield-glyph { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.shield-glyph-text { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.shield-earned .shield-body { fill: var(--brand-fill); stroke: var(--lime); }
.shield-earned .shield-glyph { stroke: var(--lime); }
.shield-earned .shield-glyph-solid, .shield-earned .shield-glyph-text { fill: var(--lime); }
.shield-locked .shield-body { fill: none; stroke: var(--muted); }
.shield-locked .shield-glyph { stroke: var(--muted); }
.shield-locked .shield-glyph-solid { fill: none; stroke-width: 2.5; }
.shield-locked .shield-glyph-text { fill: var(--muted); }
.badge-body { min-width: 0; }
.badge-name { margin: 0 0 2px; font-weight: 700; font-size: 0.98rem; }
.badge-count { color: var(--muted); font-weight: 700; }
.badge-detail { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.callout-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #eef6f0;
}
.callout-icon {
  flex: 0 0 auto;
  color: var(--brand-ink);
}
.callout-card strong { font-size: 0.95rem; display: block; }
.callout-card p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---- Private leagues ---- */
.league-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.league-name { font-size: 1rem; }

.invite-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.invite-card strong { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.invite-code {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand-ink);
  background: var(--grey);
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 4px;
  display: inline-block;
}
.invite-code-inline {
  font-family: monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}
.invite-link {
  font-family: monospace;
  font-size: 0.76rem;
  color: var(--muted);
  word-break: break-all;
  margin: 4px 0 0;
  max-width: 320px;
}

.league-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Dashboard ---- */
.get-started-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}
.get-started-grid form {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
@media (max-width: 560px) {
  .get-started-grid { grid-template-columns: 1fr; }
}

.dashboard-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.dashboard-links a {
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
}
.dashboard-links a:hover { text-decoration: underline; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  margin-bottom: 4px;
  min-height: 44px;
}
/* A tick box or radio button is tapped through its label, whichever class the label has. */
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height: 44px; }
.toggle-row input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- Dashboard hero ---- */
.dashboard-hero {
  background: var(--pitch-markings) center / cover no-repeat, linear-gradient(135deg, var(--brand), #0a5a32);
  color: white;
  border-radius: 14px;
  padding: 24px 22px;
  margin-bottom: 18px;
}
.dashboard-hero .greeting { font-size: 0.92rem; opacity: 0.85; margin: 0 0 4px; }
.dashboard-hero h1 {
  color: white;
  margin: 0 0 4px;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dashboard-hero .hero-sub { opacity: 0.85; font-size: 0.86rem; margin: 0 0 16px; }
.dashboard-hero .progress-track {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
  margin-bottom: 6px;
}
.dashboard-hero .progress-fill {
  background: var(--lime);
  height: 100%;
  border-radius: 999px;
}
/* The season, quieter than the round's lime: white, not the amber that matched nothing. */
.dashboard-hero .progress-fill.progress-fill-alt { background: rgba(255, 255, 255, 0.7); }
.dashboard-hero .progress-label { font-size: 0.76rem; opacity: 0.85; margin: 0 0 14px; }
.dashboard-hero .countdown-label { font-size: 0.82rem; opacity: 0.9; margin: 0 0 16px; }
.dashboard-hero .countdown { font-weight: 800; }
.dashboard-hero .hero-cta { display: inline-block; }
/* Which tournament the round belongs to, above it. Lime on the dark green reads at 10:1. */
.dashboard-hero .hero-season {
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 8px 0 2px;
}
/* The one primary action: the logo's lime with the darkest green on it, the width of the
   panel, tall enough to hit without looking. A mid-green button on a dark-green panel was
   the same colour family as what it sat on. */
.dashboard-hero .hero-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  background: var(--lime);
  color: var(--brand);
  font-weight: 800;
  border-radius: 10px;
  text-align: center;
}
.dashboard-hero .hero-cta-primary:hover { background: #c4ff1a; color: var(--brand); }
.dashboard-hero .hero-cta-primary:focus-visible { outline-color: white; }

/* ---- Quick stats ---- */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .quick-stats { grid-template-columns: 1fr; }
}
/* Four cards (an admin user's page, Maintenance): four across, and two by two on a phone.
   This was u-cols-4, whose !important beat the rule above, so on a phone the four stayed
   side by side and ran up to 150px past the screen. */
.quick-stats.quick-stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) {
  .quick-stats.quick-stats-4 { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.stat-value.latest-score { font-size: 1rem; text-transform: uppercase; }
.stat-note { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.stat-note.result-good { color: var(--green-text); font-weight: 700; }
.stat-note.result-bad { color: var(--red-text); font-weight: 700; }
.stat-link {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
}
.stat-link:hover { text-decoration: underline; }

/* ---- This week's fixtures list ---- */
.fixture-list-item {
  /* Column, not row: the Predict / Predicted status now sits on its own line beneath the
     fixture rather than being pushed out to the right edge of it. align-items:center is what
     centres that status line under the fixture. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fixture-list-item:last-child { border-bottom: none; }
.fixture-list-name {
  /* Takes the space between the two badges so the away badge sits at a consistent position
     on every row, instead of being pushed around by the length of the team names. */
  flex: 1;
  min-width: 0;
  text-align: center;
  /* Wraps inside its own box. It inherited the row's nowrap, and the row's ellipsis does not
     reach a flex item's text, so a long name ran under the away crest (production's longest
     at 375px and 390px, 20 Oct 2026). */
  white-space: normal;
  overflow-wrap: anywhere;
}
/* "Home v" and "Away" each stay on one line when they fit, so a wrapped name always breaks
   after the "v"; inline-block rather than nowrap, so a name too wide for a line still wraps. */
.fixture-list-side { display: inline-block; }
.fixture-list-teams .crest { flex-shrink: 0; }
.fixture-list-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  /* flex:none + full width, because the parent is now a column: flex:1 would make this grow
     in the vertical axis instead of the horizontal one. */
  flex: none;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* On a wide screen the row took the card's full width, 528 to 568px, leaving 127 to 149px of
   empty card either side of a name like "Arsenal v Man City" (15 to 44px on a phone). From
   600px it is at most 420px, centred (18 Nov 2026): 57 to 75px either side, with FPL's
   longest pairings ("Nott'm Forest v Crystal Palace") still on one line, which 380 did not
   keep. The status line below is centred already. */
@media (min-width: 600px) {
  .fixture-list-teams { max-width: 420px; margin-left: auto; margin-right: auto; }
}

:root { --crest-sm-size: 62px; }
.crest-sm { width: var(--crest-sm-size); height: var(--crest-sm-size); font-size: 0.94rem; }
.fixture-done { color: var(--green-text); font-weight: 700; font-size: 0.78rem; white-space: nowrap; }
/* When a row still open locks, after its pick or its Predict link (18 Nov 2026): quieter than
   either, and the same size so the line reads as one. */
.fixture-todo { font-size: 0.78rem; white-space: nowrap; }
.fixture-lock-time { color: var(--muted); font-weight: 500; }
.fixture-predict-link { color: var(--accent-text); font-weight: 700; font-size: 0.78rem; text-decoration: none; white-space: nowrap; }
.fixture-predict-link:hover { text-decoration: underline; }
.fixture-locked { color: var(--muted); font-weight: 700; font-size: 0.78rem; white-space: nowrap; }
.fixture-missed { color: var(--red-text); font-weight: 700; font-size: 0.78rem; white-space: nowrap; }

/* ---- Compact league rows on the dashboard ---- */
.league-row-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.league-row-compact:last-child { border-bottom: none; }
.league-row-compact a { color: var(--brand-ink); font-weight: 600; text-decoration: none; font-size: 0.82rem; }

/* ---- Bottom nav (mobile) ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 40;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  /* Darker than --muted, which is too faint on white for text this small. */
  color: var(--nav-ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 4px;
  /* Without this a label can wrap to two lines on a narrow phone, which makes the whole
     nav taller and the items misalign. */
  white-space: nowrap;
}
.bottom-nav a svg { width: 28px; height: 28px; }
.bottom-nav a.active { color: var(--accent-text); }

/* Up to 1199px, with the header's menu button (18 Nov 2026; was 680px): a tablet works as a
   phone does, one tap to a section rather than two through the menu. */
@media (max-width: 1199px) {
  .bottom-nav { display: flex; justify-content: space-around; }
  /* Generous buffer above the nav's own actual height (icon + label + padding + border) —
     62px was cutting it too close in practice, leaving real interactive content on longer
     pages (e.g. admin maintenance, with several stacked tables) partially covered by the
     fixed nav bar. */
  body { padding-bottom: 90px; }
  /* Body padding alone isn't enough — it reserves visual space, but scroll-into-view
     behavior (native, or via Playwright's scrollIntoViewIfNeeded()) has no way to know a
     fixed-position element sits on top of part of the viewport, so it can still land a
     target right at the boundary the nav covers. scroll-margin-bottom is the actual
     mechanism browsers use to leave extra clearance for a fixed element when scrolling
     something into view — applied broadly here since anything could end up being that
     target. */
  * { scroll-margin-bottom: 90px; }
}
/* After the block above, which sets space-around at the same specificity. */
/* On a tablet the five tabs sit together in the middle, as a phone's do, rather than 240px
   apart across a 1,200px screen. */
@media (min-width: 681px) and (max-width: 1199px) {
  /* nowrap: the bar is a <nav>, so it takes the header's flex-wrap: wrap, and at 681 to
     about 830px the fifth 160px tab wrapped to a second row instead of shrinking. */
  .bottom-nav { justify-content: center; flex-wrap: nowrap; }
  .bottom-nav a { flex: 0 1 160px; }
}

/* ---- Results auto-sync status ---- */
.sync-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sync-status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}
.sync-status-dot.ok { background: var(--lime); }
.sync-status-dot.warn { background: var(--red); }
.sync-status-dot.off { background: var(--muted); }
.sync-status-card code {
  background: var(--grey);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.push-preview {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafafa;
  max-width: 340px;
}
.push-preview strong { font-size: 0.9rem; display: block; margin-bottom: 4px; }
.push-preview p { margin: 0; font-size: 0.82rem; color: var(--muted); }

.locked-badge {
  background: var(--grey);
  color: var(--muted);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ---- Tab navigation: horizontal pill row ---- */
.tab-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  /* 8px above and below the 29px pills, taken back out of the margins, so each pill's 44px
     tap area is inside the row. Outside it, the row would scroll up and down. */
  padding: 8px 0;
  margin: -8px 0 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--brand-ink);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.tab-nav a.current {
  background: var(--brand-fill);
  border-color: var(--brand-fill);
  color: white;
}

@media (max-width: 380px) {
  .team { font-size: 0.975rem; }
  /* Slightly smaller labels here so the longest one ("Results") keeps room in its fifth
     of the bar, now that they can't wrap. */
  .bottom-nav a { font-size: 0.78rem; padding: 6px 2px; }
  .team-label { font-size: 0.76rem; max-width: 100%; }
  .crest { font-size: 0.94rem; }
  /* padding: 0 is restated because the generic input[type=number] rule further up the file
     overrides the base .score-cell rule's (same specificity, later in the file). With its
     10px 12px a 40px box had 14px left for the digits, and "10" was cut off. 16px, not
     0.95rem: under 16px iOS Safari zooms the page when the box is focused. Measured in
     Chromium at 320 to 380px on 2 Oct 2026: the box, the row and the name truncation are
     unchanged, and "10" fits with room to spare. */
  .score-cell input { width: 46px; height: 44px; padding: 0; margin-bottom: 0; font-size: 1.5rem; }
  .fixture-main { gap: 8px; }
  /* The admin's result boxes: same two faults, same fix. */
  .score-inputs input { width: 36px; height: 36px; padding: 0; font-size: 16px; }
  /* Eased back a little where the boxes themselves shrink to 36px, so the separator stays
     proportionate — still well up on the 1.05rem it was before. */
  .score-sep { font-size: 1.3rem; }
  .card { padding: 16px; }
}


/* ---- Notification opt-in banner ---- */
/* Fixed above the mobile bottom nav so it never covers it; the nav is 62px plus safe-area. */
.push-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--brand);
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  font-size: 0.82rem;
}
.push-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.push-banner-text strong { font-size: 0.9rem; }
.push-banner-text span { opacity: 0.85; }
.push-banner-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.push-banner .btn-sm { background: var(--accent); color: white; border: none; }
.push-banner-dismiss {
  min-height: 0;
  background: none;
  border: none;
  color: white;
  opacity: 0.75;
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
  padding: 0;
}
/* From 681px the banner takes its desktop width on the right, still above the tab bar; from
   1200px, where there is no tab bar, it sits in the corner. */
@media (min-width: 681px) {
  .push-banner { left: auto; right: 16px; max-width: 420px; }
}
@media (min-width: 1200px) {
  .push-banner { bottom: 16px; }
}

/* ---- League invite QR ---- */
.qr-details > summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  list-style: none;
  padding: 4px 0;
}
.qr-details > summary::-webkit-details-marker { display: none; }
.qr-details > summary::after { content: ' ▾'; }
.qr-details[open] > summary::after { content: ' ▴'; }
/* White padding around the code matters: the quiet zone is part of the spec, and scanners
   struggle without it. */
.league-qr {
  display: inline-block;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-top: 6px;
  line-height: 0;
}
.league-qr img, .league-qr canvas { display: block; }


/* ---- Scoreline frequency bars ---- */
.scoreline-bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--brand-fill);
  min-width: 2px;
}


/* ---- Team scorelines, home beside away ---- */
.team-scoreline-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* Stacks on narrow screens — two tables side by side is unreadable on a phone. */
@media (max-width: 680px) {
  .team-scoreline-cols { grid-template-columns: 1fr; }
}


/* ---- Still-open predictions in history ---- */
.status-pill.still-open { background: #e7f7ed; color: var(--green-text); }
/* A link, not just text: if it's still open the useful thing is to go and do it. */
.still-open-link { color: var(--green-text); font-weight: 700; text-decoration: underline; }


/* ---- Prediction status grid ---- */
.prediction-status-table th, .prediction-status-table td { padding: 8px 6px; }
/* A round's seven columns were 10px past a 320px screen (walkthrough, 18 Nov 2026). It is a
   grid to be read across and down, so it stays one: narrower cells and smaller headings
   there, Done as "5/5", and a long name breaks onto a second line rather than widening the table. */
.pred-player { overflow-wrap: anywhere; }
/* /admin/season's standings: the name ends in an ellipsis (.player-cell), which needs
   columns that do not grow to their content; a 16-character name made the table 299px in
   256 at 320px. Rank keeps .rank's 34px and the name takes what Points leaves. */
.season-standings { table-layout: fixed; }
.season-standings th:first-child { width: 34px; }
.season-standings th.numeric { width: 4.5rem; }
@media (max-width: 400px) {
  .prediction-status-table th, .prediction-status-table td { padding: 8px 3px; }
  /* "PLAYER" and "DONE" set those columns' widths; this is the fixture headings' size. */
  .prediction-status-table th { font-size: 0.62rem; }
}
.pred-fixture-col { text-align: center; font-size: 0.62rem; line-height: 1.2; white-space: nowrap; }
.pred-cell { text-align: center; }
.pred-yes { color: var(--green-text); font-weight: 800; }
.pred-no { color: var(--muted); font-weight: 700; }
/* A row nobody has touched is the one worth spotting from across the room. */
.pred-none { background: #fde8e8; }
.pred-partial { background: #fff8e6; }


/* ---- Admin index ---- */
.admin-index-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}
.admin-index-group h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.admin-index-group a {
  display: block;
  padding: 14px 0;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.admin-index-group a:hover { text-decoration: underline; }
/* The admin home's list of what needs the admin, each line a link to the page that settles
   it, and a full-width 44px target. */
.needs-you-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.needs-you-list li + li { border-top: 1px solid var(--border); }
.needs-you-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.needs-you-list a:hover { text-decoration: underline; }
/* The pages that belong with Rounds, as a line of 44px targets that wrap whole. */
.rounds-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 4px 0 0;
}
.rounds-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.rounds-links a:hover { text-decoration: underline; }
/* The ESPN import page: the year box and its button on one line, and each round's matches. */
.import-year-row { display: flex; gap: 10px; align-items: center; }
.import-year-row input { margin-bottom: 0; }
.import-fixtures { list-style: none; padding: 0; margin: 0 0 14px; }
.import-fixtures li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.import-fixtures li:last-child { border-bottom: none; }
.import-fixtures .kickoff-time { display: block; color: var(--muted); font-size: 0.86rem; }
/* The Rounds page's manual form, folded under a summary that is its own 44px target. */
.manual-round > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-ink);
}
.manual-round[open] > summary { margin-bottom: 8px; }
/* The manual round form's fixture rows: three across when they fit, stacked when they do
   not. As a flex row the kickoff box ran 9px past a 375px screen. */
.manual-fixture-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 0 10px;
  align-items: end;
  margin-bottom: 6px;
}
/* The end-of-round preview links: a line of short labels ("8+"), each a 44px target, not
   the column of full-width links above. After that rule, which it overrides. */
.admin-index-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.admin-index-note span { display: block; }
.admin-index-note a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
}


/* ---- Per-fixture lock status ---- */
.fixture-lock-status {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 6px;
}
/* Green reads as "you can still act on this", which is the state that matters most. */
.lock-open { color: var(--green-text); }
.lock-locked { color: var(--muted); }
/* What the scoreline amounts to (public/js/margin-line.js): the winner and the margin are
   all that score. The brand's darkest green, which reads on every row tint. */
.margin-line {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-ink);
}
.margin-line:empty { display: none; }


/* ---- Notification schedule reference ---- */
.notif-type { padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif-type:last-child { border-bottom: none; }
.notif-type-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notif-subject { margin: 4px 0 6px; font-size: 0.86rem; color: var(--muted); font-style: italic; }
.notif-type p.stat-note { margin: 2px 0; }
/* Flags a notification whose behaviour no longer matches how the app works. */
.notif-warning {
  margin: 6px 0 0;
  padding: 6px 10px;
  background: #fff8e6;
  border-left: 3px solid #d29200;
  font-size: 0.8rem;
}


/* ---- Notification template preview ---- */
.template-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  max-height: 420px;
  overflow: auto;
}
.template-preview img { max-width: 100%; }


/* The fixture named beneath the dashboard countdown, so it is clear WHICH one locks next. */
.countdown-fixture {
  font-size: 0.78rem;
  opacity: 0.85;
  font-weight: 500;
}

/* The standing, as one sentence. Replaced three stat tiles, one of which repeated the
   hero's "predictions remaining" a couple of inches further down the same screen. */
.standing-line { padding: 14px 16px; }
/* The player's own place above the leaderboard and league table (partials/your-position.ejs):
   the place large, in the display face; how it moved and the gap to the lead under it. */
.your-position { padding-top: 14px; padding-bottom: 14px; }
.your-position-headline { margin: 0; font-size: 1.9rem; line-height: 1.1; color: var(--brand-ink); }
.your-position-detail { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.your-position-sep { margin: 0 2px; }
/* One left and right padding for every card on the dashboard and the Me page (18 Nov 2026),
   so their text starts on one line down the page. On the dashboard the hero was 22px, the
   standing line and season bar 16, the fixtures card 16 on a phone and 20 wider, the result
   cards 18; on Me the hero 22, the cards 16 (20 wider) and More insights 18. Only on those
   two: the same classes are used elsewhere. Top and bottom stay each card's own. Me's three
   stat tiles are centred and keep theirs; its insight card's 4px green bar counts toward
   the inset. Every other player page already had one (pw-tools/scorepredictor/page-edges.js). */
.dashboard-page,
.me-page { --card-x: 20px; }
.dashboard-page .dashboard-hero,
.dashboard-page .card,
.dashboard-page .stat-card,
.me-page .dashboard-hero,
.me-page .card,
.me-page .more-insights > summary {
  padding-left: var(--card-x);
  padding-right: var(--card-x);
}
.me-page .insight-card { padding-left: calc(var(--card-x) - 4px); }
.standing-main {
  margin: 0;
  font-size: 1.05rem;
}
.standing-main strong { font-weight: 800; }
.standing-move {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.standing-move.up { color: var(--green-text); font-weight: 600; }
.standing-move.down { color: var(--red-text); font-weight: 600; }

/* Season progress, now at the foot of the page rather than in the hero. */
.season-progress { padding: 14px 16px; }
/* The bar's rules did not come with it: they are all scoped to .dashboard-hero, so here the
   track had no height and the fill no colour, and the bar was drawn 0px high. These are its
   own. Purple on a grey track rather than the hero's pale yellow, which is made for a purple
   background and all but vanishes on a white card. */
.season-progress .progress-track {
  background: var(--border);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
  margin-bottom: 10px;
}
.season-progress .progress-fill {
  background: var(--brand-fill);
  height: 100%;
  border-radius: 999px;
}
.season-progress .progress-label { margin: 0; }

/* Screen-reader-only text. "=1" reads as "equals one" or is skipped entirely depending on
   the reader, so the word "joint" is spelled out for anyone not looking at the symbol. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Marks a prediction an admin changed after the fact. Deliberately conspicuous rather than
   subtle — the player is the person with the strongest interest in noticing it. */
.corrected-flag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red-text);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
  white-space: nowrap;
}

/* Why it was changed, on its own line under the score. It wraps: the reason is a sentence
   the admin typed, in a narrow table cell on a phone. */
.corrected-reason {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---- Large text mode ---------------------------------------------------------------
   A per-user accessibility preference, not a zoom control. Browser zoom makes this table
   WIDER, so at large sizes the points column — the one thing anyone actually came to read —
   scrolls off the right edge. This mode drops information density instead: position, name
   and points only, at a size that stays within the viewport.

   Scoped to `body.large-text` so a single preference can grow to cover other pages without
   the toggle needing to know about them. */
.large-text .large-text-toggle { margin-bottom: 10px; }
.large-text-toggle { margin-bottom: 10px; }

.large-text .leaderboard-table th,
.large-text .leaderboard-table td {
  font-size: 1.35rem;
  padding: 14px 8px;
}

/* Everything that competes with the three things that matter. The trend column is emptied
   rather than narrowed — an arrow at this size is decoration, not information. */
.large-text .leaderboard-table th:nth-child(3),
.large-text .leaderboard-table td:nth-child(3),
.large-text .leaderboard-table th:nth-child(4),
.large-text .leaderboard-table td:nth-child(4),
.large-text .leaderboard-table th:nth-child(5),
.large-text .leaderboard-table td:nth-child(5),
.large-text .leaderboard-table .player-avatar {
  display: none;
}

/* Fixed layout is what forces the ellipsis at narrow widths. With three columns instead of
   six there is room to let the name wrap and show in full, which is the whole point. */
.large-text .leaderboard-table { table-layout: auto; }
.large-text .leaderboard-table .player-cell > span:not(.player-avatar) {
  font-size: 1.35rem;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.large-text .leaderboard-table .rank { font-size: 1.35rem; font-weight: 700; }
.large-text .leaderboard-table .points-pill {
  font-size: 1.3rem;
  padding: 6px 12px;
}


/* ---- Results: a scoreboard a match (design pass, 30 Nov 2026) ----
   The kickoff (and, until there is a result, why not) on the first line, then a line a team:
   crest, name taking the room, score. Once a match has a winner the other side goes muted,
   so the winner reads first; a draw leaves both as they are. */
.result-rows { list-style: none; margin: 0; padding: 0; }
.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  row-gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.result-row:first-child { border-top: none; padding-top: 2px; }
.result-row:last-child { padding-bottom: 0; }
.result-meta { margin: 0; font-size: 0.82rem; color: var(--muted); }
.result-status { justify-self: end; }
.result-team { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--text); }
.result-team .crest { width: 32px; height: 32px; flex: none; font-size: 0.62rem; }
.result-name { flex: 1; min-width: 0; font-size: 1rem; overflow-wrap: anywhere; }
.result-score { font-size: 1.55rem; line-height: 1; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.result-team.is-winner .result-name { font-weight: 700; }
.result-row:has(.is-winner) .result-team:not(.is-winner) { color: var(--muted); }

/* Where the display font goes: headings, and the numbers a page is about. Anything else is
   in the system font, which reads better small and in sentences. Here, late, because the
   generic input rules above would put the score boxes back otherwise. */
h1,
.gw-heading,
.score-cell input,
.points-badge.points-lg,
.stat-value,
.leaderboard-table td.rank,
.leaderboard-table .points-pill,
.your-position-headline,
.recap-tier,
.recap-points,
.result-score { font-family: var(--font-display); }

/* ---- Utility classes ----
   Stand-ins for the inline styles adopt-style-primitives.js replaced in the views. They sit at
   the END of the file on purpose: each is a single class, so it only beats rules of equal
   specificity (.gw-heading's margin, th/td's text-align) by coming later. No !important —
   an inline style on the same element (admin-fixture-predictions.ejs sets its own gap on a
   .split-row) must still win, as it would have before. */

/* Right-aligned numbers line up on their last digit only with tabular (fixed-width) figures. */
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.flush { margin: 0; }
.flush-top { margin-top: 0; }
.flush-bottom { margin-bottom: 0; }

/* Two things either side of a row: a heading and a date, a title and its count. Wraps rather
   than squashing on a narrow screen. */
.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Motion: SPEC-motion.md stage 2 ---- */

/* 2.1 Points counting. Equal-width digits, so the number is as wide at 11 as at 88 and
   count-up.js can hold its box still while it counts. */
[data-count-to] { font-variant-numeric: tabular-nums; }

/* 2.2 Results and league standings arriving. Only the first eight rows, 45ms apart, so a long
   table never makes anyone wait to read it. Opacity only: Safari's support for transform on
   a table row is unreliable. */
.results-list > * { animation: row-in 0.32s var(--ease-out) both; }
.results-list > :nth-child(2) { animation-delay: 45ms; }
.results-list > :nth-child(3) { animation-delay: 90ms; }
.results-list > :nth-child(4) { animation-delay: 135ms; }
.results-list > :nth-child(5) { animation-delay: 180ms; }
.results-list > :nth-child(6) { animation-delay: 225ms; }
.results-list > :nth-child(7) { animation-delay: 270ms; }
.results-list > :nth-child(8) { animation-delay: 315ms; }
.results-list > :nth-child(n+9) { animation: none; }
@keyframes row-in { from { opacity: 0; } to { opacity: 1; } }

/* 2.3 Deadline approaching. A ::before, not a child element, because fixture-lock.js rewrites
   the countdown with textContent, which would delete one. Slow on purpose: faster reads as an
   error rather than a clock. The only looping animation in the app. */
.lock-open.urgent { color: var(--red-text); }
.lock-open.urgent::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  animation: beat 1.9s ease-in-out infinite;
}
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }

/* 2.4 Position change, on rows whose trend is up or down only, and only under .lift-now, which
   rank-lift.js adds the first time this viewer sees this snapshot. On the cells rather than the
   row, so it doesn't displace the row's own row-in on league standings. No end keyframe: it
   fades back to whatever the cell's resting background is, and a fill-mode end state of
   transparent would sit over tr.me's highlight. rgba rather than color-mix for older phones. */
.lift-now tr.moved > td { animation: lift 0.75s var(--ease-out); }
.lift-now tr.moved .trend { animation: arrow-in 0.55s var(--ease-out) 0.1s both; }
@keyframes lift { from { background: rgba(180,240,0,0.22); } }
@keyframes arrow-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---- Motion: SPEC-motion.md stage 4 ---- */

/* 4.1 Page to page. Where the browser can do it (Safari 18.2, Chrome 126), going from one page
   to the next cross-fades the content while the header and the bottom bar, named below, stay
   exactly where they are. Anywhere else nothing here applies and .container's own 0.1s fade
   at the top of this file is what plays, as before.
   The rule that switches it on, @view-transition, is NOT in this file: it is a <style> in
   the page's head (views/partials/header.ejs). The browser has to know a page has opted in
   by the time it first draws it, and from this file it often did not: in headless Chromium
   at phone size the transition ran on 2 navigations in 10, against 10 in 10 from the head
   (measured 2 Oct 2026). What is here is everything else about it. */
/* A name makes the element its own layer, which is what holds it still. It also makes it a
   stacking context, so the header is lifted as a whole: the menu panel inside it had
   z-index 20 on its own and would otherwise open underneath the page. */
nav:not(.bottom-nav) {
  view-transition-name: site-header;
  position: relative;
  z-index: 20;
}
.bottom-nav { view-transition-name: bottom-nav; }
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) { animation-duration: 0.18s; }
/* The cross-fade replaces .container's fade rather than adding to it. A zero duration, not
   animation: none — taking the animation away and giving it back when the transition ends
   would start it then. */
:root:active-view-transition .container { animation-duration: 0s; }

/* 4.2 Press feedback. Tap highlighting is off for the whole app (top of this file), which
   left links giving nothing back until the next page arrived. Buttons already shrink a little.
   :where() keeps this as weak as a plain a:active, so anything more specific still wins. */
a:where(:not(.btn, .btn-sm)):active { opacity: 0.6; }
.bottom-nav a:active { opacity: 1; color: var(--brand-ink); transform: scale(0.92); }
.me-links a:active { opacity: 1; background: rgba(5,59,34,0.05); }

/* 4.3 The save bar arriving. It becomes fixed the moment a score changes; it now slides up
   from behind the bottom bar instead of appearing. The one exception to "nothing animates on
   the predict form while someone is typing", agreed 2 Oct 2026. */
.save-bar.is-active { animation: bar-in 0.24s var(--ease-out); }
@keyframes bar-in { from { transform: translateY(100%); } }

/* 4.4 A flash message is the outcome of what someone just did, and people were missing it.
   The short delay lets the page arrive first. */
.flash { animation: flash-in 0.32s var(--ease-out) 0.12s both; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* 4.5 The notification banner. It starts display: none; the entrance plays when
   push-banner.js shows it, and .is-leaving is added on the way out. */
.push-banner { animation: banner-in 0.3s var(--ease-out) both; }
.push-banner.is-leaving { animation: banner-out 0.2s ease both; }
@keyframes banner-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes banner-out { to { opacity: 0; transform: translateY(16px); } }

/* 4.6 and 4.7 play only under .first-sight, which first-sight-mark.js adds the first time
   this viewer sees that value: with JavaScript off, or storage unavailable, they don't. */

/* 4.6 A dashboard progress bar fills to its mark. Scaled, not widened: the width is the
   server's and stays put. */
.progress-fill { transform-origin: left center; }
.progress-fill.first-sight { animation: fill-in 0.6s var(--ease-out); }
@keyframes fill-in { from { transform: scaleX(0); } }

/* 4.7 An exact score, and a badge just earned. Starts from full size and opacity because
   the element is already on screen when the class arrives. */
.first-sight .points-exact,
strong.first-sight,
.badge-earned.first-sight .badge-icon { animation: pop 0.5s var(--ease-out); }
strong.first-sight { display: inline-block; }
@keyframes pop { 40% { transform: scale(1.3); } }

/* ---- One-declaration utilities ----
   What the views used to say in style attributes: each class is a single declaration, named
   for it. Spacing is in px (u-mt-16 is margin-top:16px, u-m-6-0-0 is margin:6px 0 0, n is
   a minus), font sizes in hundredths of a rem (u-fs-90 is 0.9rem), colours by their variable.

   !important, unlike .flush and the others above, because these replaced inline styles one
   for one and have to win wherever those did: over a rule with more classes, over :hover,
   over .large-text. That is also why they must not go on an element whose style a script
   sets (the push banner, the count-up numbers) — a script's value would lose to them. What is
   still inline in the views is computed in the template, set by a script, or too particular
   to name. */
.u-items-baseline { align-items: baseline !important; }
.u-items-center { align-items: center !important; }
.u-items-end { align-items: flex-end !important; }
.u-no-border { border: none !important; }
.u-border-purple { border-color: var(--brand) !important; }
.u-border-red { border-color: var(--red) !important; }
.u-text-inherit { color: inherit !important; }
.u-text-pink { color: var(--accent-text) !important; }
.u-text-purple { color: var(--brand-ink) !important; }
.u-text-red { color: var(--red-text) !important; }
.u-text-white { color: white !important; }
.u-pointer { cursor: pointer !important; }
.u-flex { display: flex !important; }
.u-inline-block { display: inline-block !important; }
.u-grow { flex: 1 !important; }
.u-grow-160 { flex: 1 1 160px !important; }
.u-flex-col { flex-direction: column !important; }
.u-shrink-0 { flex-shrink: 0 !important; }
.u-wrap { flex-wrap: wrap !important; }
.u-float-right { float: right !important; }
.u-mono { font-family: monospace !important; }
.u-fs-85 { font-size: 0.85rem !important; }
.u-fs-86 { font-size: 0.86rem !important; }
.u-fs-88 { font-size: 0.88rem !important; }
.u-fs-90 { font-size: 0.9rem !important; }
.u-fs-95 { font-size: 0.95rem !important; }
.u-fs-100 { font-size: 1rem !important; }
.u-fs-105 { font-size: 1.05rem !important; }
.u-fs-130 { font-size: 1.3rem !important; }
.u-fw-400 { font-weight: 400 !important; }
.u-fw-600 { font-weight: 600 !important; }
.u-fw-700 { font-weight: 700 !important; }
.u-gap-8 { gap: 8px !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-20 { gap: 20px !important; }
.u-justify-between { justify-content: space-between !important; }
.u-m-0 { margin: 0 !important; }
.u-m-0-0-6 { margin: 0 0 6px !important; }
.u-m-0-0-10 { margin: 0 0 10px !important; }
.u-m-0-0-16 { margin: 0 0 16px !important; }
.u-m-2-0-0 { margin: 2px 0 0 !important; }
.u-m-2-0-10 { margin: 2px 0 10px !important; }
.u-m-2-0-12 { margin: 2px 0 12px !important; }
.u-m-4-0-0 { margin: 4px 0 0 !important; }
.u-m-4-0-16 { margin: 4px 0 16px !important; }
.u-m-6-0 { margin: 6px 0 !important; }
.u-m-6-0-0 { margin: 6px 0 0 !important; }
.u-m-6-0-10 { margin: 6px 0 10px !important; }
.u-m-6-0-16 { margin: 6px 0 16px !important; }
.u-m-8-0 { margin: 8px 0 !important; }
.u-m-8-0-0 { margin: 8px 0 0 !important; }
.u-m-10-0 { margin: 10px 0 !important; }
.u-m-10-0-0 { margin: 10px 0 0 !important; }
.u-m-14-0 { margin: 14px 0 !important; }
.u-m-14-0-0 { margin: 14px 0 0 !important; }
.u-m-16-0-0 { margin: 16px 0 0 !important; }
.u-m-40-auto-0 { margin: 40px auto 0 !important; }
.u-m-n6-0-18 { margin: -6px 0 18px !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-4 { margin-bottom: 4px !important; }
.u-mb-6 { margin-bottom: 6px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-10 { margin-bottom: 10px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-14 { margin-bottom: 14px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-20 { margin-bottom: 20px !important; }
.u-ml-4 { margin-left: 4px !important; }
.u-ml-6 { margin-left: 6px !important; }
.u-mr-8 { margin-right: 8px !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-2 { margin-top: 2px !important; }
.u-mt-4 { margin-top: 4px !important; }
.u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-28 { margin-top: 28px !important; }
.u-maxw-120 { max-width: 120px !important; }
.u-maxw-260 { max-width: 260px !important; }
.u-maxw-380 { max-width: 380px !important; }
.u-maxw-420 { max-width: 420px !important; }
.u-maxw-480 { max-width: 480px !important; }
.u-minw-200 { min-width: 200px !important; }
.u-p-0 { padding: 0 !important; }
.u-p-10-0 { padding: 10px 0 !important; }
.u-pl-20 { padding-left: 20px !important; }
.u-relative { position: relative !important; }
.u-text-center { text-align: center !important; }
.u-text-right { text-align: right !important; }
.u-no-underline { text-decoration: none !important; }
.u-underline { text-decoration: underline !important; }
.u-uppercase { text-transform: uppercase !important; }
.u-align-middle { vertical-align: middle !important; }
.u-pre-wrap { white-space: pre-wrap !important; }
.u-w-100 { width: 100% !important; }

/* The register form's trap field (services/signupGuard.js): off the page rather than
   display:none, which some bots check for. aria-hidden and tabindex=-1 keep people out. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.u-w-auto { width: auto !important; }
.u-break-word { word-break: break-word !important; }

/* The end-of-round screen (views/round-result.ejs): the whole screen, no menu or tab bar.
   The screen is pinned to the edges of what the browser is showing (position: fixed), the
   button row takes the height it needs at the bottom and the picture gets what is left, so
   nothing scrolls. It was sized from 100dvh less a fixed height for the button row, and on
   a real phone the button was half off the bottom. The space either side of the picture on
   a wide or short screen is the same picture blurred. */
/* padding-bottom: the room every other page leaves for the tab bar, which is not here. */
body.bare { background: #1b0320; padding-bottom: 0; }
.bare > nav, .bare .skip-link, .bare .bottom-nav, .bare main > .stat-note { display: none; }
.bare .push-banner { display: none !important; }
.bare .container { max-width: none; padding: 0; }
.round-result {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
}
.round-result::before {
  content: '';
  position: absolute;
  inset: -48px;
  background: center / cover no-repeat;
  filter: blur(28px) brightness(0.55);
}
.round-result-tough-luck::before { background-image: url(/images/round-result/tough-luck.webp); }
.round-result-keep-going::before { background-image: url(/images/round-result/keep-going.webp); }
.round-result-doing-great::before { background-image: url(/images/round-result/doing-great.webp); }
.round-result-wow::before { background-image: url(/images/round-result/wow.webp); }
.round-result-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
.round-result-art {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  /* The picture's edges fade into the blurred copy behind it instead of ending in a line. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, #000 95%, transparent);
  mask-composite: intersect;
}
.round-result-foot {
  position: relative;
  flex: none;
  width: 100%;
  max-width: 420px;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
.round-result-score { margin: 0 0 10px; font-size: 1rem; line-height: 1.4; }
a.btn.round-result-continue {
  display: block;
  border-radius: 999px;
  font-size: 1.1rem;
  padding-top: 16px;
  padding-bottom: 16px;
}
.round-result-continue:focus-visible { outline-color: var(--lime); }
/* The welcome page after sign-up (views/welcome.ejs): the whole screen in the brand's green,
   which is what the logo is drawn for, on the bare page (whose own background is the
   end-of-round screen's). White text is 12.9:1 on --brand; the button is lime with green text. */
.welcome-push {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 48px max(20px, calc(50% - 210px)) 32px;
  background: var(--pitch-markings) center / cover no-repeat, linear-gradient(180deg, var(--brand) 0%, #0a5a32 100%);
  color: #fff;
  text-align: center;
}
.welcome-logo { height: 44px; width: auto; margin-bottom: 28px; }
.welcome-push h1 { margin: 0 0 12px; color: #fff; }
.welcome-lead { font-size: 1.05rem; margin: 0 0 24px; color: rgba(255, 255, 255, 0.92); }
.welcome-push p { color: rgba(255, 255, 255, 0.92); }
.welcome-push .welcome-cta { display: block; width: 100%; margin: 8px 0 12px; background: var(--lime); color: var(--brand); border-color: var(--lime); }
.welcome-small { font-size: 0.9rem; min-height: 1.2em; }
.welcome-steps { text-align: left; margin: 0 0 20px; padding-left: 1.4em; }
.welcome-steps li { margin-bottom: 8px; }
.welcome-push .welcome-ok { color: var(--lime); font-weight: 700; }
.welcome-later { display: inline-block; margin-top: 8px; color: #fff; }

/* Sign up and log in (views/register.ejs, login.ejs): a green band carries the heading, the
   labels and notes are full reading size, and the main button is the welcome page's lime,
   larger than an ordinary one. Asked for 29 Nov 2026: the text was small and Sign up did not
   stand out. Lime with --brand text is far over 4.5:1; the green band's white text 12.9:1. */
.auth-card { padding: 0; overflow: hidden; }
.auth-head {
  background: var(--pitch-markings) center / cover no-repeat, linear-gradient(135deg, var(--brand) 0%, #0a5a32 100%);
  color: #fff;
  padding: 22px 24px 20px;
}
.auth-head h1 { color: #fff; margin: 0 0 6px; font-size: 1.6rem; }
.auth-head .subtitle { color: rgba(255, 255, 255, 0.92); margin: 0; font-size: 1rem; line-height: 1.4; }
.auth-body { padding: 18px 24px 24px; }
.auth-card label { font-size: 0.95rem; color: var(--text); }
.auth-card label .stat-note { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.auth-card a:not(.btn) { color: var(--accent-text); font-weight: 600; }
.auth-terms { font-size: 0.88rem; color: var(--muted); line-height: 1.45; margin: 16px 0 14px; }
.auth-card .auth-submit {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  background: var(--lime);
  color: var(--brand);
  font-size: 1.12rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 3px 0 rgba(5, 59, 34, 0.28);
}
.auth-card .auth-submit-quiet { background: var(--brand); color: #fff; box-shadow: none; }
.auth-card a.auth-submit { padding-top: 16px; padding-bottom: 16px; }
.auth-alt { font-size: 0.95rem; text-align: center; margin: 18px 0 0; }
.auth-alt-tight { margin-top: 8px; }

/* A union's own crest in the team circle (views/partials/team-crest.ejs): on white, with a
   faint ring so a white crest still has an edge, the whole crest inside the circle. */
.crest.crest-img { background: #fff; box-shadow: inset 0 0 0 1px var(--border); padding: 4px; box-sizing: border-box; }
.crest.crest-img img { width: 100%; height: 100%; object-fit: contain; display: block; }


/* Last in the file so it wins on order; !important so it beats every animation, including ones
   added later. Durations go to near-zero rather than none, so animations still land on their
   final keyframe instead of being left at their first. Delays go to zero because a staggered
   row with fill-mode both sits at opacity 0 for its whole delay, then pops in. */
/* ---- Dark mode (30 Nov 2026) ----
   Follows the phone or computer's setting; there is no switch in the app (decided with
   Crinks). The role variables take dark values, and the pale tints that had no variable are
   given dark ones here. The bars, the hero and the auth header keep their dark green, which
   already works on a dark page; the lime fills keep the brand green on them. Measured in
   headless Chromium: every text element on 34 pages at 4.5:1 or better
   (pw-tools/ruckit/theme-contrast.js), and light mode pixel-identical to before
   (theme-shots.js and theme-compare.js). */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1512;
    --surface: #17201b;
    --grey: #222d27;
    --text: #e4e9e6;
    --muted: #a0a9a4;
    --border: #2b3731;
    --label: #b9c0bc;
    --nav-ink: #a0a9a4;
    --brand-ink: #b4f000;
    --brand-fill: #1e6b40;
    --green-text: #6fdc8c;
    --accent-text: #6fdc8c;
    --red-text: #ff8b7e;
    --focus: var(--lime);
  }
  /* Fields: the browser's dark field is a flat grey; the card's own colour sits better.
     :where() so every rule that colours a field (disabled, the score boxes) still wins. */
  :where(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select) {
    background-color: var(--surface);
    color: var(--text);
  }
  .season-select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b9c0bc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  }
  /* The pale tints, darkened. */
  .flash, .info-banner { background: #2c2416; }
  .flash-positive, .status-pill.still-open { background: #16301f; }
  .flash-negative, .error, .status-pill.missed-week, .pred-none { background: #3a1d1b; }
  .purge-confirm-form { background: #2a1717; }
  .status-pill.to-predict { background: #24331a; }
  .status-pill.postponed { background: #3a3016; color: #f0c75e; }
  .status-pill.cancelled { background: var(--grey); }
  .pred-partial, .notif-warning { background: #2f2816; }
  tr.me { background: #1d2e24; }
  .points-pill.me { background: #1d3a28; }
  .insight-bar, .funnel-bar { background: var(--grey); }
  .badge-earned, .callout-card { background: #1a271f; }
  .push-preview { background: #1c2621; }
  .sc-line path { stroke: #5a6660; }
  /* The right-winner row's yellow wash is 32% for white; over the dark card that is olive,
     and the grey text on it fell to 2.75:1. At 12% it reads as yellow and the text clears
     5:1. */
  .fixture-row.outcome-correct { background: rgba(255,224,138,0.12); }
  .unsaved-flag, .lock-lost-flag { color: #f0b429; }
  /* Shadows that only showed against white. */
  .card, .stat-card, .more-insights > summary { box-shadow: none; }
}

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

