/*
 * Web fonts, served from app/assets/fonts (no third-party request, and the
 * home-screen app gets them from its cache). Latin subset only: it covers
 * accented names (é, ñ, ü); anything rarer falls back to the system font
 * for that letter. Both are SIL Open Font License; the licences sit beside
 * the files.
 *
 * Inter: all body text, tables and labels. One variable file holds every
 * weight, including the in-between ones the app uses (650, 750).
 *
 * Barlow Condensed: headings, the brand and a few big numbers
 * (--font-display in tokens.css), in bold; and in medium, the player names
 * in the Pick chart on phones, where room is tightest. A browser only
 * fetches a face a page uses, so desktops never download the medium.
 *
 * A condensed face looks smaller than Inter at the same font-size, so
 * size-adjust scales it up here, once, rather than every rule that uses it
 * carrying its own bigger size. Anything still on the
 * fallback font gets Inter at the normal size.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/inter-latin-variable-007fce1bff9f7f37469fe61eff9ef62c033af63fccb0e65a2e94f4e0c14d9d6d.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  size-adjust: 115%;
  src: url(/assets/barlow-condensed-latin-700-0240034e1d1295977cdc45ef31f9eca87b7c679f65b3ffb5ee06cdbf80389243.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  size-adjust: 115%;
  src: url(/assets/barlow-condensed-latin-500-fe1ec5290a879434a583241491b239b46e7c99fc8a7f43f84e5865b561a94265.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/*
 * Design tokens.
 *
 * Every colour, space, radius and shadow used anywhere in the app comes from
 * here so that the whole site can be re-themed from one file. Semantic names
 * (--surface, --text-muted) are preferred in components over raw palette
 * values (--navy-700) so dark mode only has to redefine the semantic layer.
 */

:root {
  /* Lets the browser draw its own parts (scrollbars, the area past the end of
     the page when it bounces, form controls, the date picker) in the
     matching theme, instead of light ones on the dark page. */
  color-scheme: light dark;

  /* Palette --------------------------------------------------------------- */
  --navy-900: #08182f;
  --navy-800: #0c2545;
  --navy-700: #123560;
  --navy-600: #1b4a83;
  --navy-100: #e3ecf8;

  --green-700: #14622f;
  --green-600: #17803d;
  --green-500: #1d9c4c;
  --green-100: #dcf5e4;

  --gold-700: #8a6306;
  --gold-600: #a97a09;
  --gold-500: #e3a008;
  --gold-300: #fbd561;
  --gold-100: #fdf3d4;

  --red-700: #8f1d1d;
  --red-600: #b4292a;
  --red-500: #d63d3e;
  --red-100: #fbe3e3;

  --slate-900: #131a24;
  --slate-800: #1e2733;
  --slate-700: #33414f;
  --slate-600: #506273;
  /* Muted text, on every light surface: dark enough for 4.5:1 (WCAG AA)
     on the page's grey and the blue of your own row, not just on white.
     test/assets/color_contrast_test.rb checks it. */
  --slate-500: #566879;
  --slate-400: #97a7b5;
  --slate-300: #c4cfd9;
  --slate-200: #dfe6ed;
  --slate-100: #eef2f6;
  --slate-50: #f6f8fa;
  --white: #ffffff;

  /* Semantic colours ------------------------------------------------------ */
  --bg: var(--slate-100);
  --surface: var(--white);
  --surface-sunken: var(--slate-50);
  --surface-raised: var(--white);
  --border: var(--slate-200);
  --border-strong: var(--slate-300);

  --text: var(--slate-900);
  --text-secondary: var(--slate-700);
  --text-muted: var(--slate-500);
  --text-inverse: var(--white);

  --brand: var(--navy-800);
  --brand-strong: var(--navy-900);
  --brand-soft: var(--navy-100);
  --brand-text: var(--navy-700);

  --accent: var(--green-600);
  --accent-hover: var(--green-700);
  --accent-soft: var(--green-100);
  --accent-text: var(--green-700);

  --highlight: var(--gold-500);
  --highlight-soft: var(--gold-100);
  /* Darker than the gold itself: it's read on --highlight-soft (badges,
     the You Tried award) and needs 4.5:1 there. */
  --highlight-text: var(--gold-700);

  --danger: var(--red-600);
  --danger-hover: var(--red-700);
  --danger-soft: var(--red-100);
  --danger-text: var(--red-700);

  --focus-ring: 0 0 0 3px rgba(27, 74, 131, 0.35);

  /* The soft edge on a table that scrolls sideways (tables.css). */
  --scroll-shadow: rgba(8, 24, 47, 0.14);

  /* Drawn around team logos so a dark one (the Panthers', the Raiders')
     still stands out from the page. Nothing in light mode. */
  --logo-outline: none;

  /* Typography ------------------------------------------------------------ */
  /* Both loaded in fonts.css. Display is for headings, the brand and the
     big point totals; everything else is sans. */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", var(--font-sans);
  --font-numeric: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 0.9375rem;/* 15px */
  --text-md: 1rem;       /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.375rem;   /* 22px */
  --text-2xl: 1.75rem;   /* 28px */
  --text-3xl: 2.25rem;   /* 36px */

  /* Spacing --------------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3.5rem;

  /* Radii & shadows ------------------------------------------------------- */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(8, 24, 47, 0.06), 0 1px 3px rgba(8, 24, 47, 0.06);
  --shadow: 0 2px 4px rgba(8, 24, 47, 0.05), 0 6px 16px rgba(8, 24, 47, 0.08);
  --shadow-lg: 0 8px 24px rgba(8, 24, 47, 0.12), 0 2px 6px rgba(8, 24, 47, 0.06);

  /* Layout ---------------------------------------------------------------- */
  --container: 1120px;
  --container-narrow: 720px;
  --container-wide: 1600px;
  --header-height: 60px;
  /* A rank badge's height, so the points beside one can be given a line
     the same height and sit level with it (.round-heading). */
  --rank-size: 1.85rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b121c;
    --surface: #151f2c;
    --surface-sunken: #101927;
    --surface-raised: #1b2736;
    --border: #27364a;
    --border-strong: #35485f;

    --text: #e8eef5;
    --text-secondary: #b9c6d4;
    /* 4.5:1 on --brand-soft too: your own row on the standings. */
    --text-muted: #8a9cae;

    --brand: #102a4c;
    --brand-strong: #0b1f3a;
    --brand-soft: #1a2f4d;
    --brand-text: #9dc0ea;

    /* White text sits on these (buttons, Complete badges): kept dark
       enough for 4.5:1 rather than brightened for the dark page. Hover
       goes a shade darker, as it does in light mode. */
    --accent: #18873f;
    --accent-hover: var(--green-600);
    --accent-soft: #14301f;
    --accent-text: #6fd694;

    --highlight: var(--gold-500);
    --highlight-soft: #33280a;
    --highlight-text: var(--gold-300);

    /* Likewise the red: white on it, a shade darker on hover. */
    --danger: #c8393a;
    --danger-hover: var(--red-600);
    --danger-soft: #34191a;
    --danger-text: #f0a3a3;

    --focus-ring: 0 0 0 3px rgba(110, 160, 220, 0.4);

    --scroll-shadow: rgba(0, 0, 0, 0.55);
    --logo-outline: drop-shadow(0 0 1px rgba(255, 255, 255, 0.55))
      drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
/* Reset + element defaults. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
  /* A heading that wraps splits evenly ("Danny O'Shea's / Picks" on a
     small phone reads better as two balanced lines). */
  text-wrap: balance;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p {
  margin: 0 0 var(--space-4);
  /* No single word left on a line of its own at the end ("then / save."). */
  text-wrap: pretty;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

li + li {
  margin-top: var(--space-2);
}

a {
  color: var(--brand-text);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

strong {
  font-weight: 650;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Utilities -------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--text-muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.stack > * + * {
  margin-top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* App shell: header, nav, page container, footer. */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* The overall standings (both views): the pick grid has a column for every
   week. The weekly standings match them. */
.container--wide {
  max-width: var(--container-wide);
}

/* Site header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-height);
  flex-wrap: wrap;
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  white-space: nowrap;
  margin-right: auto;
}

.brand:hover {
  text-decoration: none;
  color: var(--white);
}

.brand__mark {
  font-size: 1.25rem;
  line-height: 1;
}

.brand__year {
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}

/* Signed out on the smallest phones (320 wide), the brand and "Sign up"
   and "Log in" are too wide for one row, and the buttons would drop to a
   row of their own. The year goes (the page's own heading has it, and
   screen readers still get it) so they all stay on the brand's row. */
@media (max-width: 359px) {
  .site-header__inner:has(.site-header__user:not(.site-header__user--signed-in)) .brand__year {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* On a phone the nav gets a row of its own under the brand. It wraps
   rather than scrolling sideways, so a link past the edge (Admin, after Past
   seasons) is never hidden off screen. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  order: 3;
  width: 100%;
  padding-bottom: var(--space-1);
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav__link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  text-decoration: none;
}

.site-nav__link.is-active {
  background-color: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

.site-nav__link--admin {
  color: var(--gold-300);
}

.site-header__user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  order: 2;
}

.site-header__user-name {
  color: var(--white);
  font-weight: 600;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__form {
  display: inline;
}

/* Buttons sitting on the dark header bar need a light treatment. */
.site-header__user .btn {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--white);
  box-shadow: none;
}

.site-header__user .btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

/* Phones: Past seasons and Admin leave the nav for the menu, and the
   signed-in name and Log out give way to its button (see .site-menu). */
.site-nav__link--secondary,
.site-header__user--signed-in {
  display: none;
}

/* Header menu (phones only) ---------------------------------------------- */

.site-menu {
  position: relative;
  order: 2;
}

.site-menu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.site-menu__toggle::-webkit-details-marker {
  display: none;
}

.site-menu__toggle:hover,
.site-menu[open] .site-menu__toggle {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.site-menu__panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 30;
  width: max-content;
  min-width: 13rem;
  max-width: calc(100vw - 2 * var(--space-4));
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.site-menu__who {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3) var(--space-3);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
}

.site-menu__name {
  color: var(--text);
  font-weight: 700;
}

.site-menu__email {
  color: var(--text-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.site-menu__links {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.site-menu__form {
  margin: 0;
}

/* Log out is a <button>, so this also undoes the default button look. */
.site-menu__link {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background-color: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
}

.site-menu__link:hover {
  background-color: var(--surface-sunken);
  color: var(--text);
  text-decoration: none;
}

.site-menu__link[aria-current] {
  background-color: var(--brand-soft);
  color: var(--brand-text);
}

.site-menu__link--admin {
  color: var(--highlight-text);
}

.site-menu__logout {
  color: var(--danger-text);
}

@media (min-width: 860px) {
  .site-menu {
    display: none;
  }

  .site-nav__link--secondary,
  .site-header__user--signed-in {
    display: inline-flex;
  }

  .site-nav {
    order: initial;
    width: auto;
    padding-bottom: 0;
  }

  .brand {
    font-size: var(--text-lg);
    margin-right: var(--space-4);
  }

  .site-header__user {
    margin-left: auto;
  }

  .site-header__user-name {
    max-width: none;
  }
}

/* Page structure --------------------------------------------------------- */

.site-main {
  flex: 1 0 auto;
  padding-block: var(--space-5) var(--space-7);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.page-header__titles {
  min-width: 0;
}

.page-header__eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.page-header__title {
  margin: 0;
  font-size: var(--text-2xl);
}

.page-header__subtitle {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
  font-size: var(--text-base);
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.section {
  margin-bottom: var(--space-6);
}

.section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

/* A button at the far end of a section's heading. */
.section__title-action {
  margin-left: auto;
}

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

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding-block: var(--space-5);
  margin-top: var(--space-6);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-5);
}

/* Tall enough to tap with a thumb, without spacing the row out. */
.site-footer__links a {
  display: inline-block;
  padding-block: var(--space-2);
  font-weight: 600;
}

.site-footer__about {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-footer__name {
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

.site-footer__season {
  white-space: nowrap;
}

.site-footer__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
/* Reusable UI components. */

/* Buttons ---------------------------------------------------------------- */

.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  /* Not inherit: a button in a heading stays Inter, not the display face. */
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  text-decoration: none;
}

.btn:active,
button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

/* Default / secondary */
.btn,
button,
input[type="submit"] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  background-color: var(--surface-sunken);
  border-color: var(--text-muted);
}

.btn--primary,
input[type="submit"].btn--primary {
  background-color: var(--accent);
  border-color: transparent;
  color: var(--white);
}

.btn--primary:hover,
input[type="submit"].btn--primary:hover {
  background-color: var(--accent-hover);
  border-color: transparent;
  color: var(--white);
}

.btn--brand {
  background-color: var(--brand);
  border-color: transparent;
  color: var(--white);
}

.btn--brand:hover {
  background-color: var(--brand-strong);
  border-color: transparent;
  color: var(--white);
}

.btn--danger {
  background-color: transparent;
  border-color: var(--border-strong);
  color: var(--danger-text);
}

.btn--danger:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-text);
}

.btn--ghost {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background-color: var(--surface-sunken);
  border-color: var(--border);
  color: var(--text);
}

/* The submit selectors match the base input[type="submit"] rule's weight,
   so form.submit buttons take their size like any other .btn. */
.btn--lg,
input[type="submit"].btn--lg {
  padding: 0.7rem 1.25rem;
  font-size: var(--text-md);
}

.btn--sm,
input[type="submit"].btn--sm {
  padding: 0.3rem 0.6rem;
  font-size: var(--text-xs);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--icon {
  padding: 0.35rem 0.5rem;
  font-size: var(--text-sm);
  line-height: 1;
}

.btn[aria-disabled="true"],
.btn:disabled,
button:disabled,
input[type="submit"]:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.6;
  background-color: var(--surface-sunken);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.inline-form {
  display: inline;
}

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

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
}

.card__body {
  padding: var(--space-4);
}

.card__footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background-color: var(--surface-sunken);
  border-radius: 0 0 var(--radius) var(--radius);
}

.card--flush .card__body {
  padding: 0;
}

/* Badges & pills --------------------------------------------------------- */

/* Badges and position tags set their own family so the ones that sit in a
   heading ("Divisional 1.1x", "QB" in a stats heading) don't pick up the
   display face from it. */
.badge {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}

.badge--accent {
  background-color: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}

.badge--brand {
  background-color: var(--brand-soft);
  border-color: transparent;
  color: var(--brand-text);
}

.badge--highlight {
  background-color: var(--highlight-soft);
  border-color: transparent;
  color: var(--highlight-text);
}

.badge--danger {
  background-color: var(--danger-soft);
  border-color: transparent;
  color: var(--danger-text);
}

/* Before the week in play's name where weeks are listed side by side
   (with_current_week_dot): a marker, not a fill, so it doesn't read as the
   week selected. Still, unlike the pulsing .live-dot. */
.current-week-dot {
  display: inline-block;
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4em;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  vertical-align: 0.1em;
}

/* By a player whose game is under way (live_dot): their points are still
   going up. The same pulse as the "Live" note under the page title. */
.live-dot {
  display: inline-block;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35em;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  vertical-align: 0.1em;
  animation: live-dot-pulse 2s ease-in-out infinite;
}

@keyframes live-dot-pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
}

/* A player's injury designation from Sleeper: "Q", "OUT"... (injury_badge,
   and the pick form's player picker). */
.injury-badge {
  flex-shrink: 0;
  padding: 0 0.4rem;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
  cursor: help;
}

/* injury_badge's badge is a button that opens the details (.injury-popover),
   so a tap shows them on a phone. It keeps the badge's look, none of the
   button look above: no shadow, no press, and its colour on hover. */
.injury-toggle {
  margin: 0;
  box-shadow: none;
  cursor: pointer;
}

/* A dotted underline under the designation, like points with a breakdown
   (.points-toggle), to say there's more behind it. Dots of its own rather
   than a dotted text-decoration: the browser starts those at the left
   edge, which under one or two letters leaves a gap on the right and looks
   off-centre. `space` spreads whole dots evenly across the letters. */
.injury-toggle .injury-badge__label {
  --injury-underline: color-mix(in srgb, currentColor 70%, transparent);
  background: radial-gradient(circle, var(--injury-underline) 0.45px, transparent 0.7px)
    center bottom 0.15em / 1.75px 1.75px space no-repeat;
}

.injury-toggle:hover .injury-badge__label {
  --injury-underline: currentColor;
}

.injury-toggle:hover,
.injury-toggle:active {
  transform: none;
}

.injury-toggle.badge--highlight:hover {
  background-color: var(--highlight-soft);
  border-color: transparent;
}

.injury-toggle.badge--danger:hover {
  background-color: var(--danger-soft);
  border-color: transparent;
}

.injury-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.badge--muted {
  color: var(--text-muted);
}

/* A round that's all played: solid, so it reads as settled next to the soft
   "Picks open" and "In progress". */
.badge--done {
  background-color: var(--accent);
  border-color: transparent;
  color: var(--white);
}

/* A round's multiplier, coloured like the chip in the stacked overall
   leaderboard (.week-total__mult) but at badge size. */
.badge--mult {
  background-color: var(--surface);
  color: var(--text-secondary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Position chips (QB / RB / WR / TE / FLEX) */
.pos {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 750;
  letter-spacing: 0.04em;
  background-color: var(--slate-200);
  color: var(--slate-700);
}

.pos--qb { background-color: #dbe7fb; color: #1c4f9c; }
.pos--rb { background-color: #d9f2e2; color: #146b35; }
.pos--wr { background-color: #fde6cf; color: #9a5310; }
.pos--te { background-color: #ead8fa; color: #67309c; }
.pos--flex { background-color: #fbe0ea; color: #9c2f57; }

@media (prefers-color-scheme: dark) {
  .pos { background-color: #27364a; color: var(--text-secondary); }
  .pos--qb { background-color: #17304f; color: #93bdf2; }
  .pos--rb { background-color: #15361f; color: #79d49b; }
  .pos--wr { background-color: #3a2711; color: #e9b273; }
  .pos--te { background-color: #2d1d43; color: #c6a1ef; }
  .pos--flex { background-color: #3c1c2b; color: #ef9ab9; }
}

/* Alerts / flash messages ------------------------------------------------ */

.flash {
  margin-bottom: var(--space-4);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: 500;
}

.alert__icon {
  flex-shrink: 0;
  line-height: 1.4;
}

.alert--notice {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.alert--error {
  background-color: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-text);
}

.alert--info {
  background-color: var(--brand-soft);
  border-color: var(--brand-text);
  color: var(--brand-text);
}

/* Links in an alert share its colour, so underline them to stand out. */
.alert a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Madden's picture in place of an emoji (Ask Madden's answer). */
.alert__icon--avatar {
  line-height: 0;
}

/* The rotating "what Madden is up to" line while a suggestion is worked out. */
.ai-thinking {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
}

.ai-thinking__note {
  flex-basis: 100%;
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* Empty states ----------------------------------------------------------- */

.empty-state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-base);
}

.empty-state__action {
  margin-top: var(--space-4);
}

.empty-state__icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: var(--space-2);
  opacity: 0.7;
}

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

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.player-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.player-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-sunken);
}

.player-card__photo-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 118px;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface));
  overflow: hidden;
}

.player-card__photo {
  height: 118px;
  width: auto;
  object-fit: contain;
}

.player-card__body {
  padding: var(--space-3);
  text-align: center;
}

.player-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.3;
}

/* Beside a player who was the round's top scorer at their position. */
.top-star {
  color: var(--highlight);
  font-size: 1.05em;
  line-height: 1;
  cursor: help;
}

.player-card__team {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Who the player's team plays and when: when the card locks. */
.player-card__game {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* A game line (PicksHelper#player_game_line): the opponent with its logo,
   then "·" and the kickoff, each kept whole. Laid out with flex so the logo
   and abbreviation sit level with "vs"/"@" and the "·". If it doesn't fit
   on one line, the kickoff moves down and its "·" is hidden: every part
   starts with a --game-line-sep wide space (the opponent's is padding, the
   kickoff's is the "·"), the parts are shifted left by that much, and
   .game-line clips it. So whichever part starts a line has its space, or
   its "·", cut off, and the dot only shows between the two. */
.game-line {
  --game-line-sep: 1.1em;
  overflow: hidden;
}

.game-line__parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: calc(-1 * var(--game-line-sep));
}

.game-line__opponent {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding-left: var(--game-line-sep);
  white-space: nowrap;
}

.game-line__kickoff {
  white-space: nowrap;
}

/* In place of the kickoff while the game's on, and once it's over. */
.game-line__live {
  color: var(--accent-text);
  font-weight: 600;
}

.game-line__final {
  font-weight: 600;
}

/* A line of parts separated by "·" (round_kickoff_line), each kept
   together: where they don't all fit, the next part moves down whole rather
   than leaving a word or two on a line of its own. Like .game-line, every
   part starts with a --status-line-sep wide space (the first's is padding,
   the rest's is the "·"), the parts are shifted left by that much, and
   .status-line clips it, so the dot only shows between two parts on one
   line. A part too long for a line by itself still wraps inside. */
.status-line {
  --status-line-sep: 1.1em;
  display: block;
  overflow: hidden;
}

.status-line__parts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-left: calc(-1 * var(--status-line-sep));
}

.status-line__part:first-child {
  padding-left: var(--status-line-sep);
}

.status-line__sep {
  display: inline-block;
  width: var(--status-line-sep);
  text-align: center;
}

.game-line__sep {
  display: inline-block;
  width: var(--game-line-sep);
  text-align: center;
}

/* Player cards are narrow on a phone, so they always put the kickoff under
   the opponent, centred, with no "·". */
.player-card__game .game-line__parts {
  flex-direction: column;
  row-gap: 0.1em;
  margin-left: 0;
}

.player-card__game .game-line__opponent {
  padding-left: 0;
}

.player-card__game .game-line__sep {
  display: none;
}

/* The opponent's logo in a game line, a touch smaller than beside a name. */
.player-card__game .team-logo,
.pick-slot__game .team-logo,
.player-picker__selection-game .team-logo {
  width: 1.35em;
  height: 1.35em;
}

/* Disclosure ------------------------------------------------------------- */

/* A card that folds its contents under a summary row, with a chevron at the
   right end that turns over when it opens: the pick pages' Matchups and
   Madden's lineups, so the two read as the same kind of thing. The summary's
   text goes in one element (a heading, or .disclosure__label), so the flex
   row doesn't pull its words apart. No display rule on .disclosure itself,
   so its hidden attribute works. */
.disclosure {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.disclosure__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.disclosure__summary::-webkit-details-marker {
  display: none;
}

.disclosure__summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.2rem 0.15rem 0 0;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.disclosure[open] > .disclosure__summary::after {
  margin-top: 0.2rem;
  transform: rotate(-135deg);
}

.disclosure__summary:hover::after {
  border-color: var(--text);
}

.disclosure__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Split evenly when it wraps, like the headings, so a narrow phone doesn't
   leave "(2)" on a line of its own. */
.disclosure__label {
  min-width: 0;
  text-wrap: balance;
}

.disclosure > .disclosure__body {
  padding: 0 var(--space-4) var(--space-4);
}

/* Matchup list ----------------------------------------------------------- */

/* The pick pages fold the list under its heading (a .disclosure), so a long
   regular-season week needn't be scrolled past to reach the lineup, and the
   standings fold it away on a phone. */
.matchups__title {
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* Two small cards a row even on a phone, more on wider screens. */
.matchup-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(170px, calc(50% - var(--space-2))), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.matchup-list li + li {
  margin-top: 0;
}

.matchup {
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.matchup--locked {
  background-color: var(--surface-sunken);
  border-style: dashed;
}

/* A game still going. It looks the same on the pick pages, where it's
   locked as well (its lock says so), as on the standings: live is what
   matters about it, so this comes after .matchup--locked and wins. */
.matchup--live {
  background-color: var(--surface);
  border-color: var(--accent);
  border-style: solid;
}

/* The standings' games sit above the table, which is what the page is for
   (and on a phone they're folded to one line), so the heading is a slim one. */
.matchups--standings {
  margin-bottom: var(--space-4);
}

.matchups--standings > .disclosure__summary {
  padding-block: var(--space-2);
}

.matchups--standings .matchups__title {
  font-size: var(--text-base);
}

.matchup__teams {
  display: flex;
  /* On the narrowest cards the home team drops to a second line rather than
     spilling out of the card. */
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-1);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}

/* A game with a score: away over home, the scores lined up on the right.
   Two short lines, about as tall as a card whose teams wrap on a phone. */
.matchup__scoreboard {
  display: grid;
  gap: 2px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.matchup__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.matchup__row--lost {
  color: var(--text-muted);
}

.matchup__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.matchup__clock {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.matchup__vs {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.matchup__meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.35;
}

.matchup__time {
  white-space: nowrap;
}

.matchup__lock {
  flex-shrink: 0;
  font-size: 0.9em;
}

/* Rank markers ----------------------------------------------------------- */

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* A min-width rather than a width, so a tied "12T" grows into a pill. */
  min-width: var(--rank-size);
  height: var(--rank-size);
  padding: 0 0.4rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.rank--1 {
  background-color: var(--highlight);
  border-color: transparent;
  color: #3b2a02;
}

.rank--2 {
  background-color: var(--slate-300);
  border-color: transparent;
  color: var(--slate-800);
}

.rank--3 {
  background-color: #e2b183;
  border-color: transparent;
  color: #4a2c10;
}

.rank--none {
  background-color: transparent;
  color: var(--text-muted);
}

/* How someone's overall place has moved since the last round ended
   (rank_with_movement): "▲3" in green, "▼2" in red. Beside the badge on
   the My Picks card; under it in the standings and the Pick grid, whose
   rank columns are narrow (pinned at a set width on a wide screen). */
.rank-stand {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.rank-move {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rank-move--up {
  color: var(--accent-text);
}

.rank-move--down {
  color: var(--danger-text);
}

.leader-rank .rank-stand,
.pick-sheet__person .rank-stand {
  flex-direction: column;
  gap: 2px;
}

/* Team logo and abbreviation -------------------------------------------------
   From the team_tag helper (and the player picker's list). The logo is sized
   to the text around it, so it fits a badge as well as a matchup heading. */
.team-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  /* Lines up with the words around it, rather than sitting the logo on
     their baseline and lifting the abbreviation. */
  vertical-align: middle;
}

.team-logo {
  flex-shrink: 0;
  width: 1.5em;
  height: 1.5em;
  object-fit: contain;
  filter: var(--logo-outline);
}

.badge .team-logo {
  width: 1.35em;
  height: 1.35em;
  margin-left: -0.2em;
}

/* A player's points that open the stats behind them (PointsBreakdownHelper):
   the same number as before, with a dotted underline to say there's more,
   none of the button look above. */
.points-toggle,
.points-toggle:hover,
.points-toggle:active {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  white-space: inherit;
  background: none;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  transform: none;
  transition: none;
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 0.2em;
}

.points-toggle:hover {
  text-decoration-color: currentColor;
}

.points-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* The popover itself: the player's name, each stat beside its points, then
   the total. Hidden by the browser until it's open; the controller puts it by
   its toggle (centred on screen without the script). An injury badge's
   popover (.injury-popover) looks the same. */
.points-breakdown,
.injury-popover {
  min-width: 11rem;
  max-width: calc(100vw - 16px);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  color: var(--text-secondary);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.points-breakdown:popover-open {
  display: grid;
  grid-template-columns: 1fr auto;
}

.points-breakdown > strong {
  grid-column: 1 / -1;
  margin-bottom: var(--space-1);
  color: var(--text);
}

/* Each line's points, and the total's. A gap of their own rather than the
   grid's, so the line over the total runs unbroken. */
.points-breakdown > span:nth-child(odd) {
  padding-left: var(--space-4);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.points-breakdown__total {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
}

/* A round's score on the overall standings opens the same popover with the
   players behind it (week_picks_toggle) for stats: their position chips as
   by their names, one still to kick off muted, and under the total what
   a multiplier made of it. */
/* Every chip as wide as the widest (WR/TE), so the names line up. */
.week-picks .pos {
  min-width: 3.4rem;
  margin-right: 0.3em;
  padding-inline: 0.3rem;
  font-size: 0.6875rem;
}

.week-picks__hidden {
  color: var(--text-muted);
}

.points-breakdown > .week-picks__boosted {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* An injury badge's details: the player's name, their designation, and
   when it was checked. */
.injury-popover:popover-open {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.injury-popover > strong {
  color: var(--text);
}

.injury-popover__checked {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Where to read up on it: the player's Sleeper page, or a news search. */
.injury-popover__news {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border);
}

/* A link to a player's latest news (player_news_link): an arrow for the new
   tab it opens in. */
.news-link::after {
  content: " \2197";
  content: " \2197" / "";
}

/* Add to home screen banner ---------------------------------------------- */

/* Phones only; the home-screen-banner controller decides when to show it. */
.home-screen-banner {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
}

/* .btn sets a display, which would otherwise beat the hidden attribute. */
.home-screen-banner[hidden],
.home-screen-banner [hidden] {
  display: none;
}

.home-screen-banner__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.home-screen-banner__icon {
  flex-shrink: 0;
  border-radius: 9px;
}

.home-screen-banner__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

/* A 40px target, pulled into the corner so it doesn't widen the banner. */
.home-screen-banner__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-3)) calc(-1 * var(--space-2)) 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  box-shadow: none;
  color: var(--text-muted);
  cursor: pointer;
}

.home-screen-banner__close:hover {
  background-color: var(--surface-sunken);
  color: var(--text);
}

.home-screen-banner__close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.home-screen-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  padding-left: calc(40px + var(--space-3));
}

.home-screen-banner__how {
  flex-basis: 100%;
}

.home-screen-banner__how summary {
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

.home-screen-banner__how summary::-webkit-details-marker {
  display: none;
}

.home-screen-banner__how summary::after {
  content: " ▾";
}

.home-screen-banner__how[open] summary::after {
  content: " ▴";
}

.home-screen-banner__how summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.home-screen-banner__steps {
  margin-top: var(--space-3);
}

/* The steps use the banner's full width, out from under the icon. */
.home-screen-banner__steps,
.home-screen-banner__note {
  margin-left: calc(-1 * (40px + var(--space-3)));
}

.home-screen-banner__platform {
  margin: 0 0 var(--space-1);
  font-weight: 650;
  color: var(--text);
}

.home-screen-banner__steps ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.home-screen-banner__steps li + li {
  margin-top: var(--space-1);
}

.home-screen-banner__glyph {
  vertical-align: -2px;
}

.home-screen-banner__note {
  margin-top: var(--space-3);
  margin-bottom: 0;
  color: var(--text-muted);
}

/* How long until picks lock (shared/_lock_countdown.html.erb): a quiet pill
   most of the time, amber in the last day. The amber is the background and
   border; the words stay the normal text colour so they read clearly. */
.lock-countdown {
  display: inline-flex;
  /* Its own width, not the whole column's, in a flex column (round cards). */
  align-self: flex-start;
  width: fit-content;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35em;
  margin: 0 0 var(--space-2);
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background-color: var(--brand-soft);
  color: var(--brand-text);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.lock-countdown__left {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lock-countdown--soon {
  background-color: var(--highlight-soft);
  border-color: var(--highlight);
  color: var(--text);
}

.lock-countdown--done {
  background-color: var(--surface-sunken);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* Under a page title (the pick form), a little room above. */
.page-header__titles .lock-countdown {
  margin: var(--space-2) 0 0;
}

.lock-countdown__note {
  font-size: var(--text-sm);
}

/* My Picks pulls its kickoff line up under the round's title; under the
   countdown it keeps a little room. */
.lock-countdown + .person-round__meta {
  margin-top: 0;
}

/* Bigger to tap than they look ------------------------------------------
   On a touch screen, the small buttons (28px high) and the dotted points
   that open a breakdown get an invisible margin to catch a finger, about
   44px high in all, without changing how they look or what's around them.
   A .disclosure's summary row is already that tall with its padding. */
@media (pointer: coarse) {
  .btn--sm,
  .points-toggle {
    position: relative;
  }

  .btn--sm::after,
  .points-toggle::after {
    content: "";
    position: absolute;
    inset: -8px -2px;
  }

  .points-toggle::after {
    inset: -10px -6px;
  }
}
/* Form controls. */

.form-card {
  max-width: 560px;
}

.form-card--wide {
  max-width: 780px;
}

.field {
  margin-bottom: var(--space-4);
}

.field:last-of-type {
  margin-bottom: 0;
}

.field__label,
label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

.field__hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c7f91'%3E%3Cpath d='M8 11.2 3.6 6.4a.7.7 0 0 1 1-1L8 9.1l3.4-3.7a.7.7 0 1 1 1 1L8 11.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-text);
  box-shadow: var(--focus-ring);
}

input::placeholder {
  color: var(--text-muted);
}

/* Native date/time pickers: follow the OS theme so the calendar popup and
   picker icon stay legible in dark mode. */
input[type="datetime-local"] {
  width: auto;
  min-width: 15rem;
  color-scheme: light dark;
  cursor: pointer;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* Checkboxes */
.field--check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.field--check label,
.checkbox-label {
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* A submit button placed directly after a field (compact forms such as the
   login card) still needs breathing room, since .field:last-of-type drops its
   bottom margin. */
.field + .btn,
.field + input[type="submit"] {
  margin-top: var(--space-4);
}

/* Form actions */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.form-actions [hidden] {
  display: none;
}

.disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Validation errors ------------------------------------------------------ */

.error-messages {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background-color: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger-text);
}

.error-messages__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
}

.error-messages ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-base);
}

.error-messages li {
  position: relative;
  padding-left: var(--space-4);
}

.error-messages li::before {
  content: "•";
  position: absolute;
  left: var(--space-1);
}

.error-messages li + li {
  margin-top: var(--space-1);
}

/* Grouped fields ---------------------------------------------------------- */

.fieldset {
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.fieldset__legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Buttons and a count above a group of checkboxes. They wrap under each
   other on a narrow screen rather than squeezing the buttons. */
.fieldset__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.fieldset__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3) var(--space-4);
}

.field-grid .field {
  margin-bottom: 0;
}

/* Searchable player picker ------------------------------------------------
   Built by player_picker_controller.js on top of a pick slot's <select>. */

.player-picker__ui {
  position: relative;
}

/* Filtering hides options with the hidden attribute; keep the display rules
   below from overriding it. */
.player-picker [hidden] {
  display: none;
}

/* The closed picker: a button that looks like the other form fields. */
.player-picker__trigger {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  min-height: calc(1.45em + 1.1rem + 2px);
  padding: 0.55rem 2.25rem 0.55rem 0.7rem;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c7f91'%3E%3Cpath d='M8 11.2 3.6 6.4a.7.7 0 0 1 1-1L8 9.1l3.4-3.7a.7.7 0 1 1 1 1L8 11.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  border-color: var(--border-strong);
  box-shadow: none;
}

.player-picker__trigger:hover {
  background-color: var(--surface);
  border-color: var(--text-muted);
}

.player-picker__trigger:active {
  transform: none;
}

.player-picker__trigger:focus {
  outline: none;
}

.player-picker__trigger:focus-visible,
.player-picker__ui.is-open .player-picker__trigger {
  border-color: var(--brand-text);
  box-shadow: var(--focus-ring);
}

.player-picker__selection-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* The chosen player's name, then their team. A long name is cut short
   rather than pushing the team out of sight. */
.player-picker__selection-text {
  display: flex;
  align-items: center;
  gap: 0.35em;
  min-width: 0;
  white-space: nowrap;
}

.player-picker__selection-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-picker__selection-team {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--text-muted);
}

/* Who the chosen player plays and when: when the slot locks. */
.player-picker__selection-game {
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--text-muted);
}

.player-picker__selection-text.is-placeholder {
  color: var(--text-muted);
}

.player-picker__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  max-height: min(24rem, 65vh);
  overflow: hidden;
  background-color: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.player-picker__sheet-head {
  display: none;
}

/* Stays put at the top of the open list while the players scroll under it. */
.player-picker__search-wrap {
  position: relative;
  flex-shrink: 0;
  padding: var(--space-2);
  border-bottom: 1px solid var(--border);
}

/* 16px so iOS doesn't zoom the page in when the box is tapped. */
.player-picker__search-wrap .player-picker__search {
  font-size: max(1rem, 16px);
  padding: 0.45rem 2.4rem 0.45rem 0.6rem;
}

/* Our own clear button replaces the browser's. */
.player-picker__search::-webkit-search-cancel-button {
  display: none;
}

/* Shown while there's something to clear or the keyboard is up. */
.player-picker__clear {
  position: absolute;
  top: 50%;
  right: calc(var(--space-2) + 0.3rem);
  display: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  transform: translateY(-50%);
  color: var(--text-muted);
  background: var(--surface-sunken) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236c7f91' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7'/%3E%3C/svg%3E") no-repeat center / 0.9rem;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: none;
}

.player-picker__clear:hover {
  background-color: var(--border);
  border: none;
}

.player-picker__clear:active {
  transform: translateY(-50%);
}

.player-picker__search-wrap.has-text .player-picker__clear,
.player-picker__search:focus + .player-picker__clear {
  display: block;
}

/* The list, with the rail of games down its right-hand side (in thumb's
   reach on a phone). */
.player-picker__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.player-picker__list-wrap {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.player-picker__list {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Touch screens: the list's own scroll indicator, drawn above the pinned
   game headings (iOS draws its native one under them). The list runs 20px
   past the right of the box showing it, which clips the native indicator
   out of sight; its padding keeps the rows and headings in view. The
   controller (showScrollThumb) sizes and moves this one, and fades it out
   once scrolling stops. */
.player-picker__scroll-thumb {
  display: none;
}

@media (pointer: coarse) {
  .player-picker__list-wrap {
    overflow: hidden;
  }

  /* (Beats the list's margin and padding reset further down.) */
  .player-picker__list-wrap > .player-picker__list {
    margin-right: -20px;
    padding-right: 20px;
  }

  .player-picker__scroll-thumb {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 3px;
    display: block;
    width: 3px;
    border-radius: 3px;
    background-color: var(--text-muted);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  .player-picker__scroll-thumb.is-visible {
    opacity: 0.7;
    transition: none;
  }
}

/* A button for each game: tap one to jump the list there. */
.player-picker__rail {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: 3.75rem;
  padding: var(--space-1);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background-color: var(--surface-sunken);
  border-left: 1px solid var(--border);
}

.player-picker__rail::-webkit-scrollbar {
  display: none;
}

.player-picker__rail-day {
  flex-shrink: 0;
  padding: var(--space-1) 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}

.player-picker__rail-day:not(:first-child) {
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.player-picker__jump {
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: 100%;
  padding: 0.3rem 0;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

/* Mice only: on a touch screen a tapped button would stay looking hovered. */
@media (hover: hover) {
  .player-picker__jump:hover {
    background-color: var(--surface);
    border-color: var(--border);
  }
}

.player-picker__jump.is-current {
  color: var(--brand-text);
  background-color: var(--brand-soft);
  border-color: var(--brand-text);
}

.player-picker__jump-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.player-picker__jump .team-logo {
  width: 1.3rem;
  height: 1.3rem;
}

/* A team without a logo: its abbreviation, squeezed into a logo's room. */
.player-picker__jump-abbr {
  font-size: 0.6rem;
  font-weight: 700;
}

.player-picker__jump-time {
  font-variant-numeric: tabular-nums;
}

/* Focused by the clear button to put a phone's keyboard away. */
.player-picker__list:focus {
  outline: none;
}

/* Phones: the open list fills the screen, so it has room even with the
   keyboard up. The controller keeps its top at the top of the screen and
   pads the end of the list by however much the keyboard covers. Narrow
   screens, plus short touch screens (phones on their side); keep in step
   with SHEET_QUERY in player_picker_controller.js. */
@media (max-width: 719px), (max-height: 500px) and (pointer: coarse) {
  .player-picker__panel {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border: none;
    border-radius: 0;
    /* Paint the sheet's background out past its edges too, so the page
       never peeks through around it (say, while the keyboard slides in). */
    box-shadow: 0 0 0 100vmax var(--surface-raised);
    animation: player-picker-sheet-in 0.18s ease-out;
  }

  .player-picker__sheet-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
  }

  .player-picker__sheet-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 650;
    color: var(--text-secondary);
  }

  .player-picker__sheet-close {
    flex-shrink: 0;
  }

  .player-picker__search-wrap {
    padding: var(--space-3) var(--space-4);
  }

  .player-picker__clear {
    right: calc(var(--space-4) + 0.3rem);
  }

  html.player-picker-sheet-open {
    overflow: hidden;
  }
}

@keyframes player-picker-sheet-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-picker__panel {
    animation: none;
  }
}

.player-picker__list,
.player-picker__group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Rows sit flush; the site-wide li + li gap would also open up above the
   first match whenever filtering hides the rows before it. */
.player-picker li {
  margin: 0;
}

.player-picker__group-label {
  position: sticky;
  top: 0;
  /* Above the rows scrolling under it: the faded photo and position on a
     picked player (opacity) would otherwise be drawn on top. */
  z-index: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background-color: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

/* Both teams' logos before their abbreviations, then the kickoff: a
   .game-line, so where the kickoff doesn't fit it moves down without its
   "·". */
.player-picker__group-label:has(.game-line) {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* A block, so it clips the "·" (an inline box wouldn't). */
.player-picker__group-label .game-line {
  display: block;
}

.player-picker__group-teams {
  color: var(--text-secondary);
}

.player-picker__group-label .team-logo {
  width: 1.75em;
  height: 1.75em;
}

.player-picker__group + .player-picker__group .player-picker__group-label {
  border-top: 1px solid var(--border);
}

.player-picker__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  color: var(--text);
  cursor: pointer;
}

/* With a mouse, rows needn't be finger-sized: tighter, to show more at once. */
@media (pointer: fine) {
  .player-picker__option {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
}

/* A slimmer position chip than elsewhere, leaving the name more room. Every
   position is two letters, so a fixed width keeps the names lined up. */
.player-picker__option .pos {
  flex-shrink: 0;
  width: 2rem;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  letter-spacing: 0.02em;
}

.player-picker__option.is-active {
  background-color: var(--brand-soft);
}

.player-picker__option.is-chosen .player-picker__name {
  font-weight: 700;
}

/* The right-hand end of a row: the check mark, then points per game, then
   the position chip (order puts them so), keeping the points and the chips
   in straight lines down the list. */
.player-picker__option.is-chosen::after {
  content: "✓";
  order: 1;
  color: var(--accent-text);
  font-weight: 700;
}

.player-picker__ppg {
  order: 2;
}

.player-picker__option .pos {
  order: 3;
}

/* Headshot, or initials when there isn't one (see .player-photo--fallback). */
.player-picker__photo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: top center;
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
}

.player-picker__photo.player-photo--fallback {
  font-size: var(--text-xs);
}

/* The chosen player's photo, at the left edge of the closed picker. */
.player-picker__selection-photo {
  display: flex;
  flex-shrink: 0;
  margin: -0.15rem 0 -0.15rem -0.15rem;
}

.player-picker__photo--selection {
  width: 26px;
  height: 26px;
}

.player-picker__photo--selection.player-photo--fallback {
  font-size: 0.6rem;
}

/* Already used in another round: shown for reference, can't be chosen. */
.player-picker__option.is-disabled {
  cursor: not-allowed;
  color: var(--text-muted);
}

.player-picker__option.is-disabled .pos,
.player-picker__option.is-disabled .player-picker__ppg,
.player-picker__option.is-disabled .player-picker__team,
.player-picker__option.is-disabled .player-picker__photo {
  opacity: 0.5;
}

/* The name, with "Picked in Wild Card" under it for anyone used already. */
.player-picker__name-block {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.player-picker__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-picker__picked {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--text-muted);
}

/* Fantasy points per game, what the list is ranked by: "14.2" over "PPG". */
.player-picker__ppg {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  min-width: 2rem;
  line-height: 1.1;
}

.player-picker__ppg-value {
  font-size: var(--text-sm);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.player-picker__ppg-unit {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* A row's team, by the photo: just its logo, since the game's heading names
   both teams. The abbreviation stays for screen readers, and shows (small,
   to fit the logo's room) if the logo won't load. A fixed width keeps the
   names lined up either way. */
.player-picker__team {
  flex-shrink: 0;
  justify-content: center;
  width: 1.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.player-picker__team .team-logo {
  width: 1.6rem;
  height: 1.6rem;
}

.player-picker__team:has(.team-logo) .team-tag__abbr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.player-picker__empty {
  margin: 0;
  padding: var(--space-4) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Narrow phones: the rail's logos stack, away over home, so the rail takes
   less of the players' room. */
@media (max-width: 399px) {
  .player-picker__rail {
    width: 2.75rem;
    padding: var(--space-1) 3px;
  }

  .player-picker__jump-teams {
    flex-direction: column;
  }

  .player-picker__jump-time {
    font-size: 0.65rem;
  }
}

/* The smallest phones: no room for points per game beside the name. The
   list is still ranked by them. */
@media (max-width: 359px) {
  .player-picker__ppg {
    display: none;
  }
}

/* Narrower phones: the rows' sides are trimmed, and their logos are a
   little smaller, to leave the name room. */
@media (max-width: 374px) {
  .player-picker__option {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .player-picker__team,
  .player-picker__team .team-logo {
    width: 1.35rem;
  }

  .player-picker__team .team-logo {
    height: 1.35rem;
  }
}

/* A team box on the matchup form, with the team's logo to its left once a
   team abbreviation is typed. The logo's space is kept when there isn't one,
   so the box doesn't jump as you type. */
.team-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.team-field__logo {
  display: flex;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

.team-field__logo .team-logo {
  width: 100%;
  height: 100%;
}

.team-field input {
  flex: 1;
  min-width: 0;
}
/* Data tables. */

/* Horizontal scroll container for wide tables, so the page body never
   scrolls sideways on a phone. */
.table-wrap {
  /* Positioned so it's what anything absolutely placed in the table (the
     screen-reader-only text in some cells) measures from. Otherwise that
     text sits out past the scrolled-off columns, where this doesn't clip
     it, and the whole page scrolls sideways (a tablet's standings, showing
     every week). */
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);

  /* Scroll shadows: the soft edges only appear while there is more table to
     scroll to, which is the only cue a phone user gets. */
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, var(--surface) 40%, transparent),
    linear-gradient(to left, var(--surface) 40%, transparent),
    linear-gradient(to right, var(--scroll-shadow), transparent),
    linear-gradient(to left, var(--scroll-shadow), transparent);
  background-position: left center, right center, left center, right center;
  background-size: 44px 100%, 44px 100%, 14px 100%, 14px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-base);
}

.table th,
.table td {
  padding: var(--space-3);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

.table tbody tr:last-child th,
.table tbody tr:last-child td {
  border-bottom: 0;
}

/* A heading that sorts its table (the sortable-table controller adds the
   button): its words, looking just as they did, and on the column sorted,
   an arrow after them saying which way. None of the usual button look
   (components.css): no border, shadow, fill or press, and its words wrap
   as the heading's would. */
.sort-button,
.sort-button:hover,
.sort-button:active {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  transform: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  white-space: inherit;
  cursor: pointer;
}

.sort-button:focus-visible {
  box-shadow: var(--focus-ring);
}

/* The arrow takes no room of its own, hanging off the end of the words
   into the cell's padding, so sorting a column never makes its heading
   wrap onto another line or shift its centred words aside. */
.sort-button__arrow {
  display: inline-block;
  width: 0;
  white-space: nowrap;
}

.sort-button__arrow::before {
  position: relative;
  left: 0.3em;
  font-size: 0.7em;
}

[data-sorted="descending"] .sort-button__arrow::before {
  content: "▼";
}

[data-sorted="ascending"] .sort-button__arrow::before {
  content: "▲";
}

[data-sorted] .sort-button {
  color: var(--text);
}

.is-sortable :is(thead th, .pick-grid__head [data-sort-key])[data-sort-key] {
  cursor: pointer;
}

@media (hover: hover) {
  .is-sortable :is(thead th, .pick-grid__head [data-sort-key])[data-sort-key]:hover .sort-button {
    color: var(--text);
  }
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

/* Only where there's a real pointer: on a phone a tap leaves :hover stuck
   on the row until something else is tapped, so scrolling past (or opening
   a points breakdown) would leave a highlighted row behind. */
@media (hover: hover) {
  .table tbody tr:hover {
    background-color: var(--surface-sunken);
  }

  /* Reference tables whose rows aren't interactive skip the hover highlight. */
  .table--static tbody tr:hover {
    background-color: transparent;
  }
}

.table--center th,
.table--center td {
  text-align: center;
}

/* Alignment helpers are scoped to .table so they beat the base
   `.table th/td { text-align: left }` rule. */
.table th.table__num,
.table td.table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table th.table__center,
.table td.table__center {
  text-align: center;
}

.table__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.table__empty {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-base);
}

/* Two-column reference tables read better when they aren't stretched across
   a wide screen. */
.table-wrap--narrow {
  max-width: 640px;
}

/* Compact variant for dense stat tables */
.table--compact th,
.table--compact td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* Leaderboard specifics -------------------------------------------------- */

/* By rank rather than row, so everyone tied into the top three gets it. */
.table--leaderboard tbody tr.is-podium .leader-name {
  font-weight: 700;
}

.leader-rank {
  width: 1%;
  white-space: nowrap;
}

.leader-name {
  font-weight: 600;
  white-space: nowrap;
}

/* Names open that person's picks page. */
.leader-name a {
  font-weight: inherit;
}

.leader-total {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The dash stays in Inter: the condensed one is a stub. */
.leader-total--empty {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-weight: 500;
}

/* Under a total on the weekly standings: how many of the person's players
   are still playing and yet to kick off (pick_progress). */
.leader-progress {
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.leader-progress__live {
  color: var(--accent-text);
  font-weight: 600;
}

/* A player slot inside a leaderboard cell */
.table td.slot {
  text-align: center;
  min-width: 104px;
}

.slot__name {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.3;
}

.slot__score {
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.slot__pending {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* Weekly totals in the overall leaderboard */
.table td.week-total {
  text-align: center;
  min-width: 88px;
}

/* Round name + multiplier, shown only once the table stacks and the column
   headers are hidden. */
.week-total__round {
  display: none;
}

.week-total__mult {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0 0.4em;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.week-total__boosted {
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.week-total__raw {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Under a round's points on the overall standings: where they placed in
   it, then what a multiplier boosted ("🥇 1st · 71.18 raw"). Each part
   stays whole, so a narrow column wraps between them. */
.week-total__result {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.week-total__result > * {
  white-space: nowrap;
}

.week-total__result .week-total__raw {
  font-size: inherit;
}

.week-total__sep {
  opacity: 0.6;
}

.week-total__place--podium {
  color: var(--highlight-text);
  font-weight: 700;
}

/* Picks in for a round nobody on them has kicked off in yet. "Picks in"
   on its own line in a narrow column, the rest under it. */
.week-total__hidden {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.week-total__hidden-note {
  display: block;
  font-size: 0.6875rem;
}

.table th.week-col {
  text-align: center;
}

.week-col__name {
  display: block;
  font-size: var(--text-xs);
}

.week-col__multiplier {
  display: block;
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
}

/* By a week's name, going to its standings (the heading itself sorts the
   table): a small tinted square, so it reads as a button of its own rather
   than part of the name. */
.week-col__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  border-radius: var(--radius-sm);
  background-color: var(--brand-soft);
  color: var(--brand-text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.week-col__link:hover {
  background-color: var(--brand);
  color: var(--text-inverse);
}

/* The week in play, while the season's live, has a dot before its name
   (.current-week-dot) in its column header and, once the table stacks, on
   its tile: marked rather than tinted, so it doesn't look like the week
   selected. */

/* A regular season's older weeks, hidden on a phone until "Show all
   weeks". A wide screen shows them all, scrolling sideways. */
@media (max-width: 719px) {
  .table--leaderboard:not(.is-showing-all) .is-older-week {
    display: none;
  }
}

@media (min-width: 720px) {
  /* Over the button's own display (inline-grid when shown), wherever that
     comes in the file. */
  .leaderboard-toolbar .leaderboard-toolbar__weeks:not([hidden]) {
    display: none;
  }
}

/* The overall standings on a wide screen: rank, name and total pinned on
   the left while the weeks scroll sideways (starting at the latest; the
   sideways-scroll controller), each at a set width so they sit side by
   side. Opaque, so the weeks pass under them. */
@media (min-width: 720px) {
  .table--overall {
    --pin-rank: 3.5rem;
    --pin-name: 13rem;
    --pin-total: 7rem;
  }

  .table--overall tr > :nth-child(-n + 3) {
    position: sticky;
    z-index: 1;
    background-color: var(--surface);
  }

  .table--overall thead tr > :nth-child(-n + 3) {
    z-index: 3;
    background-color: var(--surface-sunken);
  }

  .table--overall tr > :nth-child(1) {
    left: 0;
    width: var(--pin-rank);
    min-width: var(--pin-rank);
  }

  .table--overall tr > :nth-child(2) {
    left: var(--pin-rank);
    width: var(--pin-name);
    min-width: var(--pin-name);
    max-width: var(--pin-name);
  }

  .table--overall .leader-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table--overall tr > :nth-child(3) {
    left: calc(var(--pin-rank) + var(--pin-name));
    width: var(--pin-total);
    min-width: var(--pin-total);
    border-right: 1px solid var(--border);
  }

  .table--overall tbody tr.is-you > :nth-child(-n + 3) {
    background-color: var(--brand-soft);
  }
}

@media (min-width: 720px) and (hover: hover) {
  .table--overall tbody tr:hover > :nth-child(-n + 3) {
    background-color: var(--surface-sunken);
  }

  .table--overall tbody tr.is-you:hover > :nth-child(-n + 3) {
    background-color: var(--brand-soft);
  }
}

/* Over the overall standings: Standings / Pick grid and "Jump to you" on
   the left, "Show all weeks" (a regular season's) on the right. */
.leaderboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.leaderboard-toolbar__end {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.leaderboard-toolbar__weeks:not([hidden]) {
  display: inline-grid;
  justify-items: center;
}

.leaderboard-toolbar__weeks[hidden] {
  display: none;
}

/* "Expand all" is for the phone layout's folded rows, so it (and a toolbar
   with nothing else in it) only shows there. */
.leaderboard-toolbar__expand {
  display: none;
}

/* Both labels in the same spot, the one not in use hidden but still taking
   up room, so neither button changes width when it's pressed. */
.leaderboard-toolbar__expand > span,
.leaderboard-toolbar__weeks > span {
  grid-area: 1 / 1;
}

.leaderboard-toolbar__expand.is-all-open .leaderboard-toolbar__expand-label,
.leaderboard-toolbar__expand:not(.is-all-open) .leaderboard-toolbar__collapse-label,
.leaderboard-toolbar__weeks.is-showing-all .leaderboard-toolbar__all-weeks-label,
.leaderboard-toolbar__weeks:not(.is-showing-all) .leaderboard-toolbar__latest-weeks-label {
  visibility: hidden;
}

@media (max-width: 719px) {
  .leaderboard-toolbar__expand:not([hidden]) {
    display: inline-grid;
    justify-items: center;
  }

  /* Light borders, and less padding than a regular button: room for all
     three buttons on one line on a phone. The border is always there, not
     just on hover: a tapped button stays "hovered" until the next tap lands
     somewhere else, so a hover border would come and go as rows open. */
  .leaderboard-toolbar__end .btn {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .leaderboard-toolbar__end .btn--ghost {
    border-color: var(--border);
  }
}

/* Nor does a tapped button keep its hover shading on a touch screen. */
@media (hover: none) {
  .leaderboard-toolbar__end .btn--ghost:hover {
    background-color: transparent;
    color: var(--text-secondary);
  }
}

.leaderboard-toolbar__place {
  color: var(--text-muted);
  font-weight: 600;
}

/* Where "Jump to you" lands: clear of the sticky header (which wraps onto
   a second row on phones), with a flash to show which row it is. */
.table--leaderboard tbody tr,
.pick-sheet {
  scroll-margin-top: calc(var(--header-height) + var(--space-6));
}

@media (max-width: 719px) {
  .table--leaderboard tbody tr,
  .pick-sheet {
    scroll-margin-top: 160px;
  }
}

.table--leaderboard tbody tr.is-flashing,
.pick-sheet.is-flashing {
  animation: standings-row-flash 1.6s ease-out;
}

@keyframes standings-row-flash {
  0%,
  35% {
    box-shadow: inset 0 0 0 2px var(--brand);
  }

  100% {
    box-shadow: inset 0 0 0 2px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .table--leaderboard tbody tr.is-flashing,
  .pick-sheet.is-flashing {
    animation: none;
    box-shadow: inset 0 0 0 2px var(--brand);
  }
}

/* The chevron that opens a row of the standings on phones (below). */
.standings-row-toggle {
  display: none;
}

/* The signed-in user's own row, so they can find themselves at a glance. */
.table tbody tr.is-you {
  background-color: var(--brand-soft);
}

.table tbody tr.is-you:hover {
  background-color: var(--brand-soft);
}

.table tbody tr.is-you th,
.table tbody tr.is-you td {
  border-bottom-color: var(--border-strong);
}

/* Stats table: keep the player's name pinned while the stat columns scroll. */
.stat-table th.stat-player,
.stat-table td.stat-player {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
}

.stat-table thead th.stat-player {
  z-index: 3;
  background-color: var(--surface-sunken);
}

.stat-table tbody tr:hover td.stat-player {
  background-color: var(--surface-sunken);
}

/* Stacked leaderboard rows on small screens -------------------------------
   A seven-column leaderboard is unreadable on a phone, so below the
   breakpoint each row becomes a card: rank, name and total on the first
   line, then the four slots in a 2x2 grid underneath. Labels that lived in
   the (now hidden) header are re-attached to each cell via data-label. */

@media (max-width: 719px) {
  .table--stacked thead {
    display: none;
  }

  .table--stacked,
  .table--stacked tbody,
  .table--stacked tr,
  .table--stacked th,
  .table--stacked td {
    display: block;
  }

  .table--stacked tr {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: center;
    gap: var(--space-3) var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
  }

  .table--stacked tr:last-child {
    border-bottom: 0;
  }

  .table--stacked th,
  .table--stacked td {
    padding: 0;
    border-bottom: 0;
  }

  .table--stacked .leader-rank {
    grid-column: 1 / 2;
  }

  .table--stacked .leader-name {
    grid-column: 2 / 5;
    white-space: normal;
  }

  .table--stacked .stacked-total {
    grid-column: 5 / 7;
    text-align: right;
  }

  .table--stacked td.slot,
  .table--stacked td.week-total {
    grid-column: span 3;
    min-width: 0;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    background-color: var(--surface-sunken);
  }

  .table--stacked td.slot--empty {
    grid-column: 1 / -1;
    background-color: transparent;
    text-align: left;
  }

  /* Column headings move onto each cell. */
  .table--stacked td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .table--stacked .week-total__round {
    display: block;
    margin-bottom: 2px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  /* The cards are the sunken colour, so on a row that's tinted too (yours
     here, one under the mouse below) they turn white rather than blend in. */
  .table--stacked tr.is-you td.slot,
  .table--stacked tr.is-you td.week-total {
    background-color: var(--surface);
  }

  /* Every slot card the same size, whether or not its player has played:
     at least as tall as one with a name and score, stretched to match its
     neighbour if a long name wraps, and its contents centred in it. */
  .table--stacked td.slot {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.875rem;
  }
}

/* The overall standings on phones: one line per person until it's opened
   (standings-rows controller, which adds .is-collapsible; without it every
   row shows its weeks). The total and its chevron share the right end. */
@media (max-width: 719px) {
  .table--stacked.is-collapsible tr:not(.is-open) td.week-total {
    display: none;
  }

  /* A boosted round has a second line (what it was before the multiplier)
     and a 1.0x round doesn't, so tiles side by side are stretched to the
     same height, their contents centred. */
  .table--stacked td.week-total {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .table--stacked.is-collapsible tbody tr {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  /* Only the first line opens and closes the row; the weeks don't. */
  .table--stacked.is-collapsible tbody td.week-total {
    cursor: auto;
  }

  .table--stacked.is-collapsible .stacked-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
  }

  .table--stacked.is-collapsible .standings-row-toggle:not([hidden]),
  .pick-grid.is-collapsible .standings-row-toggle:not([hidden]) {
    display: inline-flex;
    flex: none;
    width: 2rem;
    height: 2rem;
    margin-right: calc(-1 * var(--space-2));
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background-color: transparent;
    box-shadow: none;
    color: var(--text-muted);
  }

  .table--stacked.is-collapsible .standings-row-toggle:hover,
  .pick-grid.is-collapsible .standings-row-toggle:hover {
    background-color: transparent;
  }

  .standings-row-toggle__chevron {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.2rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
  }

  .standings-row-toggle[aria-expanded="true"] .standings-row-toggle__chevron {
    margin-top: 0.2rem;
    transform: rotate(-135deg);
  }
}

@media (max-width: 719px) and (hover: hover) {
  .table--stacked tr:hover td.slot,
  .table--stacked tr:hover td.week-total {
    background-color: var(--surface);
  }
}

/* Stacked admin tables on small screens ------------------------------------
   Admin tables end with an actions column, which is exactly the column that
   falls off the right edge of a phone. Below the breakpoint each row becomes
   a labelled block instead. */

@media (max-width: 719px) {
  .table--cards thead {
    display: none;
  }

  .table--cards,
  .table--cards tbody,
  .table--cards tr,
  .table--cards th,
  .table--cards td {
    display: block;
  }

  .table--cards tr {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
  }

  .table--cards tr:last-child {
    border-bottom: 0;
  }

  .table--cards th,
  .table--cards td,
  .table--cards td.table__center,
  .table--cards th.table__center {
    padding: var(--space-1) 0;
    border-bottom: 0;
    text-align: left;
  }

  .table--cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .table--cards .table__actions {
    justify-content: flex-start;
    margin-top: var(--space-3);
  }

  .table--cards .player-thumb {
    width: 56px;
    height: 56px;
  }
}

/* The admin's player lists: a search box over both, filtering their rows
   (player_search_controller.js). A hidden row stays hidden in the phone
   layout too, where .table--cards rows are display: block. */
.player-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.player-search[hidden],
.table tr[hidden],
.table-wrap[hidden] {
  display: none;
}

.player-search input[type="search"] {
  flex: 1 1 18rem;
  max-width: 28rem;
}

.player-search__injured {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.player-search__count {
  font-size: var(--text-sm);
}

.player-injury {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

/* On a phone, where each player is a card, a healthy player's card skips
   the Injury line rather than show a dash. */
@media (max-width: 719px) {
  .table--cards td.player-injury-cell--healthy {
    display: none;
  }
}

/* Standings / Pick grid ------------------------------------------------
   The switch over the overall standings, between everyone's points and
   everyone's players. */
.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background-color: var(--border);
}

.view-switch__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 2rem;
  padding: 0 var(--space-3);
  border-radius: calc(var(--radius) - 3px);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  text-decoration: none;
}

.view-switch__option:hover {
  color: var(--text);
  text-decoration: none;
}

.view-switch__option[aria-current] {
  background-color: var(--surface);
  color: var(--brand-text);
  box-shadow: var(--shadow-sm);
}

/* A row of its own on a phone, the rest of the toolbar under it. */
@media (max-width: 719px) {
  .view-switch {
    display: flex;
    flex: 1 0 100%;
  }

  .view-switch__option {
    flex: 1;
    min-height: 2.5rem;
  }
}

/* What the shading on a player's points means: each range a little cell
   in that shading, its text styled as a player's points would be. */
.pick-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: 0 var(--space-2) 0 0;
  font-size: var(--text-xs);
}

.pick-legend__label {
  margin-right: var(--space-1);
  font-weight: 600;
  color: var(--text-secondary);
}

.pick-legend__key {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pick-legend__key.pick-cell--fire {
  border-color: transparent;
  color: var(--pick-fire-text);
  font-weight: 700;
}

.pick-legend__key.pick-cell--hot {
  border-color: transparent;
  color: var(--accent-text);
  font-weight: 700;
}

.pick-legend__key.pick-cell--good {
  border-color: transparent;
}

.pick-legend__key.pick-cell--cold {
  color: var(--text-muted);
}

/* The pick grid's key: in the toolbar on a wide screen; on a phone,
   behind a Key button, opening across the toolbar's width over the top of
   the grid. */
.pick-key {
  display: none;
}

@media (max-width: 719px) {
  .pick-legend--toolbar {
    display: none;
  }

  .leaderboard-toolbar {
    position: relative;
  }

  .pick-key {
    display: block;
  }

  .pick-key__toggle {
    gap: var(--space-1);
    list-style: none;
    cursor: pointer;
  }

  .pick-key__toggle::-webkit-details-marker {
    display: none;
  }

  .pick-key[open] .round-menu__caret {
    transform: rotate(180deg);
  }

  .pick-key__panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    z-index: 30;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface-raised);
    box-shadow: var(--shadow-lg);
  }

  .pick-legend--panel {
    flex-wrap: nowrap;
    margin: 0;
  }

  .pick-legend--panel .pick-legend__key {
    flex: 1;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

/* The Pick grid view (leaderboard/_pick_grid) --------------------------
   One markup, two layouts. Wide screens: each person (.pick-sheet) is a
   grid filled a column at a time, five rows deep: their name over the slot
   chips down the left, then for each week its score over its four players.
   The wrappers in between (.pick-sheet__slots, .pick-sheet__weeks,
   .pick-week) step aside (display: contents) so their children are the
   grid's cells. Every person's grid is the same width with the same
   columns, so they line up under the week headings, and the names stay
   pinned while the weeks scroll sideways.

   Phones: each person is a line that opens (standings-rows controller) to
   a grid with the slots across the top and a week to a row, newest first. */
.pick-sheet {
  --sheet-bg: var(--surface);
  background-color: var(--sheet-bg);
}

.pick-sheet.is-you {
  --sheet-bg: var(--brand-soft);
}

.pick-sheet__who {
  min-width: 0;
}

.pick-sheet__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pick-sheet.is-podium .pick-sheet__name {
  font-weight: 700;
}

.pick-sheet__who .badge {
  margin-left: var(--space-1);
  vertical-align: 0.1em;
}


.pick-week__total {
  font-variant-numeric: tabular-nums;
}

.pick-week__score {
  font-weight: 700;
}

.pick-week__hidden {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.pick-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.25;
}

/* The round's top scorer at their position (top_at_position_star): a small
   star tucked into the cell's top right corner, in the colour of the
   cell's points, so it sits with each shade rather than fighting it. The
   name stops short of it. */
.pick-cell .top-star {
  position: absolute;
  top: 0.15rem;
  right: 0.25rem;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 400;
}

.pick-cell--top .pick-cell__name {
  padding-right: 0.7rem;
}

.pick-cell__name {
  overflow: hidden;
  font-size: var(--text-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pick-cell__points {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pick-cell--hidden .pick-cell__name {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-muted);
}

/* By the player's points: 30 or more, 20 or more, 10 or more, under 5.
   30 or more is a solid green tile with white text, so the big games jump
   out of the grid; below it, shades of the accent mixed into the page's
   surface, each step clearly lighter than the one above it in either
   theme. The dark theme's tile is a step deeper than its accent, which is
   too bright to keep white text readable. */
:root {
  --pick-fire: var(--green-600);
  --pick-fire-text: var(--white);
  --pick-hot: color-mix(in srgb, var(--accent) 24%, var(--surface));
  --pick-good: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

@media (prefers-color-scheme: dark) {
  :root {
    --pick-hot: color-mix(in srgb, var(--accent) 34%, var(--surface));
    --pick-good: color-mix(in srgb, var(--accent) 15%, var(--surface));
  }
}

.pick-cell--fire {
  background-color: var(--pick-fire);
}

.pick-cell--fire .pick-cell__name,
.pick-cell--fire .pick-cell__points {
  color: var(--pick-fire-text);
}

.pick-cell--fire .pick-cell__points {
  font-weight: 700;
}

/* The breakdown's dotted underline and the live dot are drawn in the
   accent's colours, which vanish on the tile: white instead. */
.pick-cell--fire .points-toggle:not(:hover) {
  text-decoration-color: color-mix(in srgb, var(--pick-fire-text) 70%, transparent);
}

.pick-cell--fire .live-dot {
  background-color: var(--pick-fire-text);
}

.pick-cell--hot {
  background-color: var(--pick-hot);
}

.pick-cell--hot .pick-cell__points {
  color: var(--accent-text);
  font-weight: 700;
}

.pick-cell--good {
  background-color: var(--pick-good);
}

.pick-cell--cold {
  background-color: var(--surface-sunken);
}

.pick-cell--cold .pick-cell__name,
.pick-cell--cold .pick-cell__points {
  color: var(--text-muted);
}

/* The overall standings' tables, both views: sideways only. A few pixels
   of rounding in a table's height would otherwise make it scroll up and
   down too, by those few pixels, and an iPad's swipes and trackpad then get
   caught scrolling it rather than the page. Nor does a swipe past either
   end go back a page. */
.table-wrap--sideways {
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}

@media (min-width: 720px) {
  .pick-grid {
    --pick-label: 13rem;
    --pick-col: 7.5rem;
    /* As wide as the space, or wider to give every week its minimum and
       scroll; --weeks is set on it. */
    width: max(100%, calc(var(--pick-label) + var(--weeks, 1) * var(--pick-col)));
  }

  .pick-grid__head,
  .pick-sheet {
    display: grid;
    grid-template-columns: var(--pick-label);
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .pick-sheet {
    grid-template-rows: auto repeat(4, minmax(2.75rem, auto));
    border-bottom: 1px solid var(--border-strong);
  }

  .pick-sheet:last-child {
    border-bottom: 0;
  }

  .pick-sheet__slots,
  .pick-sheet__weeks,
  .pick-week {
    display: contents;
  }

  .pick-grid__head {
    background-color: var(--surface-sunken);
    border-bottom: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .pick-grid__corner,
  .pick-grid__week {
    padding: var(--space-3);
  }

  .pick-grid__week {
    text-align: center;
    border-left: 1px solid var(--border);
  }

  /* The two headings over the names: Person, and the totals under them
     at the right end, sorting by those. */
  .pick-grid__corner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .pick-grid__week.is-current-week {
    background-color: var(--accent-soft);
    color: var(--accent-text);
  }

  /* The names and slot chips, pinned on the left. */
  .pick-grid__corner,
  .pick-sheet__person,
  .pick-sheet__slot {
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 1px solid var(--border);
  }

  .pick-grid__corner {
    background-color: var(--surface-sunken);
  }

  .pick-sheet__person,
  .pick-sheet__slot {
    background-color: var(--sheet-bg);
  }

  .pick-sheet__person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-3);
    align-items: center;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
  }

  .pick-sheet__end {
    grid-column: 2;
  }

  /* Under the name here, smaller than the standings' (a phone's line has
     it as big). */
  .pick-sheet__total {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-secondary);
  }

  .pick-sheet__slot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 var(--space-3);
  }

  /* The "Week" heading over the weeks' names is for phones. */
  .pick-sheet__slot--week {
    display: none;
  }

  .pick-week > * {
    border-left: 1px solid var(--border);
  }

  .pick-week__total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2);
    text-align: center;
    border-bottom: 1px solid var(--border);
  }

  .pick-week.is-current-week .pick-week__total {
    background-color: color-mix(in srgb, var(--accent) 8%, transparent);
  }

  /* The week's name and multiplier are the column heading here. */
  .pick-week__name,
  .pick-week__mult {
    display: none;
  }

  .pick-cell {
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }
}

@media (max-width: 719px) {
  .pick-grid__head {
    display: none;
  }

  .pick-sheet {
    border-bottom: 1px solid var(--border);
  }

  .pick-sheet:last-child {
    border-bottom: 0;
  }

  /* Laid out just as a line of the standings is (.table--stacked tr):
     rank, name, then the total and its chevron at the right end. */
  .pick-sheet__person {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: center;
    gap: var(--space-3) var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  /* Its own size, not stretched across the column (the standings' sits
     in a table cell). */
  .pick-sheet__person > .rank-stand {
    grid-column: 1 / 2;
    justify-self: start;
  }

  .pick-sheet__who {
    grid-column: 2 / 5;
  }

  .pick-sheet__end {
    grid-column: 5 / 7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
  }

  .pick-sheet__slots,
  .pick-week {
    display: grid;
    grid-template-columns: 3.6rem repeat(4, minmax(0, 1fr));
    gap: 2px;
  }

  .pick-sheet__slots {
    padding: 0 var(--space-1) var(--space-1);
    align-items: end;
  }

  .pick-sheet__slot--week {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .pick-sheet__slot .pos {
    min-width: 0;
    padding-inline: 0.3rem;
    font-size: 0.625rem;
  }

  /* Newest week first. */
  .pick-sheet__weeks {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    padding: 0 var(--space-1) var(--space-3);
  }

  .pick-week__total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.6875rem;
    line-height: 1.2;
  }

  .pick-week__name {
    font-weight: 700;
    color: var(--text-secondary);
  }

  .pick-week.is-current-week .pick-week__name {
    color: var(--accent-text);
  }

  .pick-week__place {
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .pick-week__place--podium {
    color: var(--highlight-text);
    font-weight: 700;
  }

  .pick-week__place-sep {
    opacity: 0.6;
  }

  .pick-week__score {
    font-weight: 500;
    color: var(--text-muted);
  }

  .pick-week__total .pick-week__mult {
    align-self: flex-start;
    margin: 2px 0 0;
  }

  /* No room for the place, or the words beside the lock. */
  .pick-week__total .week-total__result,
  .pick-week__hidden-label {
    display: none;
  }

  .pick-cell {
    padding: 0.25rem 0.3rem;
    border-radius: var(--radius-sm);
  }

  /* The condensed face, so longer surnames fit whole in a quarter of a
     phone ("Whittington", "Smith-Njigba"). */
  .pick-cell__name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-xs);
  }

  .pick-cell__points {
    font-size: 0.6875rem;
  }

  /* Just the surname: "Dart". */
  .pick-cell__first {
    display: none;
  }

  /* Folded to one line until opened, once the controller has run. */
  .pick-grid.is-collapsible .pick-sheet:not(.is-open) > :not(.pick-sheet__person) {
    display: none;
  }

  .pick-grid.is-collapsible .pick-sheet__person {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Smaller phones: the same columns, narrower. Names a size down, so most
   surnames still fit whole (a tap on the points gives the full name), and
   below 360px the place goes under the week's name to give the players its
   room. */
@media (max-width: 374px) {
  .pick-cell {
    padding-inline: 0.25rem;
  }

  .pick-cell__name {
    font-size: 0.6875rem;
  }

  .pick-cell__points {
    font-size: 0.625rem;
  }
}

@media (max-width: 359px) {
  .pick-sheet__slots,
  .pick-week {
    grid-template-columns: 2.6rem repeat(4, minmax(0, 1fr));
  }

  .pick-week__place {
    display: block;
  }

  .pick-week__place-sep {
    display: none;
  }
}
/* Page-specific layouts. */

/* Home ------------------------------------------------------------------- */

/* Round cards */
/* A notice above a page's content ("you're not playing this season",
   "you're looking back at a past season"). */
.page-notice {
  margin-bottom: var(--space-4);
}

.rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
}

.round-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.round-card--open:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.round-card--upcoming {
  background-color: var(--surface-sunken);
  border-style: dashed;
  box-shadow: none;
}

/* The week everyone's picking for (or watching): first in a regular
   season, and marked out from the rest. */
.round-card--current {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.round-card--current.round-card--open:hover {
  border-color: var(--accent-hover);
}

.round-card--current.round-card--upcoming {
  background-color: var(--surface);
}

/* Across the full row in a regular season, so it reads as the headline
   with the weeks already played beneath it. */
.rounds--regular-season .round-card--current {
  grid-column: 1 / -1;
}

/* The regular-season weeks after the current one, below those played. */
.rounds-upcoming {
  margin-top: var(--space-8);
}

/* Rounds still to come with no games posted (shared/unposted_rounds): a
   line each in one quiet box, so they're there to see without each taking
   a card's worth of screen to say there's nothing yet. */
.round-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: var(--radius-lg);
  background-color: var(--surface-sunken);
}

* + .round-lines {
  margin-top: var(--space-4);
}

.round-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  padding: var(--space-3) var(--space-4);
  scroll-margin-top: var(--space-4);
}

.round-line + .round-line {
  border-top: 1px dashed var(--border);
}

.round-line__name {
  font-weight: 700;
  color: var(--text-secondary);
}

.round-line__note {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.round-card__eyebrow {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.round-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.round-card__name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.round-card__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.round-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
}

/* Rules ------------------------------------------------------------------ */

.prose {
  font-size: var(--text-md);
  color: var(--text-secondary);
}

.prose h2 {
  margin-top: 0;
}

.prose li {
  line-height: 1.6;
}

.prose strong {
  color: var(--text);
}

.rules-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-6);
}

@media (min-width: 780px) {
  .rules-grid--two {
    grid-template-columns: 1fr 1fr;
  }
}

.payout-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background-color: var(--brand-soft);
  border-radius: var(--radius);
}

.payout-callout__figure {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  color: var(--brand-text);
  font-variant-numeric: tabular-nums;
}

.payout-callout__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.payout-callout__note {
  flex: 1 1 16rem;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Pick form -------------------------------------------------------------- */

/* minmax(0, ...) so the column is the page's width, never a slot's: a long
   name in the player picker would otherwise widen it past a narrow phone's
   screen. The picker cuts the name short instead. */
.pick-slots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.pick-slot {
  padding: var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pick-slot--locked {
  background-color: var(--surface-sunken);
  border-style: dashed;
}

.pick-slot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.pick-slot__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

/* On a slot whose saved player has since stopped playing this round. */
.pick-slot__warning {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--danger, #b42318);
}

/* The chosen player's injury designation, when it was checked and a link to
   the latest news. Red, like the warning above, for anyone likely to miss
   the game; quieter for a Questionable player, who usually plays. */
.pick-slot__injury {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.pick-slot__injury--warning {
  font-weight: 600;
  color: var(--danger, #b42318);
}

.pick-slot__injury .news-link {
  font-weight: 600;
  white-space: nowrap;
}

.pick-slot__locked-player {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--text);
}

/* Lined up under the name, past the 32px photo and its gap. */
.pick-slot__game {
  margin: 0 0 0 calc(32px + var(--space-2));
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Same size as the photos in the player picker the slot had before kickoff. */
.pick-slot__photo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: top center;
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
}

.pick-slot__photo.player-photo--fallback {
  font-size: var(--text-xs);
}

.pick-slot select {
  margin: 0;
}

/* A slot left empty, or one the last save turned down: outlined in red with
   the reason underneath (set by the server, or by the player picker when the
   form is sent with the slot empty). */
.pick-slot.pick-slot--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.pick-slot--error .player-picker__trigger,
.pick-slot--error select {
  border-color: var(--danger);
}

.pick-slot__error {
  display: flex;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--danger-text);
}

.pick-slot__error::before {
  content: "⚠️";
}

.pick-slot__error[hidden] {
  display: none;
}

/* "Ask Madden", the AI lineup suggestion. The button and status messages
   reuse .btn and .alert; this only lays them out and marks the slots
   Madden filled in. */
.ai-suggestion {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.ask-madden {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ask-madden[hidden] {
  display: none;
}

.ask-madden__text {
  display: grid;
  gap: var(--space-1);
}

.ask-madden__title {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Madden's picture: the placeholder badge or a photo, cropped to a circle. */
.madden-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--surface);
  box-shadow: 0 0 0 2px var(--highlight);
}

.ai-suggestion__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Wraps the button exactly, so hovering a disabled button (which ignores the
   pointer) shows this wrapper's tooltip. */
.ai-suggestion__button-wrap {
  display: inline-flex;
}

.ai-suggestion__button-wrap[title] {
  cursor: not-allowed;
}

.ai-suggestion__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* .btn sets display, which would otherwise beat the hidden attribute. */
.ai-suggestion [hidden] {
  display: none;
}

.ai-suggestion__status:empty {
  display: none;
}

.ai-suggestion__body {
  display: grid;
  gap: var(--space-2);
}

.ai-suggestion__status ul {
  margin: 0;
  padding-left: var(--space-5);
}

.ai-suggestion__status p {
  margin: 0;
}

.ai-suggestion__note {
  font-size: var(--text-sm);
  font-weight: 400;
  opacity: 0.85;
}

/* The person's past AI suggestions this round, folded under the button: a
   .disclosure, like the Matchups above. */
.ai-history {
  margin-bottom: var(--space-4);
}

.ai-history__summary {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.ai-history__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  list-style: none;
}

.ai-history__item {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.ai-history__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.ai-history__when {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* One column on phones, then two by two like the four pick slots. */
.ai-history__players {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

@media (min-width: 480px) {
  .ai-history__players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ai-history__players li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Both lists space their items with grid gaps; cancel the global li + li
   margin, which would push every item but the first down a little. */
.ai-history__list > li + li,
.ai-history__players li + li {
  margin-top: 0;
}

.ai-history__why {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* How a suggestion did, or would have, once its players kick off. */
.ai-history__pts {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ai-history__best {
  font-weight: 400;
  color: var(--text-muted);
}

.ai-history__result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border);
  font-size: var(--text-sm);
}

.ai-history__total strong {
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}

/* Up top, where "Use this lineup" would be. */
.ai-history__went-with {
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ai-history__standout {
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background-color: var(--highlight-soft);
  color: var(--highlight-text);
  font-weight: 600;
}

.pick-slot--suggested {
  border-color: var(--highlight);
  box-shadow: 0 0 0 1px var(--highlight);
}

/* Pick summary (show page) ----------------------------------------------- */

.pick-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* Person's picks (from the leaderboards) ------------------------------- */

.person-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.person-summary__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.person-summary__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* The total gets a line as tall as the rank badge beside it, so the two
   sit level under their labels (as in .round-heading). */
.person-summary__item .leader-total {
  line-height: var(--rank-size);
}

/* Pushed to the end of the row so the card stays one row high on phones,
   where its label shortens to "Standings". */
.person-summary__action {
  align-self: center;
  margin-left: auto;
  white-space: nowrap;
}

.person-summary__action-short {
  display: none;
}

@media (max-width: 719px) {
  .person-summary {
    flex-wrap: nowrap;
    gap: var(--space-5);
    padding: var(--space-3) var(--space-4);
  }

  .person-summary__action-long {
    display: none;
  }

  .person-summary__action-short {
    display: inline;
  }
}

@media (max-width: 419px) {
  .person-summary__label-extra {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* Very narrow screens (an iPhone with Display Zoom or Safari's page zoom
   reports about 320px): tighten the card and shrink the button so it all
   still fits on one row. */
@media (max-width: 359px) {
  .person-summary {
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .person-summary__action {
    gap: var(--space-1);
    padding: 0.375rem 0.5rem;
    font-size: var(--text-xs);
  }
}

/* Leaderboard links jump straight to a round; keep its heading clear of the
   sticky header, which wraps onto a second row on phones. */
.person-round {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

@media (max-width: 719px) {
  .person-round {
    scroll-margin-top: 160px;
  }
}

/* The round in play on a page of someone's picks: marked off down its
   left edge, like the home page's current round card. */
.person-round--current {
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent);
}

/* Space Madden's lineups off the buttons or empty-state card above them. */
.person-round .ai-history {
  margin-top: var(--space-4);
}

.person-round__meta {
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Weekly standings, just under the round's rank and points: full width on
   phones, sized to its label on wider screens. Edit picks matches it. */
.person-round__standings {
  margin-bottom: var(--space-4);
}

@media (max-width: 719px) {
  .person-round__standings,
  .person-round__edit {
    display: flex;
    width: 100%;
  }
}

.rounds-upcoming__title {
  margin-bottom: var(--space-5);
}

.round-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.round-heading .section__title {
  margin-bottom: 0;
}

/* The rank badge and the points sit level: the points get a line exactly
   as tall as the badge, and both hang from the top, so their middles line
   up whatever comes under the points (the "× 1.1" line in a boosted
   round). Centring the two blocks instead would drop the badge to the
   middle of the points and that line together. */
.round-heading__score {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.round-heading__points {
  text-align: right;
  line-height: 1.2;
}

.round-heading__points .leader-total {
  line-height: var(--rank-size);
}

.round-heading__rank {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: var(--space-2);
}

.round-heading__label-short {
  display: none;
}

.round-heading__hidden {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* On phones "Weekly rank" beside the badge would knock the rank and points
   onto a line of their own, so it shortens to "Rank" and sits over the
   badge instead, with "Points" over the points to match, keeping them
   beside the round's name. The full words stay for screen readers. */
@media (max-width: 719px) {
  .round-heading__score {
    gap: var(--space-4);
  }

  .round-heading__rank {
    flex-direction: column;
    gap: var(--space-1);
    margin-right: 0;
  }

  .round-heading__score .person-summary__label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: 0.625rem;
    line-height: 1;
  }

  .round-heading__rank .person-summary__label {
    margin-bottom: 0;
  }

  .round-heading__label-long {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .round-heading__label-short {
    display: inline;
  }
}

/* "34.10 pts" stays on one line and keeps its width beside the position tag.
   It only just fits a phone card, so it used to wrap whenever Safari
   measured the text a fraction wider than the box it gave it. */
.player-card__points {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* A pick whose game hasn't kicked off: the slot is shown, the player isn't. */
.player-card--hidden {
  border-style: dashed;
  box-shadow: none;
}

.player-card--hidden .player-card__photo-wrap {
  background: var(--surface-sunken);
}

/* Stats page ------------------------------------------------------------- */

/* The tabs across the top (QB / RB / WR/TE) and the Picked only switch.
   They stay in view just under the site header on the way down a long
   page; section-nav measures the header (taller on phones, where it wraps)
   into --section-nav-top. It runs edge to edge of the page's padding, on a
   frosted strip of the page background so rows scroll by underneath. */
.stat-nav {
  position: sticky;
  top: var(--section-nav-top, var(--header-height));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-2) calc(-1 * var(--space-4)) 0;
  padding: var(--space-2) var(--space-4);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.stat-nav__tabs {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-nav__tabs li {
  margin: 0;
}

.stat-nav__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 36px;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}

.stat-nav__tab:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  color: var(--text);
}

/* The section being read (section-nav keeps it up to date). */
.stat-nav__tab[aria-current] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
}

.stat-nav__count {
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.stat-nav__filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.stat-nav__filter:hover {
  text-decoration: none;
  color: var(--text);
}

.stat-nav__filter.is-on {
  color: var(--accent-text);
}

/* Drawn as a switch, though it's a link: on, it's showing picked players
   only. */
.stat-nav__switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background-color 0.15s ease;
}

.stat-nav__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.stat-nav__filter.is-on .stat-nav__switch {
  background: var(--accent);
}

.stat-nav__filter.is-on .stat-nav__switch::after {
  transform: translateX(14px);
}

/* Room for the whole row on a phone. */
@media (max-width: 419px) {
  .stat-nav {
    gap: var(--space-2);
  }

  .stat-nav__tab {
    gap: 0.25rem;
    padding-inline: 0.5rem;
  }
}

/* The smallest phones (320 wide) still can't fit the counts and "Picked
   only" on one row, so the tabs drop their counts: each section's heading
   says how many players it has. */
@media (max-width: 359px) {
  .stat-nav__count {
    display: none;
  }
}

.stat-section {
  /* A tab jumped to lands with the heading just below the header and the
     tabs, not under them. The fallback is roughly a phone's, for before
     section-nav has measured. */
  scroll-margin-top: calc(var(--section-nav-offset, 170px) + var(--space-3));
}

.stat-nav + .stat-section {
  margin-top: var(--space-5);
}

.stat-section + .stat-section {
  margin-top: var(--space-6);
}

.stat-section__of {
  color: var(--text-muted);
  font-weight: 500;
}

.stat-table th.stat-col,
.stat-table td.stat-col {
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 3.5rem;
}

.stat-table td.stat-col {
  color: var(--text-secondary);
}

.stat-table .stat-player {
  white-space: nowrap;
  font-weight: 600;
}

.stat-table .stat-points {
  text-align: center;
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Its heading stays the size of the others; only the points are bigger. */
.stat-table thead th.stat-points {
  font-size: var(--text-xs);
}

/* The stats page's tables: columns of set widths, the same in every table,
   rather than ones sized to whatever rows are showing (which made the
   tables differ from each other, and jump when "Picked only" was toggled).
   Each position has its own five stat columns, in the same places, so the
   tables line up down the page. Other, last, takes what's left of the
   page's width, but never less than enough for a fumble or two; below that
   (phones, or with the admin's Edit and Delete), the table scrolls
   sideways in its .table-wrap. */
.stat-table--fixed {
  --stat-table-min: 63.5rem;
  table-layout: fixed;
  width: max(100%, var(--stat-table-min));
}

.stat-table--fixed.stat-table--admin {
  --stat-table-min: 72.5rem;
}

.stat-table__player {
  width: 16rem;
}

.stat-table__points,
.stat-table__picked {
  width: 5rem;
}

.stat-table__stat {
  width: 5.5rem;
}

.stat-table__actions {
  width: 9rem;
}

/* Headings that don't fit their column go onto two lines. */
.stat-table--fixed thead th {
  white-space: normal;
  vertical-align: bottom;
}

.stat-table--fixed th.stat-col,
.stat-table--fixed td.stat-col {
  min-width: 0;
  padding-inline: var(--space-2);
}

/* A name too long for the player column is cut short rather than
   spilling into the points, so every row is one line high. */
.stat-table--fixed td.stat-player {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The team's logo, just before the name. */
.stat-table td.stat-player .team-logo {
  width: 1.35em;
  height: 1.35em;
  margin-right: 0.4em;
  vertical-align: middle;
}

/* The stats a player had that their table has no column for: "1 fumble
   lost". */
.stat-table td.stat-other {
  color: var(--text-secondary);
}

/* Shown only on a phone, in place of a .stat-detail cell (see the empty
   row in statlines/index). */
.stat-table .stat-table__narrow {
  display: none;
}

/* On a phone, sixteen rem of frozen player column left room for about one
   stat at a time, so the stat columns (.stat-detail) go: each table is just
   the player, their points and how many picked them, filling the width
   without scrolling, and tapping the points opens the stats behind them
   (.points-toggle), as on the standings. With nothing to scroll past, the
   player's column needn't stay pinned. The admin's Edit and Delete still need room, so their
   tables keep enough width for a name and scroll sideways for the rest. */
@media (max-width: 719px) {
  .stat-table .stat-detail {
    display: none;
  }

  .stat-table .stat-table__narrow {
    display: table-cell;
  }

  .stat-table--fixed {
    --stat-table-min: 0rem;
  }

  .stat-table--fixed.stat-table--admin {
    --stat-table-min: 28rem;
  }

  .stat-table__player {
    width: auto;
  }

  .stat-table__points,
  .stat-table__picked {
    width: 4.5rem;
  }

  .stat-table__actions {
    width: 8.5rem;
  }

  .stat-table:not(.stat-table--admin) th.stat-player,
  .stat-table:not(.stat-table--admin) td.stat-player {
    position: static;
    border-right: 0;
  }
}

/* Stats from Sleeper: the checklist of stat lines to add or change ------- */

.stat-import-notes {
  margin-bottom: var(--space-6);
}

.stat-import-notes__list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.stat-import__pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

/* A number Sleeper would change, with what's here now beneath it. */
.stat-table td.is-changed {
  color: var(--text);
  font-weight: 700;
  background-color: var(--highlight-soft);
}

.stat-was {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Games from Sleeper: the checklist's notes and kickoff time fields ----- */

.schedule-import-notes {
  margin-bottom: var(--space-6);
}

.schedule-import-notes p {
  margin: 0 0 var(--space-2);
}

.schedule-import-notes__list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-1);
  color: var(--text-secondary);
}

.kickoff-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.kickoff-field input[type="time"] {
  width: auto;
  padding: var(--space-1) var(--space-2);
}

/* The quick buttons for Sunday's usual kickoffs, under the time field. */
.kickoff-cell {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.kickoff-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.kickoff-presets__button {
  white-space: nowrap;
}

.kickoff-presets__button[aria-pressed="true"],
.kickoff-presets__button[aria-pressed="true"]:hover {
  background-color: var(--accent);
  border-color: transparent;
  color: var(--white);
}

.schedule-import-notes .schedule-import-notes__tip {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
}

/* Auth ------------------------------------------------------------------- */

.auth-shell {
  max-width: 420px;
  margin: var(--space-6) auto;
}

.auth-shell__title {
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-shell__lede {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-5);
}

/* Admin ------------------------------------------------------------------ */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  /* Each tile only as tall as it needs, so opening one tile's details
     doesn't stretch the others in its row. */
  align-items: start;
  gap: var(--space-4);
}

.admin-tile {
  display: block;
  padding: var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-tile:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--text);
}

.admin-tile__icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: var(--space-2);
}

.admin-tile__name {
  display: block;
  font-weight: 700;
  font-size: var(--text-md);
}

.admin-tile__desc {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* A short list in a tile, e.g. the Injuries tile's schedule. */
.admin-tile__list {
  margin: var(--space-1) 0 0;
  padding-left: 1.1rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.admin-tile__list li + li {
  margin-top: var(--space-1);
}

/* A tile's explanation and settings, folded away under its status and
   buttons so the tiles stay short. */
.admin-tile__more {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.admin-tile__more > summary {
  cursor: pointer;
  width: fit-content;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

.admin-tile__more > summary:hover {
  color: var(--text);
}

.admin-tile__more[open] > summary {
  margin-bottom: var(--space-2);
}

/* Last in the tile, so no rule under it. */
.admin-tile__more .reminder-settings {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

/* Weeks other than the current one and the one before it, folded away:
   on the admin tiles, and the Matchups page (--page). */
.week-fold {
  margin-top: var(--space-2);
}

.week-fold > summary {
  cursor: pointer;
  width: fit-content;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

.week-fold > summary:hover {
  color: var(--text);
}

.week-fold > .admin-tile__links {
  margin-top: var(--space-2);
}

.week-fold--page {
  margin-bottom: var(--space-5);
}

.week-fold--page > summary {
  font-size: var(--text-md);
}

.week-fold--page[open] > summary {
  margin-bottom: var(--space-4);
}

/* The Entries page's choice of season. */
.season-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.admin-tile__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* The kickoff reminders tile's settings: on/off, then hours before kickoff. */
.reminder-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.reminder-settings .field {
  margin-bottom: 0;
}

.reminder-settings__hours {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.reminder-settings__hours input[type="number"] {
  width: 5rem;
}

/* The sign-ups tile's settings: open or closed, then the payment details. */
.signup-settings {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.signup-settings .field {
  width: 100%;
  margin-bottom: 0;
}

.signup-settings textarea {
  width: 100%;
}

.login-link-box {
  padding: var(--space-3);
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-numeric);
  font-size: var(--text-sm);
  word-break: break-all;
  line-height: 1.6;
}

/* Player thumbnails in admin tables */
.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: top center;
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
}

/* Keep the lineup form at a comfortable reading width on wide screens. */
.pick-form {
  max-width: 640px;
}

/* Save picks and friends, with a line under them saying where the lineup
   stands ("2 of 4 chosen"), kept up to date by pick-changes. */
.pick-form__actions {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.pick-form__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.pick-form__status {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pick-form__status.is-ready {
  color: var(--accent-text);
  font-weight: 600;
}

/* On a phone, once there's something to save, the buttons stick to the
   bottom of the screen while the lineup is in view, so Save picks is in
   reach from whichever slot was just filled. They settle back into place
   at the end of the form. Below the player picker's full-screen list
   (forms.css), which covers them while it's open. */
@media (max-width: 719px) {
  .pick-form--changed .pick-form__actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-inline: calc(-1 * var(--space-4));
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    background: var(--surface);
    box-shadow: 0 -4px 16px rgba(8, 24, 47, 0.08);
  }

  .pick-form--changed .pick-form__buttons .btn {
    flex: 1;
  }
}

.auth-shell__footnote {
  margin-top: var(--space-5);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-shell__danger-zone {
  margin-top: var(--space-5);
}

/* Initials shown when a player has no usable headshot URL. */
.player-photo--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background-color: var(--surface-sunken);
}

.player-card__photo.player-photo--fallback {
  width: 100%;
  font-size: var(--text-2xl);
}

/* Round navigation ---------------------------------------------------------
   The overall leaderboard's column headers link to each weekly board, but
   those headers are hidden once the table stacks on a phone. This row carries
   the same links at every width. */

.round-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.round-nav__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The week in play: a chip like the rest, with a dot (.current-week-dot)
   before its name. Not filled or outlined in green, which in a row of chips
   reads as the one selected, as if this were that week's standings. The
   dot's own margin spaces it, not the chip's gap. */
.round-nav .round-nav__current {
  gap: 0;
}

/* On a phone the weeks stay on one line and scroll sideways rather than
   wrapping a lone "Super Bowl" (or half a regular season) onto rows of
   their own. The row runs to the screen's edges so it's plain there's more
   off to the side, and the round-nav controller scrolls the week in play
   into view. */
@media (max-width: 719px) {
  .round-nav {
    flex: 1 1 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Sideways only: the tap targets around each chip (.btn--sm::after)
       reach past the row's top and bottom, which would otherwise let it
       scroll up and down a few pixels too. */
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--space-4));
    padding: var(--space-1) var(--space-4);
    scroll-padding-inline: var(--space-4);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .round-nav::-webkit-scrollbar {
    display: none;
  }

  .round-nav > * {
    flex: none;
  }
}

/* A regular season's weeks, in a menu: one button in the page header,
   opening on a grid of the eighteen weeks under it, at its right edge
   (where the header puts it on a wide screen, and on the title's row on
   a phone). */
.round-menu {
  position: relative;
}

.round-menu__toggle {
  gap: var(--space-1);
  list-style: none;
  cursor: pointer;
}

.round-menu__toggle::-webkit-details-marker {
  display: none;
}

.round-menu__caret {
  display: inline-block;
  line-height: 1;
  transition: transform 0.15s ease;
}

.round-menu[open] .round-menu__caret {
  transform: rotate(180deg);
}

.round-menu__panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(5.5rem, 1fr));
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.round-menu__week {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

a.round-menu__week:hover {
  background-color: var(--surface-sunken);
  color: var(--text);
  text-decoration: none;
}

/* No standings yet: listed, so the season's shape is plain, but muted. */
.round-menu__week[aria-disabled] {
  color: var(--text-muted);
  font-weight: 400;
}

/* The week in play's standings button, then the menu, side by side. The
   menu's panel opens from the pair's edge rather than the menu's: on a
   phone they're on a row of their own at the left, where the menu's right
   edge would push the panel off the screen. */
.page-header__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.page-header__actions .round-menu {
  position: static;
}

@media (max-width: 719px) {
  .page-header__actions .round-menu__panel {
    right: auto;
    left: 0;
  }
}

/* Dot, week and arrow as close as the menu's label and caret. */
.page-header__this-week {
  gap: 0.35em;
}

.page-header__this-week .current-week-dot {
  margin-right: 0;
}

/* On a phone the overall standings put the menu on the title's row, at
   the right (.page-header--title-menu), so the panel opens from there:
   the header's titles let their lines go into a grid alongside it, the
   eyebrow and stats line across both columns. A title too long for the
   row wraps beside the button. */
@media (max-width: 719px) {
  .page-header--title-menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 var(--space-3);
  }

  .page-header--title-menu .page-header__titles {
    display: contents;
  }

  .page-header--title-menu .page-header__eyebrow {
    grid-area: 1 / 1 / 2 / -1;
  }

  .page-header--title-menu .page-header__title {
    grid-area: 2 / 1;
  }

  .page-header--title-menu .round-menu {
    grid-area: 2 / 2;
  }

  .page-header--title-menu .stats-status {
    grid-area: 3 / 1 / 4 / -1;
  }
}

/* The weekly standings' previous and next round ------------------------- */

/* A slim line of text under the page header: the round before on the
   left, the round after on the right. They're secondary to the buttons
   above, so plain links rather than cards, pulled up a little towards the
   header. The padding gives a finger more to hit than the text alone. */
.week-pager {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin: calc(-1 * var(--space-3)) 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
}

.week-pager__link {
  padding: var(--space-2) var(--space-1);
  color: var(--brand-text);
  text-decoration: none;
}

.week-pager__link:hover {
  text-decoration: underline;
}

/* A round whose games aren't posted yet: greyed out, opening a note on why
   (.week-pager__note). A button, but with none of the button look. */
.week-pager__unposted,
.week-pager__unposted:hover,
.week-pager__unposted:active {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  font: inherit;
  color: var(--text-muted);
  opacity: 0.7;
  text-decoration: none;
  cursor: help;
}

/* The note itself, styled like the other popovers (components.css). The
   controller puts it under the round's name. */
.week-pager__note {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* A player's teams through the season, on the Change team page. */
.team-history {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* "Stats as of ..." under the leaderboard and stats page titles ---------- */

.stats-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.stats-status--live strong {
  color: var(--accent-text);
}

.stats-status abbr {
  text-decoration: none;
}

/* "stats" after the round's name: a wide screen only, so on a phone the
   line fits on one row. */
@media (max-width: 719px) {
  .stats-status__wide {
    display: none;
  }
}

.stats-status__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  animation: stats-status-pulse 2s ease-in-out infinite;
}

/* Reloading for the latest numbers (live-refresh): no longer claiming to
   be live until they're in. */
.stats-status--updating strong {
  color: inherit;
}

.stats-status--updating .stats-status__dot {
  background-color: var(--text-muted);
  animation: none;
}

@keyframes stats-status-pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .stats-status__dot {
    animation: none;
  }
}

/* The admin's Recap page: draft with AI, edit beside a preview, send. */
.recap-card {
  margin-bottom: var(--space-4);
}

.recap-card__note {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* The editor and the preview side by side once there's room for both. */
.recap-editor {
  display: grid;
  gap: 0 var(--space-4);
  align-items: start;
}

@media (min-width: 1000px) {
  .recap-editor {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.recap-editor__body {
  min-height: 24rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  resize: vertical;
}

.recap-preview__subject {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
}

/* The email is drawn on its own light background whatever the site's theme,
   as it will be in an inbox. */
.recap-preview__frame {
  display: block;
  width: 100%;
  min-height: 24rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #eef2f6;
}

.recap-links {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}

.recap-links li {
  margin-bottom: var(--space-2);
  overflow-wrap: anywhere;
}

.recap-links__url {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* A sent recap is locked: its boxes can be read but not typed in. */
.recap-editor [readonly] {
  background-color: var(--surface-sunken);
  color: var(--text-muted);
}

.recap-lock {
  margin-left: auto;
  flex-shrink: 0;
}

.recap-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.recap-recipients {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.recap-recipients summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text-secondary);
}

.recap-recipients ul {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
  columns: 18rem;
}

.recap-recipients li {
  margin-bottom: var(--space-1);
  break-inside: avoid;
  overflow-wrap: anywhere;
}

/* The Invitations page's list of this season's invitations. */
.invitation-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.invitation-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.invitation-list__subject {
  flex-basis: 100%;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.invitation-list__action {
  margin-left: auto;
}

/* The invitation's people from past seasons, to tick onto the list. */
.past-players {
  margin-top: var(--space-4);
}

.past-players__list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  max-height: 24rem;
  overflow-y: auto;
}

.past-players__list .field--check {
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.past-players__detail {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.past-players__on-list {
  width: 1.1em;
  text-align: center;
  color: var(--text-secondary);
}

/* The sign-ups tile's invite link: the whole address, with Copy under it. */
.invite-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.invite-link__label {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

.invite-link__url {
  width: 100%;
  margin: 0;
  user-select: all;
}

/* The invite page's one box, for the code. */
.invite-code-form .field {
  margin-bottom: var(--space-4);
}

/* Admin: pick check ------------------------------------------------------ */

.pick-check__flags {
  display: grid;
  gap: var(--space-3);
  max-width: 40rem;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  list-style: none;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Lineups by how many people picked them: one bar a count of people. */
.lineup-spread {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  max-width: 40rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lineup-spread__title {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
}

.lineup-spread__rows {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.lineup-spread__row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: center;
  gap: var(--space-3);
}

.lineup-spread__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.lineup-spread__value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  min-width: 0;
}

.lineup-spread__track {
  flex: 1;
  display: block;
  height: 1rem;
  border-bottom: 1px solid var(--border);
}

.lineup-spread__bar {
  display: block;
  height: 100%;
  min-width: 4px;
  background-color: var(--accent);
  border-radius: 0 4px 4px 0;
}

.lineup-spread__row:hover .lineup-spread__bar {
  background-color: var(--accent-hover);
}

.lineup-spread__count {
  flex: none;
  width: 5.5rem;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Admin: Ask Madden round report ---------------------------------------- */

.report-figures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.report-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report-figure__value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.report-figure__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.report-figure__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.madden-lineup {
  margin: 0;
  padding: 0;
  list-style: none;
}

.madden-rationale {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  max-width: 32rem;
}

.madden-rationale > summary {
  cursor: pointer;
  color: var(--text-muted);
}

.madden-rationale > p {
  margin: var(--space-1) 0 0;
}

/* One Ask Madden request (madden_asks/show): what he weighed, in order. */
.madden-transcript {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
  max-width: 48rem;
}

.madden-step {
  border-left: 3px solid var(--border);
  padding-left: var(--space-3);
  overflow-wrap: anywhere;
}

.madden-step p {
  margin: var(--space-1) 0 0;
}

.madden-step--thinking {
  border-left-color: var(--text-muted);
}

.madden-step--search,
.madden-step--lineup {
  border-left-color: var(--accent);
}

.madden-step--reply {
  border-left-color: var(--highlight);
}

.madden-step__label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.madden-step ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
}

.madden-quote {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--border);
  font-style: italic;
  max-width: 40rem;
}

.madden-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  max-height: 20rem;
  overflow-y: auto;
  padding: var(--space-2);
  margin: var(--space-1) 0 0;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
}

.madden-prompt {
  margin-bottom: var(--space-2);
}

.madden-prompt > summary {
  cursor: pointer;
}

.madden-prompt > pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  max-height: 32rem;
  overflow-y: auto;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
}

/* One-click sign-in as any seeded person, on the sign-in page in development
   and preview deploys only (devise/sessions/_quick_sign_in). A large seed
   has dozens of people, so the list scrolls. */
.quick-sign-in {
  margin-top: var(--space-5);
}

.quick-sign-in__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

.quick-sign-in__list li + li {
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.quick-sign-in__form {
  margin: 0;
}

.quick-sign-in__button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-weight: 400;
}

.quick-sign-in__button:hover,
.quick-sign-in__button:focus-visible {
  background-color: var(--surface-sunken);
}

.quick-sign-in__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.quick-sign-in__name {
  font-weight: 600;
}

.quick-sign-in__email {
  color: var(--text-muted);
  font-size: var(--text-xs);
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-sign-in__badges {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Most picked (stats page) ----------------------------------------------- */

/* The round's most-picked players above the tables: a row of cards on a wide
   screen, a strip to swipe along on a phone. */
.most-picked {
  margin-bottom: var(--space-4);
}

.most-picked__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin-bottom: var(--space-2);
}

.most-picked__title {
  margin-bottom: 0;
  font-size: var(--text-base);
}

.most-picked__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.most-picked__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.most-picked__list li + li {
  margin-top: 0;
}

.most-picked__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-2);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.most-picked__photo {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: top;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface-sunken));
}

.most-picked__photo.player-photo--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
}

.most-picked__body {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.most-picked__player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 600;
}

.most-picked__share {
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.most-picked__share strong {
  font-size: var(--text-md);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.most-picked__points {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1023px) {
  .most-picked__list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    /* Room for the cards' borders against the scrolling edge. */
    padding-bottom: 2px;
  }

  .most-picked__item {
    flex: 0 0 auto;
    width: 13rem;
    scroll-snap-align: start;
  }
}

/* The stats page's Picked column: the count, and under it the share of the
   pool that is. */
.stat-picked__count,
.stat-picked__share {
  display: block;
}

.stat-picked__share {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Head to head ----------------------------------------------------------
   Two people's seasons side by side (leaderboard/head_to_head): who's
   picked, the tale of the tape, then each round's scores with the lineups
   slot by slot under them, the left person's players facing the right's. */
.h2h-title__vs {
  font-size: 0.7em;
  color: var(--text-muted);
}

.h2h-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 34rem;
  margin-bottom: var(--space-5);
}

.h2h-picker__select {
  flex: 1;
  min-width: 0;
}

.h2h-picker__vs {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.h2h-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.h2h-summary__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.h2h-summary__side--right {
  align-items: flex-end;
  text-align: right;
}

.h2h-summary__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  text-decoration: none;
}

.h2h-summary__name:hover {
  text-decoration: underline;
}

.h2h-summary__stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.h2h-summary__side.is-ahead .leader-total {
  color: var(--accent-text);
}

.h2h-summary__record {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.h2h-summary__wins {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.h2h-summary__wins .is-ahead {
  color: var(--accent-text);
}

.h2h-summary__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.h2h-summary__lead {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
}

.h2h-summary__shared {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
}

.h2h-round {
  margin-bottom: var(--space-3);
  overflow: hidden;
}

/* Round name, the two scores in fixed columns so they line up from round
   to round, and who won it. */
.h2h-round__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  list-style: none;
}

.h2h-round__summary::-webkit-details-marker {
  display: none;
}

.h2h-round__summary:hover {
  background-color: var(--surface-sunken);
}

.h2h-round__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}

/* A chevron that turns when the round is open. */
.h2h-round__name::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.h2h-round[open] .h2h-round__name::before {
  transform: rotate(45deg);
}

.h2h-round__points {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.h2h-round__points--left {
  text-align: right;
}

.h2h-round__points.is-ahead {
  color: var(--text);
}

.h2h-round__points.is-ahead.is-final {
  color: var(--accent-text);
}

.h2h-round__result {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: right;
}

.h2h-lineups {
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-5) var(--space-3);
}

/* Left player, slot, right player: the two in each slot face each other
   across the middle. */
.h2h-lineups__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.75rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.h2h-lineups__row + .h2h-lineups__row {
  border-top: 1px dashed var(--border);
}

.h2h-lineups__row > .pos {
  justify-self: center;
}

.h2h-player {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.h2h-player--left {
  flex-direction: row-reverse;
  text-align: right;
}

.h2h-player__photo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: top center;
  background-color: var(--surface-sunken);
}

.h2h-player__photo.player-photo--fallback {
  font-size: var(--text-xs);
}

.h2h-player__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.h2h-player__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h2h-player__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.h2h-player__points {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Phones: the round's name and its two scores on one line, the result
   under them, and the lineups without photos so the names have room. */
@media (max-width: 600px) {
  .h2h-summary {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2) var(--space-3);
  }

  .h2h-summary__name {
    font-size: var(--text-lg);
  }

  .h2h-round__summary {
    grid-template-columns: minmax(0, 1fr) 3.75rem 3.75rem;
    gap: 0 var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .h2h-round__points {
    font-size: var(--text-lg);
    text-align: right;
  }

  .h2h-round__result {
    grid-column: 1 / -1;
    padding-left: calc(0.45rem + var(--space-2) + 2px);
    font-size: var(--text-xs);
    text-align: left;
  }

  .h2h-lineups {
    padding: var(--space-1) var(--space-3) var(--space-2);
  }

  .h2h-lineups__row {
    grid-template-columns: minmax(0, 1fr) 3.25rem minmax(0, 1fr);
    gap: var(--space-2);
  }

  .h2h-player__photo {
    display: none;
  }

  .h2h-player__name {
    white-space: normal;
    font-size: var(--text-sm);
  }

  .h2h-player__meta {
    font-size: var(--text-xs);
  }
}

/* Background jobs (admin) ------------------------------------------------
   Whether Solid Queue's worker is running and how many jobs are in each
   state, then the failed jobs as cards with their errors, then the
   scheduled tasks. */
.jobs-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.jobs-status__worker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.jobs-status__note {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.jobs-status__counts {
  display: flex;
  gap: var(--space-5);
  margin: 0;
}

.jobs-status__count {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jobs-status__count dt {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.jobs-status__count dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.jobs-status__count--alert dd {
  color: var(--danger-text);
}

.jobs-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.jobs-section__header .section__title {
  margin: 0;
}

.jobs-section__actions,
.jobs-failed__actions {
  display: flex;
  gap: var(--space-2);
}

.jobs-empty {
  color: var(--accent-text);
  font-weight: 600;
}

.jobs-failed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.jobs-failed__job {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--danger);
}

.jobs-failed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.jobs-failed__what {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.jobs-failed__name {
  font-family: var(--font-numeric);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.jobs-failed__args {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.jobs-failed__when {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.jobs-failed__error {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background-color: var(--danger-soft);
  color: var(--danger-text);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.jobs-failed__error code {
  font-weight: 700;
}

.jobs-failed__backtrace {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.jobs-failed__backtrace summary {
  cursor: pointer;
  color: var(--text-secondary);
}

.jobs-failed__backtrace pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background-color: var(--surface-sunken);
  font-size: var(--text-xs);
  line-height: 1.5;
}
/*
 * Application stylesheet manifest.
 *
 * Files are required explicitly (rather than with require_tree) so the
 * cascade order is predictable: tokens first, then element defaults, then
 * layout, then components, then page-specific rules.
 *









 */
