/* Leaderboards page. Colors come from the shared theme variables set by theme-shell.js. */
/* one column that never grows past the screen: a wide table scrolls inside its panel instead of widening the page.
   Wider than the site's other pages (styles.css: min(1180px, 92vw)), so three boards side by side get room on a wide
   screen; 900px and under keeps the site's width (one board at a time starts at 1200px). From 1644px the site's sidebar docks in the
   margin left of the page (site-sidebar.js): the page leaves that margin room for a 200px column (+ 16px either side),
   and the sidebar is told the margin it really has (--site-margin, site-sidebar.css), so the two never overlap. */
:root { --lb-page-width: min(1560px, 94vw); }
@media (max-width: 900px) { :root { --lb-page-width: min(1180px, 92vw); } }
@media (min-width: 1644px) {
  :root { --lb-page-width: max(1180px, min(1560px, 100vw - 464px)); }
  body .site-sidebar.is-docked { --site-margin: calc((100vw - var(--lb-page-width)) / 2); }   /* "body": over site-sidebar.css, loaded later */
}
.lb-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; width: var(--lb-page-width); padding: 2rem 0 3rem; }
.lb-main > * { min-width: 0; }
.lb-heading h1 { margin: 0.5rem 0 0.6rem; font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.lb-intro { max-width: 640px; margin: 0; color: var(--ink-soft); line-height: 1.6; }

.lb-gate, .lb-board {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  padding: 1.3rem 1.4rem;
}
.lb-gate strong { display: block; font-size: 1.1rem; }
.lb-gate p { margin: 0.5rem 0 0; color: var(--muted); }
.lb-gate a { color: var(--accent); font-weight: 700; }
.lb-account { color: var(--ink); font-size: 0.85rem; font-weight: 700; }

.lb-preview-badge {
  display: inline-block;
  margin-bottom: 1rem;
  border: 1px dashed var(--accent-2);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.75rem;
  text-transform: uppercase;
}

.lb-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.lb-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 0.5rem 1rem;
}
.lb-tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-primary); }

.lb-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem 1rem; margin-bottom: 1rem; }
.lb-filters label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.75rem; font-weight: 750; }
.lb-filters label[hidden] { display: none; }
.lb-filters input[type="search"] {
  min-width: 9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
}
/* Every dropdown on the boards (week, season, server, filters): themed like the tabs, with a themed arrow and an
   open list in the theme's own colours instead of the browser's grey box. */
.lb-filters select, .lb-interlink select, .lb-server select, .lb-filters .aniimo-picker-input {
  appearance: none;
  -webkit-appearance: none;
  min-width: 9rem;
  max-width: 100%;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--panel-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 52%, calc(100% - 0.72rem) 52%;
  background-size: 0.34rem 0.34rem, 0.34rem 0.34rem;
  background-repeat: no-repeat;
  color: var(--text);
  color-scheme: inherit;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 0.45rem 2.2rem 0.45rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lb-filters select:hover, .lb-interlink select:hover, .lb-server select:hover, .lb-filters .aniimo-picker-input:hover { border-color: var(--accent); }
.lb-filters select:focus-visible, .lb-interlink select:focus-visible, .lb-server select:focus-visible, .lb-filters .aniimo-picker-input:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}
.lb-filters select option, .lb-interlink select option, .lb-server select option { background-color: var(--panel); color: var(--text); }
/* the type-to-filter boxes (aniimo-picker.js) look like the dropdowns; the arrow gives way to the clear button */
.lb-filters .aniimo-picker-input { cursor: text; }
.lb-filters .aniimo-picker-input::placeholder { color: var(--text); opacity: 1; }
.lb-filters .aniimo-picker-input:focus::placeholder { color: var(--muted); }
.lb-filters .aniimo-picker:has(.aniimo-picker-clear:not([hidden])) .aniimo-picker-input { background-image: none; }
.lb-filter-wide input[type="search"] { min-width: 14rem; }
.lb-filters .lb-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }

.lb-summary { min-height: 1.2rem; margin: 0 0 0.6rem; color: var(--muted); font-size: 0.82rem; }
.lb-table-wrap { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.lb-table th, .lb-table td { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding: 0.55rem 0.6rem; text-align: left; white-space: nowrap; }
.lb-table th { color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.lb-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.lb-table tr.is-own td { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.lb-table tr.is-hidden td { opacity: 0.55; }
.lb-rank { width: 3rem; color: var(--accent-2); font-weight: 900; }
.lb-sort, .lb-expand { border: 0; background: none; color: inherit; cursor: pointer; font: inherit; padding: 0; text-transform: inherit; letter-spacing: inherit; }
.lb-sort.is-active { color: var(--accent); }
.lb-sort:hover, .lb-sort:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lb-expand { color: var(--text); font-weight: 750; text-decoration: underline dotted; text-underline-offset: 3px; }
.lb-you { margin-left: 0.45rem; border-radius: 999px; background: var(--accent-2); color: var(--on-highlight); font-size: 0.66rem; font-weight: 900; padding: 0.05rem 0.45rem; text-transform: uppercase; }
.lb-empty { color: var(--muted); text-align: center; }

.lb-detail td { white-space: normal; background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.lb-players { width: auto; border-collapse: collapse; margin-bottom: 0.8rem; font-size: 0.8rem; }
.lb-players th, .lb-players td { border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); padding: 0.3rem 0.8rem 0.3rem 0; text-align: left; }
.lb-buffs ol { columns: 2 14rem; margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.lb-setup { position: sticky; left: 0; max-width: min(100%, calc(100vw - 4rem)); margin-bottom: 0.8rem; font-size: 0.8rem; }
.lb-setup-team { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.4rem 0; padding-left: 1.2rem; }
.lb-setup-team li { padding-right: 0.2rem; }
.lb-mvp { cursor: default; }
.lb-setup-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.2rem 0.8rem; margin: 0.4rem 0; }
.lb-setup-facts dt { color: var(--muted); }
.lb-setup-facts dd { margin: 0; overflow-wrap: anywhere; }
.lb-setup-picked summary { cursor: pointer; }
.lb-setup-picked ul { columns: 2 16rem; margin: 0.4rem 0 0; padding-left: 1.2rem; }
.lb-facts { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.8rem; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lb-actions button { min-height: 0; font-size: 0.8rem; padding: 0.4rem 0.9rem; }
.lb-evidence { display: block; max-width: min(100%, 900px); border: 1px solid var(--line); border-radius: 12px; }

.lb-pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: 0.85rem; }
.lb-pager button:disabled { opacity: 0.45; cursor: default; transform: none; }

.lb-character { margin-left: 0.45rem; color: var(--muted); font-size: 0.78rem; }
.lb-character::before { content: "· "; }

/* boards inside a mode (Boss runs / Weekly total / ...) - a lighter second row of tabs */
.lb-board-tabs { margin-top: -0.4rem; }
.lb-board-tabs[hidden] { display: none; }
.lb-board-tabs button { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.lb-board-tabs button[aria-selected="true"] { border-color: var(--accent); background: transparent; color: var(--accent); }

/* party: AI teammates and links to public profiles */
.lb-ai { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 0.75em; font-weight: 700; letter-spacing: 0.04em; opacity: 0.8; }
a.lb-character, .lb-players a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Interlink: the star icon, and the "i" explanations */
.lb-stars { display: inline-flex; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.lb-star { width: 1.1em; height: 1.1em; flex: none; }
.lb-empty { padding: 1.2rem; text-align: center; opacity: 0.7; }
.lb-th-info { display: inline-flex; align-items: center; gap: 0.4rem; }
.lb-info { display: inline-grid; width: 1.25rem; height: 1.25rem; place-items: center; padding: 0; border: 1px solid var(--line);
  border-radius: 50%; background: transparent; color: var(--ink-soft); font: italic 700 0.75rem/1 Georgia, serif; text-transform: none; cursor: pointer; }
.lb-info:hover, .lb-info:focus-visible { border-color: var(--teal); color: var(--teal); outline: none; }
.lb-info-pop { width: min(360px, calc(100vw - 2rem)); margin: auto; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 16px;
  background: rgb(var(--panel-rgb)); color: var(--ink); box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 400;
  letter-spacing: normal; line-height: 1.55; text-align: left; text-transform: none; white-space: normal; overflow: visible; }
.lb-info-pop::backdrop { background: rgba(0, 0, 0, 0.35); }
.lb-info-pop ul { margin: 0.5rem 0; padding-left: 1.1rem; color: var(--ink-soft); }
.lb-info-pop p { margin: 0; color: var(--ink-soft); }

/* a claimed player's blue badge (one blue for all four themes: #2b7de9), the rare marks (no character, a lookalike
   name), and an unclaimed player's softer name (no mark; its line says why on hover) */
.lb-claimed { display: inline-grid; width: 1.05em; height: 1.05em; flex: none; place-items: center; color: #2b7de9; vertical-align: -0.15em; cursor: help; }
.lb-claimed svg { width: 100%; height: 100%; }
.lb-player > .lb-claimed { margin-left: 4px; }      /* the Sim and Egg Heist tables: after the name button */
.is-unclaimed .lb-name, .lb-player.is-unclaimed .lb-expand { color: color-mix(in srgb, var(--text) 62%, transparent); font-weight: 700; }
.is-unclaimed { cursor: help; }
/* a team row's seats: the game's 1P-4P / Ai mark in a fixed column left of each name (the picture as it is, no
   backdrop of ours; its text in the same spot until or unless the picture loads), a bot's softer plain name, and a
   player ranked with another run in italics with their place */
.lb-seat { display: inline-grid; flex: none; place-items: center; width: 1.65rem; height: 1.45rem; margin-right: 0.1rem; }
.lb-seat img { display: block; width: auto; height: 22px; }
.lb-seat-text { color: var(--muted); font-size: 0.62rem; font-weight: 850; letter-spacing: 0.02em; }
.lb-seat .lb-ai { margin: 0; padding: 0 4px; font-size: 0.62rem; line-height: 1.35; }
.lb-bot .lb-name { color: color-mix(in srgb, var(--text) 62%, transparent); font-weight: 700; }
.lb-bot { cursor: help; }
.lb-also-line > .lb-name, .lb-also-place, .lb-legend-also { color: color-mix(in srgb, var(--text) 62%, transparent); font-style: italic; font-weight: 650; }
.lb-also-line { cursor: help; }
.lb-also-place { flex: none; }
.lb-marks-legend .lb-seat { width: auto; height: auto; margin: 0; }
.lb-mark { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 0.72em; font-weight: 700; letter-spacing: 0.03em; opacity: 0.75; cursor: help; }
.lb-lookalike { background: color-mix(in srgb, var(--coral) 22%, transparent); color: var(--coral); opacity: 1; }
.lb-player [title] { cursor: help; }
.lb-player .lb-when { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 400; }

/* the game-server picker above the boards */
.lb-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin: 0.4rem 0 1rem; }
.lb-pickers .lb-board-tabs, .lb-pickers .lb-tabs { margin: 0; }
.lb-server, .lb-ladders { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.lb-server[hidden] { display: none; }
.lb-unlinked { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; cursor: pointer; }
/* Show: Teams / Players, one switch for every team board on the page (and View all), beside the other pickers */
.lb-show { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.lb-show[hidden] { display: none; }
.lb-show .lb-seg { flex: none; }



/* Egg Heist: the Ladders dropdown in place of board tabs (styled like the other board dropdowns) */
.lb-ladders select { appearance: none; -webkit-appearance: none; min-width: 13rem; min-height: 2.35rem; border: 1px solid var(--line);
  border-radius: 12px; background-color: var(--panel-2); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 650;
  padding: 0.45rem 2.2rem 0.45rem 0.85rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 52%, calc(100% - 0.72rem) 52%; background-size: 0.34rem 0.34rem, 0.34rem 0.34rem; background-repeat: no-repeat; }
.lb-ladders select:hover, .lb-ladders select:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22); }
.lb-ladders select option { background-color: var(--panel); color: var(--text); }

/* Phones: slimmer panel, full-width pickers and search, a tighter table that scrolls sideways inside the panel */
@media (max-width: 640px) {
  .lb-main { gap: 1rem; padding: 1.2rem 0 2rem; }
  .lb-gate, .lb-board { padding: 1rem 0.85rem; border-radius: 16px; }
  .lb-tabs { gap: 0.4rem; }
  .lb-tabs button { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
  .lb-filters { gap: 0.6rem; }
  .lb-filters label { flex: 1 1 100%; }
  .lb-filters label.lb-check { flex: 0 1 auto; }
  .lb-filters select, .lb-interlink select, .lb-server select, .lb-ladders select, .lb-filters input[type="search"], .lb-filter-wide input[type="search"],
  .lb-filters .aniimo-picker-input {
    width: 100%; min-width: 0;
  }
  /* Server and Ladders stack like the other pickers: label above, full width */
  .lb-server, .lb-ladders { display: grid; width: 100%; gap: 0.3rem; margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 750; }
  .lb-server[hidden], .lb-ladders[hidden] { display: none; }
  .lb-show { display: grid; width: 100%; gap: 0.3rem; color: var(--muted); font-size: 0.75rem; font-weight: 750; }
  .lb-show[hidden] { display: none; }
  .lb-table-wrap { margin: 0 -0.85rem; padding: 0 0.85rem; }
  .lb-table { font-size: 0.8rem; }
  .lb-table th, .lb-table td { padding: 0.45rem 0.4rem; }
  .lb-table th { font-size: 0.66rem; }
  .lb-rank { width: 1.8rem; }
  .lb-pager { gap: 0.5rem; }
}


/* Interlink: Per Boss (three boards, one a phone at a time) and Season Ladder */
.lb-interlink { --lb-left: #6fa8ff; --lb-center: #f2a93b; --lb-right: #c792ff; display: grid; gap: 0.8rem; margin-bottom: 0.8rem; }
.lb-interlink[hidden] { display: none; }
.lb-interlink .is-left { --slot: var(--lb-left); }
.lb-interlink .is-center { --slot: var(--lb-center); }
.lb-interlink .is-right { --slot: var(--lb-right); }
.lb-subbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.lb-week-nav { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; }
.lb-week-nav small { color: var(--muted); font-weight: 700; }
.lb-week-nav button { width: 2rem; height: 2rem; flex: none; border: 1px solid var(--line); border-radius: 50%; background: transparent;
  color: var(--text); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.lb-week-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.lb-week-nav button:disabled { opacity: 0.35; cursor: default; }
.lb-updated { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.8rem; }
.lb-updated i { width: 0.5rem; height: 0.5rem; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18); }
.lb-rules { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0; color: var(--muted); font-size: 0.8rem; }
.lb-rules b { color: var(--text); }
.lb-note { margin: 0; color: var(--muted); font-size: 0.8rem; }

.lb-bosses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.lb-boss { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.6rem; min-width: 0; border: 1px solid var(--line); border-top: 4px solid var(--slot, var(--accent));
  border-radius: 14px; background: color-mix(in srgb, var(--panel-2) 55%, transparent); padding: 0.75rem; }
.lb-boss-head, .lb-full-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.6rem; min-width: 0; }
.lb-boss-head > div:first-child, .lb-full-head > div:first-child { min-width: 0; }
.lb-slot { color: var(--slot, var(--accent)); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.lb-boss h3, .lb-full-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.2; }
.lb-boss h3 small, .lb-full-head h3 small { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.lb-cap { display: grid; justify-items: end; gap: 0.1rem; flex: none; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.lb-cap .lb-stars { color: var(--text); font-size: 1rem; font-weight: 900; }
.lb-pair-note { flex-basis: 100%; }
.lb-ladder { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.75rem; font-weight: 750; }
.lb-interlink .lb-ladder select { flex: 1 1 0; width: 100%; min-width: 0; }
.lb-ladder > span:first-child { flex: none; }
.lb-seg { display: flex; flex: 1 1 0; gap: 3px; box-sizing: border-box; min-width: 0; min-height: 2.35rem; padding: 3px; border: 1px solid var(--line);
  border-radius: 12px; background-color: var(--panel-2); }
.lb-seg button { flex: 1 1 0; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit;
  font-size: 0.85rem; font-weight: 700; padding: 0.25rem 0.75rem; cursor: pointer; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.lb-seg button:hover { color: var(--text); }
.lb-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-primary); font-weight: 850; }
.lb-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22), inset 0 0 0 1px var(--accent); }
.lb-rows { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
/* A Per Boss row, both views: three columns, top-aligned: the place | one line per player | the result (figure, stars,
   outcome, icons), right-aligned and no wider than it needs */
.lb-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: start; gap: 0 0.6rem;
  border-radius: 8px; padding: 0.4rem 0.5rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.lb-row .lb-rk { line-height: 1.45rem; }
.lb-figs { display: grid; justify-items: end; align-content: start; gap: 1px; max-width: 11rem; text-align: right; }
.lb-row .lb-val { font-size: 0.95rem; line-height: 1.45rem; }
.lb-row-result { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px 0.3rem; color: var(--muted);
  font-size: 0.75rem; font-weight: 650; white-space: nowrap; }
.lb-row-result .lb-party-tag { margin-right: 0; }
/* a phone: the Solo / Duo / Trio tag over the outcome, so the result column stays narrow */
@media (max-width: 640px) { .lb-row-result { flex-direction: column; align-items: flex-end; gap: 2px; } }
/* the run's icons, one line: its check, its pictures, its link, when it was updated; one size each */
.lb-row-icons { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.lb-row-icons > .lb-proof, .lb-row-icons > .lb-link, .lb-row-icons > .lb-row-when { width: 1.5rem; height: 1.5rem; min-width: 0; min-height: 0; margin: 0; padding: 0; }
.lb-row-icons > .lb-proof svg, .lb-row-icons > .lb-link svg, .lb-row-icons > .lb-row-when svg { width: 1rem; height: 1rem; flex: none; }
.lb-row-icons > .lb-check { margin: 0 2px 0 0; font-size: 0.8rem; }
.lb-row-icons > .lb-link { position: relative; justify-content: center; }
/* the link's word ("Link copied", "Couldn't make the link", or the link itself to copy by hand): a bubble over the
   button, anchored at its right edge, so the row doesn't move and nothing runs off the card */
.lb-row-icons .lb-link-label { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 6; padding: 0.25rem 0.5rem;
  border: 1px solid currentColor; border-radius: 6px; background: rgb(var(--panel-rgb)); box-shadow: var(--shadow);
  font-size: 0.72rem; font-weight: 700; line-height: 1.3; text-align: left; white-space: nowrap; }
.lb-row-icons .lb-link[data-state="manual"] .lb-link-label { width: max-content; max-width: min(18rem, 70vw); color: var(--ink); white-space: normal; }
.lb-week-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; margin-top: 0.3rem; }
.lb-week-head h3 { margin: 0; font-size: 1rem; }
.lb-week-head > span { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.lb-week-head .lb-updated { margin-left: auto; }
.lb-row:nth-child(odd) { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.lb-row.is-own { background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.lb-rk { color: var(--muted); font-weight: 900; text-align: center; }
/* medals by place, not by position: rows that tie share a place and its colour */
.lb-row[data-place="1"] .lb-rk { color: #e8b923; }
.lb-row[data-place="2"] .lb-rk { color: #a9b6ba; }
.lb-row[data-place="3"] .lb-rk { color: #d08a5a; }
/* The players: one line per seat (Teams: the run's players, the ones ranked with another run, its bots) */
.lb-who { display: grid; align-content: start; min-width: 0; }
/* a player's line: the name, then its marks (claimed, you, no character, a lookalike) and their own copy's pictures,
   which never wrap away from it; only the name is cut with "…" when the line is too short */
.lb-who-name { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.3rem; min-width: 0; font-size: 0.9rem; font-weight: 800; line-height: 1.45rem; }
.lb-who-name > .lb-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who-name > :not(.lb-name) { flex: none; }
.lb-who-name > .lb-you, .lb-who-name > .lb-mark, .lb-who-name > .lb-proof, .lb-who-name > .lb-check { margin-left: 0; }
.lb-who-name > .lb-proof { width: 1.3rem; height: 1.3rem; }
.lb-who-name a { color: inherit; }
.lb-who small { color: var(--muted); font-size: 0.75rem; }
.lb-result { display: inline-flex; align-items: center; gap: 2px; }
.lb-result .lb-proof { width: 1.2rem; height: 1.2rem; margin-left: 2px; }
.lb-val { font-weight: 900; text-align: right; }
.lb-row .lb-stars { justify-content: flex-end; font-size: 0.82rem; font-weight: 800; }
.lb-more { border: 1px solid rgba(var(--accent-rgb), 0.6); border-radius: 10px; background: rgba(var(--accent-rgb), 0.08); color: var(--accent);
  font: inherit; font-weight: 900; padding: 0.5rem; cursor: pointer; }
.lb-more:hover { background: rgba(var(--accent-rgb), 0.16); }

/* View all: one board, every figure */
.lb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-weight: 800; }
.lb-back { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 900; padding: 0; cursor: pointer; }
.lb-full-head { border: 1px solid var(--line); border-top: 4px solid var(--slot, var(--accent)); border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 55%, transparent); padding: 0.8rem 1rem; }
.lb-full-head h3 { font-size: 1.3rem; }
.lb-table .is-ranked { color: var(--accent); font-weight: 900; }
/* View all: the run's shared figures after a soft divider (both views). Teams: one block per team, one row per seat;
   faint lines between its players under the per-player columns only (they stop at the divider), the place and the
   shared figures one merged cell each, centred, and a stronger line closing the block across the whole width. Hover
   and the own-team colour light the whole block. The result (outcome, check, pictures, link) stays on one line. */
.lb-table .lb-shared-start { border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
/* each player's own figures (Avg DPS, BREAK, healing): a line before each, stronger than the faint lines between a
   team's players, weaker than the line under a team */
.lb-table .lb-own-fig { border-left: 1px solid color-mix(in srgb, var(--line) 68%, transparent); text-align: right; }
.lb-table .lb-result { flex-wrap: nowrap; }
.lb-table tr.lb-team-row td { border-bottom: 1px solid color-mix(in srgb, var(--line) 38%, transparent); }
.lb-table tr.lb-team-row.lb-team-last td, .lb-table tr.lb-team-row td[rowspan] { border-bottom: 2px solid var(--line); }
.lb-table tr.lb-team-row td[rowspan] { vertical-align: middle; }
.lb-table tr.lb-team-row td { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.lb-table tbody tr.lb-team-row:hover { background: none; }
.lb-table tbody tr.lb-team-row.is-hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* Season Ladder */
.lb-split { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.lb-bar { display: block; height: 4px; margin-top: 4px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); }
.lb-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e8b923, #ffd98a); }

/* From 1200px down (phones, tablets, small windows and aLogs' narrower sizes): one boss at a time, picked with Left /
   Center / Right. Three boards side by side are under about 370px each there, too narrow for a line per seat (names
   were cut to a few letters); View all switches to its stacked layout at the same width. */
.lb-slot-switch { display: none; }
@media (max-width: 1200px) {
  .lb-bosses { grid-template-columns: minmax(0, 1fr); }
  .lb-boss[data-shown="false"] { display: none; }
  .lb-slot-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
  .lb-slot-switch button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem;
    font-weight: 900; padding: 0.45rem 0.25rem; cursor: pointer; }
  .lb-slot-switch button small { display: block; overflow: hidden; font-size: 0.7rem; font-weight: 700; opacity: 0.85; text-overflow: ellipsis; white-space: nowrap; }
  .lb-slot-switch button[aria-selected="true"] { background: var(--slot, var(--accent)); color: #10181b; }
}
/* Narrow screens: the bars above the boards stack, and the tables fold their extra columns */
@media (max-width: 900px) {
  .lb-subbar { flex-direction: column; align-items: stretch; }
  .lb-week-nav { justify-content: space-between; }
  .lb-split { display: grid; }
  .lb-split select { width: 100%; min-width: 0; }
  .lb-hide-sm { display: none; }
}

/* Per Boss: the columns' names over the rows (the row's three columns), and "last updated" as a calendar icon in each
   row's icons (hover or tap for the time) */
.lb-rows-head { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0 0.5rem 0.15rem;
  color: var(--muted); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.lb-rows-head > span:first-child { text-align: center; }
.lb-rows-head > span:last-child { text-align: right; }
.lb-line-icon { width: 0.95rem; height: 0.95rem; }
/* the two marks, said once beside the week menu */
.lb-marks-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; margin: 0 0 0 auto; color: var(--muted); font-size: 0.76rem; font-weight: 650; }
.lb-marks-legend > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.lb-marks-legend .lb-claimed { font-size: 0.95rem; }
.lb-marks-legend .lb-check { margin: 0; font-size: 0.8rem; }
.lb-row-when { position: relative; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; padding: 0; border: 0;
  border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.lb-row-when:hover, .lb-row-when:focus-visible, .lb-row-when.is-open { color: var(--teal); outline: none; }
.lb-row-when.is-open::after { content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 5;
  padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: rgb(var(--panel-rgb)); color: var(--ink); box-shadow: var(--shadow);
  font-size: 0.72rem; font-weight: 600; white-space: nowrap; }

/* View all up to 1200px wide (phones, tablets, small laptops: below that the regrouped table needs about 1010px and
   would scroll sideways; measured on a 25-team board): a block per team instead of the table (fullStack in leaderboard.js). The
   columns are fixed widths so the figures line up from block to block; below about 380px the list scrolls sideways a
   little inside the panel rather than cutting names further. */
.lb-stack { display: none; }
@media (max-width: 1200px) {
  .lb-table-wrap.has-stack .lb-table { display: none; }
  .lb-table-wrap.has-stack { overflow-x: auto; margin: 0 -0.35rem; padding: 0; }
  .lb-stack { --stack-run: 6.45rem; --stack-line: 1px solid color-mix(in srgb, var(--line) 68%, transparent); display: grid; gap: 0.35rem; min-width: 366px; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
  .lb-stack-sort { display: flex; align-items: end; gap: 0.4rem; }
  .lb-stack-sort label { display: grid; flex: 1 1 auto; gap: 0.25rem; color: var(--muted); font-size: 0.72rem; font-weight: 750; }
  .lb-stack-sort select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 2.35rem; border: 1px solid var(--line); border-radius: 12px;
    background-color: var(--panel-2); color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 650; padding: 0.45rem 2.2rem 0.45rem 0.85rem; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 1.05rem) 52%, calc(100% - 0.72rem) 52%; background-size: 0.34rem 0.34rem, 0.34rem 0.34rem; background-repeat: no-repeat; }
  .lb-stack-sort select option { background-color: var(--panel); color: var(--text); }
  .lb-stack-dir { flex: none; width: 2.35rem; height: 2.35rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
  .lb-stack-sort select:focus-visible, .lb-stack-dir:focus-visible, .lb-stack-dir:hover { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22); }
  .lb-stack-head, .lb-stack-team { display: grid; grid-template-columns: 15px minmax(0, 1fr) var(--stack-run); column-gap: 3px; }
  .lb-stack-head { padding: 0 2px; color: var(--muted); font-size: 0.55rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
  .lb-stack-runhead { padding-right: 0.1rem; border-left: var(--stack-line); text-align: right; }
  .lb-stack-head .lb-stack-line > span:not(:first-child) { text-align: right; }
  .lb-stack-list { display: grid; margin: 0; padding: 0; list-style: none; }
  .lb-stack-team { padding: 0 2px; border-bottom: 2px solid var(--line); }
  .lb-stack-team.is-own { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
  .lb-stack-rank { align-self: center; color: var(--accent-2); font-weight: 900; text-align: center; }
  .lb-stack-players { display: grid; min-width: 0; }
  .lb-stack-line { display: grid; grid-template-columns: minmax(0, 1fr) 45px 49px 35px; align-items: center; min-width: 0; }
  .lb-stack-line > .lb-who-name { padding-right: 0.2rem; }
  .lb-stack-players .lb-stack-line + .lb-stack-line { border-top: 1px solid color-mix(in srgb, var(--line) 38%, transparent); }
  .lb-stack-num { align-self: stretch; display: grid; align-items: center; justify-items: end; padding-right: 3px; border-left: var(--stack-line);
    color: var(--ink-soft); font-size: 10.5px; white-space: nowrap; }
  .lb-stack-head .lb-stack-line > span:not(:first-child) { padding-right: 0.15rem; border-left: var(--stack-line); }
  .lb-stack .lb-who-name { font-size: 12px; line-height: 1.3rem; gap: 3px; }
  .lb-stack .lb-seat { width: 17px; height: 1.15rem; margin: 0; }
  .lb-stack .lb-seat img { height: 16px; }
  .lb-stack .lb-also-place { font-size: 10.5px; }
  .lb-stack .lb-you { display: none; }
  .lb-stack .is-own-name > .lb-name { color: var(--accent-2); }
  .lb-stack .lb-claimed { font-size: 0.9em; }
  .lb-stack .lb-who-name > .lb-proof { width: 1.1rem; height: 1.1rem; }
  .lb-stack-run { display: grid; align-content: center; justify-items: end; gap: 1px; padding: 0.2rem 0 0.15rem 0.3rem; border-left: var(--stack-line);
    color: var(--muted); font-size: 0.68rem; text-align: right; white-space: nowrap; }
  .lb-stack-score { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text); font-size: 13px; white-space: nowrap; }
  .lb-stack-score b { color: var(--accent); font-weight: 900; }
  .lb-stack-score .lb-stars { font-weight: 800; }
  .lb-stack-teamdps { color: var(--text); font-weight: 750; }
  .lb-stack-teamdps small { color: var(--muted); font-size: 0.6rem; font-weight: 700; }
  .lb-stack-when .lb-when, .lb-stack-when time { display: inline; font-size: 0.66rem; }
  /* the icons: the tag and the check (not a button) close together on the left, the pictures and link buttons spread
     to the right with a thumb-sized (28px) target each */
  .lb-stack-icons { display: flex; justify-self: stretch; align-items: center; justify-content: flex-end; gap: 2px; }
  .lb-stack-icons > .lb-proof { margin-left: auto; }
  .lb-stack-icons .lb-party-tag { margin: 0 2px 0 0; font-size: 0.52rem; padding: 0 0.25rem; letter-spacing: 0.02em; }
  .lb-stack-icons > .lb-proof, .lb-stack-icons > .lb-link { width: 28px; height: 28px; min-width: 0; min-height: 0; padding: 0; }
  .lb-stack-icons > .lb-link { margin: 0 0 0 4px; }
  .lb-stack-icons > .lb-proof svg, .lb-stack-icons > .lb-link svg { width: 0.9rem; height: 0.9rem; }
  .lb-stack-icons > .lb-check { margin: 0 2px 0 0; font-size: 0.72rem; }
  .lb-stack-icons > .lb-link { position: relative; justify-content: center; }
  .lb-stack-icons .lb-link-label { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 6; padding: 0.25rem 0.5rem;
    border: 1px solid currentColor; border-radius: 6px; background: rgb(var(--panel-rgb)); box-shadow: var(--shadow);
    font-size: 0.72rem; font-weight: 700; line-height: 1.3; text-align: left; white-space: nowrap; }
  .lb-stack-icons .lb-link[data-state="manual"] .lb-link-label { width: max-content; max-width: min(18rem, 70vw); color: var(--ink); white-space: normal; }
  .lb-stack-team[data-place="1"] .lb-stack-rank { color: #e8b923; }
  .lb-stack-team[data-place="2"] .lb-stack-rank { color: #a9b6ba; }
  .lb-stack-team[data-place="3"] .lb-stack-rank { color: #d08a5a; }
}

/* Per Boss boards on a phone: denser rows (smaller type and pitch, less padding), the score and stars on one line */
@media (max-width: 640px) {
  .lb-row { padding: 0.28rem 0.35rem; column-gap: 0.45rem; line-height: 1.2; }
  .lb-row .lb-rk, .lb-row .lb-val { line-height: 1.2rem; }
  .lb-row .lb-who-name { font-size: 0.8rem; line-height: 1.2rem; gap: 0.22rem; }
  .lb-row .lb-seat { width: 1.3rem; height: 1.2rem; margin: 0; }
  .lb-row .lb-seat img { height: 18px; }
  .lb-row .lb-who-name > .lb-proof { width: 1.1rem; height: 1.1rem; }
  .lb-figs { grid-template-columns: auto auto; column-gap: 0.4rem; }
  .lb-figs > .lb-val { grid-column: 1; }
  .lb-figs > .lb-stars { grid-column: 2; }
  .lb-figs > .lb-row-result, .lb-figs > .lb-row-icons { grid-column: 1 / -1; justify-self: end; }
  .lb-row .lb-val { font-size: 0.85rem; }
  .lb-row-result { font-size: 0.7rem; }
  /* thumb-sized targets (30px), spaced apart; the check (not a button) sits closer */
  .lb-row-icons { margin-top: 0; gap: 4px; }
  .lb-row-icons > .lb-proof, .lb-row-icons > .lb-link, .lb-row-icons > .lb-row-when { width: 30px; height: 30px; }
  .lb-row-icons > .lb-proof svg, .lb-row-icons > .lb-link svg, .lb-row-icons > .lb-row-when svg { width: 0.9rem; height: 0.9rem; }
  .lb-row-icons > .lb-check { font-size: 0.72rem; }
}

/* phones: the page and its panel give their side room to the boards (a few pixels each side) */
@media (max-width: 640px) {
  :root { --lb-page-width: calc(100vw - 12px); }
  .lb-board { padding-left: 0.45rem; padding-right: 0.45rem; }
}

/* the same blocks on a tablet or small laptop (641-1200px): the room goes to larger type and wider figure columns */
@media (min-width: 641px) and (max-width: 1200px) {
  .lb-stack { --stack-run: 10rem; }
  .lb-stack-head, .lb-stack-team { grid-template-columns: 1.6rem minmax(0, 1fr) var(--stack-run); column-gap: 0.4rem; }
  .lb-stack-head { font-size: 0.66rem; }
  .lb-stack-line { grid-template-columns: minmax(0, 1fr) 6rem 6.5rem 4.5rem; }
  .lb-stack .lb-who-name { font-size: 0.9rem; line-height: 1.7rem; gap: 0.3rem; }
  .lb-stack .lb-seat { width: 1.6rem; height: 1.45rem; }
  .lb-stack .lb-seat img { height: 22px; }
  .lb-stack .lb-also-place { font-size: 0.82rem; }
  .lb-stack-num { font-size: 0.82rem; padding-right: 0.5rem; }
  .lb-stack-run { font-size: 0.78rem; padding-left: 0.6rem; }
  .lb-stack-score { font-size: 0.95rem; }
  .lb-stack-teamdps small { font-size: 0.7rem; }
  .lb-stack-when .lb-when, .lb-stack-when time { font-size: 0.76rem; }
}
