/* ChessAt UI — product surfaces (home, overview). Tokens override template defaults. */

:root {
  --ca-ink: #141414;
  --ca-ink-soft: #2a2a2a;
  --ca-paper: #fafafa;
  --ca-surface: #ffffff;
  --ca-line: #e4e4e4;
  --ca-muted: #6f6f6f;
  --ca-accent: #a67c00;
  /* Accent as text: --ca-accent is 3.8:1 on white, below WCAG AA for small text */
  --ca-accent-text: #8a6700;
  --ca-accent-soft: #f3ead0;
  --ca-live: #9f1239;
  --ca-live-soft: #fff1f2;
  --ca-danger: #b42318;
  /* A gain / a loss as text (the club ranking's ± column) */
  --ca-gain: #2f6b3a;
  --ca-loss: #a33b2b;
  --ca-mark-inaccuracy: #8a6700;
  --ca-mark-mistake: #c2410c;
  --ca-mark-blunder: #b91c1c;
  /* Eval graph: fixed colours in both themes, like the eval bar. */
  --ca-graph-black: #1c1c1c;
  --ca-graph-white: #f3f3f3;
  --ca-graph-mid: #8a8a8a;
  --ca-graph-inaccuracy: #e3b341;
  --ca-graph-mistake: #fb923c;
  --ca-graph-blunder: #f87171;
  --ca-board-edge: #d6d3d1;
  /* Inverse chrome: stays dark in both themes (header, active fills) */
  --ca-chrome: #141414;
  --ca-on-chrome: #ffffff;
  /* Hairline on the chrome (the collapsed header menu's divider) */
  --ca-chrome-line: rgba(255, 255, 255, 0.14);
  /* Syne has no Cyrillic and no ə: those letters fall back to Source Sans 3 (self-hosted Cyrillic and latin-ext
     subsets, fonts.css) before the system font. */
  --ca-font-display: "Syne", "Source Sans 3", "Helvetica Neue", sans-serif;
  --ca-font-body: "Source Sans 3", "Helvetica Neue", sans-serif;

  /* Align legacy tokens used by watch / body */
  --background: var(--ca-paper);
  --color: var(--ca-ink);
  --arrow-color: var(--ca-accent);
}

[data-theme="dark"] {
  --ca-ink: #f5f5f5;
  --ca-ink-soft: #e5e5e5;
  --ca-paper: #171717;
  --ca-surface: #222222;
  --ca-line: #333333;
  --ca-muted: #a3a3a3;
  --ca-accent: #d4a017;
  --ca-accent-text: #d4a017;
  --ca-accent-soft: #3a3010;
  --ca-live: #fb7185;
  --ca-live-soft: #3f1219;
  --ca-danger: #f87171;
  --ca-gain: #7dba88;
  --ca-loss: #e08a7a;
  --ca-mark-inaccuracy: #e3b341;
  --ca-mark-mistake: #fb923c;
  --ca-mark-blunder: #f87171;
  --ca-board-edge: #404040;
  --ca-chrome: #0a0a0a;
  --ca-on-chrome: #f5f5f5;
  --ca-chrome-line: rgba(245, 245, 245, 0.14);
  --background: var(--ca-paper);
  --color: var(--ca-ink);
  --arrow-color: var(--ca-accent);
}

body {
  font-family: var(--ca-font-body);
  color: var(--ca-ink);
  background-color: var(--ca-paper);
}

/* Bootstrap 4 reboot spacing the watch/analysis controls were laid out with (only Bootstrap 5 CSS is loaded) */
label {
  margin-bottom: 0.5rem;
}

/* —— Header —— */
.header_section {
  background-color: var(--ca-chrome) !important;
  border-bottom: 1px solid transparent;
}
.header_section .navbar {
  min-height: 3.25rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}
.navbar-brand.ca-wordmark,
.header_section .navbar-brand.ca-wordmark {
  font-family: var(--ca-font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: #fff !important;
  padding: 0.25rem 0;
  margin-right: 1rem;
  line-height: 1;
}
.navbar-brand.ca-wordmark:hover {
  color: #fff !important;
  opacity: 0.9;
}
/* One centre line for the whole header: the nav list centres its items, links / search / theme
   toggle share one height (2.25rem), and style.css's 10px link margins are reset. */
.header_section .navbar-nav {
  align-items: center;
  gap: 0.25rem;
}
.custom_nav-container.navbar-expand-lg .navbar-nav .nav-link {
  display: flex;
  align-items: center;
  height: 2.25rem;
  margin: 0;
  font-family: var(--ca-font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0 0.75rem !important;
}
.custom_nav-container.navbar-expand-lg .navbar-nav .nav-link:hover {
  color: #fff !important;
}
.header_section .user_option,
.header_section .nav_search-btn {
  display: none !important;
}
/* Site navigation (views/layouts/main.php, spec-site-discovery story 1): primary links next to the wordmark, the
   utilities (search, settings, account) apart at the end; the current section's link (aria-current "page" on that
   page itself, "true" elsewhere in the section) is underlined. */
.ca-nav .nav-link:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
  box-shadow: none;
}
.custom_nav-container.navbar-expand-lg .ca-nav__primary .nav-link[aria-current="page"],
.custom_nav-container.navbar-expand-lg .ca-nav__primary .nav-link[aria-current="true"] {
  color: var(--ca-on-chrome) !important;
  text-decoration-line: underline;
  text-decoration-color: var(--ca-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
.custom_nav-container.navbar-expand-lg .ca-nav__user {
  max-width: 100%;
  background: none;
  border: 0;
  border-radius: 0;
}
.ca-nav__user-name {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.ca-nav__user::after {
  margin-left: 0.4em;
}
/* The organizer call to action (views/layouts/main.php #nav-organize): an outlined accent pill on the bar, a full-width
   button at the bottom of the collapsed phone menu; current (an organizer page) = filled. */
.custom_nav-container.navbar-expand-lg .navbar-nav .nav-link.ca-nav__cta {
  gap: 0.35rem;
  height: 2rem;
  padding: 0 0.85rem !important;
  border: 1.5px solid var(--ca-accent);
  border-radius: 999px;
  color: #fff !important;
  white-space: nowrap;
}
.custom_nav-container.navbar-expand-lg .navbar-nav .nav-link.ca-nav__cta:hover,
.custom_nav-container.navbar-expand-lg .navbar-nav .nav-link.ca-nav__cta[aria-current] {
  background: var(--ca-accent);
  color: var(--ca-chrome) !important;
}
.ca-nav__cta-plus {
  font-weight: 700;
  line-height: 1;
}
@media (min-width: 992px) {
  /* style.css shades the collapsed menu up to 992px inclusive; the expanded bar starts at 992px. */
  .header_section .navbar-collapse {
    background-color: transparent;
  }
  .ca-nav__utils {
    margin-left: auto;
    padding-left: 0.75rem;
  }
  .header_section .ca-nav__account .dropdown-menu {
    top: calc(100% + 6px);
    right: 0;
    left: auto;
  }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Four primary links, the organizer call to action, the search box and a username on one line from 992px on: the
     search box is a magnifier button that opens over the call to action while it is focused or holds a query (a
     5.5rem box showed "Searc"). */
  .ca-nav__utils .ca-player-search {
    width: 2.25rem;
    height: 2.25rem;
  }
  .ca-nav__utils .ca-player-search__input {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 2.25rem;
    max-width: none;
    padding-right: 0;
    cursor: pointer;
    transition: width 0.15s ease;
  }
  .ca-nav__utils .ca-player-search__input::placeholder {
    color: transparent;
  }
  .ca-nav__utils .ca-player-search__input:focus,
  .ca-nav__utils .ca-player-search__input:not(:placeholder-shown) {
    width: 14rem;
    padding-right: 0.65rem;
    cursor: text;
    background-color: var(--ca-chrome);
  }
  .ca-nav__utils .ca-player-search__input:focus::placeholder {
    color: rgba(255, 255, 255, 0.65);
  }
  .custom_nav-container.navbar-expand-lg .navbar-nav .nav-link {
    padding: 0 0.5rem !important;
    white-space: nowrap;
  }
  .header_section .navbar-nav {
    gap: 0.1rem;
  }
  .ca-nav__utils {
    padding-left: 0.25rem;
  }
  .custom_nav-container.navbar-expand-lg .navbar-nav .nav-link.ca-nav__cta {
    padding: 0 0.6rem !important;
    font-size: 0.88rem;
  }
  .ca-nav__user-name {
    max-width: 4.5rem;
  }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  /* The same line with the organizer call to action: a narrower search box and username. */
  .ca-nav__utils .ca-player-search__input {
    width: 10rem;
  }
  .ca-nav__user-name {
    max-width: 8rem;
  }
}
@media (max-width: 991.98px) {
  /* Collapsed menu (phones): the primary links, then the utilities under a rule. */
  .ca-nav__primary {
    padding-top: 0.25rem;
  }
  .ca-nav__utils {
    margin-top: 0.5rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--ca-chrome-line);
  }
  .ca-nav__account {
    text-align: center;
  }
  .ca-nav__organize {
    order: 99;
    align-self: stretch;
    margin-top: 0.5rem;
  }
  .custom_nav-container.navbar-expand-lg .navbar-nav .nav-link.ca-nav__cta {
    justify-content: center;
    height: 2.75rem;
  }
  .header_section .ca-nav__account .dropdown-menu {
    margin-bottom: 0.25rem;
  }
}

#main-container.container {
  max-width: 1100px;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* Visually hidden, read by assistive tech (Font Awesome's copy of this rule loads late or not at all). */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* —— Homepage —— */
.site-index {
  padding-bottom: 2rem;
}
.site-index-hero {
  text-align: center;
  padding: 2.5rem 0.5rem 2rem;
}
.site-index-title {
  margin: 0 0 0.85rem;
  font-size: inherit;
  line-height: inherit;
}
.site-index-brand {
  display: block;
  font-family: var(--ca-font-display);
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ca-ink);
  margin: 0 0 0.6rem;
}
.site-index-tagline {
  display: block;
  font-family: var(--ca-font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ca-ink-soft);
}
.site-index-lede {
  font-family: var(--ca-font-body);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--ca-muted);
  max-width: 28rem;
  margin: 0 auto 2rem;
  line-height: 1.45;
}
.site-index-section-label {
  font-family: var(--ca-font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0 0 1.25rem;
  text-align: center;
}
.site-index-section-label--finished {
  margin-top: 3rem;
}

.site-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1rem 1.15rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.site-index-card {
  position: relative;
  display: block;
  text-decoration: none !important;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  padding: 1.1rem 1.15rem 1.15rem;
  transition: border-color 0.15s ease;
}
.site-index-card:hover {
  border-color: var(--ca-ink);
  color: var(--ca-ink);
}
.site-index-card--live {
  border-left: 3px solid var(--ca-live);
}
.site-index-card-title {
  font-family: var(--ca-font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--ca-ink);
  margin: 0 0 0.45rem;
  line-height: 1.2;
  padding-right: 3.25rem;
}
.site-index-card-alt {
  margin: -0.2rem 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ca-ink-soft);
}
.site-index-card-desc {
  font-family: var(--ca-font-body);
  font-size: 0.92rem;
  color: var(--ca-muted);
  margin: 0 0 0.65rem;
  line-height: 1.4;
}
.site-index-card-meta {
  font-family: var(--ca-font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0 0 0.85rem;
}
.site-index-card-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--ca-line);
}
.site-index-card-stat__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ca-muted);
}
.site-index-card-stat__value {
  font-family: var(--ca-font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ca-ink);
  line-height: 1;
}
.site-index-card-elite {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}
.site-index-card-elite__label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ca-accent-text);
  margin-right: 0.4rem;
}
.site-index-card-elite__names {
  color: var(--ca-ink-soft);
}
.site-index-card-elite__more {
  color: var(--ca-muted);
  font-weight: 600;
}
.site-index-live-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  background: var(--ca-live);
  color: #fff;
  font-family: var(--ca-font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 2px;
}
[data-theme="dark"] .site-index-live-badge {
  /* white on the dark-theme pink is 2.7:1 */
  color: #141414;
}
/* Community broadcast cards (spec-self-service-broadcast story 6): the organizer badge and the delay label. */
.site-index-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding-right: 3.5rem; /* clear of the live badge */
}
.site-index-community-badge,
.site-index-delay-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--ca-line);
  color: var(--ca-ink-soft);
  overflow-wrap: anywhere;
}
.site-index-delay-badge {
  color: var(--ca-muted);
}
.site-index-community,
.site-index-upcoming {
  margin-top: 2.5rem;
}
h2.site-index-section-label {
  line-height: 1.4;
}
.site-index-finished .site-index-card-stat__value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ca-ink-soft);
}
.site-index-finished .site-index-card-stat {
  margin-bottom: 0.4rem;
  padding-top: 0.45rem;
}
.site-index-empty {
  text-align: center;
  color: var(--ca-muted);
  font-size: 1rem;
  padding: 1.5rem;
}

.site-index-more {
  text-align: center;
  margin: 1.75rem 0 0;
}
.site-index-more a {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  font-weight: 600;
  color: var(--ca-ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.site-index-more a:hover,
.site-index-more a:focus-visible {
  border-color: var(--ca-ink);
  color: var(--ca-ink);
}

/* —— /tournaments —— */
.tournaments-page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 0.5rem 3rem;
}
.tournaments-page__title {
  margin: 0 0 0.35rem;
  font-family: var(--ca-font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--ca-ink);
}
.tournaments-page__lede {
  margin: 0;
  color: var(--ca-muted);
}
.tournaments-page__group-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ca-line);
  font-family: var(--ca-font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ca-ink);
}
.tournaments-page__count {
  font-family: var(--ca-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ca-muted);
}
.tournaments-page .site-index-grid {
  max-width: none;
  padding: 0;
}

/* The links pair "Broadcasts" / "Community tournaments" under the page head (spec-community-tournaments CAP-1): the
   tabs of .ca-club__tabs, as two links. */
.tournaments-page__links {
  margin-top: 1.5rem;
}
.tournaments-page__links .ca-club__tabs {
  margin-bottom: 0;
}
.tournaments-page__links + .tournaments-page__group .tournaments-page__group-title {
  margin-top: 1.75rem;
}
/* Community tournament cards (views/site/_community-cards.php): a card with two links, the tournament and its club,
   not one big link. Colours come from the tokens, so both themes follow. */
.ca-ct-card,
.ca-ct-card:hover {
  border-color: var(--ca-line);
  min-width: 0;
}
.ca-ct-card__badges {
  margin: 0 0 0.5rem;
}
.ca-ct-card__title {
  padding-right: 0;
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
}
.ca-ct-card__title a {
  color: var(--ca-ink);
  text-decoration: none;
}
.ca-ct-card__title a:hover,
.ca-ct-card__title a:focus-visible {
  color: var(--ca-ink);
  text-decoration: underline;
}
.ca-ct-card__club {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ca-muted);
  overflow-wrap: anywhere;
}
.ca-ct-card__club a {
  color: var(--ca-ink-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ca-ct-card__club a:hover,
.ca-ct-card__club a:focus-visible {
  color: var(--ca-ink);
}
.ca-ct-card__title a:focus-visible,
.ca-ct-card__club a:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-ct-card__meta {
  margin-bottom: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ca-ct-card__fact {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ca-ink);
  overflow-wrap: anywhere;
}
.ca-ct-card__fact--soft {
  margin-top: 0.2rem;
  color: var(--ca-muted);
}
/* /clubs (spec-community-tournaments CAP-3): the clubs' tournaments above the club list, as the same cards. The
   grid fills the page column like on the community tournaments page. */
.ca-club-tournaments {
  margin: 0 0 1.75rem;
}
.ca-club-tournaments__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
}
.ca-club-tournaments__head .ca-club__subtitle {
  margin: 0;
}
.ca-club-tournaments__all {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ca-ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ca-club-tournaments__all:hover,
.ca-club-tournaments__all:focus-visible {
  color: var(--ca-ink);
}
.ca-club-tournaments__all:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-club-tournaments .site-index-grid {
  max-width: none;
  padding: 0;
}
.ca-ct-empty {
  margin-top: 2rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--ca-muted);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
.ca-ct-empty p {
  margin: 0 0 0.5rem;
}
.ca-ct-empty p:last-child {
  margin-bottom: 0;
}
.ca-ct-empty a {
  font-weight: 600;
  color: var(--ca-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Overview —— */
.overview-header {
  text-align: left;
  margin: 0.5rem 0 1.25rem;
  padding: 0 4px;
}
.overview-local-name {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ca-muted);
}
/* Title and live pill on one row: the pill sits on the title's first line (spec-tournament-page CAP-1). */
.overview-header__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.overview-header h1 {
  font-family: var(--ca-font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ca-ink);
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.overview-live-pill {
  display: inline-block;
  flex: none;
  position: relative;
  top: -0.2em;
  background: var(--ca-live-soft);
  color: var(--ca-live);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
  text-transform: uppercase;
}
/* PGN downloads under the boards (broadcast story 4). */
/* "Round N in brief" under the boards (spec-seo-recovery CAP-4). */
.round-summary {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ca-line);
  border-radius: 8px;
  color: var(--ca-ink);
}
.round-summary__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.round-summary__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ca-muted);
  font-size: 0.9rem;
}
.round-summary__counts strong {
  color: var(--ca-ink);
}
.round-summary__line {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}
.overview-pgn {
  margin: 0.5rem 0 0;
  color: var(--ca-muted);
  font-size: 0.85rem;
}
/* A community broadcast's delay (spec-self-service-broadcast story 4), beside the live pill. */
.overview-delay-pill {
  display: inline-block;
  flex: none;
  position: relative;
  top: -0.2em;
  color: var(--ca-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--ca-line);
  white-space: nowrap;
}
/* Next round countdown (spec-next-round-countdown): "Round 2 in 2 hours" and its start time, beside the live pill, in
   the boards page's empty state and in the live cards' meta line. web/js/site.js relabels it and hides it ([hidden]). */
.next-round[hidden] {
  display: none !important;
}
.next-round--pill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 0.5em;
  flex: none;
  position: relative;
  top: -0.2em;
  color: var(--ca-accent-text);
  background: var(--ca-accent-soft);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}
.next-round--pill .next-round__time {
  color: var(--ca-muted);
  font-weight: 500;
}
.next-round--empty {
  margin: 0 0 0.75rem;
  color: var(--ca-ink);
}
.next-round--empty .next-round__label {
  display: block;
  font-family: var(--ca-font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.next-round--empty .next-round__time {
  display: block;
  color: var(--ca-muted);
  font-size: 0.95rem;
}
.overview-empty__wait {
  margin: 0;
}
.next-round--card {
  color: var(--ca-accent-text);
}
/* A community broadcast's report link (spec-self-service-broadcast story 6): quiet, after the pills. */
.overview-report-link {
  flex: none;
  position: relative;
  top: -0.2em;
  margin-left: auto;
  font-size: 12px;
  color: var(--ca-muted);
  text-decoration: underline;
  white-space: nowrap;
}
.overview-report-link:hover,
.overview-report-link:focus {
  color: var(--ca-ink);
}
@media screen and (max-width: 767.98px) {
  .overview-header {
    margin: 0 0 0.75rem;
  }
  /* Phones: at most two lines of title (the full name stays in the text and the title attribute; a tap opens it). */
  .overview-header h1 {
    font-size: clamp(1.05rem, 4.4vw + 0.1rem, 1.2rem);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .overview-header.is-expanded h1 {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
  }
  .overview-local-name {
    margin-top: 0.1rem;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .overview-header.is-expanded .overview-local-name {
    white-space: normal;
  }
}

.overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0 4px 1rem;
  border-bottom: 1px solid var(--ca-line);
}
.overview-toolbar__primary {
  display: flex;
  flex: 1 1 20rem;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  min-width: 0;
  max-width: 100%;
}
.section-control label,
.page-size-control label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin-right: 0.5rem;
  display: block;
  margin-bottom: 0.25rem;
}
/* Boards per page: label and select on one line; in the toolbar on desktop, under the boards on phones (CAP-4). */
.page-size-control {
  display: flex;
  flex: none;
  align-items: center;
  margin-left: auto;
}
.page-size-control label {
  display: inline;
  margin-bottom: 0;
}
.page-size-control--footer {
  display: none;
}
.section-control select,
#sectionSelect {
  font-family: var(--ca-font-body);
  font-weight: 600;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  padding: 0.35rem 0.6rem;
  min-width: 14rem;
  max-width: 100%;
}
.player-identity {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
  overflow: visible;
}
.player-flag {
  flex-shrink: 0;
  border-radius: 1px;
  object-fit: cover;
  align-self: center;
}
.player-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ca-accent-text);
  flex-shrink: 0;
}
/* Event score right after the rating, set apart by a dot; the name gives way first (spec-watch-page CAP-11). */
.player-event-score {
  position: relative; /* keeps the absolute .sr-only label inside the bar */
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ca-muted);
  white-space: nowrap;
}
.player-event-score[hidden] {
  display: none;
}
.player-event-score::before {
  content: "·";
  margin-right: 0.35rem;
}
.player-name-text {
  font-family: var(--ca-font-body);
  font-weight: 600;
  color: var(--ca-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.55;
  /* expand border box so Chromium overflow clipping keeps descenders */
  padding: 0.2em 0 0.28em;
  margin: -0.15em 0 -0.1em;
}
a.player-name-link {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a.player-name-link:hover,
a.player-name-link:focus-visible {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
  outline: none;
}

/* Rounds: one strip that scrolls sideways, the selected round brought into view (site.js [data-ca-strip]; CAP-3). */
.round-navigation {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}
.round-strip {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
}
.round-navigation .label {
  flex: none;
  font-family: var(--ca-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin-right: 1rem;
}
.round-link {
  display: inline-block;
  flex: none;
  position: relative;
  padding: 0.4rem 0.85rem;
  margin: 0 0.15rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  text-decoration: none;
  color: var(--ca-muted);
  font-family: var(--ca-font-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.round-link:hover {
  color: var(--ca-ink);
  background: transparent;
  text-decoration: none;
}
.round-link.active {
  color: var(--ca-ink);
  background: transparent;
  border-bottom-color: var(--ca-accent);
}
.round-link.is-latest:not(.active) {
  border-bottom-style: solid;
  border-bottom-color: var(--ca-muted);
}
.round-link:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}
/* Live dot on the latest round of a live tournament. */
.round-link__live {
  position: absolute;
  top: 0.35rem;
  right: 0.3rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ca-live);
}
@media screen and (max-width: 767.98px) {
  .overview-toolbar {
    display: block;
    margin: 0 0 1rem;
    padding: 0 4px 0.5rem;
  }
  .overview-toolbar__primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .overview-toolbar__primary > * {
    max-width: 100%;
  }
  .overview-toolbar__primary .results-mode-tabs {
    align-self: flex-start;
  }
  .section-control select,
  #sectionSelect {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    font-size: 1rem;
  }
  .round-navigation .label {
    display: none;
  }
  .round-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.6rem;
    margin: 0;
  }
  .page-size-control--toolbar {
    display: none;
  }
  .page-size-control--footer {
    display: flex;
    margin-left: 0;
  }
  .page-size-control select {
    min-height: 2.75rem;
    font-size: 1rem;
  }
}

.page-size-control label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin-right: 0.5rem;
}
.page-size-control select,
#pageSizeSelect {
  font-family: var(--ca-font-body);
  font-weight: 600;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  padding: 0.25rem 0.5rem;
}

/* Boards in equal columns that fill the width: 1 on phones, 2 from 576px, 3 from 992px (and on short landscape
   phones), 4 from 1240px, where boards stay at least 260px in the tournament pages' wider container
   (spec-tournament-page CAP-6). */
.tournament-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  padding: 0.5rem 4px 1.5rem;
}
@media (min-width: 576px) {
  .tournament-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 992px), (min-width: 576px) and (max-height: 500px) and (orientation: landscape) {
  .tournament-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1240px) {
  .tournament-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* The tournament pages (views/game/_tournament_header.php sets the class) share one container: wider on large
   screens, tighter on phones, so switching tabs never moves the header. */
@media (min-width: 1200px) {
  #main-container.container.container--tournament {
    max-width: 1320px;
  }
}
.container--tournament .results-page {
  max-width: none;
}
@media screen and (max-width: 767.98px) {
  #main-container.container.container--tournament {
    padding-top: 0.5rem;
  }
  .container--tournament .overview-header {
    margin-bottom: 0.5rem;
  }
}
@media screen and (max-width: 767.98px) {
  /* Phones: the whole first board card fits a 320x640 screen, a Turkish local-name line included. */
  .overview-page .overview-toolbar__primary {
    gap: 0.4rem;
  }
  .overview-page .overview-toolbar {
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .overview-page .tournament-overview {
    padding-top: 0;
    row-gap: 1rem;
  }
  .overview-page .overview-match {
    flex-wrap: nowrap;
    margin-bottom: -0.6rem;
    padding-bottom: 0.2rem;
    font-size: 0.88rem;
    line-height: 1.2;
  }
  /* One line on phones: long club names are cut (the heading text keeps them whole). */
  .overview-page .overview-match__team {
    flex: 1 1 0;
    overflow: hidden;
  }
  .overview-page .overview-match__team--away {
    justify-content: flex-end;
  }
  .overview-page .overview-match__name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .overview-page .overview-match__score {
    flex: none;
  }
  .overview-page .player-row {
    padding: 0.25rem 0;
  }
}
@media screen and (max-width: 359.98px) {
  /* Smallest phones (320px): a team event's match header and a Turkish local name still leave the first card
     on a 640px screen. */
  #main-container.container.container--tournament {
    padding-top: 0.25rem;
  }
  .container--tournament .overview-header {
    margin-bottom: 0.35rem;
  }
  .overview-page .overview-toolbar__primary {
    gap: 0.3rem;
  }
  .overview-page .overview-toolbar {
    margin-bottom: 0;
  }
  .overview-page .tournament-overview {
    padding-top: 0.3rem;
  }
  .overview-page .overview-match {
    margin-bottom: -0.75rem;
    font-size: 0.82rem;
  }
  .overview-page .overview-match:first-child {
    margin-top: -0.3rem;
  }
  .overview-page .overview-match__score {
    padding: 0 0.35rem;
    border-color: transparent;
  }
  .overview-page .player-row {
    padding: 0.2rem 0;
  }
}
.game-item {
  text-align: left;
  min-width: 0;
}
/* Phones: section and rounds at the top once the toolbar's round row has scrolled away (spec-tournament-page
   CAP-8; shown by the boards page's script, `hidden` otherwise). */
.overview-stickybar {
  display: none;
}
@media screen and (max-width: 767.98px) {
  .overview-stickybar:not([hidden]) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px; /* 44px controls; grows with a larger root font, the scroll padding follows */
    padding: 0 16px;
    background: var(--ca-paper);
    border-bottom: 1px solid var(--ca-line);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }
  .overview-stickybar .section-control {
    flex: 0 1 42%;
    min-width: 0;
  }
  .overview-stickybar .round-navigation {
    flex: 1 1 0;
    min-width: 0;
  }
  html.has-stickybar-page {
    scroll-padding-top: calc(var(--ca-stickybar-h, 48px) + 8px);
  }
}

/* List view on phones (spec-tournament-page CAP-9): a toggle beside the rounds; one row per game while
   html.ca-list-view (set before the first paint from the viewer's stored choice). */
.overview-roundrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}
.overview-roundrow .round-navigation {
  flex: 1 1 auto;
}
.overview-view-toggle,
.game-line {
  display: none;
}
@media screen and (max-width: 767.98px) {
  .overview-view-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--ca-line);
    border-radius: 2px;
    background: var(--ca-surface);
    color: var(--ca-ink);
    cursor: pointer;
  }
  .overview-view-toggle[aria-pressed="true"] {
    background: var(--ca-chrome);
    border-color: var(--ca-chrome);
    color: var(--ca-on-chrome);
    box-shadow: inset 0 0 0 2px var(--ca-accent); /* tells the states apart in dark too */
  }
  .overview-view-toggle:focus-visible {
    outline: 2px solid var(--ca-accent);
    outline-offset: 2px;
  }
  html.ca-list-view .tournament-overview {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }
  html.ca-list-view .tournament-overview .game-item > :not(.game-line) {
    display: none;
  }
  html.ca-list-view .tournament-overview .overview-match {
    margin: 0.75rem 0 0;
  }
  html.ca-list-view .tournament-overview .overview-match:first-child {
    margin-top: 0;
  }
  html.ca-list-view .tournament-overview .game-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--ca-line);
    color: var(--ca-ink);
    text-decoration: none;
  }
  .game-line:hover,
  .game-line:active {
    background: var(--ca-accent-soft);
  }
  .game-line:focus-visible {
    outline: 2px solid var(--ca-accent);
    outline-offset: -2px;
  }
  .game-line__players {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
  }
  .game-line__side {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.3;
  }
  /* Which player has White: a light and a dark square before the names. */
  .game-line__colour {
    flex: none;
    width: 8px;
    height: 8px;
    border: 1px solid var(--ca-muted);
    border-radius: 1px;
  }
  .game-line__colour--white {
    background: #fff;
  }
  .game-line__colour--black {
    background: #1c1c1c;
  }
  .game-line__name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .game-line__result {
    flex: none;
    min-width: 2.5rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .game-line__result.is-running::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ca-live);
  }
}

/* Board number of a card (within its match on team events) and team match headers (spec-tournament-page CAP-7). */
.game-item__no,
.game-line__no {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 0.2rem;
  margin-right: 0.4rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ca-muted);
  font-variant-numeric: tabular-nums;
}
.overview-match {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0.25rem 0 -0.75rem;
  padding: 0 0 0.3rem;
  border-bottom: 1px solid var(--ca-line);
  font-family: var(--ca-font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ca-ink);
}
.overview-match:first-child {
  margin-top: 0;
}
.overview-match__team {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.overview-match__score {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0.05rem 0.45rem;
  border-radius: 2px;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
}
.overview-match__score.is-running {
  color: var(--ca-live);
}
.overview-match__score.is-running::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--ca-live);
  vertical-align: 0.15em;
}
.overview-match__score:not(.is-running) .overview-match__state {
  display: none;
}
.overview-board-row {
  display: flex;
  overflow: hidden; /* a board waiting for its resize never spills into the next column */
  align-items: stretch;
  gap: 4px;
  margin-bottom: 0.35rem;
}
.overview-board-row .game-board {
  flex: none; /* width set by the page's sizeBoardBox(): 8 squares + borders */
  margin-bottom: 0;
}
.game-board {
  border: 1px solid var(--ca-board-edge);
  margin-bottom: 0.35rem;
  background: var(--ca-surface);
}
.game-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.game-link:hover .game-board {
  border-color: var(--ca-ink);
}
.overview-eval-bar {
  position: relative;
  flex: 0 0 12px;
  width: 12px;
  min-height: 120px;
  background: #1c1c1c;
  border: 1px solid var(--ca-board-edge);
  overflow: hidden;
  align-self: stretch;
}
.overview-eval-bar__white {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: #f3f3f3;
  transition: height 0.45s ease;
}
/* A team board drawn from Black's side (home team with Black at the bottom): White's share grows from the top. */
.overview-eval-bar--flipped .overview-eval-bar__white {
  top: 0;
  bottom: auto;
}
.overview-eval-bar__label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  writing-mode: vertical-rl;
  font-family: var(--ca-font-body);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #888;
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}
.overview-eval-bar--white-lead .overview-eval-bar__label {
  color: #222;
}
.overview-eval-bar--black-lead .overview-eval-bar__label {
  color: #eee;
}
.player-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  overflow: visible;
}
.player-name {
  font-family: var(--ca-font-body);
  font-weight: 600;
  color: var(--ca-ink);
}
/* The player's team code beside the clock / score on team boards, from 768px (phones keep the space). */
.player-team {
  display: none;
}
@media (min-width: 768px) {
  .player-team {
    display: inline;
    margin-left: auto;
    color: var(--ca-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
}
.player-score,
.player-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ca-muted);
  text-align: right;
  white-space: nowrap;
}
.highlight {
  background-color: color-mix(in srgb, var(--ca-accent) 45%, transparent) !important;
}
.overview-empty {
  text-align: center;
  color: var(--ca-muted);
  padding: 3rem 1rem;
  font-size: 1.05rem;
}
.overview-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
}
.pagination {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.overview-footer .pagination {
  flex-wrap: wrap;
  row-gap: 4px;
  margin-bottom: 0;
}
@media screen and (max-width: 767.98px) {
  .overview-footer .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
.pagination .page-link {
  line-height: 1.25;
  color: var(--ca-ink);
  background-color: var(--ca-surface);
  border-color: var(--ca-line);
  border-radius: 2px;
  margin: 0 2px;
}
.pagination .page-link:hover {
  color: var(--ca-ink);
  background-color: var(--ca-accent-soft);
  border-color: var(--ca-line);
}
.pagination .active .page-link,
.pagination .page-item.active .page-link {
  background-color: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}

/* Soften / replace legacy template footers */
.info_section,
.footer_section {
  display: none;
}

.ca-site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--ca-line);
  background: var(--ca-surface);
  color: var(--ca-ink);
  font-family: var(--ca-font-body);
}
.ca-site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.75rem 2.5rem;
}
.ca-site-footer__name {
  font-family: var(--ca-font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: inline-block;
  margin-bottom: 0.25rem;
  color: var(--ca-ink);
  text-decoration: none;
}
.ca-site-footer__tag {
  margin: 0;
  color: var(--ca-muted);
  font-size: 0.95rem;
  max-width: 22rem;
}
.ca-site-footer__copy {
  margin: 0.75rem 0 0;
  color: var(--ca-muted);
  font-size: 0.85rem;
}
/* Three link columns (views/layouts/main.php #ca-footer-links): Explore, Organize, Site; two then one on phones. */
.ca-site-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(9rem, auto));
  gap: 1.5rem 3rem;
  font-size: 0.9rem;
}
.ca-site-footer__heading {
  margin: 0 0 0.6rem;
  font-family: var(--ca-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-site-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ca-site-footer__list li + li {
  margin-top: 0.35rem;
}
.ca-site-footer__list a {
  display: inline-block;
  padding: 0.1rem 0;
  color: var(--ca-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.ca-site-footer__list a:hover,
.ca-site-footer__name:hover {
  border-bottom-color: var(--ca-accent);
}
@media (max-width: 767.98px) {
  .ca-site-footer__nav {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }
  .ca-site-footer__list a {
    padding: 0.35rem 0; /* a 44px-ish touch row */
  }
}

/* —— Watch studio —— */
.watch-body {
  margin: 0;
  min-height: 100vh;
  background: var(--ca-paper);
  overflow-x: clip;
}
.watch-chrome-hotzone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  z-index: 25;
  /* Invisible hit strip so phone users can reveal the bar */
}
.watch-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-height: 3rem;
  border-bottom: 1px solid var(--ca-line);
  background: var(--ca-surface);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  transform: translateY(-100%);
  transition: transform 0.22s ease;
  pointer-events: none;
}
.watch-body.watch-chrome-visible .watch-topbar {
  transform: translateY(0);
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .watch-topbar {
    transform: none;
    pointer-events: auto;
    transition: none;
  }
}
.watch-topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 0.65rem;
  margin: 0;
  border-radius: 2px;
  color: var(--ca-ink);
  text-decoration: none;
  font-family: var(--ca-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.watch-topbar__back:hover,
.watch-topbar__back:focus {
  color: var(--ca-ink);
  text-decoration: none;
  background: var(--ca-accent-soft);
}
.watch-topbar__back i {
  font-size: 0.95rem;
}
.watch-topbar__brand {
  font-family: var(--ca-font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  color: var(--ca-ink);
  text-decoration: none;
  margin-left: 0.15rem;
}
.watch-topbar__brand:hover {
  color: var(--ca-ink);
  text-decoration: none;
}
@media (max-width: 420px) {
  .watch-topbar__back-label {
    font-size: 0.9rem;
  }
  .watch-chrome-hotzone {
    height: 22px;
  }
}
.watch-container.container {
  max-width: 520px;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.site-chessboard {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  font-family: var(--ca-font-body);
  color: var(--ca-ink);
}
.site-chessboard .player-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
  margin: 0.35rem 0;
  width: 100%;
  font-size: 0.95rem;
}
.site-chessboard .player-score {
  margin-right: 0.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--ca-accent-text);
  min-width: 1.1em;
}
.site-chessboard .player-name {
  flex-grow: 1;
  text-align: left;
  letter-spacing: -0.01em;
}
.site-chessboard .player-time {
  text-align: right;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--ca-muted);
  font-weight: 600;
}
.board-eval-wrap {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: 100%;
}
.board-stack {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.board-eval-wrap #board {
  width: 100%;
  margin-left: 0; /* legacy style.css pulls #board 15px left on phones */
  border: 1px solid var(--ca-board-edge);
}
.board-stack .arrow-container {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.85;
}
.board-stack .arrow-container[hidden] {
  display: none !important;
}
.board-stack .arrow {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.board-stack .arrow-shaft {
  stroke: var(--arrow-color);
  stroke-width: 10;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  fill: none;
}
.board-stack .arrow-head {
  fill: var(--arrow-color);
  stroke: none;
}
.eval-bar {
  position: relative;
  flex: 0 0 14px;
  width: 14px;
  align-self: stretch;
  min-height: 120px;
  background: #1c1c1c;
  border: 1px solid var(--ca-board-edge);
  overflow: hidden;
}
.eval-bar[hidden] {
  display: none !important;
}
.eval-bar__white {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: #f3f3f3;
  transition: height 0.45s ease;
}
.eval-bar--flipped .eval-bar__white {
  bottom: auto;
  top: 0;
}
.eval-bar__label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--ca-font-body);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #888;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}
.eval-bar--white-lead .eval-bar__label {
  color: #222;
}
.eval-bar--black-lead .eval-bar__label {
  color: #eee;
}
.site-chessboard .highlightFrom {
  background-color: color-mix(in srgb, var(--ca-accent) 55%, transparent) !important;
}
.site-chessboard .highlightTo {
  background-color: color-mix(in srgb, var(--ca-accent) 35%, transparent) !important;
}
.site-chessboard .highlightClicked {
  outline: 2px solid var(--ca-accent) !important;
  z-index: 1;
}

.move-buttons {
  display: flex;
  gap: 4px;
  margin: 0.5rem 0 0.65rem;
}
/* View switcher: phones only (the narrow studio below). */
.move-buttons .watch-tabs {
  display: none;
}
.move-buttons .btn {
  flex: 1 1 0;
  min-width: 0;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  color: var(--ca-ink);
  padding: 0.4rem 0.25rem;
  box-shadow: none;
  outline: none;
}
/* Kill sticky post-tap hover (and legacy style.css red hover) on touch */
.move-buttons button:hover,
.move-buttons .btn:hover,
.move-buttons .btn:focus {
  background: var(--ca-surface);
  border-color: var(--ca-line);
  color: var(--ca-ink);
}
@media (hover: hover) and (pointer: fine) {
  .move-buttons button:hover,
  .move-buttons .btn:hover {
    background: var(--ca-chrome);
    border-color: var(--ca-chrome);
    color: var(--ca-on-chrome);
  }
}
.move-buttons .btn:focus-visible {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.move-buttons .btn:active {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}

.watch-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.55rem;
}
.watch-tools__analyze,
.watch-tools__gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  margin: 0;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-surface);
  color: var(--ca-ink);
  font-family: var(--ca-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.watch-tools__gear {
  min-width: 2.75rem;
  padding: 0;
}
.watch-tools__analyze:hover,
.watch-tools__gear:hover,
.watch-tools__analyze:focus-visible,
.watch-tools__gear:focus-visible {
  background: var(--ca-accent-soft);
  border-color: var(--ca-line);
  color: var(--ca-ink);
  outline: none;
}
.watch-tools__analyze.is-on {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.watch-tools__analyze.is-on:hover,
.watch-tools__analyze.is-on:focus-visible {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.watch-tools__gear.settings-on {
  background: var(--ca-accent-soft);
  border-color: var(--ca-accent);
  color: var(--ca-ink);
}

.analyzeContainer {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  margin-bottom: 0.5rem;
}
#analysisSettingsContainer {
  padding: 0.5rem 0.65rem !important;
  border: 1px solid var(--ca-line);
  border-bottom: none;
  background: var(--ca-surface);
}
#engineSelect,
#valueDisplay {
  font-family: var(--ca-font-body);
  border: 1px solid var(--ca-line) !important;
  border-radius: 2px;
  background: var(--ca-paper);
  color: var(--ca-ink);
}
#depthSetting .btn,
#variationSetting .btn,
.analyzeContainer .btn-info {
  background: var(--ca-surface) !important;
  border: 1px solid var(--ca-line) !important;
  color: var(--ca-ink) !important;
  border-radius: 2px;
  padding: 0.15rem 0.45rem;
  box-shadow: none;
}
#depthSetting .btn:hover,
#variationSetting .btn:hover {
  background: var(--ca-chrome) !important;
  color: var(--ca-on-chrome) !important;
  border-color: var(--ca-chrome) !important;
}
.analyzeContainer > div:last-child,
.analyze-result-wrap {
  border: 1px solid var(--ca-line);
  background: var(--ca-surface);
  padding: 0.35rem 0.5rem;
}
.player-elo {
  color: var(--ca-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.site-chessboard .player-info .player-identity {
  flex: 1;
  min-width: 0;
}
.site-chessboard .player-name {
  /* legacy class unused when identity is present */
}
#result {
  color: var(--ca-ink);
}

#bottom-section {
  border: 1px solid var(--ca-line) !important;
  border-radius: 2px !important;
  background: var(--ca-surface);
  overflow: auto;
}
#movesContainer {
  padding: 0.25rem 0 0.5rem;
}
/* Focused only when a delete left no move to focus: inside the scrolling list, which would clip an outer outline. */
#movesContainer:focus {
  outline: none;
}
#movesContainer:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}

/* Move list: numbered rows, variation blocks under their move (spec-watch-page CAP-2). */
.ml {
  font-size: 0.95rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.ml-row {
  display: grid;
  grid-template-columns: 3rem 1fr 1fr;
  align-items: center;
  min-height: 1.45rem;
}
.ml-row--alt {
  background: var(--ca-paper);
}
.ml-num {
  padding-left: 0.65rem;
  font-size: 0.85rem;
  color: var(--ca-muted);
}
.site-chessboard .ml .ml-move {
  position: relative; /* keeps the absolute .sr-only time label inside the scrolling list */
  display: flex;
  flex-wrap: wrap; /* a long move with an h:mm:ss time puts the time on its own line, never in the next column */
  align-items: baseline;
  margin: 0;
  padding: 0.1rem 0.5rem;
  min-width: 0;
}
/* Mark (?! ? ??) and time spent inside the move cell; clicks still land on the move (spec-watch-page CAP-6, CAP-10). */
.ml-mark,
.ml-time {
  pointer-events: none;
}
.ml-mark {
  margin-left: 0.1rem;
  font-weight: 700;
}
.ml-mark--inaccuracy {
  color: var(--ca-mark-inaccuracy);
}
.ml-mark--mistake {
  color: var(--ca-mark-mistake);
}
.ml-mark--blunder {
  color: var(--ca-mark-blunder);
}
.ml-time {
  flex-shrink: 0;
  line-height: 1; /* the smaller text must not make the row taller (CAP-3 row count) */
  margin-left: auto;
  padding-left: 0.4rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ca-muted);
}
.site-chessboard .ml .bold {
  color: var(--ca-ink);
}
.site-chessboard .ml-skip {
  color: var(--ca-muted);
  cursor: default;
}
.ml-var {
  margin: 0.15rem 0.65rem 0.25rem 1.1rem;
  padding: 0.2rem 0 0.2rem 0.6rem;
  border-left: 2px solid var(--ca-line);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ca-muted);
}
.site-chessboard .ml-var .move {
  /* inline-block: adjacent move buttons have no spaces, so plain inline gives long lines nowhere to wrap */
  display: inline-block;
  position: relative; /* keeps the absolute .sr-only name prefix inside the scrolling list */
  margin-left: 0.1rem;
}
/* Variation moves in theme colours (the old .sub2-.sub9 tints are too faint on the dark theme). */
.site-chessboard .ml-var .subMove {
  color: var(--ca-ink-soft);
}
.ml-result {
  padding: 0.4rem 0.65rem;
  font-weight: 700;
  text-align: center;
  color: var(--ca-ink);
}

/* Move cells are buttons (spec viewer-polish CAP-3) that look like the list's text: no button chrome,
   the list's font and colours (the rules above and below, all more specific, set the rest). */
button.move {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-align: inherit;
  text-transform: none;
}
.site-chessboard .move {
  cursor: pointer;
  border-radius: 2px;
  padding: 0 2px;
}
.site-chessboard .move:hover {
  background: var(--ca-accent-soft);
}
/* Inside the cell: the scrolling list would clip an outline drawn outside the row's edge columns. */
.site-chessboard .ml .ml-move:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}
.site-chessboard .ml-var .move:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
.site-chessboard .bold {
  font-weight: 700;
  background: var(--ca-accent-soft);
}

/* Variation colors — muted neutrals/accent, no purple rainbow */
.subMove,
.sub1 { color: var(--ca-muted); }
.sub2 { color: #8a7340; }
.sub3 { color: #6b7280; }
.sub4 { color: #9a6b3f; }
.sub5 { color: #5c6b4a; }
.sub6 { color: #4b5563; }
.sub7 { color: #7c6f57; }
.sub8 { color: #57534e; }
.sub9 { color: #78716c; }
.delim,
.varFirst { color: var(--ca-muted); }

/* Delete controls after the current move (spec viewer-polish CAP-4): inline in a variation; in a numbered row,
   a line of their own under the moves, so White's and Black's columns stay in place. */
.ml-delete {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0.15rem 0 0.3rem;
  vertical-align: baseline;
}
.ml-row > .ml-delete {
  grid-row: 2;
  grid-column: 2 / -1;
  margin: 0.1rem 0.5rem 0.2rem;
}
.ml-row > .ml-move + .ml-move + .ml-delete {
  grid-column: 3; /* under Black's move */
}
.subVarDelete {
  font-family: var(--ca-font-body);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  padding: 0 5px;
  color: var(--ca-muted);
  background: var(--ca-surface);
}
button.subVarDelete {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ca-ink-soft);
  cursor: pointer;
}
button.subVarDelete:hover {
  border-color: var(--ca-muted);
  color: var(--ca-ink);
}
button.subVarDelete:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
.engineVarInsert {
  background-color: var(--ca-chrome) !important;
  border-color: var(--ca-chrome) !important;
  color: var(--ca-on-chrome) !important;
  border-radius: 2px !important;
}

#resize-bar {
  background-color: var(--ca-line) !important;
  border-radius: 2px !important;
  height: 3px;
  margin: 0.35rem auto;
  width: 28%;
}

/* "More controls" exists only where the narrow bottom bar hides controls (rules in the narrow studio). */
#moreNav,
.watch-more__menu {
  display: none;
}

/* The resize handle is dragged, never scrolled, on touch screens. */
#resize-bar {
  touch-action: none;
}
/* Keyboard: a focused handle shows a ring (spec viewer-polish CAP-6). */
#resize-bar:focus {
  outline: none;
}
#resize-bar:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 3px;
}
@media (forced-colors: active) {
  #resize-bar {
    background-color: CanvasText !important;
  }
}

/* Room for the fixed top bar: it slides away, except under reduced motion where it stays pinned. */
.watch-body {
  --watch-pad-top: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  .watch-body {
    --watch-pad-top: 4.25rem;
  }
}
#main-container.watch-container {
  padding-top: var(--watch-pad-top);
}
/* Eval bar on the left of the board (as on chess.com and Lichess). */
.board-eval-wrap .eval-bar {
  order: -1;
}
/* Engine lines (spec-watch-page CAP-3, revised 2026-10-19): one fixed-height row per requested line,
   so the block never changes height while the engine searches. Moves that do not fit wrap onto a
   second line the row clips (whole moves only); "…" marks the cut, the row's title holds the line.
   (Legacy style.css sets nowrap + ellipsis on #result.) */
.analyzeContainer #result {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.analyzeContainer .variant {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: 1.55rem; /* fixed; small enough to keep the CAP-3 move rows at 1440x900 with 4 lines */
  padding: 0;
  line-height: 1.4;
  overflow: hidden;
}
.analyzeContainer .variant + .variant {
  border-top: 1px solid var(--ca-line);
}
.analyzeContainer .variant .engineVarInsert {
  flex: 0 0 auto;
  float: none; /* legacy style.css floats it; in the row it sits last */
  margin: 0 0 0 auto;
}
.variant__eval {
  flex: 0 0 auto;
  min-width: 3.1em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.variant__moves {
  display: flex;
  flex: 0 1 auto; /* as wide as its moves, so "…" follows the last one shown */
  flex-wrap: wrap;
  column-gap: 0.35em;
  min-width: 0;
  height: 1.4em;
  overflow: hidden;
}
.variant__move {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis; /* only a first move wider than the whole row */
}
.variant__more {
  flex: 0 0 auto;
  padding: 0 0.3rem;
  border: 0;
  background: none;
  color: var(--ca-muted);
  font: inherit;
  cursor: pointer;
}
.variant__more[hidden] {
  display: none;
}
.variant__more:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
/* A row opened with "…": the whole line, wrapped (the viewer's choice, so its height may change). */
.analyzeContainer .variant.variant--open {
  height: auto;
  min-height: 1.55rem;
  align-items: flex-start;
}
.variant--open .variant__moves {
  height: auto;
}
/* Touch screens in the wide layout (phones in landscape): 44px "+" and "…" in taller rows. */
@media (pointer: coarse) {
  .analyzeContainer .variant {
    height: 2.9rem;
  }
  .analyzeContainer .variant.variant--open {
    min-height: 2.9rem;
  }
  .analyzeContainer .engineVarInsert,
  .analyzeContainer .variant__more {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
.variant__message {
  color: var(--ca-muted);
}

/* Eval graph (spec-watch-page CAP-6): White's winning chances per ply, in the eval bar's fixed colours. */
.watch-graph {
  flex: 0 0 auto;
  height: 3.5rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-graph-black);
  cursor: pointer;
  overflow: hidden;
}
.watch-graph[hidden] {
  display: none !important;
}
/* Short screens (phones in landscape): a lower graph keeps the move rows. */
@media (max-height: 500px) {
  .watch-graph {
    height: 2rem;
  }
}
.watch-graph svg {
  display: block;
  width: 100%;
  height: 100%;
}
.eg-area {
  fill: var(--ca-graph-white);
}
.eg-mid {
  stroke: var(--ca-graph-mid);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.eg-cursor {
  stroke: var(--ca-accent);
  stroke-width: 2;
}
.eg-mark {
  stroke: var(--ca-graph-black);
  stroke-width: 1;
}
.eg-mark--inaccuracy {
  fill: var(--ca-graph-inaccuracy);
}
.eg-mark--mistake {
  fill: var(--ca-graph-mistake);
}
.eg-mark--blunder {
  fill: var(--ca-graph-blunder);
}

/* Live row above the move list (watch page, live games; spec-watch-page CAP-5). */
.watch-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.watch-live[hidden] {
  display: none !important;
}
.watch-live__delay {
  color: var(--ca-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
/* Engine hidden while the game runs (broadcast story 4): one line in the engine block instead of the tools. */
.watch-hidden-note {
  margin: 0.25rem 0 0.5rem;
  color: var(--ca-muted);
  font-size: 0.85rem;
}
.watch-live__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ca-live);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.watch-live__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ca-live);
  animation: ca-live-pulse 1.6s ease-in-out infinite;
}
@keyframes ca-live-pulse {
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .watch-live__dot {
    animation: none;
  }
}
.watch-live__news {
  margin-left: auto;
}
.watch-live__new,
.watch-live__sound {
  min-height: 2.25rem;
  font-family: var(--ca-font-body);
  cursor: pointer;
}
.watch-live__new {
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  background: var(--ca-chrome);
  color: var(--ca-on-chrome);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.watch-live__new[hidden] {
  display: none;
}
.watch-live__new i {
  margin-right: 0.3rem;
}
.watch-live__sound {
  min-width: 2.25rem;
  padding: 0;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-surface);
  color: var(--ca-ink);
}
.watch-live__sound[aria-pressed="true"] {
  border-color: var(--ca-ink);
}
.watch-live__new:focus-visible,
.watch-live__sound:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
@media (pointer: coarse) {
  .watch-live__new,
  .watch-live__sound {
    min-height: 2.75rem;
  }
  .watch-live__sound {
    min-width: 2.75rem;
  }
}
/* The side to move's clock while it counts down (padding always there: no shift when it starts). */
.site-chessboard .player-time {
  padding: 0 0.35rem;
  border-radius: 2px;
}
.site-chessboard .player-time.is-running {
  background: var(--ca-live-soft);
  color: var(--ca-live);
}

/* Accuracy per player beside the eval graph (spec-watch-page CAP-12). */
.watch-graph-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.watch-graph-row .watch-graph {
  flex: 1 1 auto;
  min-width: 0;
}
.watch-accuracy {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  font-size: 0.8rem;
  line-height: 1.15;
  color: var(--ca-ink-soft);
  white-space: nowrap;
}
.watch-accuracy[hidden] {
  display: none !important;
}
.watch-accuracy__label {
  font-weight: 700;
  color: var(--ca-ink);
}
.watch-accuracy__side b {
  font-variant-numeric: tabular-nums;
  color: var(--ca-ink);
}
.watch-accuracy__swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.3rem;
  border: 1px solid var(--ca-graph-mid); /* visible on both themes' paper */
  border-radius: 2px;
  vertical-align: -0.05rem;
}
.watch-accuracy__swatch--white {
  background: var(--ca-graph-white);
}
.watch-accuracy__swatch--black {
  background: var(--ca-graph-black);
}
/* Short screens: the lower graph keeps the two values, the label goes to the title. */
@media (max-height: 500px) {
  .watch-accuracy__label {
    display: none;
  }
}

/* Share row under the tools (spec-watch-page CAP-8). */
.watch-tools__share {
  margin-left: auto;
}
.watch-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}
.watch-share[hidden] {
  display: none !important;
}
.watch-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-surface);
  color: var(--ca-ink);
  font-family: var(--ca-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.watch-share__btn:hover,
.watch-share__btn:focus-visible {
  background: var(--ca-accent-soft);
}
.watch-share__btn:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
.watch-share__btn:hover,
.watch-share__btn:focus {
  color: var(--ca-ink);
  text-decoration: none;
}
/* Its room is kept while empty, so a message never re-wraps the row. */
.watch-share__status {
  display: inline-block;
  min-width: 9.5em;
  font-size: 0.85rem;
  color: var(--ca-muted);
}
.watch-tools__share[aria-expanded="true"] {
  background: var(--ca-accent-soft);
  border-color: var(--ca-ink);
}
@media (pointer: coarse) {
  .watch-share__btn {
    min-height: 2.75rem;
  }
}

/* Round list and previous / next board (watch page; spec-watch-page CAP-7). Shown in the Round view:
   wide screens switch the list area with the Round toggle in the tools row, narrow ones with the bottom bar. */
.watch-round,
.watch-tools__round,
.watch-tools__flip {
  display: none;
}
/* Wide: the Round toggle sits in the tools row (no extra strip above the list). */
.watch-tools__round[aria-pressed="true"] {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.watch-round__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 0.35rem;
}
.watch-round__pos {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ca-ink);
}
.watch-round__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-surface);
  color: var(--ca-ink);
}
.watch-round__step:hover,
.watch-round__step:focus {
  color: var(--ca-ink);
  text-decoration: none;
  border-color: var(--ca-ink);
}
.watch-round__step.is-disabled {
  color: var(--ca-muted);
  opacity: 0.45;
}
.watch-round__nav,
.watch-round__links {
  flex: 0 0 auto;
}
/* Only the list scrolls: the steps and the links stay in view. */
/* The move list's absolutely positioned screen-reader status stays inside the scrolling list (viewer polish CAP-20). */
#movesContainer {
  position: relative;
}
.watch-round__list {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scroll-padding-top: 2.25rem; /* a focused row scrolled up stays below the sticky match header */
}
/* The current board's team match under its position (team events). */
.watch-round__sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ca-ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
}
/* Team events: each match's boards under its header (home, score of our boards, away; as on the boards page).
   The header stays at the top of the list while its boards scroll by. */
.watch-round__group + .watch-round__group,
.watch-round__row + .watch-round__group,
.watch-round__group + .watch-round__row {
  margin-top: 0.35rem;
}
.watch-round__boards {
  margin: 0;
  padding: 0;
  list-style: none;
}
.watch-round__match {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.5rem 0.3rem;
  border-bottom: 1px solid var(--ca-line);
  background: var(--ca-paper);
  color: var(--ca-ink);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}
.wr-team {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.wr-team--away {
  justify-content: flex-end;
}
.wr-team__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wr-score {
  flex: none;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  background: var(--ca-surface);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wr-score.is-running {
  color: var(--ca-live);
}
.wr-score.is-running::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--ca-live);
  vertical-align: 0.15em;
}
.wr-score:not(.is-running) .wr-score__state {
  display: none;
}
/* Very large rounds (viewer polish CAP-14): a row away from the list's view is laid out and painted only once it
   scrolls near (the browser remembers each row's height after that). Focus rings are inset, so paint containment
   clips nothing. */
.watch-round__row {
  content-visibility: auto;
  contain-intrinsic-size: auto 1.9rem;
}
.watch-round__row a {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) 3rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.3rem 0.5rem;
  color: var(--ca-ink);
  font-size: 0.9rem;
  text-decoration: none;
}
.watch-round__row:nth-child(even) a {
  background: var(--ca-paper);
}
.watch-round__row a:hover {
  color: var(--ca-ink);
  text-decoration: none;
  background: var(--ca-accent-soft);
}
.watch-round__row.is-current a {
  background: var(--ca-accent-soft);
  font-weight: 700;
}
.watch-round__row.is-current .wr-no,
.watch-round__row.is-current .wr-elo,
.watch-round__row a:hover .wr-no,
.watch-round__row a:hover .wr-elo {
  color: var(--ca-ink-soft); /* muted grey is under 4.5:1 on the accent tint */
}
.wr-no,
.wr-elo {
  color: var(--ca-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.wr-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Which player has White in the round list (team rounds put the home player left whatever their colour). */
.wr-colour {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.35rem;
  border: 1px solid var(--ca-muted);
  border-radius: 1px;
  vertical-align: 0.05em;
}
.wr-colour--white {
  background: #fff;
}
.wr-colour--black {
  background: #1c1c1c;
}
.wr-state {
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wr-state.is-live {
  color: var(--ca-live);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.watch-round__links {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}
.watch-round__step:focus-visible,
.watch-round__row a:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}
@media (pointer: coarse) {
  .watch-round__step {
    min-height: 2.75rem;
  }
  .watch-round__step {
    min-width: 2.75rem;
  }
  .watch-round__row a {
    min-height: 2.75rem;
    align-items: center;
  }
  .watch-round__row {
    contain-intrinsic-size: auto 2.75rem;
  }
}

/* Watch / analysis studio: board column + side panel from 1024px, or from 640px in landscape
   (spec-watch-page CAP-1, CAP-3; keep in sync with Watch.wideLayoutQuery()). Narrower screens get the
   narrow studio below (CAP-4). Classic min/max-width syntax: range syntax needs Safari 16.4+. */
@media (min-width: 1024px), (min-width: 640px) and (orientation: landscape) {
  #main-container.watch-container {
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 0.75rem;
  }
  .site-chessboard.watch-studio {
    max-width: none;
  }
  .watch-studio__row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 1.25rem;
  }
  .watch-studio__board {
    flex: 0 0 auto;
    min-width: 0;
  }
  /* Board stays against the panel; the eval bar takes its reserved space on the left. */
  .watch-studio__board .board-eval-wrap {
    width: auto;
    justify-content: flex-end;
  }
  .watch-studio__board .board-stack {
    flex: 0 0 auto;
  }
  .watch-studio__panel {
    position: relative;
    flex: 0 0 clamp(320px, 28vw, 420px);
    min-width: 0;
  }
  /* Absolute so the panel never makes the row taller than the board column. */
  .watch-studio__panel-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  /* Bounded engine block: the toggle and gear stay put, only the settings and lines scroll. */
  .watch-studio__engine {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 40%;
    overflow: hidden;
  }
  .watch-studio__engine .watch-tools {
    flex: 0 0 auto;
    margin-top: 0;
    margin-bottom: 0.4rem;
  }
  .watch-studio__panel .move-buttons .btn {
    min-height: 2.25rem;
  }
  @media (pointer: coarse) {
    .watch-studio__panel .move-buttons .btn {
      min-height: 2.75rem;
    }
  }
  /* Mouse-sized on desktop; touch screens keep 44px (narrow layout and pointer: coarse). */
  @media (pointer: fine) {
    .watch-studio__engine .watch-tools__analyze,
    .watch-studio__engine .watch-tools__gear {
      min-height: 2.25rem;
    }
    .watch-studio__engine .watch-tools__gear {
      min-width: 2.25rem;
    }
  }
  .watch-studio__engine .analyzeContainer {
    min-height: 0;
    margin-bottom: 0;
    overflow-y: auto;
  }
  .watch-studio__panel #bottom-section {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
  }
  .watch-studio__engine .watch-graph-row {
    flex: 0 0 auto;
    margin-bottom: 0.4rem;
  }
  .watch-tools__round {
    display: inline-flex;
  }
  .watch-studio[data-view="round"] .watch-studio__panel #bottom-section {
    display: none;
  }
  .watch-studio[data-view="round"] .watch-round {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  .watch-studio__panel .move-buttons {
    flex: 0 0 auto;
    margin: 0;
  }
  #resize-bar {
    width: 40%;
    cursor: ns-resize;
  }
  .watch-studio--analysis .analysis-import {
    max-width: 720px;
    margin: 1.25rem auto 0;
  }
}
/* Narrow studio (phones, portrait tablets; spec-watch-page CAP-4): the screen height is split between
   board, best engine line and move list; navigation and the view switcher sit in a fixed bottom bar.
   The wrappers dissolve, so the blocks stack in DOM order. */
@media (max-width: 1023.98px) and (orientation: portrait), (max-width: 639.98px) {
  #main-container.watch-container {
    max-width: none;
    padding-bottom: 0;
  }
  .site-chessboard.watch-studio {
    max-width: none;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--watch-pad-top));
    height: calc(100dvh - var(--watch-pad-top));
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .watch-studio__row,
  .watch-studio__board,
  .watch-studio__panel,
  .watch-studio__panel-inner,
  .watch-studio__engine {
    display: contents;
  }
  .watch-studio #bottom-section {
    flex: 1 1 0;
    min-height: 4.5rem;
    height: auto !important;
  }
  #resize-bar {
    display: none;
  }
  .watch-studio .move-buttons {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    margin: 0;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--ca-surface);
    border-top: 1px solid var(--ca-line);
  }
  .watch-studio .move-buttons .watch-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    margin-right: 2px;
    padding-right: 6px;
    border-right: 1px solid var(--ca-line);
  }
  .watch-studio .move-buttons .btn,
  .move-buttons .watch-tab {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  /* Beats legacy style.css `.move-buttons button` (orange) and the hover reset above. */
  .move-buttons .watch-tab,
  .move-buttons .watch-tab:hover {
    padding: 0;
    border: 1px solid var(--ca-line);
    border-radius: 2px;
    background: var(--ca-surface);
    color: var(--ca-ink);
  }
  .move-buttons .watch-tab[aria-pressed="true"],
  .move-buttons .watch-tab[aria-pressed="true"]:hover {
    background: var(--ca-chrome);
    border-color: var(--ca-chrome);
    color: var(--ca-on-chrome);
  }
  .move-buttons .watch-tab:focus-visible {
    outline: 2px solid var(--ca-accent);
    outline-offset: 1px;
  }
  /* The bar holds n 44px controls in n * 2.75rem + gaps + padding (thresholds in em follow the user's font size).
     "More controls" (spec viewer-polish CAP-7) takes one place once a control has to go and lists the hidden ones
     (Start, Autoplay, End, Flip): watch 8 controls fit from 25.3em; below, start + autoplay go (7 with More, 22.3em),
     then end (6, 19.3em). /analysis 9 fit from 28.3em; below, start + autoplay go (8 with More, 25.3em), then end (7),
     then flip (6). Under 19.3em (a 280px screen, or a large font) the six scroll sideways. */
  @media (max-width: 25.3em) {
    .watch-studio .move-buttons #autoplay,
    .watch-studio .move-buttons #start {
      display: none;
    }
    .watch-studio .move-buttons #moreNav {
      display: inline-flex;
    }
  }
  @media (max-width: 22.3em) {
    .watch-studio .move-buttons #end {
      display: none;
    }
  }
  @media (max-width: 28.3em) {
    .watch-studio--analysis .move-buttons #autoplay,
    .watch-studio--analysis .move-buttons #start {
      display: none;
    }
    .watch-studio--analysis .move-buttons #moreNav {
      display: inline-flex;
    }
  }
  @media (max-width: 25.3em) {
    .watch-studio--analysis .move-buttons #end {
      display: none;
    }
  }
  @media (max-width: 22.3em) {
    .watch-studio--analysis .move-buttons #flip {
      display: none;
    }
  }
  @media (max-width: 19.3em) {
    .watch-studio .move-buttons {
      justify-content: flex-start;
      overflow-x: auto;
      overscroll-behavior-x: contain;
    }
  }
  .watch-studio .move-buttons #moreNav {
    align-items: center;
    justify-content: center;
  }
  /* Autoplay running from the menu: a dot on its button. */
  .watch-studio .move-buttons #moreNav.is-playing {
    position: relative;
  }
  .watch-studio .move-buttons #moreNav.is-playing::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ca-live);
  }
  .watch-studio .move-buttons .watch-more__menu {
    position: fixed; /* bottom set by the script: just above the bar */
    right: 0.5rem;
    max-width: calc(100vw - 1rem);
    z-index: 26;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 11rem;
    padding: 0.35rem;
    background: var(--ca-surface);
    border: 1px solid var(--ca-line);
    border-radius: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  }
  .watch-studio .move-buttons .watch-more__menu[hidden] {
    display: none;
  }
  /* Beats the legacy style.css `.move-buttons button` (orange, bold 20px) explicitly. */
  .watch-studio .move-buttons .watch-more__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--ca-ink);
    font: inherit;
    font-weight: 400;
    text-align: left;
  }
  .watch-studio .move-buttons .watch-more__item[aria-pressed="true"] {
    font-weight: 700;
  }
  @media (forced-colors: active) {
    .watch-studio .move-buttons .watch-more__item {
      border: 1px solid ButtonText;
    }
  }
  .watch-studio .move-buttons .watch-more__item:hover {
    background: var(--ca-accent-soft);
  }
  .watch-studio .move-buttons .watch-more__item:focus-visible {
    outline: 2px solid var(--ca-accent);
    outline-offset: -2px;
  }
  .watch-studio .watch-live {
    margin-bottom: 0.25rem;
  }
  .watch-studio .watch-live__new,
  .watch-studio .watch-live__sound {
    min-height: 2.75rem;
  }
  .watch-studio .watch-live__sound {
    min-width: 2.75rem;
  }
  /* Engine controls are touch targets too. */
  .watch-studio #analysisSettingsContainer .btn,
  .watch-studio #engineSelect,
  .watch-studio #valueDisplay,
  .watch-studio .engineVarInsert {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  /* Views: Moves (best engine line + list), Engine (toggle, settings, all lines), Load (/analysis). */
  .watch-studio[data-view="moves"] #watchShareMenu,
  .watch-studio[data-view="import"] #watchShareMenu,
  .watch-studio[data-view="round"] #watchShareMenu,
  .watch-studio[data-view="moves"] #watchTools,
  .watch-studio[data-view="moves"] #analysisSettingsContainer,
  .watch-studio[data-view="moves"] #evalGraph,
  .watch-studio[data-view="moves"] #evalAccuracy,
  .watch-studio[data-view="import"] #evalAccuracy,
  .watch-studio[data-view="round"] #evalAccuracy,
  .watch-studio[data-view="import"] #evalGraph,
  .watch-studio[data-view="moves"] #result .variant:not(.variant--best),
  .watch-studio[data-view="moves"] #analysisImport:not(:focus-within), /* a field typed in while the layout narrows stays until the Load view shows */
  .watch-studio[data-view="engine"] #bottom-section,
  .watch-studio[data-view="engine"] #analysisImport:not(:focus-within),
  .watch-studio[data-view="import"] #watchTools,
  .watch-studio[data-view="import"] #analyzeContainer,
  .watch-studio[data-view="import"] #bottom-section {
    display: none !important;
  }
  /* Rows hold the 44px "+" and "…" on narrow screens. */
  .watch-studio .analyzeContainer .variant {
    height: 2.9rem;
  }
  .watch-studio .analyzeContainer .variant.variant--open {
    height: auto;
    min-height: 2.9rem;
  }
  .watch-studio .variant__more {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  .watch-studio[data-view="round"] #watchTools,
  .watch-studio[data-view="round"] #analyzeContainer,
  .watch-studio[data-view="round"] #evalGraph,
  .watch-studio[data-view="round"] #bottom-section {
    display: none !important;
  }
  .watch-studio[data-view="round"] .watch-round {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    margin: 0 0 0.5rem;
    overflow: hidden;
  }
  .watch-studio .watch-round__step,
  .watch-studio .watch-round__row a {
    min-height: 2.75rem;
  }
  .watch-studio .watch-round__row {
    contain-intrinsic-size: auto 2.75rem;
  }
  .watch-studio .watch-round__step {
    min-width: 2.75rem;
  }
  .watch-studio .watch-share__btn {
    min-height: 2.75rem;
  }
  .watch-studio--round .watch-tools__share {
    margin-left: 0; /* Flip before it takes the free space */
  }
  /* With a Round tab the bar would hold 9 controls: Flip moves to the Engine view's tools row. */
  .watch-studio--round .move-buttons #flip {
    display: none;
  }
  .watch-studio--round .watch-tools__flip {
    display: inline-flex;
    margin-left: auto;
  }
  .watch-studio[data-view="engine"] #analyzeContainer,
  .watch-studio[data-view="import"] #analysisImport {
    flex: 1 1 0;
    min-height: 0;
    margin: 0 0 0.5rem;
    overflow-y: auto;
  }
}

@media (max-width: 500px) {
  .site-chessboard {
    max-width: none;
  }
  .watch-container.container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* —— Settings menu (header + watch top bar; views/layouts/_settings.php, web/js/site.js) —— */
.ca-settings {
  position: relative;
}
.ca-settings__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 4px;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ca-settings__toggle::-webkit-details-marker {
  display: none;
}
.ca-settings__toggle:hover,
.ca-settings[open] > .ca-settings__toggle {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.ca-settings__toggle:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-settings__panel {
  position: absolute;
  z-index: 1070;
  top: calc(100% + 6px);
  right: 0;
  width: 15rem;
  padding: 0.85rem;
  text-align: left;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.ca-settings__group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ca-settings__group + .ca-settings__group {
  margin-top: 0.85rem;
}
.ca-settings__label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-settings__seg {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-settings__option {
  position: relative;
  flex: 1;
  margin: 0;
}
.ca-settings__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.ca-settings__option span {
  display: block;
  padding: 0.4rem 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--ca-ink-soft);
  cursor: pointer;
}
.ca-settings__option + .ca-settings__option span {
  border-left: 1px solid var(--ca-line);
}
.ca-settings__option input:checked + span {
  color: var(--ca-on-chrome);
  background: var(--ca-chrome);
}
.ca-settings__option input:focus-visible + span {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}
.ca-settings__hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ca-muted);
}
.ca-settings__langs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ca-settings__langs a {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.4rem;
  font-weight: 600;
  color: var(--ca-ink);
  text-decoration: none;
  border-radius: 4px;
}
.ca-settings__langs a:hover {
  background: var(--ca-accent-soft);
}
.ca-settings__langs a[aria-current="true"]::after {
  content: "\2713";
  color: var(--ca-accent-text);
}
.watch-topbar .ca-settings {
  margin-left: auto;
}
.watch-topbar .ca-settings__toggle {
  color: var(--ca-ink);
}
.watch-topbar .ca-settings__toggle:hover,
.watch-topbar .ca-settings[open] > .ca-settings__toggle {
  color: var(--ca-ink);
  background: var(--ca-accent-soft);
}
.ca-settings__text {
  display: none;
}
@media (max-width: 991.98px) {
  /* Collapsed header menu: the gear carries its name ("Language and theme"), so a visitor finds the language. */
  .header_section .ca-settings__toggle {
    width: auto;
    gap: 0.5rem;
    padding: 0 0.75rem;
    font-weight: 600;
  }
  .header_section .ca-settings__text {
    display: inline;
  }
  /* Collapsed header menu: the gear is centred, so centre the panel under it. */
  .header_section .ca-settings__panel {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Kill legacy style.css a:hover { color: initial } on product surfaces */
body a:hover,
body a:focus {
  color: var(--ca-ink);
}

/* —— Dark theme: Bootstrap / chrome overrides —— */
[data-theme="dark"] .dropdown-menu {
  background-color: var(--ca-surface);
  border-color: var(--ca-line);
  color: var(--ca-ink);
}
[data-theme="dark"] .dropdown-item {
  color: var(--ca-ink);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background-color: var(--ca-accent-soft);
  color: var(--ca-ink);
}
[data-theme="dark"] .dropdown-divider {
  border-top-color: var(--ca-line);
}
[data-theme="dark"] .card,
[data-theme="dark"] .site-index-card {
  background-color: var(--ca-surface);
  color: var(--ca-ink);
  border-color: var(--ca-line);
}
[data-theme="dark"] .text-muted {
  color: var(--ca-muted) !important;
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .custom-select,
[data-theme="dark"] select.form-control,
[data-theme="dark"] .form-select {
  background-color: var(--ca-surface);
  color: var(--ca-ink);
  border-color: var(--ca-line);
}
[data-theme="dark"] .form-select {
  /* Bootstrap 5's select draws a dark arrow: a light one, and the native option list in the dark scheme */
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f5f5f5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  color-scheme: dark;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: var(--ca-surface);
  color: var(--ca-ink);
  border-color: var(--ca-accent);
  box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--ca-accent) 25%, transparent);
}
[data-theme="dark"] .breadcrumb {
  background-color: transparent;
}
[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a {
  color: var(--ca-muted);
}
[data-theme="dark"] .breadcrumb-item.active {
  color: var(--ca-ink);
}
[data-theme="dark"] .alert {
  border-color: var(--ca-line);
}
[data-theme="dark"] .table {
  color: var(--ca-ink);
}
[data-theme="dark"] .navbar-collapse {
  background-color: var(--ca-chrome);
}
[data-theme="dark"] .sub2 { color: #c4a86a; }
[data-theme="dark"] .sub3 { color: #9ca3af; }
[data-theme="dark"] .sub4 { color: #c4926a; }
[data-theme="dark"] .sub5 { color: #9aaa7e; }
[data-theme="dark"] .sub6 { color: #9ca3af; }
[data-theme="dark"] .sub7 { color: #b5a78a; }
[data-theme="dark"] .sub8 { color: #a8a29e; }
[data-theme="dark"] .sub9 { color: #a8a29e; }

/* Player tournament games */
.player-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.player-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-family: var(--ca-font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ca-muted);
  text-decoration: none;
}
.player-page__back:hover {
  color: var(--ca-ink);
  text-decoration: none;
}
.player-page__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ca-line);
}
.player-page__header--flush {
  margin-bottom: 0.65rem;
  padding-bottom: 0;
  border-bottom: none;
}
.player-page__name {
  display: block;
  margin: 0 0 0.35rem;
  /* Source Sans — Syne clips descenders (g/y/ğ) at display sizes */
  font-family: var(--ca-font-body);
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ca-ink);
  line-height: 1.55;
  overflow: visible;
  /* keep descenders inside the border box (body overflow clips ink) */
  padding: 0.2em 0 0.35em;
}
.player-page__name .player-flag,
.player-page__name .player-title {
  vertical-align: middle;
  margin-right: 0.35rem;
}
.player-page__name .player-title {
  display: inline-block;
  position: relative;
  top: -0.05em;
}
.player-page__event {
  margin: 0;
  font-family: var(--ca-font-body);
  font-size: 0.95rem;
  color: var(--ca-muted);
}
.player-page__meta,
.player-page__ratings,
.player-page__tour {
  margin: 0.45rem 0 0;
  font-family: var(--ca-font-body);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--ca-muted);
  line-height: 1.45;
}
.player-page__ratings {
  margin-top: 0.55rem;
  color: var(--ca-ink-soft);
}
.player-page__rating--std {
  color: var(--ca-ink);
  font-weight: 700;
}
.player-page__rating-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.player-page__sep {
  margin: 0 0.35rem;
  color: var(--ca-line-strong, var(--ca-muted));
  opacity: 0.7;
}
.player-page__tour {
  margin: 0 0 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ca-line);
  color: var(--ca-ink-soft);
  font-weight: 600;
}
.player-page__delta--up {
  color: #2f6b3a;
}
.player-page__delta--down {
  color: #a33b2b;
}
[data-theme="dark"] .player-page__delta--up {
  color: #7dba88;
}
[data-theme="dark"] .player-page__delta--down {
  color: #e08a7a;
}
.player-games {
  list-style: none;
  margin: 0;
  padding: 0;
}
.player-games > li + li {
  border-top: 1px solid var(--ca-line);
}
.player-games__row {
  display: grid;
  grid-template-columns: 2.5rem 3.5rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.15rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.12s ease;
}
.player-games__row:hover {
  background: var(--ca-accent-soft);
  text-decoration: none;
  color: inherit;
}
.player-games__round {
  font-family: var(--ca-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ca-muted);
}
.player-games__color {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ca-ink-soft);
}
.player-games__vs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.player-games__vs-label {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ca-muted);
  text-transform: lowercase;
}
.player-games__score {
  justify-self: end;
  font-family: var(--ca-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ca-ink);
}
.player-games__score--win { color: var(--ca-ink); }
.player-games__score--loss { color: var(--ca-muted); }
.player-games__score--draw { color: var(--ca-ink-soft); }

/* Links inside the muted player meta lines (FIDE profile, "All tournaments & rating"):
   accent text colour (AA) and an underline so they stand apart from the surrounding text. */
.player-page__meta a,
.player-page__event a {
  color: var(--ca-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Player search (header + /players; web/js/player-search.js) —— */
.ca-player-search {
  position: relative;
  margin: 0 0.75rem 0 0;
}
.ca-player-search__input {
  width: 14rem;
  max-width: 100%;
  height: 2.25rem;
  padding: 0 0.65rem 0 2rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ca-on-chrome);
  background-color: rgba(255, 255, 255, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba%28255%2C255%2C255%2C0.65%29' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.65rem center;
  background-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
}
.ca-player-search__input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.ca-player-search__input:focus {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
  background-color: rgba(255, 255, 255, 0.14);
}
.ca-player-search__list {
  position: absolute;
  z-index: 1060;
  top: calc(100% + 4px);
  right: 0;
  width: 21rem;
  max-width: calc(100vw - 2rem);
  /* Up to 10 players, 5 tournaments and 3 clubs under their labels: tall enough to show the second group. */
  max-height: min(34rem, calc(100vh - 6rem));
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  text-align: left;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
/* A group of suggestions (players, tournaments, clubs) under its label. */
.ca-player-search__group + .ca-player-search__group {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--ca-line);
}
.ca-player-search__label {
  padding: 0.35rem 0.75rem 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-player-search__option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.ca-player-search__option:hover,
.ca-player-search__option.is-active {
  background: var(--ca-accent-soft);
}
.ca-player-search__name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ca-player-search__facts {
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--ca-muted);
  white-space: nowrap;
}
/* A tournament's fact is a text (its dates, its club's name): it shares the line with the name, each down to an ellipsis. */
.ca-player-search__facts--text {
  flex: 0 1 auto;
  min-width: 4rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-player-search__empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--ca-muted);
}
.ca-player-search--page {
  max-width: 28rem;
  margin: 1.25rem 0 0;
}
.ca-player-search--page .ca-player-search__input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.8rem 0 2.3rem;
  font-size: 1rem;
  color: var(--ca-ink);
  background-color: var(--ca-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E");
  background-position: 0.8rem center;
  background-size: 1.05rem;
  border-color: var(--ca-line);
}
.ca-player-search--page .ca-player-search__input::placeholder {
  color: var(--ca-muted);
}
.ca-player-search--page .ca-player-search__list {
  left: 0;
  right: 0;
  width: auto;
}
@media (max-width: 991.98px) {
  .ca-player-search-item {
    width: 100%;
    padding: 0.5rem 0;
  }
  .ca-player-search {
    margin: 0;
  }
  .ca-player-search__input {
    width: 100%;
  }
  .ca-player-search__list {
    left: 0;
    right: 0;
    width: auto;
  }
}

/* —— /players —— */
.players-page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}
.players-page__title {
  margin: 0 0 0.35rem;
  font-family: var(--ca-font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--ca-ink);
}
.players-page__lede,
.players-page__empty {
  margin: 0;
  color: var(--ca-muted);
}
.players-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.players-list > li {
  display: flex;
  align-items: center;
}
.players-list > li + li {
  border-top: 1px solid var(--ca-line);
}
.players-list__row {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.7rem 0.15rem;
  color: inherit;
  text-decoration: none;
}
.players-list__row:hover {
  background: var(--ca-accent-soft);
  color: inherit;
  text-decoration: none;
}
.players-list__rank {
  flex-shrink: 0;
  width: 1.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ca-muted);
}
.players-list__who {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.players-list__name {
  min-width: 0;
  font-weight: 600;
  color: var(--ca-ink);
  overflow-wrap: anywhere;
}
.players-list__sub {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--ca-muted);
}
.players-list__facts {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--ca-ink-soft);
}
.players-list__watch {
  flex-shrink: 0;
  margin-left: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ca-live);
}

/* —— Player profile (/player/<fideId>/<slug>) —— */
.player-profile__h2 {
  font-family: var(--ca-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ca-ink);
  margin: 2rem 0 0.5rem;
}
.player-profile__h3 {
  font-family: var(--ca-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 1.25rem 0 0.25rem;
}
.player-live {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  background: var(--ca-live-soft);
  color: var(--ca-ink);
  text-decoration: none;
}
.player-live:hover {
  color: var(--ca-ink);
  text-decoration: none;
  border-color: var(--ca-live);
}
.player-live__badge,
.player-events__live {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ca-live);
}
.player-live__text {
  flex: 1;
  min-width: 0;
}
.player-live__cta {
  font-weight: 700;
}
.player-events {
  list-style: none;
  margin: 0;
  padding: 0;
}
.player-events > li + li {
  border-top: 1px solid var(--ca-line);
}
.player-events__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.15rem;
  color: inherit;
  text-decoration: none;
}
.player-events__row:hover {
  background: var(--ca-accent-soft);
  color: inherit;
  text-decoration: none;
}
.player-events__name {
  min-width: 0;
  font-weight: 600;
  color: var(--ca-ink);
}
.player-events__live {
  margin-left: 0.35rem;
}
.player-events__sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ca-muted);
}
.player-events__stats {
  display: flex;
  flex-shrink: 0;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--ca-ink-soft);
}
.player-events__score {
  font-family: var(--ca-font-display);
  font-weight: 700;
  color: var(--ca-ink);
}
.player-history {
  width: 100%;
  max-width: 28rem;
  font-size: 0.9rem;
  border-collapse: collapse;
}
.player-history th,
.player-history td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--ca-line);
  text-align: right;
}
.player-history th:first-child,
.player-history td:first-child {
  text-align: left;
}
.player-history th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}

@media (max-width: 480px) {
  .player-games__row {
    grid-template-columns: 2.25rem 3rem minmax(0, 1fr) 1.75rem;
    gap: 0.35rem;
  }
}

/* Results (chess-results) */
/* One-line strip of the tournament pages: scrolls sideways when it does not fit, the active tab is brought into
   view and the hidden end fades (web/js/site.js [data-ca-strip]; spec-tournament-page CAP-2). */
.results-mode-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  margin-right: 0.75rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
/* Every strip (mode tabs, rounds): a horizontal scroll box without a scrollbar on touch screens; a mouse wheel
   does not scroll sideways, so fine pointers get a thin bar when the strip overflows. */
[data-ca-strip] {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (pointer: coarse) {
  [data-ca-strip] {
    scrollbar-width: none;
  }
  [data-ca-strip]::-webkit-scrollbar {
    display: none;
  }
}
[data-ca-strip][data-more-end] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
[data-ca-strip][data-more-start] {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent);
}
@media print {
  [data-ca-strip] {
    flex-wrap: wrap;
    overflow: visible;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
}
[data-ca-strip][data-more-start][data-more-end] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}
.results-mode-tabs__link {
  display: inline-flex;
  flex: none;
  align-items: center;
  white-space: nowrap;
  min-height: 2rem;
  padding: 0 0.75rem;
  font-family: var(--ca-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  text-decoration: none;
  background: var(--ca-surface);
}
.results-mode-tabs__link.is-active {
  background: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
a.results-mode-tabs__link:hover {
  color: var(--ca-ink);
  text-decoration: none;
}
a.results-mode-tabs__link:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: -2px;
}
@media screen and (max-width: 767.98px) {
  /* Phones: 44px tabs; the frame is drawn inside so the strip stays 44px tall. */
  .results-mode-tabs {
    margin-right: 0;
    border: 0;
    background: var(--ca-surface);
    box-shadow: inset 0 0 0 1px var(--ca-line);
  }
  .results-mode-tabs__link {
    min-height: 2.75rem;
    padding: 0 0.7rem;
    background: transparent;
  }
}
.results-page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 0 3rem;
}
.results-section {
  margin-top: 1.75rem;
}
.results-section__title {
  font-family: var(--ca-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--ca-ink);
}
.results-section--matches {
  margin-top: 2.25rem;
}
.team-match {
  margin-bottom: 1.25rem;
}
.team-match__head {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.15rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--ca-line);
  margin-bottom: 0;
}
.team-match__head:hover {
  background: var(--ca-accent-soft);
  text-decoration: none;
  color: inherit;
}
.team-match__round {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ca-muted);
}
.team-match__vs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.team-match__vs-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ca-muted);
  text-transform: lowercase;
}
.team-match__opp {
  font-weight: 600;
  color: var(--ca-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-match__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ca-ink);
  white-space: nowrap;
}
.team-match__boards {
  border-top: none;
  border-radius: 0 0 2px 2px;
}
.team-match__boards .results-table--team-boards {
  table-layout: fixed;
  width: 100%;
}
.team-match__boards .results-table thead {
  display: none;
}
.team-match__boards .results-table--team-boards th.col-board,
.team-match__boards .results-table--team-boards td.col-board {
  width: 2.25rem;
}
.team-match__boards .results-table--team-boards th.col-color,
.team-match__boards .results-table--team-boards td.col-color {
  width: 1.6rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  text-align: center;
}
.team-match__boards .results-table--team-boards th.col-num,
.team-match__boards .results-table--team-boards td.col-num {
  width: 3.1rem;
}
.team-match__boards .results-table--team-boards th.col-result,
.team-match__boards .results-table--team-boards td.col-result {
  width: 2.6rem;
}
.team-match__boards .results-table--team-boards th.col-title,
.team-match__boards .results-table--team-boards td.col-title {
  width: 2.75rem;
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.team-match__boards .results-table--team-boards th.col-name,
.team-match__boards .results-table--team-boards td.col-name {
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.team-match__boards .results-table--team-boards td.col-title .pairing-title {
  margin-right: 0;
}
.board-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  line-height: 1;
}
.board-color--white {
  background: #f4f4f0;
  color: #222;
  border-color: #c8c8c0;
}
.board-color--black {
  background: #2a2a2a;
  color: #f2f2f2;
  border-color: #2a2a2a;
}
.team-match__boards td.is-ours,
.team-match__boards td.is-ours .player-name-link {
  font-weight: 700;
  color: var(--ca-ink);
}
.team-board__pts {
  font-family: var(--ca-font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.team-board__pts--win { color: var(--ca-ink); }
.team-board__pts--loss { color: var(--ca-muted); }
.team-board__pts--draw { color: var(--ca-ink-soft); }
a.team-board__pts {
  text-decoration: none;
}
@media (min-width: 640px) {
  .team-match__boards .results-table thead {
    display: table-header-group;
  }
}
.results-section__meta {
  font-family: var(--ca-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ca-muted);
  margin-left: 0.5rem;
}
.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  -webkit-overflow-scrolling: touch;
}
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.results-table th,
.results-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--ca-line);
  color: var(--ca-ink);
  background: var(--ca-surface); /* opaque: sticky columns cover what scrolls under them */
}
.results-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ca-muted);
  background: var(--ca-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.results-table--pairings {
  font-variant-numeric: tabular-nums;
}
.results-table--pairings th.col-board,
.results-table--pairings td.col-board,
.results-table--pairings th.col-num,
.results-table--pairings td.col-num,
.results-table--pairings th.col-result,
.results-table--pairings td.col-result,
.results-table--pairings th.col-title,
.results-table--pairings td.col-title {
  text-align: center;
  white-space: nowrap;
}
.results-table--pairings td.col-board {
  font-weight: 700;
  color: var(--ca-muted);
  width: 2.5rem;
}
.results-table--team-pairings td.col-board {
  width: 3.25rem;
  min-width: 3.25rem;
}
.results-table--pairings td.col-title {
  width: 3rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.results-table--pairings td.col-result {
  font-weight: 700;
  min-width: 4rem;
}
.results-table--pairings tr.is-linked,
.results-table--standings tr.is-linked {
  cursor: pointer;
}
.results-table--pairings tr.is-linked:hover,
.results-table--standings tr.is-linked:hover {
  background: var(--ca-accent-soft);
}
.results-table--pairings tr.is-linked:hover td,
.results-table--standings tr.is-linked:hover td {
  background: var(--ca-accent-soft);
}
/* Sticky rank / board + name while scrolling wide tables */
.results-table th.col-sticky,
.results-table td.col-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--ca-line);
}
.results-table th.col-sticky {
  z-index: 3;
}
.results-table th.col-sticky-2,
.results-table td.col-sticky-2 {
  position: sticky;
  left: 2.75rem;
  z-index: 1;
  border-right: 1px solid var(--ca-line);
  min-width: 8rem;
}
.results-table th.col-sticky-2 {
  z-index: 3;
}
[data-theme="dark"] .results-table th,
[data-theme="dark"] .results-table td {
  background: var(--ca-paper); /* opaque: sticky columns cover what scrolls under them */
}
[data-theme="dark"] .results-table th {
  background: var(--ca-surface);
}
.pairing-title {
  display: inline-block;
  font-family: var(--ca-font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ca-muted);
  margin-right: 0.3rem;
}
.pairing-result-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.pairing-result-link:hover {
  color: var(--ca-ink);
  text-decoration: underline;
}
.results-table--team-pairings th.col-flag,
.results-table--team-pairings td.col-flag {
  width: 1.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}
.results-table--team-pairings th.col-fed,
.results-table--team-pairings td.col-fed {
  width: 2.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ca-muted);
}
.pairing-flag {
  display: inline-block;
  vertical-align: middle;
  border-radius: 1px;
}
.results-pairings {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
.results-pairings > li + li {
  border-top: 1px solid var(--ca-line);
}
.results-pairings__row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 4.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  color: inherit;
  text-decoration: none;
}
a.results-pairings__row:hover {
  background: var(--ca-accent-soft);
  text-decoration: none;
  color: inherit;
}
.results-pairings__board {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ca-muted);
}
.results-pairings__names {
  min-width: 0;
  font-weight: 600;
  color: var(--ca-ink);
}
.results-pairings__result {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.results-vs {
  color: var(--ca-muted);
  font-weight: 600;
  margin: 0 0.35rem;
}


/* Free analysis board (FEN/PGN import) */
.watch-studio--analysis .watch-studio__title {
  font-family: var(--ca-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-align: center;
  color: var(--ca-ink);
}
.analysis-import {
  margin: 0.85rem 0 0.5rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--ca-line);
  text-align: left;
}
.analysis-import__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0.55rem 0 0.3rem;
}
.analysis-import__row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
.analysis-import__input,
.analysis-import__textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  padding: 0.45rem 0.55rem;
}
.analysis-import__textarea {
  min-height: 5.5rem;
  resize: vertical;
}
.analysis-import__input:focus,
.analysis-import__textarea:focus {
  outline: none;
  border-color: var(--ca-accent);
}
.analysis-import__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.analysis-import__btn {
  font-family: var(--ca-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--ca-chrome);
  background: var(--ca-chrome);
  color: var(--ca-on-chrome);
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
}
.analysis-import__btn:hover {
  opacity: 0.9;
}
.analysis-import__btn--ghost {
  background: transparent;
  color: var(--ca-ink);
  border-color: var(--ca-line);
}
.analysis-import__btn--ghost:hover {
  border-color: var(--ca-muted);
  opacity: 1;
}

/* Team pairings: accordion + mini board points */
.results-table--team-pairings th.col-boards,
.results-table--team-pairings td.col-boards {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.team-pairings__match.is-expandable {
  cursor: pointer;
}
.team-pairings__match.is-expandable:hover td {
  background: var(--ca-accent-soft);
}
.team-pairings__match.is-open td {
  background: var(--ca-accent-soft);
}
.team-pairings__mini {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ca-ink-soft);
  letter-spacing: 0.02em;
}
.team-pairings__bo {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
/* The match's boards open from this button (keyboard and screen readers); the row click stays a mouse shortcut. */
button.team-pairings__toggle {
  justify-content: center;
  padding: 0.15rem 0.3rem;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button.team-pairings__toggle:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}

/* Filter over long results tables (spec-tournament-page CAP-11). */
.results-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.75rem;
}
.results-filter__input {
  flex: 1 1 14rem;
  max-width: 24rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.6rem;
  font-family: var(--ca-font-body);
  font-size: 1rem;
  color: var(--ca-ink);
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
.results-filter__input:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 1px;
}
.results-filter__input::placeholder {
  color: var(--ca-muted);
  opacity: 1;
}
[data-theme="dark"] .results-filter__input {
  color-scheme: dark; /* the clear button follows the theme */
}
.results-filter__count {
  font-size: 0.85rem;
  color: var(--ca-muted);
  font-variant-numeric: tabular-nums;
}
.results-filter__empty {
  flex-basis: 100%;
  margin: 0;
  font-weight: 600;
  color: var(--ca-ink);
}
@media screen and (max-width: 767.98px) {
  .results-filter__input {
    min-height: 2.75rem;
    max-width: none;
  }
}

/* Phones: the key columns (rank or board, name, points / result) fit the screen; FED beside a flag, SNo and Title
   columns hide, the title shows before the name and ratings / points on a line under it, team standings show MP
   beside the team (spec-tournament-page CAP-5). */
.results-table .col-phone-key,
.results-phone-only,
.results-phone-meta {
  display: none;
}
@media screen and (max-width: 767.98px) {
  .results-table {
    font-size: 0.88rem;
  }
  .results-table th,
  .results-table td {
    padding: 0.45rem 0.4rem;
  }
  .results-table th.col-title,
  .results-table td.col-title,
  .results-table th.col-fed,
  .results-table td.col-fed,
  .results-table .col-phone-hide {
    display: none;
  }
  .results-table .col-phone-key {
    display: table-cell;
  }
  .results-phone-only {
    display: inline-block;
  }
  .results-phone-meta {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ca-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .results-table th.col-sticky-2,
  .results-table td.col-sticky-2 {
    min-width: 7rem;
  }
  /* Long names may break anywhere, so Bo. / White / Result / Black fit a 320px phone too. */
  .results-table td.col-name,
  .team-match__boards .results-table--team-boards td.col-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  /* The name column sticks at 2.75rem, so the first column is exactly that wide. */
  .results-table--sticky-name th.col-sticky,
  .results-table--sticky-name td.col-sticky {
    width: 2.75rem;
    min-width: 2.75rem;
  }
  .results-fed {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ca-muted);
  }
  /* The meta line keeps its contrast on a hovered or open row (accent background). */
  tr.is-linked:hover .results-phone-meta,
  .team-pairings__match.is-expandable:hover .results-phone-meta,
  .team-pairings__match.is-open .results-phone-meta {
    color: var(--ca-ink-soft);
  }
  .results-table--pairings td.col-result {
    min-width: 3.25rem;
  }
  .results-table--pairings td.col-board,
  .results-table--team-pairings td.col-board {
    width: auto;
    min-width: 0;
  }
  button.team-pairings__toggle {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
.team-pairings__caret {
  flex: 0 0 auto;
  color: var(--ca-muted);
  opacity: 0.9;
  transform-origin: 50% 45%;
  transition: transform 0.12s ease, color 0.12s ease;
}
.team-pairings__match.is-expandable:hover .team-pairings__caret {
  color: var(--ca-ink);
}
.team-pairings__match.is-open .team-pairings__caret {
  transform: rotate(180deg);
  color: var(--ca-ink);
}
.team-pairings__detail td {
  padding: 0 !important;
  border-bottom: 1px solid var(--ca-line);
  background: var(--ca-paper);
}
.team-pairings__detail-inner {
  padding: 0.65rem 0.75rem 0.85rem;
}
.team-pairings__detail-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
.team-pairings__match-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ca-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
}
.team-pairings__match-link:hover {
  color: var(--ca-accent-text);
}
.team-pairings__detail .results-table--team-boards {
  margin: 0;
  min-width: 0;
}

/* —— Privacy notice (/privacy: the owner's Markdown, story 14) —— */
.ca-legal {
  max-width: 44rem;
  margin: 1rem auto 2.5rem;
  color: var(--ca-ink);
  line-height: 1.6;
  overflow-wrap: break-word;
}
.ca-legal__title {
  font-family: var(--ca-font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}
.ca-legal__meta {
  color: var(--ca-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}
.ca-legal__note {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--ca-accent);
  background: var(--ca-surface);
}
.ca-legal__body h1,
.ca-legal__body h2,
.ca-legal__body h3 {
  font-family: var(--ca-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.6rem;
}
.ca-legal__body h1 { font-size: 1.35rem; }
.ca-legal__body h2 { font-size: 1.2rem; }
.ca-legal__body h3 { font-size: 1.05rem; }
.ca-legal__body a {
  color: var(--ca-ink);
  border-bottom: 1px solid var(--ca-accent);
  text-decoration: none;
}
.ca-legal__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1rem;
}
.ca-legal__body th,
.ca-legal__body td {
  border: 1px solid var(--ca-line);
  padding: 0.35rem 0.6rem;
  vertical-align: top;
}
/* —— Organizer help (/help, /help/<slug>: spec-site-discovery story 3, components/HelpGuide) —— */
.ca-help {
  max-width: 46rem;
  margin: 1rem auto 2.5rem;
  color: var(--ca-ink);
  line-height: 1.6;
  overflow-wrap: break-word;
}
.ca-help__kicker,
.ca-help__crumb {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-accent-text);
}
.ca-help__crumb a {
  color: var(--ca-accent-text);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-line);
}
.ca-help__crumb a:hover {
  border-bottom-color: var(--ca-accent);
}
.ca-help__title {
  font-family: var(--ca-font-display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
.ca-help__meta {
  color: var(--ca-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.ca-help__note {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--ca-accent);
  background: var(--ca-surface);
}
.ca-help__lede {
  font-size: 1.1rem;
  color: var(--ca-ink-soft);
  margin: 0 0 1.5rem;
}
.ca-help a:not(.ca-help-pager__link):not(.ca-club-btn) {
  color: var(--ca-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
}
.ca-help a:not(.ca-help-pager__link):not(.ca-club-btn):hover {
  color: var(--ca-accent-text);
}
.ca-help-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.ca-help-list__item {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  margin: 0 0 0.6rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-help-list__no {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ca-font-display);
  font-weight: 800;
  font-size: 0.95rem;
  background: var(--ca-accent-soft);
  color: var(--ca-ink);
}
.ca-help-list__main {
  min-width: 0;
}
.ca-help-list__title {
  font-family: var(--ca-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.1rem 0 0.25rem;
}
.ca-help-list__summary {
  margin: 0;
  color: var(--ca-muted);
}
.ca-help-toc {
  margin: 0 0 1.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-left: 3px solid var(--ca-accent);
  border-radius: 4px;
}
.ca-help-toc__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0 0 0.4rem;
}
.ca-help-toc__list {
  margin: 0;
  padding-left: 1.25rem;
}
.ca-help-toc__list li {
  margin: 0.15rem 0;
}
.ca-help__body h2,
.ca-help__body h3 {
  font-family: var(--ca-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.6rem;
  scroll-margin-top: 1rem;
}
.ca-help__body h2 {
  font-size: 1.3rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ca-line);
}
.ca-help__body h3 {
  font-size: 1.05rem;
}
.ca-help__body h2:target {
  border-top-color: var(--ca-accent);
}
.ca-help__body ol,
.ca-help__body ul {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
.ca-help__body li {
  margin: 0.3rem 0;
}
.ca-help__body strong {
  font-weight: 700;
}
.ca-help__body code {
  font-size: 0.9em;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  color: var(--ca-ink);
}
.ca-help__body blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 0.85rem;
  border-left: 3px solid var(--ca-line);
  color: var(--ca-ink-soft);
}
.ca-help-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}
.ca-help-pager__link {
  flex: 1 1 14rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.75rem 1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  color: var(--ca-ink);
  text-decoration: none;
}
.ca-help-pager__link:hover,
.ca-help-pager__link:focus-visible {
  border-color: var(--ca-accent);
  color: var(--ca-ink);
}
.ca-help-pager__link--next {
  text-align: right;
}
.ca-help-pager__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-help-pager__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ca-help__foot {
  border-top: 1px solid var(--ca-line);
  padding-top: 1rem;
  color: var(--ca-muted);
}
.ca-help__foot p,
.ca-help__contact {
  margin: 0 0 0.5rem;
}
@media (max-width: 575.98px) {
  .ca-help__title {
    font-size: 1.5rem;
  }
  .ca-help__lede {
    font-size: 1rem;
  }
  .ca-help-pager__link--next {
    text-align: left;
  }
}

/* —— Organizer landing and topic pages (/organize…: spec-site-discovery story 4, components/OrganizePages) —— */
.ca-org {
  max-width: 50rem;
  margin: 1rem auto 2.5rem;
  color: var(--ca-ink);
  line-height: 1.6;
  overflow-wrap: break-word;
}
.ca-org__kicker,
.ca-org__crumb {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-accent-text);
}
.ca-org__crumb a {
  color: var(--ca-accent-text);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-line);
}
.ca-org__crumb a:hover {
  border-bottom-color: var(--ca-accent);
}
.ca-org__title {
  font-family: var(--ca-font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}
.ca-org__lede {
  font-size: 1.1rem;
  color: var(--ca-ink-soft);
  margin: 0 0 1.25rem;
}
.ca-org__note {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--ca-accent);
  background: var(--ca-surface);
}
.ca-org a:not(.ca-club-btn) {
  color: var(--ca-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
}
.ca-org a:not(.ca-club-btn):hover {
  color: var(--ca-accent-text);
}
.ca-org-hero {
  padding: 0.5rem 0 1.5rem;
  border-bottom: 1px solid var(--ca-line);
  margin: 0 0 0.5rem;
}
.ca-org-cta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
}
.ca-org-cta__row .ca-club-btn {
  font-size: 1rem;
  padding: 0.65rem 1.15rem;
  white-space: normal;
}
.ca-org-section h2,
.ca-org-faq h2,
.ca-org-cta h2 {
  font-family: var(--ca-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 1rem;
}
.ca-org-section ul,
.ca-org-section ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
.ca-org-section li {
  margin: 0.35rem 0;
}
.ca-org-section p {
  margin: 0 0 0.85rem;
}
.ca-org-features {
  list-style: none;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}
.ca-org-features__item {
  margin: 0 !important;
  padding: 0.85rem 1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-org-features__title {
  font-family: var(--ca-font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}
.ca-org-features__item p {
  margin: 0;
  color: var(--ca-muted);
  font-size: 0.95rem;
}
.ca-org-steps {
  counter-reset: ca-step;
  list-style: none;
  padding: 0 !important;
}
.ca-org-steps li {
  counter-increment: ca-step;
  position: relative;
  padding: 0.1rem 0 0.4rem 2.6rem;
  min-height: 2rem;
}
.ca-org-steps li::before {
  content: counter(ca-step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ca-font-display);
  font-weight: 800;
  background: var(--ca-accent-soft);
  color: var(--ca-ink);
}
.ca-org-toc {
  margin: 1.5rem 0 0.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-left: 3px solid var(--ca-accent);
  border-radius: 4px;
}
.ca-org-toc__title {
  font-size: 0.8rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0 0 0.4rem !important;
}
.ca-org-toc__list {
  margin: 0;
  padding-left: 1.25rem;
}
.ca-org-faq__list {
  margin: 0;
}
.ca-org-faq__item {
  padding: 0.75rem 0;
  border-top: 1px solid var(--ca-line);
}
.ca-org-faq__item dt {
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.ca-org-faq__item dd {
  margin: 0;
  color: var(--ca-ink-soft);
}
.ca-org-cta {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-top: 3px solid var(--ca-accent);
  border-radius: 4px;
}
.ca-org-cta h2 {
  margin-top: 0;
}
.ca-org-cta p {
  margin: 0 0 0.5rem;
  color: var(--ca-ink-soft);
}
.ca-org-related {
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-line);
}
.ca-org-related__title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  margin: 0 0 0.5rem;
}
.ca-org-related ul {
  margin: 0;
  padding-left: 1.25rem;
}
.ca-org-related li {
  margin: 0.3rem 0;
  color: var(--ca-muted);
}
/* The round-robin table generator (views/organize/_generator.php). */
.ca-rr {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-rr > h2 {
  margin-top: 0;
}
.ca-rr-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 1rem 1.5rem;
}
.ca-rr-form__field {
  margin: 0 0 1rem;
  min-width: 0;
}
.ca-rr-form__field > label,
.ca-rr-form__field legend {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.3rem;
}
.ca-rr-form__cycles {
  border: 0;
  padding: 0;
}
.ca-rr-form__cycles label {
  display: block;
  font-weight: 400;
  margin: 0 0 0.2rem;
}
.ca-rr-form__number {
  max-width: 8rem;
}
.ca-rr-form textarea {
  font-family: var(--ca-font-body);
  min-height: 7rem;
}
.ca-rr-form__hint {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--ca-muted);
}
.ca-rr-form__error {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ca-live);
}
.ca-rr-form__summary {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--ca-live);
  background: var(--ca-live-soft);
}
.ca-rr-form__summary p,
.ca-rr-form__summary ul {
  margin: 0;
}
.ca-rr-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.ca-rr-form__actions .ca-club-btn {
  font-size: 1rem;
  padding: 0.6rem 1.15rem;
}
.ca-rr-form__note {
  font-size: 0.88rem;
  color: var(--ca-muted);
}
.ca-rr-result {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ca-line);
}
.ca-rr-result__title {
  font-family: var(--ca-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.ca-rr-result__meta,
.ca-rr-result__note,
.ca-rr-result__share {
  color: var(--ca-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}
.ca-rr-result__share a {
  overflow-wrap: anywhere;
}
.ca-rr-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.ca-rr-round {
  min-width: 0;
  padding: 0.6rem 0.75rem 0.5rem;
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  background: var(--ca-paper);
  break-inside: avoid;
}
.ca-rr-round__title {
  font-family: var(--ca-font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.ca-rr-round__cycle {
  font-family: var(--ca-font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ca-muted);
  margin-left: 0.35rem;
}
.ca-rr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  table-layout: fixed;
}
.ca-rr-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  text-align: left;
  padding: 0.2rem 0.3rem;
  border-bottom: 1px solid var(--ca-line);
}
.ca-rr-table td {
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid var(--ca-line);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.ca-rr-table th.num,
.ca-rr-table td.num {
  width: 4rem;
  text-align: right;
  padding-right: 0.75rem;
  white-space: nowrap;
}
.ca-rr-bye {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--ca-muted);
  overflow-wrap: anywhere;
}
.ca-rr-next {
  margin: 1.25rem 0 0;
}
.ca-rr-next h3 {
  font-family: var(--ca-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.ca-rr-next p {
  margin: 0 0 0.25rem;
}
/* Tie-break example table (Buchholz / Sonneborn-Berger pages) and the rating calculator. */
.ca-tb {
  margin: 1rem 0 0;
}
.ca-tb__scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ca-tb__scroll:focus-visible {
  outline: 2px solid var(--ca-accent, currentColor);
  outline-offset: 2px;
}
.ca-tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.ca-tb-table caption {
  caption-side: top;
  white-space: normal;
  color: var(--ca-muted);
  font-size: 0.9rem;
  padding: 0 0 0.4rem;
  text-align: left;
}
.ca-tb-table th,
.ca-tb-table td {
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid var(--ca-line);
  text-align: left;
  white-space: nowrap;
}
.ca-tb-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-tb-table thead abbr {
  text-decoration: none;
  cursor: help;
}
.ca-tb-table .num {
  text-align: right;
}
.ca-tb-table .is-marked {
  background: var(--ca-surface);
  font-weight: 700;
}
.ca-tb__legend {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--ca-muted);
}
.ca-calc {
  margin-top: 1rem;
}
.ca-calc-games {
  max-width: 26rem;
  table-layout: auto;
}
.ca-calc-games__caption {
  caption-side: top;
  font-weight: 600;
  color: var(--ca-ink);
  padding: 0 0 0.3rem;
}
.ca-calc-games td {
  padding: 0.2rem 0.3rem;
}
.ca-calc-games__input {
  max-width: 9rem;
}
.ca-calc-games__add {
  margin-top: 0.4rem;
}
.ca-calc-games__add[hidden] {
  display: none;
}
.ca-calc-table {
  table-layout: auto;
  font-variant-numeric: tabular-nums;
}
.ca-calc-table th.num,
.ca-calc-table td.num {
  width: auto;
}
.ca-calc-note {
  display: block;
  font-size: 0.8rem;
  color: var(--ca-muted);
  white-space: normal;
}
.ca-calc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.5rem 1rem;
  margin: 1rem 0;
}
.ca-calc-summary > div {
  min-width: 0;
}
.ca-calc-summary dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-calc-summary dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 575.98px) {
  .ca-org__lede {
    font-size: 1rem;
  }
  .ca-rr {
    padding: 0.9rem 0.85rem 1rem;
  }
  .ca-rr-form__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .ca-rr-rounds {
    grid-template-columns: minmax(0, 1fr);
  }
  .ca-tb-table th,
  .ca-tb-table td {
    padding: 0.25rem 0.2rem;
    font-size: 0.84rem;
  }
}
/* Printing a generated table prints the table only: no site header / footer, form, copy or calls to action. */
@media print {
  body:has(#rr-result) .header_section,
  body:has(#rr-result) .ca-site-footer,
  body:has(#rr-result) .ca-verify-banner,
  body:has(#rr-result) .ca-org > :not(#generator),
  body:has(#rr-result) #rr-form,
  body:has(#rr-result) #generator > h2 {
    display: none !important;
  }
  body:has(#rr-result),
  body:has(#rr-result) #main-container {
    background: #fff !important;
    color: #000 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body:has(#rr-result) .ca-org,
  body:has(#rr-result) .ca-rr,
  body:has(#rr-result) .ca-rr-round {
    max-width: none;
    margin: 0;
    border-color: #999;
    background: #fff;
    color: #000;
  }
  body:has(#rr-result) .ca-rr-result {
    border: 0;
    padding: 0;
    margin: 0;
  }
  body:has(#rr-result) .ca-rr-table th,
  body:has(#rr-result) .ca-rr-table td,
  body:has(#rr-result) .ca-rr-result__meta,
  body:has(#rr-result) .ca-rr-bye {
    color: #000;
    border-color: #999;
  }
}

/* —— Homepage: the organizer block (story 4) —— */
.site-index-organize {
  max-width: 44rem;
  margin: 3.5rem auto 1rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--ca-line);
}
.site-index-organize__title {
  font-family: var(--ca-font-display);
  font-size: clamp(1.3rem, 3.2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ca-ink);
  margin: 0 0 0.5rem;
}
.site-index-organize__text {
  color: var(--ca-muted);
  margin: 0 auto 1.1rem;
  max-width: 34rem;
  line-height: 1.5;
}
.site-index-organize__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
}
.site-index-organize__link {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
  font-weight: 600;
  color: var(--ca-ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.site-index-organize__link:hover,
.site-index-organize__link:focus-visible {
  border-color: var(--ca-ink);
  color: var(--ca-ink);
}

.ca-account input[type="checkbox"] + label a {
  color: var(--ca-ink);
  border-bottom: 1px solid var(--ca-accent);
  text-decoration: none;
}

/* —— Accounts (/account/*) —— */
.ca-account {
  max-width: 26rem;
  margin: 1rem auto 2rem;
  padding: 1.5rem 1.25rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  color: var(--ca-ink);
}
.ca-account__title {
  font-family: var(--ca-font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}
.ca-account__subtitle {
  font-family: var(--ca-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-line);
}
.ca-account__lede {
  color: var(--ca-muted);
  margin: 0 0 1rem;
}
.ca-account .form-label,
.ca-account label {
  font-weight: 600;
}
.ca-account .form-text {
  color: var(--ca-muted);
}
.ca-account__turnstile {
  margin: 0.25rem 0 1rem;
  min-height: 65px;
}
.ca-account__error {
  color: var(--ca-live);
  font-size: 0.875rem;
  margin-top: 0.35rem;
}
.ca-account__btn {
  display: inline-block;
  width: 100%;
  font-family: var(--ca-font-body);
  font-weight: 700;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ca-chrome);
  border-radius: 2px;
  background: var(--ca-chrome);
  color: var(--ca-on-chrome);
  cursor: pointer;
}
.ca-account__btn:hover {
  opacity: 0.9;
}
.ca-account__btn:focus-visible,
.ca-verify-banner__btn:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-account__btn--ghost {
  background: transparent;
  color: var(--ca-ink);
  border-color: var(--ca-line);
}
.ca-account__btn--ghost:hover {
  border-color: var(--ca-muted);
  opacity: 1;
}
.ca-account__btn--danger {
  background: var(--ca-live);
  border-color: var(--ca-live);
  color: var(--ca-paper);
}
.ca-account__list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--ca-ink);
}
.ca-account__list .ca-account__list {
  margin: 0.25rem 0 0.25rem;
  color: var(--ca-muted);
}
.ca-account__list li + li {
  margin-top: 0.3rem;
}
.ca-account__links {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--ca-muted);
}
.ca-account__links a {
  color: var(--ca-ink);
  border-bottom: 1px solid var(--ca-accent);
  text-decoration: none;
}

/* —— Contact form (/contact, spec-site-discovery story 2): the account card, wider for the message —— */
.ca-account.ca-contact {
  max-width: 36rem;
}
.ca-contact textarea.form-control {
  min-height: 10rem;
  resize: vertical;
}
.ca-contact .invalid-feedback {
  color: var(--ca-live);
}
.ca-nav-form {
  margin: 0;
}
.ca-verify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--ca-accent-soft);
  border: 1px solid var(--ca-accent);
  border-radius: 4px;
  color: var(--ca-ink);
  font-size: 0.925rem;
  overflow-wrap: anywhere;
}
.ca-verify-banner__form {
  margin: 0;
}
.ca-verify-banner__btn {
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--ca-ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ca-ink);
  cursor: pointer;
}

/* —— Clubs (/club/*: groups, members, players) —— */
.ca-club {
  max-width: 60rem;
  margin: 1rem auto 2rem;
  color: var(--ca-ink);
}
.ca-club__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
}
.ca-club__head-main {
  min-width: 0;
}
.ca-club__crumb {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
}
.ca-club__crumb a,
.ca-club__note a {
  color: var(--ca-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-line);
}
.ca-club__crumb a:hover {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
}
.ca-club__title {
  font-family: var(--ca-font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  overflow-wrap: anywhere;
}
.ca-club__title--panel {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.ca-club__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--ca-muted);
  font-size: 0.9rem;
}
.ca-club__lede,
.ca-club__note {
  color: var(--ca-muted);
  margin: 0 0 1rem;
}
.ca-club__note {
  font-size: 0.9rem;
}
.ca-club__muted {
  color: var(--ca-muted);
  font-weight: 400;
}
.ca-club__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--ca-line);
}
.ca-club__tab {
  display: inline-block;
  padding: 0.5rem 0;
  margin-bottom: -1px;
  color: var(--ca-muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.ca-club__tab:hover {
  color: var(--ca-ink);
}
.ca-club__tab.is-active {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
}
.ca-club__panel {
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
  padding: 1.25rem;
  margin: 0 0 1rem;
}
.ca-club__panel--narrow {
  max-width: 34rem;
}
.ca-club__panel--danger {
  border-color: var(--ca-live);
}
.ca-club__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.5rem;
}
/* Buttons side by side in a panel head (Print, Download TRF). */
.ca-club__panel-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ca-club__panel-head .ca-club__subtitle {
  margin: 0;
}
.ca-club__subtitle {
  font-family: var(--ca-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}
.ca-club__subtitle--small {
  font-size: 0.95rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-line);
}
.ca-club__fieldset {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--ca-line);
}
.ca-club__legend {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.ca-club .form-label,
.ca-club label {
  font-weight: 600;
}
.ca-club .form-text {
  color: var(--ca-muted);
}
.ca-club-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ca-club-btn {
  display: inline-block;
  font-family: var(--ca-font-body);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--ca-chrome);
  border-radius: 2px;
  background: var(--ca-chrome);
  color: var(--ca-on-chrome);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ca-club-btn:hover {
  opacity: 0.9;
  color: var(--ca-on-chrome);
}
.ca-club-btn:focus-visible,
.ca-club__tab:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-club-btn--ghost {
  background: transparent;
  color: var(--ca-ink);
  border-color: var(--ca-line);
}
.ca-club-btn--ghost:hover {
  border-color: var(--ca-muted);
  color: var(--ca-ink);
  opacity: 1;
}
.ca-club-btn--danger {
  background: var(--ca-live);
  border-color: var(--ca-live);
  color: var(--ca-paper);
}
.ca-club-btn--danger:hover {
  color: var(--ca-paper);
}
.ca-club-btn--small {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}
/* Tie-break picker under the tournament form's tie-break box (web/js/club/tie-breaks.js). */
.ca-club-tb {
  margin: -0.25rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
.ca-club-tb__title {
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.ca-club-tb__list {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}
.ca-club-tb__row {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--ca-line);
}
.ca-club-tb__row:last-child {
  border-bottom: 0;
}
.ca-club-tb__name {
  display: inline-block;
  margin-right: 0.5rem;
  overflow-wrap: anywhere;
}
.ca-club-tb__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  vertical-align: middle;
}
.ca-club-tb .ca-club-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ca-club-tb__add label {
  display: block;
  margin-bottom: 0.25rem;
}
.ca-club-tb__add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ca-club-tb__add-row select {
  flex: 1 1 auto;
  min-width: 0;
}
/* The Koya limit next to the select while KS is chosen (spec-club-tie-break-defaults). */
.ca-club-tb__add-row {
  flex-wrap: wrap;
}
.ca-club-tb__limit {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.ca-club-tb__limit[hidden] {
  display: none;
}
.ca-club-tb__add .ca-club-tb__limit label {
  display: inline;
  margin: 0;
  white-space: nowrap;
}
.ca-club-tb__limit input {
  width: 5.5rem;
}
.ca-club-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 2px;
  background: var(--ca-accent-soft);
  color: var(--ca-ink);
}
.ca-club-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ca-club-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0 0 0.5rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-club-card__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ca-club-card__name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ca-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.ca-club-card__name:hover {
  color: var(--ca-accent-text);
}
.ca-club-card__meta {
  color: var(--ca-muted);
  font-size: 0.85rem;
}
/* Start page (spec-organizer-onboarding story 2): two options, the primary one first and accented. */
.ca-club-start {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
}
.ca-club-start__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-club-start__option--primary {
  border-color: var(--ca-accent);
  box-shadow: inset 0 0 0 1px var(--ca-accent);
}
.ca-club-start__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.ca-club-start__text {
  margin: 0;
  flex: 1;
}
.ca-club-empty {
  color: var(--ca-muted);
  margin: 0;
}
.ca-club-table-wrap {
  overflow-x: auto;
  margin: 0 0 0.5rem;
}
.ca-club-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ca-club-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--ca-line);
  white-space: nowrap;
}
.ca-club-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--ca-line);
  vertical-align: middle;
}
.ca-club-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ca-club-table__wrap {
  overflow-wrap: anywhere;
  min-width: 10rem;
}
/* Round times (spec-club-round-times): "2026-10-12 14:05 UTC" stays on one line. */
.ca-club-table__time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ca-club-round-times {
  margin: 0 0 0.75rem;
}
.ca-club-table .ca-club-table__actions {
  text-align: right;
  white-space: nowrap;
}
.ca-club-table__actions > * + * {
  margin-left: 0.35rem;
}
/* Phones: long labels (German "Inhaberschaft übertragen") wrap inside the button instead of running past the screen. */
@media (max-width: 575.98px) {
  .ca-club-btn {
    white-space: normal;
    hyphens: auto;
  }
  .ca-club-table .ca-club-table__actions {
    white-space: normal;
  }
}
.ca-club-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.ca-club-inline-form .form-select {
  width: auto;
}
.ca-club-leave {
  margin: 0.75rem 0 0;
}
.ca-club-invite {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 0 0.75rem;
  align-items: start;
}
.ca-club-invite__submit {
  padding-top: 2rem;
}
/* Late entry (entrants page of a running tournament): one block per row */
.ca-club-late__pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0 0.75rem;
}
.ca-club-late__round {
  width: auto;
  min-width: 5rem;
}
.ca-club-late__byes {
  min-width: 0;
}
.ca-club-late__byes legend { /* Bootstrap 5 floats legends */
  float: none;
}
label.ca-club-inline-check { /* label.: beats .ca-club label's weight */
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 1rem 0.25rem 0;
  font-weight: 400;
  cursor: pointer;
}
.ca-club-ratings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 0.75rem;
}
@media (max-width: 575.98px) {
  .ca-club-invite {
    grid-template-columns: minmax(0, 1fr);
  }
  .ca-club-invite__submit {
    padding-top: 0;
    margin-bottom: 0.5rem;
  }
  .ca-club-ratings {
    grid-template-columns: minmax(0, 1fr);
  }
  .ca-club-late__pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .ca-club__panel {
    padding: 1rem;
  }
}

/* —— Club tournaments (/club/tournaments, /club/t/<id>/…) —— */
.ca-club--wide {
  max-width: 75rem;
}
.ca-club-badge--live {
  background: var(--ca-live-soft);
  color: var(--ca-live);
}
.ca-club-badge--muted {
  background: transparent;
  border: 1px solid var(--ca-line);
  color: var(--ca-muted);
}
.ca-club-badge--warn {
  background: transparent;
  border: 1px solid var(--ca-accent);
  color: var(--ca-accent);
}
.ca-club-strong {
  font-weight: 700;
}
.ca-club-dates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ca-club-checks {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.25rem 1rem;
}
.ca-club-checks label {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 400;
  cursor: pointer;
}
.ca-club-checks input {
  flex: none;
}
.ca-club-checks__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ca-club-checks__rating {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ca-club-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
}
.ca-club-facts dt {
  color: var(--ca-muted);
  font-weight: 600;
}
.ca-club-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ca-club-reg-count {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ca-club-reg-count progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  margin-top: 0.35rem;
  accent-color: var(--ca-accent);
}
.ca-club-reg-note {
  overflow-wrap: anywhere;
}
.ca-club-reg-table {
  table-layout: fixed;
}
.ca-club-reg-table th:last-child,
.ca-club-reg-table td:last-child {
  width: 5.5rem;
}
.ca-club-reg-table td:first-child {
  overflow-wrap: anywhere;
}
.ca-club-reg-more summary {
  cursor: pointer;
  color: var(--ca-muted);
}
.ca-club-reg-more[open] summary {
  margin-bottom: 0.5rem;
}
/* The ranked players of /g/<slug> (spec-club-page-rating-rank): the first 10 and the table behind "Show all" line up,
   because every column but the player's has one width in both tables: a set width that is also its minimum, and
   one-line cells (a long rating head, German "Schnellschach", widens its column the same way in both). The player
   column takes the rest. With one shown rating the table fits a 320 px phone and with two a 375 px one; with three
   it scrolls inside its wrap on a phone. */
.ca-club-rank th,
.ca-club-rank td {
  white-space: nowrap;
}
.ca-club-rank td.ca-club-table__wrap {
  white-space: normal;
}
.ca-club-rank .ca-club-rank__no {
  width: 3rem;
  min-width: 3rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ca-club-rank td.ca-club-rank__no {
  font-weight: 700;
}
.ca-club-rank .ca-club-rank__change {
  width: 4.5rem;
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ca-club-rank .num {
  width: 4rem;
  min-width: 4rem;
}
.ca-club-rank .ca-club-rank__points {
  width: 3.75rem;
  min-width: 3.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 575.98px) {
  .ca-club-rank .ca-club-rank__no {
    width: 2.5rem;
    min-width: 2.5rem;
  }
  .ca-club-rank .ca-club-rank__change {
    width: 4.25rem;
    min-width: 4.25rem;
  }
  .ca-club-rank .num {
    width: 3.5rem;
    min-width: 3.5rem;
  }
  .ca-club-rank .ca-club-rank__points {
    width: 2.75rem;
    min-width: 2.75rem;
  }
}
/* Phones up to 399 px: both ± columns fit without sideways scrolling, one shown rating at 320 px and two at 375 px
   (the widest cells: "Nouveau", "−160"). */
@media (max-width: 399.98px) {
  .ca-club-rank .ca-club-rank__no {
    width: 2.25rem;
    min-width: 2.25rem;
  }
  .ca-club-rank .ca-club-rank__change {
    width: 3.75rem;
    min-width: 3.75rem;
  }
  .ca-club-table--compact.ca-club-rank .ca-club-table__wrap {
    min-width: 4rem;
  }
}
/* The sign carries the meaning; the colour is extra. */
.ca-club-rank td.ca-club-rank__change,
.ca-club-rank td.ca-club-rank__points {
  color: var(--ca-muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.ca-club-rank td.ca-club-rank__change.is-up,
.ca-club-rank td.ca-club-rank__points.is-up {
  color: var(--ca-gain);
}
.ca-club-rank td.ca-club-rank__change.is-down,
.ca-club-rank td.ca-club-rank__points.is-down {
  color: var(--ca-loss);
}
.ca-club-rank td.ca-club-rank__change.is-new {
  color: var(--ca-accent-text);
  font-size: 0.78rem;
}
.ca-club-rank__note {
  margin: 0.5rem 0 0;
}
.ca-club-reg-share {
  margin-top: 1.5rem;
}
.ca-club-reg-share__link {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ca-club-reg-share__link input {
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
}
.ca-club-reg-story {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.ca-club-reg-faq dt {
  margin-top: 0.75rem;
  font-weight: 600;
}
.ca-club-reg-faq dd {
  margin: 0.15rem 0 0;
}
.ca-club-apps__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.ca-club-apps__filters a.is-active {
  font-weight: 600;
  text-decoration: none;
  color: var(--ca-ink);
}
.ca-club-apps__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.ca-club-apps__contact {
  min-width: 12rem;
  overflow-wrap: anywhere;
}
.ca-club-apps__contact a {
  white-space: nowrap;
}
.ca-club-apps__rating {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.ca-club-apps__rating input {
  width: 5rem;
}
.ca-club-apps__flag {
  display: block;
  color: var(--ca-danger);
  font-weight: 600;
}
.ca-club-apps__names {
  width: 100%;
  min-height: 6rem;
  margin-bottom: 0.5rem;
}
.ca-club-apps__pick {
  display: block;
  font-weight: 400;
  margin: 0 0 0.25rem;
  overflow-wrap: anywhere;
}
.ca-club-position {
  width: 4.5rem;
  margin-left: auto;
}
.ca-club-rounds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.ca-club-rounds__link {
  display: inline-block;
  min-width: 2.25rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ca-ink);
  text-decoration: none;
  border: 1px solid var(--ca-line);
  border-radius: 2px;
}
.ca-club-rounds__link:hover {
  border-color: var(--ca-muted);
  color: var(--ca-ink);
}
.ca-club-rounds__link.is-active {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.ca-club-pairings .ca-club-pairings__result {
  text-align: center;
  white-space: nowrap;
  width: 9rem;
}
.ca-club-result-select {
  width: auto;
  min-width: 6.5rem;
  display: inline-block;
}
.ca-club-table tr.is-annulled td {
  color: var(--ca-muted);
}
.ca-club-table tr.is-annulled td:nth-child(2),
.ca-club-table tr.is-annulled td:nth-child(4) {
  text-decoration: line-through;
}
.ca-club-unplayed {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  color: var(--ca-muted);
}
.ca-club-print-only {
  display: none;
}
.ca-club-xt {
  font-size: 0.9rem;
}
.ca-club-xt th.ca-club-xt__col,
.ca-club-xt td.ca-club-xt__cell,
.ca-club-xt td.ca-club-xt__self {
  text-align: center;
  padding: 0.35rem 0.3rem;
  min-width: 2rem;
  border-left: 1px solid var(--ca-line);
}
.ca-club-xt td.ca-club-xt__self {
  background: var(--ca-line);
}
.ca-club-xt__game {
  display: inline-block;
  min-width: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.ca-club-xt__game + .ca-club-xt__game {
  margin-left: 0.2rem;
}
.ca-club-xt__game--b {
  text-decoration: underline;
  text-decoration-color: var(--ca-muted);
  text-underline-offset: 2px;
}
.ca-club-xt__game.is-pending {
  color: var(--ca-muted);
  text-decoration: none;
}
@media (max-width: 575.98px) {
  .ca-club-dates {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Team round robins (story 8): teams with their rosters, a round's matches with their boards, lineups. */
.ca-club-team + .ca-club-team,
.ca-club-match + .ca-club-match,
.ca-club-match + .ca-club__note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-line);
}
.ca-club-team__name {
  font-family: var(--ca-font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}
.ca-club-team .ca-club__panel-head .ca-club-team__name {
  margin: 0;
}
.ca-club-match__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.5rem;
  font-family: var(--ca-font-display);
  font-size: 1rem;
  font-weight: 700;
}
.ca-club-match__side .ca-club-team__name {
  font-family: inherit;
  font-size: 0.95rem;
}
.ca-club-match-list li + li {
  margin-top: 0.3rem;
}
.ca-club-match__teams {
  overflow-wrap: anywhere;
}
.ca-club-match__score {
  font-variant-numeric: tabular-nums;
}
.ca-club-match__stage {
  font-family: inherit;
  font-weight: 400;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.ca-club-bracket__stage {
  display: block;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
/* The drawn knockout bracket (spec-club-knockout-bracket-draw): cards placed by KnockoutDrawing (rem), lines in one
   SVG; the box scrolls sideways, the page never does. Screen only (.ca-club-noprint): the round tables print. */
.ca-club-kd {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.ca-club-kd:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
.ca-club-kd__canvas {
  position: relative;
  font-size: 1rem;
}
.ca-club-kd__lines {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}
.ca-club-kd__line {
  fill: none;
  stroke: var(--ca-line);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}
.ca-club-kd__line--done {
  stroke: var(--ca-muted);
}
.ca-club-kd__col-head,
.ca-club-kd__label {
  position: absolute;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5rem;
  color: var(--ca-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-club-kd__card,
.ca-club-kd__chip {
  position: absolute;
  box-sizing: border-box;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 6px;
  color: var(--ca-ink);
}
.ca-club-kd__card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.25rem 0.5rem;
}
.ca-club-kd__card--decided {
  border-color: var(--ca-muted);
}
.ca-club-kd__head {
  font-size: 0.72rem;
  line-height: 1.1rem;
  color: var(--ca-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-club-kd__side,
.ca-club-kd__chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.45rem;
}
.ca-club-kd__chip {
  padding: 0 0.5rem;
  color: var(--ca-muted);
  border-style: dashed;
}
.ca-club-kd__seed {
  flex: 0 0 1.5rem;
  color: var(--ca-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ca-club-kd__name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-club-kd__side--open .ca-club-kd__name {
  color: var(--ca-muted);
  font-size: 0.78rem;
}
.ca-club-kd__score {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.ca-club-kd__stage {
  margin-left: 0.35rem;
  padding-left: 0.35rem;
  border-left: 1px solid var(--ca-line);
  color: var(--ca-muted);
  font-size: 0.78rem;
}
.ca-club-kd__side--won {
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--ca-accent);
  margin-left: -0.5rem;
  padding-left: 0.5rem;
}
.ca-club-kd__side--lost {
  color: var(--ca-muted);
}
.ca-club-kd__bye {
  flex: 0 0 auto;
  font-size: 0.75rem;
}
.ca-club-match__mp {
  font-weight: 400;
  font-size: 0.9rem;
}
.ca-club-match__sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.ca-club-lineup-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
}
.ca-club-lineup-row label {
  margin: 0;
  font-weight: 600;
  color: var(--ca-muted);
}
.ca-club-lineup {
  margin: 0;
  padding-left: 1.5rem;
}
.ca-club-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ca-club-select {
  max-width: 24rem;
}
@media (max-width: 575.98px) {
  .ca-club-lineup-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
}
@media print {
  .ca-club--print .ca-club-match,
  .ca-club--print .ca-club-team {
    break-inside: avoid;
  }
  .ca-club--print ol.ca-club-print-only {
    display: block;
  }
}

/* Print: rounds, standings and crosstable (pages marked .ca-club--print) print as plain black-on-white tables,
   without the site header, footer, tabs, forms and buttons. */
@media print {
  body:has(.ca-club--print) .header_section,
  body:has(.ca-club--print) .ca-site-footer,
  body:has(.ca-club--print) .ca-verify-banner,
  body:has(.ca-club--print) .alert:not(#stale-error),
  .ca-club-noprint,
  .ca-club--print .ca-club-result-select {
    display: none !important;
  }
  body:has(.ca-club--print),
  body:has(.ca-club--print) #main-container {
    background: #fff !important;
    color: #000 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .ca-club--print {
    max-width: none;
    margin: 0;
    color: #000;
  }
  .ca-club--print .ca-club__panel {
    border: 0;
    padding: 0;
    background: #fff;
  }
  .ca-club--print .ca-club__title {
    font-size: 16pt;
  }
  .ca-club--print .ca-club__meta,
  .ca-club--print .ca-club__note,
  .ca-club--print .ca-club__muted,
  .ca-club--print .ca-club-unplayed {
    color: #333;
  }
  .ca-club--print .ca-club-badge {
    background: transparent;
    border: 1px solid #999;
    color: #000;
  }
  .ca-club--print .ca-club-table-wrap {
    overflow: visible;
  }
  .ca-club--print .ca-club-table {
    font-size: 10pt;
  }
  .ca-club--print .ca-club-table th,
  .ca-club--print .ca-club-table td {
    color: #000;
    border-bottom: 1px solid #999;
    padding: 0.2rem 0.35rem;
  }
  .ca-club--print .ca-club-table tr {
    break-inside: avoid;
  }
  .ca-club--print .ca-club-xt td.ca-club-xt__self {
    background: #ddd;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .ca-club--print .ca-club-print-only {
    display: inline;
  }
  .ca-club--print a {
    color: #000;
    text-decoration: none;
  }
}
.ca-club-radios label {
  font-weight: 400;
  margin: 0 0 0.25rem;
}
.ca-club-table tr.is-stale td {
  background: var(--ca-live-soft);
}
/* Paste a player list (spec-organizer-quick-wins story 3): the text box and the preview's errors. */
.ca-club-paste__text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.ca-club-paste__error {
  color: var(--ca-danger);
  font-weight: 600;
}
.ca-club-paste__errors {
  margin: 0;
  padding-left: 1rem;
  color: var(--ca-danger);
  font-size: 0.85rem;
}
.ca-club-paste-preview tr.is-invalid td { background: color-mix(in srgb, var(--ca-danger) 8%, transparent); }
.ca-club-paste__nick {
  min-width: 8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ca-club-stale-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--ca-live);
  white-space: normal;
}
/* Per-board save (spec-organizer-quick-wins story 1): the row's state under its result select. */
.ca-club-autosave-status {
  display: block;
  min-height: 1em;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--ca-muted);
  white-space: normal;
}
.ca-club-table tr.is-unsaved .ca-club-autosave-status,
.ca-club-table tr.is-stale .ca-club-autosave-status {
  color: var(--ca-live);
}
.ca-club-table tr.is-unsaved td {
  background: var(--ca-live-soft);
}
.ca-club-xt td.ca-club-xt__unplayed {
  color: var(--ca-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* —— Public club pages (/clubs, /g/<slug>, /t/<id>…, /p/<nickname>) —— */
.ca-club-public-meta {
  margin: 0 0 0.5rem;
}
.ca-club-table a.ca-club-person,
.ca-club-unplayed a.ca-club-person,
.ca-club__note a.ca-club-person {
  color: var(--ca-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ca-line);
}
.ca-club-table a.ca-club-person:hover,
.ca-club-unplayed a.ca-club-person:hover,
.ca-club__note a.ca-club-person:hover {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
}
.ca-club-table__sub {
  display: block;
  color: var(--ca-muted);
  font-size: 0.8rem;
}
.ca-club-table--compact .ca-club-table__wrap {
  min-width: 7rem;
}
.ca-club-table--compact.ca-club-pairings .ca-club-pairings__result {
  width: auto;
}
.ca-club-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.ca-club-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.75rem 1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-club-stat__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-muted);
}
.ca-club-stat__value {
  font-family: var(--ca-font-display);
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ca-ink);
}
.ca-club-stat__meta {
  font-size: 0.8rem;
  color: var(--ca-muted);
}
/* A name as a stat (the team on a player card): smaller, and it wraps. */
.ca-club-stat__value--text {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
/* Player card (spec-club-player-tournament-games): the colour a player had, a small square with an sr-only word. */
.ca-club-pcard__colour {
  width: 1.25rem;
  text-align: center;
}
.ca-club-colour {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border: 1px solid var(--ca-muted);
  border-radius: 2px;
  vertical-align: -0.05em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.ca-club-colour--white {
  background: #fff;
}
.ca-club-colour--black {
  background: #1c1c1c;
}
.ca-club-pcard tfoot th,
.ca-club-pcard tfoot td {
  border-top: 2px solid var(--ca-line);
  font-weight: 700;
}
.ca-club-pcard tfoot th {
  text-align: right;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--ca-ink);
  white-space: normal;
}
.ca-club-line-figure {
  margin: 0 0 1rem;
}
.ca-club-line-figure figcaption {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.ca-club-line {
  display: block;
  width: 100%;
  max-width: 32rem;
  height: auto;
  overflow: visible;
}
.ca-club-line__guide {
  stroke: var(--ca-line);
  stroke-width: 1;
}
.ca-club-line__path {
  fill: none;
  stroke: var(--ca-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ca-club-line__dot {
  fill: var(--ca-accent);
  stroke: var(--ca-surface);
  stroke-width: 2;
}
.ca-club-line__hit {
  fill: transparent;
}
.ca-club-line__point:hover .ca-club-line__dot {
  fill: var(--ca-ink);
}
@media (max-width: 575.98px) {
  .ca-club-stats {
    gap: 0.35rem;
  }
  .ca-club-stat {
    padding: 0.5rem 0.6rem;
  }
  .ca-club-stat__value {
    font-size: 1.2rem;
  }
  .ca-club-table--compact th,
  .ca-club-table--compact td {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
  .ca-club-table--compact .ca-club-table__wrap {
    min-width: 5.5rem;
  }
}
.ca-club-meta-link {
  color: var(--ca-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
}
.ca-club-meta-link:hover {
  color: var(--ca-accent-text);
}
/* Organizer help on the manage pages (spec-site-discovery story 3): the "Help" link, the getting-started checklist,
   next-step empty states. */
.ca-club-help {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ca-ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
  white-space: nowrap;
}
.ca-club-help:hover,
.ca-club-help:focus-visible {
  color: var(--ca-accent-text);
}
.ca-club-help .fa-circle-question {
  font-size: 0.95em;
  color: var(--ca-accent-text);
}
.ca-club-next {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--ca-accent-soft);
  border: 1px solid var(--ca-line);
  border-left: 3px solid var(--ca-accent);
  border-radius: 4px;
}
.ca-club__panel .ca-club-next {
  margin: 0.25rem 0 0.75rem;
}
.ca-club-next__title {
  font-family: var(--ca-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ca-ink);
  margin: 0 0 0.35rem;
}
.ca-club-next .ca-club__note {
  color: var(--ca-ink-soft);
  margin-bottom: 0.6rem;
}
.ca-club-next .ca-club__note:last-child,
.ca-club-next .ca-club-row:last-child {
  margin-bottom: 0;
}
.ca-club-next .ca-club__note a {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
}
/* Onboarding story 5: the next-step panel under the tournament tabs (views/club/shared/_next-step). */
.ca-club-next__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ca-ink-soft);
  margin: 0 0 0.15rem;
}
.ca-club-next__blockers {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ca-ink-soft);
}
.ca-club-next__blockers li + li {
  margin-top: 0.3rem;
}
.ca-club-next__blockers a {
  color: var(--ca-ink);
  border-bottom-color: var(--ca-accent);
  white-space: nowrap;
}
#next-step {
  margin-top: 0.75rem;
}
/* Onboarding story 9: the "Round complete" bar under a round's boards (views/club/round/_round-complete). */
.ca-club-done {
  margin: 1rem 0 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-left: 3px solid var(--ca-accent);
  border-radius: 4px;
}
.ca-club-done__title {
  font-family: var(--ca-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ca-ink);
  margin: 0 0 0.2rem;
}
.ca-club-done__next {
  color: var(--ca-ink-soft);
  margin: 0 0 0.6rem;
}
.ca-club-done .ca-club-row {
  margin-bottom: 0;
}
.ca-club-choice__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0.5rem 0 0.9rem;
}
@media (min-width: 768px) {
  .ca-club-choice__grid {
    grid-template-columns: 1fr 1fr;
  }
}
.ca-club-choice__option {
  padding: 0.75rem 0.9rem;
  background: var(--ca-surface);
  border: 1px solid var(--ca-line);
  border-radius: 4px;
}
.ca-club-choice__title {
  font-family: var(--ca-font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ca-ink);
  margin: 0 0 0.3rem;
}
.ca-club-choice__option .ca-club__note {
  margin-bottom: 0.6rem;
}
.ca-club-choice__option .ca-club-row:last-child {
  margin-bottom: 0;
}
.ca-club-checklist {
  border-left: 3px solid var(--ca-accent);
}
.ca-club-checklist__steps {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.ca-club-checklist__step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
}
.ca-club-checklist__mark {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--ca-line);
  color: var(--ca-ink);
  background: var(--ca-paper);
}
.ca-club-checklist__step.is-done .ca-club-checklist__mark {
  background: var(--ca-chrome);
  border-color: var(--ca-chrome);
  color: var(--ca-on-chrome);
}
.ca-club-checklist__step.is-done .ca-club-checklist__label {
  color: var(--ca-muted);
  text-decoration: line-through;
  text-decoration-color: var(--ca-line);
}
a.ca-club-checklist__label {
  color: var(--ca-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ca-accent);
}
a.ca-club-checklist__label:hover {
  color: var(--ca-accent-text);
}
.ca-club-checklist__help {
  margin: 0;
}

/* ── Cookie banner (views/layouts/_consent.php): Google Analytics only after "Accept" ── */
.ca-consent {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 1080;
  width: calc(100% - 2rem);
  max-width: 44rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--ca-surface);
  color: var(--ca-ink);
  border: 1px solid var(--ca-line);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-family: var(--ca-font-body);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.ca-consent[hidden] {
  display: none;
}
.ca-consent__text {
  flex: 1 1 22rem;
  margin: 0;
}
.ca-consent__text a {
  color: inherit;
  text-decoration: underline;
}
.ca-consent__actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}
/* Accept and Reject look the same: refusing is as easy as accepting. */
.ca-consent__btn {
  min-width: 6.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--ca-on-chrome);
  background: var(--ca-chrome);
  border: 1px solid var(--ca-chrome);
  border-radius: 4px;
  cursor: pointer;
}
.ca-consent__btn:hover {
  opacity: 0.9;
}
.ca-consent__btn:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}
@media (max-width: 575.98px) {
  .ca-consent {
    bottom: 0.5rem;
    width: calc(100% - 1rem);
    padding: 0.8rem;
  }
  .ca-consent__actions {
    flex: 1 1 100%;
  }
  .ca-consent__btn {
    flex: 1 1 0;
  }
}
@media print {
  .ca-consent {
    display: none !important;
  }
}

/* Organizer round schedule (modules/broadcast, story 2): one row per round, inputs sized to their content; the
   table scrolls inside its wrap on phones, the page never does. */
.ca-bc-rounds input[type="datetime-local"] { min-width: 11.5rem; }
.ca-bc-rounds input[type="number"] { width: 6rem; }
.ca-bc-rounds input[type="text"] { min-width: 10rem; }
.ca-bc-rounds .ca-bc-rounds__check { text-align: center; vertical-align: middle; }
.ca-bc-rounds tr.is-invalid td { background: color-mix(in srgb, var(--ca-danger) 8%, transparent); }
/* Push feed pages (story 3): the curl example and the pasted PGN keep their lines; long keys and URLs wrap. */
.ca-bc-curl { white-space: pre-wrap; word-break: break-all; font-size: 0.85rem; }
.ca-bc-pgn { font-family: var(--bs-font-monospace, monospace); font-size: 0.85rem; }
#new-key, #push-urls code { word-break: break-all; }

/* Club pairings: points before this round after a player's name (spec-club-pairing-scores-before-round). */
.ca-club-pts-before {
  color: var(--ca-muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
