/*
 * chess-days-live.css — live championship coverage on /chess-days/
 * (#cd-broadcast, #cd-standings, #cd-crosstable, #cd-rounds) plus the small
 * schedule extras (today marker, "to be confirmed" tag). Linked inline from
 * the page body. Reuses the site design tokens; rendered client-side by
 * assets/js/chess-days-live.js.
 * Title badges (.cd-title) come from chess-days-players.css.
 */

/* --- Schedule extras (inside #schedule; the day tiles + today marker live
   in main.css's .schedule-flat block) ------------------------------------- */
.cd-tbc {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #92400e;
  background: color-mix(in srgb, #f59e0b, transparent 82%);
}
.schedule .schedule-item .cd-results-link {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* The standings section was once #live: an invisible alias keeps links shared
   under that name landing below the fixed header, like a section would. */
.cd-anchor-alias {
  display: block;
  scroll-margin-top: var(--header-height);
}

/* --- Status bar (#cd-standings) -------------------------------------------- */
.cd-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 18px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--default-color), transparent 94%);
}
.cd-status-bar:not(:has(> :not([hidden]))) {
  display: none;
}
.cd-updated,
.cd-error-pill,
.cd-round-pill {
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.cd-updated {
  color: var(--heading-color);
  background: color-mix(in srgb, var(--heading-color), transparent 90%);
}
.cd-error-pill {
  color: #b54708;
  background: color-mix(in srgb, #db8a33, transparent 86%);
}
.cd-round-pill {
  font-weight: 700;
  color: var(--contrast-color, #fff);
  background: var(--accent-color);
}
.cd-round-pill.is-live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: cd-pulse 1.4s ease-in-out infinite;
}
@keyframes cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-round-pill.is-live::before { animation: none; }
}
.cd-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}
.cd-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  /* Accent like the page's other pills (.cd-player-more), but a
     shade darker: plain accent text drops below 4.5:1 on the grey
     (#f2f2f3) sections these buttons can sit on; this keeps AA on both. */
  color: color-mix(in srgb, var(--accent-color), black 15%);
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 55%);
  transition: background 0.2s ease, color 0.2s ease;
}
.cd-link-btn:hover,
.cd-link-btn:focus {
  color: var(--contrast-color, #fff);
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.cd-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-playoff {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-color);
}
/* Below the standings once the event is complete: the label, then the
   champion's linked name on its own line. */
.cd-champion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 18px 0 0;
  text-align: center;
  font-family: var(--heading-font);
  font-weight: 700;
}
.cd-champion-label {
  font-size: 15px;
  color: var(--accent-color);
}
.cd-champion .cd-name {
  font-size: 22px;
  color: var(--heading-color);
  white-space: normal;
  justify-content: center;
}
.cd-champion .cd-name .cd-title {
  font-size: 13px;
}
.cd-empty {
  text-align: center;
  font-style: italic;
  opacity: 0.7;
  margin: 0;
}
.cd-skeleton {
  text-align: center;
  opacity: 0.55;
  font-style: italic;
  padding: 18px 0;
}

/* --- Shared card ---------------------------------------------------------- */
.cd-card {
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}
.cd-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Player name → roster card link */
.cd-ref {
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, currentColor, transparent 60%);
  text-underline-offset: 2px;
}
.cd-ref:hover,
.cd-ref:focus {
  color: var(--accent-color);
  text-decoration-color: var(--accent-color);
}
.cd-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.cd-name .cd-title {
  font-size: 11px;
  padding: 0 6px;
}
.cd-rating {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--default-color), transparent 45%);
  margin-left: 6px;
}

/* --- Standings table ------------------------------------------------------ */
.cd-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}
.cd-standings-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  padding: 6px 8px;
  text-align: center;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 78%);
  white-space: nowrap;
}
.cd-standings-table th.cd-col-player {
  text-align: left;
}
.cd-standings-table td {
  padding: 9px 8px;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 90%);
  font-variant-numeric: tabular-nums;
}
.cd-standings-table tbody tr:first-child td {
  border-top: 0;
}
.cd-standings-table td.cd-col-player {
  text-align: left;
}
.cd-standings-table td.cd-rank {
  font-weight: 800;
  color: var(--heading-color);
  width: 64px; /* room for a medal: "🥇 1=" */
  white-space: nowrap;
}
.cd-standings-table td.cd-score {
  font-weight: 800;
  font-size: 15px;
  color: var(--heading-color);
}
.cd-standings-table td.cd-tb {
  color: color-mix(in srgb, var(--default-color), transparent 30%);
  font-size: 13px;
}
/* The podium (ranks 1–3 once play starts): tinted rows as on Lazareta Open,
   the tint fading from 1st to 3rd. */
.cd-standings-table tr.is-top-1 td {
  background: color-mix(in srgb, var(--accent-color), transparent 86%);
}
.cd-standings-table tr.is-top-2 td {
  background: color-mix(in srgb, var(--accent-color), transparent 91%);
}
.cd-standings-table tr.is-top-3 td {
  background: color-mix(in srgb, var(--accent-color), transparent 95%);
}
/* The rank cell's two fixed slots (chess-days-live.js): the medal on the
   left, the number right-aligned — so numbers line up whatever their width
   and whether a row has a medal. A tie's "=" hangs past the number instead
   of pushing it. */
.cd-standings-table .cd-medal {
  display: inline-block;
  width: 22px;
  text-align: left;
}
.cd-standings-table .cd-rank-n {
  position: relative;
  display: inline-block;
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cd-standings-table tr.cd-tied .cd-rank-n::after {
  content: "=";
  position: absolute;
  left: 100%;
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.7;
}

/* --- Cross-table ---------------------------------------------------------- */
.cd-crosstable {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin: 0 auto;
}
.cd-crosstable th,
.cd-crosstable td {
  padding: 6px 4px;
  text-align: center;
  min-width: 34px;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 90%);
  font-variant-numeric: tabular-nums;
}
.cd-crosstable thead th {
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 78%);
}
/* The rank and name columns stay put while the results scroll sideways on a
   phone. Both are pinned: the rank at the left edge with a fixed width, the
   name right after it — pinning only the name let the results slide through
   the gap the rank left behind. */
.cd-crosstable th.cd-ct-rank,
.cd-crosstable td.cd-ct-rank {
  position: sticky;
  left: 0;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  background: var(--surface-color);
  /* A pinned cell stops at the card's padding; this covers that strip too,
     so no result shows to the left of the rank. */
  box-shadow: -18px 0 0 var(--surface-color);
  z-index: 1;
}
.cd-crosstable td.cd-ct-rank {
  font-weight: 800;
  color: var(--heading-color);
}
.cd-crosstable th.cd-ct-name,
.cd-crosstable td.cd-ct-name {
  text-align: left;
  white-space: nowrap;
  min-width: 150px;
  position: sticky;
  left: 34px;
  background: var(--surface-color);
  z-index: 1;
  padding-left: 8px;
  padding-right: 10px;
}
.cd-crosstable td.cd-ct-self {
  background:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--heading-color), transparent 88%) 0 4px, transparent 4px 8px);
}
.cd-crosstable td.cd-ct-w { color: #047857; font-weight: 800; }
.cd-crosstable td.cd-ct-d { color: #1d4ed8; font-weight: 700; }
.cd-crosstable td.cd-ct-l { color: #b91c1c; font-weight: 700; }
.cd-crosstable td.cd-ct-live {
  color: var(--accent-color);
  font-weight: 800;
}
.cd-crosstable td.cd-ct-pts {
  font-weight: 800;
  color: var(--heading-color);
  border-left: 2px solid color-mix(in srgb, var(--accent-color), transparent 78%);
  min-width: 44px;
}
/* Each played / scheduled pairing opens its game (chess-days-live.js). */
.cd-crosstable td[data-ct-game] {
  cursor: pointer;
  border-radius: 4px;
}
.cd-crosstable td[data-ct-game]:hover,
.cd-crosstable td[data-ct-game]:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}
/* The cell's tooltip: one floating box on <body>, placed by the script. */
.cd-ct-tip {
  position: fixed;
  z-index: 1080;
  max-width: min(340px, calc(100vw - 16px));
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-color);
  color: var(--default-color);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18), 0 0 0 1px color-mix(in srgb, var(--heading-color), transparent 88%);
  font-size: 13px;
  pointer-events: none;
}
.cd-ct-tip[hidden] { display: none; }
.cd-ct-tip-head,
.cd-ct-tip-foot {
  font-size: 12px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  white-space: nowrap;
}
.cd-ct-tip-game {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  font-size: 14px;
  white-space: nowrap;
}
.cd-ct-tip-game .cd-side.win { font-weight: 800; color: var(--heading-color); }
.cd-ct-tip-game .cd-side.lose { opacity: 0.7; }
.cd-crosstable-legend {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

/* --- Rounds --------------------------------------------------------------- */
.cd-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}
.cd-round {
  position: relative;
  container-type: inline-size;
}
.cd-round.is-current {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 82%);
}
.cd-round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 78%);
}
.cd-round-title {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 17px;
  font-weight: 700;
  color: var(--heading-color);
}
.cd-round-when {
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  font-variant-numeric: tabular-nums;
}
.cd-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cd-badge.up { background: color-mix(in srgb, var(--default-color), transparent 88%); color: color-mix(in srgb, var(--default-color), transparent 25%); }
.cd-badge.live { background: color-mix(in srgb, var(--accent-color), transparent 82%); color: var(--accent-color); }
.cd-badge.live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: cd-pulse 1.4s ease-in-out infinite;
}
.cd-badge.done { background: color-mix(in srgb, #047857, transparent 86%); color: #047857; }
.cd-games {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cd-game {
  display: grid;
  /* board · white · □ · result · ■ · black */
  grid-template-columns: 22px 1fr auto auto auto 1fr;
  align-items: center;
  gap: 4px;
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  font-size: 14px;
}
.cd-game:first-child {
  border-top: 0;
}
.cd-board {
  font-size: 11px;
  color: color-mix(in srgb, var(--default-color), transparent 50%);
  font-variant-numeric: tabular-nums;
}
.cd-side {
  min-width: 0;
  line-height: 1.3;
}
.cd-side.w { text-align: right; }
.cd-side.b { text-align: left; }
.cd-side.win { font-weight: 800; color: var(--heading-color); }
.cd-side.lose { opacity: 0.7; }
/* One line per side: a surname too long for its column ends in an ellipsis
   (the full name is in its tooltip) rather than wrapping. */
.cd-side .cd-name {
  max-width: 100%;
  align-items: center;
}
.cd-side .cd-ref {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-side.w .cd-name { justify-content: flex-end; }
.cd-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 55%);
  flex-shrink: 0;
}
.cd-color.w { background: #fff; }
.cd-color.b { background: #1f2937; }
.cd-result {
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--heading-color);
  background: color-mix(in srgb, var(--heading-color), transparent 90%);
}
/* A round's result opens its game (chess-days-live.js), as the cross-table does. */
.cd-result[data-cd-open-game] {
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.cd-result[data-cd-open-game]:hover,
.cd-result[data-cd-open-game]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-color);
}
.cd-result.pend {
  color: color-mix(in srgb, var(--default-color), transparent 50%);
  font-weight: 600;
  background: transparent;
}
.cd-result.live {
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color), transparent 85%);
}
/* Per-side score, same colours as the cross-table. */
.cd-res-w { color: #047857; }
.cd-res-d { color: #1d4ed8; }
.cd-res-l { color: #b91c1c; }

/* --- Player highlight (chess-days-live.js) -------------------------------
   A crosshair beside each name in the standings and the cross-table (a small
   × on the marked player, to clear it);
   a «Highlighting: X ×» chip tops each table while a player is marked. */
[data-cd-standings],
[data-cd-crosstable],
[data-cd-rounds],
[data-cd-boards] {
  /* A highlighter amber, not the accent: the standings already tint the
     podium rows in the accent, and a highlighted 8th must not read as a
     medallist. Opaque tints (mixed into the surface, not transparent): the
     cross-table's pinned rank and name cells must still cover the results
     sliding under them. */
  --cd-hl-ink: #b07d00;
  --cd-hl: color-mix(in srgb, #ffc533 18%, var(--surface-color));
  --cd-hl-strong: color-mix(in srgb, #ffc533 34%, var(--surface-color));
}
.cd-hl-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-left: -3px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: color-mix(in srgb, var(--default-color), transparent 62%);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.cd-hl-btn:hover,
.cd-hl-btn:focus-visible {
  outline: none;
  color: var(--cd-hl-ink);
  background: var(--cd-hl);
}
.cd-hl-btn.is-on {
  color: var(--heading-color);
  background: #ffc533;
  font-size: 10px;
}
.cd-hl-chip {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin: 0 auto 12px;
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  background: var(--cd-hl-strong);
  font-size: 13px;
  color: var(--heading-color);
}
.cd-hl-chip[hidden] { display: none; }
.cd-hl-chip-label {
  color: color-mix(in srgb, var(--heading-color), transparent 30%);
}
.cd-hl-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-hl-clear {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 11px;
  cursor: pointer;
}
.cd-hl-clear:hover,
.cd-hl-clear:focus-visible {
  outline: none;
  background: var(--heading-color);
  color: var(--surface-color);
}
.cd-hl-on .cd-standings-table tr.is-hl td {
  background: var(--cd-hl-strong);
}
.cd-hl-on .cd-standings-table tr.is-hl td:first-child {
  box-shadow: inset 3px 0 0 var(--cd-hl-ink);
}
.cd-hl-on .cd-crosstable tr.is-hl td,
.cd-hl-on .cd-crosstable .is-hl-col {
  background: var(--cd-hl);
}
.cd-hl-on .cd-crosstable tr.is-hl td.cd-ct-name,
.cd-hl-on .cd-crosstable tr.is-hl td.cd-ct-rank,
.cd-hl-on .cd-crosstable th.is-hl-col {
  background: var(--cd-hl-strong);
  color: var(--heading-color);
}
.cd-hl-on .cd-crosstable tr.is-hl td.cd-ct-rank {
  box-shadow: -18px 0 0 var(--surface-color), inset 3px 0 0 var(--cd-hl-ink);
}
.cd-hl-on .cd-game {
  transition: opacity 0.2s ease;
}
.cd-hl-on .cd-game:not(.is-hl) {
  opacity: 0.4;
}
.cd-hl-on .cd-game.is-hl {
  margin: 0 -6px;
  padding-left: 6px;
  padding-right: 6px;
  border-radius: 8px;
  background: var(--cd-hl);
}
.cd-hl-on .cd-side.is-hl { opacity: 1; }
/* Live boards: the player's board is ringed in the highlight amber and the
   other boards fade (chess-days-boards.js sets .cd-hl-on only when the player
   is on one of the round's boards). */
.cd-gb-grid.cd-hl-on .cd-gb {
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.cd-gb-grid.cd-hl-on .cd-gb:not(.is-hl) {
  opacity: 0.45;
}
.cd-gb-grid.cd-hl-on .cd-gb.is-hl {
  border-color: var(--cd-hl-ink);
  box-shadow: 0 0 0 2px #ffc533, 0 2px 14px rgba(15, 23, 42, 0.05);
  background: var(--cd-hl);
}
/* The toggle on a board card: small, right after the name; whatever follows
   (material, score, clock) keeps to the right edge. */
.cd-gb-player:has(.cd-hl-btn) .cd-gb-name { flex: 0 1 auto; }
.cd-gb-player .cd-hl-btn {
  width: 20px;
  height: 20px;
  margin: 0 auto 0 -4px;
  font-size: 11px;
}
.cd-gb-player .cd-hl-btn.is-on { font-size: 9px; }
/* In the rounds the White toggle sits before the name, the Black after. */
.cd-side .cd-name { gap: 3px; }
.cd-side .cd-hl-btn {
  width: 20px;
  height: 20px;
  margin: 0;
  font-size: 11px;
}
.cd-side .cd-hl-btn.is-on { font-size: 9px; }
.cd-gb-player.is-hl .cd-gb-name {
  color: var(--heading-color);
  font-weight: 800;
  text-decoration: underline solid var(--cd-hl-ink) 2px;
  text-underline-offset: 3px;
}
.cd-hl-on .cd-side.is-hl .cd-ref {
  color: var(--heading-color);
  font-weight: 800;
  text-decoration: underline solid var(--cd-hl-ink) 2px;
  text-underline-offset: 3px;
}

/* --- Broadcast (#cd-broadcast) --------------------------------------------
   Click-to-load facade: the poster is server-rendered so the section is never
   blank, and the <iframe> only replaces it once the visitor presses play. The
   same box renders the "nothing on air" placeholder. ---------------------- */
.cd-bc {
  max-width: 960px;
  margin: 0 auto;
}
.cd-bc-status {
  text-align: center;
  margin: 0 0 12px;
  font-size: 14px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-bc-status.is-live {
  color: var(--accent-color);
  font-weight: 700;
}
.cd-bc-frame {
  /* Where the play button sits: the empty stretch of water between the title
     and the knight in broadcast-poster.jpg (dead centre would cover the title).
     Re-check both whenever the poster changes. */
  --cd-bc-play-x: 65%;
  --cd-bc-play-y: 47%;
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
}
.cd-bc-frame iframe,
.cd-bc-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cd-bc-poster {
  object-fit: cover;
}
.cd-bc-play {
  position: absolute;
  left: var(--cd-bc-play-x, 50%);
  top: var(--cd-bc-play-y, 50%);
  transform: translate(-50%, -50%);
  width: 76px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.15s ease;
}
.cd-bc-play:hover,
.cd-bc-play:focus-visible {
  background: var(--accent-color);
  transform: translate(-50%, -50%) scale(1.06);
}
/* The inert glyph shown while nothing is playable yet (a <span>, not the
   button): same shape and spot, so the box reads as a video, but greyed like
   a disabled control and deaf to the pointer so it never pretends to be
   clickable. Grey rather than a fainter navy: a dimmed dark disc vanishes
   into the bright water of the poster. */
.cd-bc-play.is-idle {
  background: rgba(100, 116, 139, 0.78);
  color: rgba(255, 255, 255, 0.8);
  cursor: default;
  pointer-events: none;
}
.cd-bc-play-label {
  position: absolute;
  left: var(--cd-bc-play-x, 50%);
  bottom: 14px;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
/* Countdown to the next stream's first move: top-right, over open water in
   broadcast-poster.jpg — clear of the title and of the play button, which can
   be up at the same time (during the pre-roll). */
.cd-bc-countdown {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  line-height: 1;
  pointer-events: none;
}
.cd-bc-countdown-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}
.cd-bc-countdown-time {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
/* A finished round's badge + replay icon (#cd-rounds), kept on one line. */
.cd-round-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
}
/* Replay icon button in a finished round's card head. */
.cd-replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--accent-color);
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 65%);
}
.cd-replay:hover,
.cd-replay:focus {
  color: var(--contrast-color, #fff);
  background: var(--accent-color);
}
/* A narrow card can't fit the title, weekday, date, badge and replay icon on
   one line, so a finished card with a replay drops the weekday there; the
   date and time stay. */
@container (max-width: 350px) {
  .cd-round.has-replay .cd-round-wd { display: none; }
}

@media (max-width: 575px) {
  .cd-standings-table { min-width: 480px; font-size: 13px; }
  .cd-standings-table th, .cd-standings-table td { padding: 7px 5px; }
  .cd-rating { display: none; }
  .cd-game { font-size: 13px; grid-template-columns: 18px 1fr auto auto auto 1fr; }
  .cd-result { min-width: 44px; padding: 2px 5px; }
  .cd-status-bar { padding: 10px 12px; }
  .cd-bc-play { width: 60px; height: 42px; font-size: 21px; }
  /* No room for the caption on a phone-width poster (it runs into the date
     line); the button keeps it as its aria-label. */
  .cd-bc-play-label { display: none; }
  .cd-bc-countdown { top: 8px; right: 8px; gap: 6px; padding: 5px 9px; border-radius: 9px; }
  .cd-bc-countdown-label { font-size: 11px; }
  .cd-bc-countdown-time { font-size: 16px; }
  .cd-bc-status { font-size: 13px; }
}

/* --- Live boards (#cd-boards, chess-days-boards.js) ----------------------
   Five cards side by side on desktop (3 + 2 on tablets, 2 per row on
   phones), each: board no. + state, Black on top, the board, White below —
   the board's orientation. The squares are ONE conic-gradient checker on
   .cd-gb-chessboard (a8 light), so only the pieces are images; the last move is a
   tint on its two squares. -------------------------------------------------- */
.cd-gb-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.cd-gb-status {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-gb-status.is-live {
  color: var(--accent-color);
  font-weight: 700;
}
.cd-gb-status.is-live::before,
.cd-gb-state.is-live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  animation: cd-pulse 1.4s ease-in-out infinite;
}
.cd-gb-status.is-error {
  color: #b54708;
}
.cd-gb-rounds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.cd-gb-rounds[hidden] {
  display: none;
}
.cd-gb-rounds-label {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--heading-color), transparent 30%);
}
.cd-gb-round {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 78%);
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cd-gb-round.is-done {
  background: color-mix(in srgb, var(--heading-color), transparent 92%);
}
.cd-gb-round:hover:not(:disabled):not(.is-current),
.cd-gb-round:focus-visible {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.cd-gb-round.is-current {
  background: var(--heading-color);
  border-color: var(--heading-color);
  color: #fff;
}
.cd-gb-round.is-live::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface-color);
  background: var(--accent-color);
  animation: cd-pulse 1.4s ease-in-out infinite;
}
.cd-gb-round:disabled {
  opacity: 0.4;
  cursor: default;
}

.cd-gb-grid {
  --cd-gb-gap: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--cd-gb-gap);
}
.cd-gb-empty {
  flex: 0 0 100%;
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-gb {
  flex: 0 0 calc((100% - 4 * var(--cd-gb-gap)) / 5);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 10px 9px;
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}
.cd-gb.is-live {
  border-color: color-mix(in srgb, var(--accent-color), transparent 55%);
}
.cd-gb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--heading-color), transparent 35%);
}
.cd-gb-head > span {
  white-space: nowrap;
}
.cd-gb-state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-gb-state.is-live {
  color: var(--accent-color);
}
.cd-gb-player {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 22px;
  font-size: 13px;
  line-height: 1.25;
}
.cd-gb-player .cd-title {
  flex-shrink: 0;
  font-size: 10px;
  padding: 0 5px;
}
.cd-gb-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--heading-color);
}
.cd-gb-clock,
.cd-gb-score {
  flex-shrink: 0;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--heading-color);
  background: color-mix(in srgb, var(--heading-color), transparent 91%);
}
.cd-gb-clock.is-running {
  color: #fff;
  background: var(--heading-color);
}
.cd-gb-score {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
/* Final result: win green, loss red, draw blue. */
.cd-gb-score.is-win,
.cd-gb-score.is-loss,
.cd-gb-score.is-draw {
  color: #fff;
}
.cd-gb-score.is-win { background: #15803d; }
.cd-gb-score.is-loss { background: #dc2626; }
.cd-gb-score.is-draw { background: #2563eb; }
.cd-gb-board {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
div.cd-gb-board {
  cursor: default;
}
button.cd-gb-board:hover {
  box-shadow: 0 0 0 2px var(--accent-color);
}
.cd-gb-board:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}
.cd-gb-chessboard {
  --cd-sq-light: #e7edf3;
  --cd-sq-dark: #8ea8bf;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
  background: repeating-conic-gradient(var(--cd-sq-dark) 0 25%, var(--cd-sq-light) 0 50%) 0 0 / 25% 25%;
}
.cd-gb-sq {
  display: block;
  aspect-ratio: 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100%;
}
.cd-gb-sq.is-last {
  background-color: rgba(246, 196, 72, 0.55);
}
.cd-gb.is-placeholder {
  box-shadow: none;
}
.cd-gb.is-placeholder .cd-gb-chessboard {
  opacity: 0.45;
}
.cd-gb.is-placeholder .cd-gb-name {
  color: color-mix(in srgb, var(--heading-color), transparent 50%);
}
@media (max-width: 1199.98px) {
  .cd-gb { flex-basis: calc((100% - 2 * var(--cd-gb-gap)) / 3); }
}
@media (max-width: 767.98px) {
  .cd-gb-grid { --cd-gb-gap: 10px; }
  .cd-gb { flex-basis: calc((100% - var(--cd-gb-gap)) / 2); padding: 8px 8px 7px; }
  /* Every pixel goes to the name: White is always the bottom row anyway. */
  .cd-gb-player .cd-color { display: none; }
  .cd-gb-player { gap: 5px; font-size: 12px; }
}
@media (max-width: 575.98px) {
  /* All nine rounds on one line. */
  .cd-gb-rounds { gap: 5px; }
  .cd-gb-rounds-label { display: none; }
  .cd-gb-round { width: 30px; height: 30px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-gb-status.is-live::before,
  .cd-gb-state.is-live::before,
  .cd-gb-round.is-live::after { animation: none; }
}

/* Game viewer dialog (#cd-boards): our own replay — board left, moves
   right; stacked on phones. Shares .cd-modal's shell. */
.cd-gb-modal {
  width: min(980px, calc(100vw - 32px));
}
.cd-gb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
}
.cd-gb-modal-title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  color: var(--heading-color);
}
.cd-gb-modal-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--heading-color), transparent 91%);
  color: var(--heading-color);
  font-size: 18px;
  cursor: pointer;
}
.cd-gb-modal-close:hover,
.cd-gb-modal-close:focus-visible {
  background: var(--accent-color);
  color: #fff;
}
.cd-gv {
  --cd-gv-board: min(560px, calc(100vh - 32px - 60px - 130px));
  display: grid;
  grid-template-columns: var(--cd-gv-board) minmax(0, 1fr);
  gap: 20px;
  padding: 16px 20px 20px;
}
.cd-gv-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cd-gv-player {
  font-size: 14px;
}
.cd-gv-player .cd-gb-name {
  flex: 0 1 auto;
}
.cd-gv-rating {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}
/* Material (chess-days-boards.js): the pieces a side has won on balance,
   overlapping within a type with a small gap between types, and the side
   ahead's "+N" — the cards show only the "+N". */
.cd-mat {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}
/* In the viewer the captures sit at the right, just before the clock. */
.cd-gv-player .cd-mat {
  margin-left: auto;
  justify-content: flex-end;
}
.cd-gv-player .cd-mat + .cd-gb-clock {
  margin-left: 6px;
}
.cd-mat-p {
  width: 17px;
  height: 17px;
  background: center / contain no-repeat;
}
.cd-mat-p + .cd-mat-p {
  margin-left: -8px;
}
.cd-mat-p.is-new {
  margin-left: 1px;
}
.cd-gb-adv {
  flex-shrink: 0;
  margin-left: 3px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
/* A phone has no room for a full set of captures beside the name: the
   viewer gives them a line of their own under it. */
@media (max-width: 575.98px) {
  .cd-gv-player {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .cd-gv-player .cd-mat {
    order: 1;
    flex-basis: 100%;
  }
  .cd-gv-player .cd-mat:empty {
    display: none;
  }
  .cd-gv-player .cd-mat + .cd-gb-clock {
    margin-left: auto; /* the clock keeps the first line's right edge */
  }
}
.cd-gv-board .cd-gb-chessboard {
  border-radius: 6px;
  overflow: hidden;
}
.cd-gv-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.cd-gv-nav button {
  width: 48px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 78%);
  border-radius: 10px;
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cd-gv-nav button:hover:not(:disabled),
.cd-gv-nav button:focus-visible {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.cd-gv-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}
.cd-gv-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.cd-gv-side .cd-link-btn {
  align-self: flex-start;
}
.cd-gv-opening {
  margin: 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-gv-opening:empty {
  display: none;
}
.cd-gv-moves {
  position: relative; /* offsetTop of the moves, for scrolling the list */
  flex: 1 1 auto;
  max-height: calc(var(--cd-gv-board) + 40px);
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  border-radius: 10px;
}
.cd-gv-move {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  align-items: center;
}
.cd-gv-move:nth-child(even) {
  background: color-mix(in srgb, var(--heading-color), transparent 95%);
}
.cd-gv-no {
  padding: 0 8px 0 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--default-color), transparent 50%);
}
.cd-gv-san {
  justify-self: start;
  margin: 2px 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cd-gv-san:hover {
  background: color-mix(in srgb, var(--heading-color), transparent 88%);
}
.cd-gv-san.is-current {
  background: var(--heading-color);
  color: #fff;
}
.cd-gv-none,
.cd-gv-result {
  padding: 10px 12px;
  font-size: 14px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.cd-gv-result {
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--heading-color);
}
/* Coordinates on the viewer's board: ranks top-left of the a-file, files
   bottom-right of the first rank, in the opposite square colour. */
.cd-gb-chessboard.has-coords .cd-gb-sq {
  position: relative;
}
.cd-gb-chessboard.has-coords .cd-gb-sq::before,
.cd-gb-chessboard.has-coords .cd-gb-sq::after {
  position: absolute;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  color: var(--cd-sq-dark);
}
.cd-gb-chessboard.has-coords .cd-gb-sq.is-dark::before,
.cd-gb-chessboard.has-coords .cd-gb-sq.is-dark::after {
  color: var(--cd-sq-light);
}
.cd-gb-chessboard.has-coords .cd-gb-sq[data-rank]::before {
  content: attr(data-rank);
  top: 3px;
  left: 3px;
}
.cd-gb-chessboard.has-coords .cd-gb-sq[data-file]::after {
  content: attr(data-file);
  right: 3px;
  bottom: 2px;
}
@media (max-width: 767.98px) {
  .cd-gv {
    --cd-gv-board: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 12px 12px 16px;
  }
  .cd-gv-moves {
    max-height: 220px;
  }
  .cd-gb-modal {
    max-height: calc(100svh - 16px);
    overflow-y: auto;
  }
}
