/* The Legacy Hall: the old game's part of the Hall of Fame (halloffame.php, tpl/legacy_round.php), for visitors and
   players alike. LAYOUT ONLY, on the game's own tokens: no decoration and no new colours. The look comes later;
   whoever styles it works from the wrapper classes:
     .lg-hall       the old game's block on the page, under the new game's rounds (.lg-hall__head its heading)
     .lg            the hall          .lg-find    the name search (.lg-hits its answers)
     .lg-person     the picked name   .lg-slider  earlier, the range, later
     .lg-stage      holds the round on show (.is-loading while another is fetched)
     .lg-round      one round: .lg-wanted, .lg-boards > .lg-board, .lg-cartels, .lg-cities, .lg-log
     .lg-table      every board; .lg-rest the "all of them" control; .lg-gap a line that says what is missing
     .is-me         the picked name's row, wherever he is
     .lg-foot       the hall's foot: .lg-own a player's own old name with its one button, .lg-ask the line to staff
   Phone: no sideways scroll at 375; a table with figures turns each row into a small block; every control is 44px tall. */

.lg-hall { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--ez-rule); min-width: 0; scroll-margin-top: 72px; }
.lg-hall__head { margin: 0 0 20px; }
.lg-hall__head :is(h2, p) { margin: 0; }
.lg { display: grid; gap: 28px; min-width: 0; }
.lg :is(h2, h3, h4) { margin: 0 0 10px; overflow-wrap: anywhere; }
.lg section { min-width: 0; }
.lg a { overflow-wrap: anywhere; }
.lg-gap { margin: 0 0 10px; color: var(--ez-text-2); }
.lg-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Facts: label over value, as many across as fit. */
.lg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 12px; }
.lg-facts div { min-width: 0; }
.lg-facts dt { font-size: var(--ez-fs-label); color: var(--ez-text-2); }
.lg-facts dd { margin: 0; overflow-wrap: anywhere; }

/* Find a name. */
.lg-find__form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.lg-find__form .ez-field { flex: 1 1 220px; min-width: 0; margin: 0; }
.lg-find__input { width: 100%; min-height: 44px; }
.lg-find__go { min-height: 44px; }
.lg-hits { list-style: none; margin: 8px 0 0; padding: 0; }
.lg-hits:empty { display: none; }
.lg-hits a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 44px; padding: 6px 8px; border-bottom: 1px solid var(--ez-rule); }
.lg-hits a:is(:hover, :focus-visible) { background: var(--ez-ground-2); }
.lg-hits__line { color: var(--ez-text-2); font-size: var(--ez-fs-small); }

/* The picked name. */
.lg-person :is(.lg-person__finishes, .lg-person__boards, .lg-person__badges) { list-style: none; margin: 0 0 14px; padding: 0; gap: 4px 16px; }
.lg-person__finishes { display: flex; flex-wrap: wrap; }
.lg-person__boards, .lg-person__badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lg-person li { min-width: 0; overflow-wrap: anywhere; }
.lg-person li a { display: inline-block; padding: 10px 0; }
.lg-person__board { display: block; }
.lg-person__times, .lg-person time { color: var(--ez-text-2); font-size: var(--ez-fs-small); }
.lg-person__more > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.lg-person__clear { display: inline-block; padding: 10px 0; }

/* The slider: earlier | number, date, range | later. */
.lg-slider { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.lg-slider__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; min-width: 0; }
.lg-slider__label { grid-column: 1 / -1; }
.lg-slider__when { color: var(--ez-text-2); margin-left: 8px; }
.lg-slider__range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--ez-hot); }
.lg-slider__step, .lg-slider__go { min-height: 44px; }
.lg-slider__step[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.lg-js .lg-slider__go { display: none; }      /* with scripts on, moving the range is the Go */

.lg-stage { min-width: 0; }
.lg-stage.is-loading { opacity: .55; }
.lg-round { display: grid; gap: 28px; min-width: 0; }
.lg-round__when { color: var(--ez-text-2); margin-left: 8px; }
.lg-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px 28px; align-items: start; }
.lg-boards > :is(h3, .lg-gap) { grid-column: 1 / -1; margin-bottom: 0; }
.lg-board { min-width: 0; }

/* Boards. */
.lg-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.lg-table :is(th, td) { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ez-rule); font-weight: inherit; overflow-wrap: anywhere; }
.lg-table thead th { font-size: var(--ez-fs-label); color: var(--ez-text-2); }
.lg-table .lg-place { width: 3.5em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-table .lg-fig { text-align: right; font-variant-numeric: tabular-nums; padding-right: 6px; padding-left: 10px; white-space: nowrap; overflow-wrap: normal; }
.lg-table :is(th, td):first-child { padding-left: 6px; }
.lg-table .lg-name a { display: inline-block; }
.lg-table tr.is-me { background: var(--ez-sel); outline: 2px solid var(--ez-text); outline-offset: -2px; }
.lg-table tr.is-me .lg-name { font-weight: 700; }
.lg-table--cities th { width: 50%; }
.lg-nobody td { color: var(--ez-text-2); }
.lg-rest > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }

.lg-log__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lg-log__list time { display: block; color: var(--ez-text-2); font-size: var(--ez-fs-small); }
.lg-log__body { overflow-wrap: anywhere; }

/* Phone: a row of a board with figures becomes a block (rank and name on one line, each figure under it with its
   label), so a 21-digit net worth never pushes the page sideways. Two-column tables stay tables. */
@media (max-width: 640px) {
  .lg { gap: 22px; }
  .lg-slider { grid-template-columns: 1fr 1fr; }
  .lg-slider__form { grid-column: 1 / -1; grid-row: 1; }
  .lg-wanted .lg-table, .lg-cartels .lg-table { display: block; }
  :is(.lg-wanted, .lg-cartels) .lg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.lg-wanted, .lg-cartels) .lg-table tbody { display: block; }
  :is(.lg-wanted, .lg-cartels) .lg-table tr { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 0 8px; padding: 8px 6px; border-bottom: 1px solid var(--ez-rule); }
  :is(.lg-wanted, .lg-cartels) .lg-table :is(th, td) { display: block; border: 0; padding: 2px 0; width: auto; }
  :is(.lg-wanted, .lg-cartels) .lg-table .lg-fig { grid-column: 2; text-align: left; padding-left: 0; white-space: normal; overflow-wrap: anywhere; }
  :is(.lg-wanted, .lg-cartels) .lg-table .lg-fig::before { content: attr(data-label) " "; color: var(--ez-text-2); font-size: var(--ez-fs-small); }
  .lg-table .lg-name a { padding: 8px 0; margin: -8px 0; }
}

/* The foot: his own old name and its one button, then the quiet line to staff. */
.lg-foot { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--ez-rule); color: var(--ez-text-2); font-size: var(--ez-fs-small); scroll-margin-top: 72px; }
.lg-foot p { margin: 0; overflow-wrap: anywhere; }
.lg-own { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.lg-own__name { color: var(--ez-text); }
.lg-own__go { min-height: 44px; }
.lg-ask a { display: inline-block; padding: 12px 0; margin: -12px 0; }
