/* The boards (leaders.php, wanted.php only). Built on the frame's colour and type variables (assets/empyrez.css :root);
   it overrides the old .op-board and phone .mw-table rules there by being more specific, and touches no other page.
   The job: find the order, compare the sizes, find yourself. No figure is ever cut, no name pushes a figure out. */

/* ---- The banner on a phone: the title keeps every letter; the chip drops under it when they do not fit -------- */
.ez-banner:has(+ .bd-boards) .ez-banner__row:first-child,
.ez-banner:has(+ .mw-scope) .ez-banner__row:first-child { flex-wrap: wrap; }
.ez-banner:has(+ .bd-boards) .ez-banner__title,
.ez-banner:has(+ .mw-scope) .ez-banner__title { flex: 1 0 auto; max-width: 100%; overflow: visible; text-overflow: clip; }

/* ---- The leader boards (and the Hall of Fame's lists, which use the same rows) -------------------------------------------------------------------------------------- */
.bd-boards { display: block; columns: 268px 3; column-gap: 14px; }   /* boards flow down the columns: a short board leaves no hole */
.bd-boards .op-board { break-inside: avoid; margin: 0 0 14px; padding: 16px 16px 12px; }
.bd-boards .op-board > p { margin: 5px 0 12px; color: var(--ez-text-2); font-size: var(--ez-fs-label); line-height: 1.35; }
.bd-boards .op-board > .ez-empty { margin-bottom: 4px; }

/* One grid per board: rank | name | figure. The rows share its columns (subgrid), so every figure on a board starts
   on one line and the column is exactly as wide as the board's widest figure. */
.bd-list { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: 8px; margin: 0; padding: 0; list-style: none; }
ol.bd-list > li.bd-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline;
  margin: 0; padding: 7px 0; border-top: 1px solid var(--ez-rule); background: none; color: inherit; }
.bd-list > .bd-row:first-child { border-top: 0; }

.bd-list .bd-rank { justify-self: end; min-width: 2ch; text-align: right; font: 800 16px/1 var(--ez-numbers); font-variant-numeric: tabular-nums; color: var(--ez-text-2); }
ol.bd-list > li.bd-row > .bd-who { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.bd-who .ez-who { align-items: baseline; max-width: 100%; }
.bd-who .ez-dot { width: 8px; height: 8px; align-self: flex-start; margin-top: .4em; }   /* stays by the first line when a long name wraps */
/* The whole name, always: it wraps on a narrow board before it would ever be cut. */
.bd-list .bd-who .ez-uname { font-size: 14px; line-height: 1.15; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.bd-fig { text-align: left; white-space: nowrap; }
.bd-fig .ez-n { font-size: 17px; line-height: 1; }

/* Number one: the same row, set larger. No block of colour. */
ol.bd-list > li.bd-row.is-top { padding: 4px 0 10px;
  --ez-c-money: inherit; --ez-c-count: inherit; --ez-c-2: inherit; }   /* the old rule set them for a bone block */
ol.bd-list > li.bd-row.is-top .bd-rank { font-size: 24px; color: var(--ez-text); }
body.ez ol.bd-list > li.bd-row.is-top .ez-who { font-size: inherit; color: inherit; }
.bd-list .bd-row.is-top .ez-uname { font-size: 16px; }
.bd-list .bd-row.is-top .bd-fig .ez-n { font-size: 21px; }

/* The losers' joke titles: a small line under the name, never a box beside it. */
.bd-badge { font: 600 11px/1.2 var(--ez-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ez-text-2); }

/* His own row: tinted edge to edge of the board, without moving a column. */
ol.bd-list > li.bd-row.is-me { background: var(--ez-sel); box-shadow: -10px 0 0 var(--ez-sel), 10px 0 0 var(--ez-sel); }
/* His own row wears a border all the way round, on Most Wanted and the leader boards (owner, 2026-11-12: "a border
   around the entire row, not just the name"). An outline drawn inside the row, so no column moves; the bone line
   reads on the tint, the stripes, the hover and a Found row alike. Who's online keeps the border on the name
   (assets/online.css): there the name is the whole row. */
@media (max-width: 767px) { .mw-table tbody tr.is-me { outline: 2px solid var(--ez-text); outline-offset: -2px; } }
/* As a table the cells paint over a row outline, so each cell carries its share of the line. */
@media (min-width: 768px) {
  .mw-table tbody tr.is-me > * { box-shadow: inset 0 2px 0 var(--ez-text), inset 0 -2px 0 var(--ez-text); }
  .mw-table tbody tr.is-me > :first-child { box-shadow: inset 0 2px 0 var(--ez-text), inset 0 -2px 0 var(--ez-text), inset 2px 0 0 var(--ez-text); }
  .mw-table tbody tr.is-me > :last-child { box-shadow: inset 0 2px 0 var(--ez-text), inset 0 -2px 0 var(--ez-text), inset -2px 0 0 var(--ez-text); }
}
ol.bd-list > li.bd-row.is-me:not(.bd-row--you) { outline: 2px solid var(--ez-text); outline-offset: 0; }
ol.bd-list > li.bd-row--you { margin-top: 6px; border-top: 1px dashed var(--ez-rule); }
.bd-you { font: 800 14px/1.15 var(--ez-body); font-stretch: 75%; color: var(--ez-text); }

.bd-more { margin-top: 8px; }

/* The Hall of Fame's lists: the name line can carry the player's id and cartel; the small line under it his counts. */
.hof-list { margin-top: 4px; }
.hof-list .bd-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.hof-list .bd-name .ez-who { min-width: 0; }
.hof-list .bd-sub { font-size: var(--ez-fs-label); line-height: 1.35; color: var(--ez-c-2); }
.hof-list .bd-sub .ez-n { font-size: 14px; }
.hof-list .ez-row__name { font-weight: 700; }

/* ---- Most Wanted on a phone: the name gets the whole first line; hoes, thugs and net worth sit under it in three
   labelled columns, figures left-aligned, so a row reads across and the board reads down. ---------------------- */
@media (max-width: 767px) {
  .mw-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: end; }
  .mw-table td:nth-child(1) { grid-column: 1 / -1; grid-row: 1; }
  .mw-table td:nth-child(n+2) { grid-row: 2; padding: 0; text-align: left; font-size: 12px; }
  .mw-table td:nth-child(2) { grid-column: 1; }
  .mw-table td:nth-child(3) { grid-column: 2; }
  .mw-table td:nth-child(4) { grid-column: 3; padding-top: 0; }
  /* the labels: one small line over each figure */
  .mw-table td:nth-child(2)::before { display: block; margin-bottom: 3px; content: attr(data-label); }
  .mw-table td:nth-child(n+2) .ez-label { display: block !important; margin-bottom: 3px; }
  .mw-table td:nth-child(2)::before, .mw-table td:nth-child(n+2) .ez-label { font: 600 11px/1 var(--ez-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ez-c-2); }
  .mw-table td:nth-child(n+2) .ez-n { font-size: 17px; }
  /* the whole name; the city moves up beside it, out of the figures' way */
  .mw-table .ez-row__main { flex-wrap: wrap; row-gap: 4px; }
  .mw-table .ez-row__main .ez-uname { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .mw-table td:first-child .ez-citylink.ez-phone-hide { display: inline-flex !important; }
  .mw-table td:nth-child(4) .ez-citylink { display: none !important; }
}
/* A board's top three and its folded rest are two lists: one shared minimum keeps their figures starting on one line. */
.hof-list { grid-template-columns: minmax(2ch, max-content) minmax(0, 1fr) minmax(6.5rem, max-content); }

/* ---- Most Wanted as a table (768 up): the whole row opens the player (empyrez.css: the name's link stretched over
   the row). That stretch was measured against the <tr>, and Safari on an iPad does not let a table row be the box an
   absolute child is measured against (WebKit bug 240961): every row's link then covered the whole page, the last
   row's on top, so any tap anywhere opened the last player. Here nothing is measured against a row: the first cell
   is the box, and the link (and a live event's outline) runs from its left edge for the width of the table, read
   from .mw-wrap. A browser without container units gets the name cell only. Below 768 a row is a grid, not a table
   row, and was never affected. To fold into empyrez.css (the whole-row rules and .mx-live) when that file is free. */
@media (min-width: 768px) {
  .mw-wrap { container-type: inline-size; }
  .mw-wrap .mw-table tbody tr, .mw-wrap .mw-table tbody tr.mx-live { position: static; }
  .mw-wrap .mw-table tbody tr > td:first-child { position: relative; }
  .mw-wrap .mw-table tbody .ez-who::after,
  .mw-wrap .mw-table tbody tr.mx-live > td:first-child::before,
  .mw-wrap .mw-table tbody tr.mx-live > td:first-child::after { inset: 0 auto 0 0; box-sizing: border-box; width: 100%; width: 100cqw; }
}
