/* The draft window (_draft_board.html, live-map.js renderDraftBoard): its own rules, out of live-page.css (16.11)
   for the stream's overlay too (stream/templates/stream/overlay.html). The map page loads this right after
   live-page.css (live_base.html styles_after), so their order there is as it was. */

/* ── The draft window (_stats_block.html #lp-draft-board, live-map.js renderDraftBoard) ──────────────────────────
   While a map is in its draft: a team a column, a row a lobby player — his position's word, his name (a stand-in's
   mark by it), his three best heroes of the last month (the portrait over its maps · win rate, each cell one width).
   A hero banned or taken by the other team grey, as the draft's bans; a line under the columns says so. Desktops:
   over the chart's panel (the draft hides the chart); narrower screens: under the map and chart; phones: under the
   draft, the teams one under the other. */
.dw { display: flex; flex-direction: column; min-width: 0; color: #e2e8f0; }
.live-view .live-gold-panel > .dw { position: absolute; inset: 0; z-index: 2; visibility: visible; background: #0b1323; }
.dw-under { display: none; }
/* Its period on top (the user, 15.11: switched in the window too), the same choice as «Статистика»'s. As the
   header's tabs (the user, 18.11: variant А over the segments' box): the words alone, the chosen one white with an
   indigo line just under it. Every period's heroes are in the window, the board's data-period shows one, the new
   ones fading in. */
.dw-top { display: flex; align-items: center; justify-content: center; flex: none; min-height: calc(36px * var(--s)); padding: 0 calc(10px * var(--s)); border-bottom: 1px solid var(--lp-rule); }
.dw-rail { display: inline-flex; gap: calc(22px * var(--s)); padding: 0; border: 0; border-radius: 0; background: none; }
.dw-rail > .dash-rail-thumb { display: none; }
.dw-rail > button { position: relative; padding: calc(4px * var(--s)) 0; border-radius: 0; background: none; box-shadow: none; color: #64748b; font-size: max(11px, calc(12.5px * var(--s))); font-weight: 600; line-height: 1.3; }
.dw-rail > button:hover { color: #cbd5e1; }
.dw-rail > button[aria-pressed="true"] { background: none; box-shadow: none; color: #f1f5f9; }
.dw-rail > button[aria-pressed="true"]::after { content: ""; position: absolute; right: 0; bottom: calc(-1px * var(--s)); left: 0; height: 2px; border-radius: 2px; background: #818cf8; }
.dw .dw-p { display: none; }
.dw[data-period="tournament"] .dw-p[data-p="tournament"],
.dw[data-period="patch"] .dw-p[data-p="patch"],
.dw[data-period="month"] .dw-p[data-p="month"],
.dw[data-period="months3"] .dw-p[data-p="months3"],
.dw[data-period="months6"] .dw-p[data-p="months6"],
.dw[data-period="year"] .dw-p[data-p="year"] { display: contents; }
.dw[data-period="tournament"] .dw-p[data-p="tournament"] > *,
.dw[data-period="patch"] .dw-p[data-p="patch"] > *,
.dw[data-period="month"] .dw-p[data-p="month"] > *,
.dw[data-period="months3"] .dw-p[data-p="months3"] > *,
.dw[data-period="months6"] .dw-p[data-p="months6"] > *,
.dw[data-period="year"] .dw-p[data-p="year"] > * { animation: stIn .24s cubic-bezier(.22, 1, .36, 1) both; }
.dw-cols { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
.dw-col { display: flex; flex-direction: column; min-width: 0; }
.dw-col + .dw-col { border-left: 1px solid var(--lp-rule); }
.dw-head,
.dw-row {
    display: grid;
    grid-template-columns: calc(68px * var(--s)) calc(90px * var(--s)) minmax(0, 1fr);
    align-items: center;
    column-gap: calc(10px * var(--s));
    padding: 0 calc(12px * var(--s));
}
.dw-head { min-height: calc(40px * var(--s)); border-bottom: 1px solid var(--lp-rule); }
.dw-team { grid-column: 1 / 3; display: flex; align-items: center; gap: calc(8px * var(--s)); min-width: 0; color: #f1f5f9; font-size: max(13px, calc(14px * var(--s))); font-weight: 700; }
.dw-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-label { color: #64748b; font-size: max(10px, calc(10.5px * var(--s))); font-weight: 700; letter-spacing: .04em; line-height: 1.25; text-align: center; text-transform: uppercase; }
.dw-row { flex: 1 1 0; min-height: 0; }
.dw-row + .dw-row { border-top: 1px solid rgba(30, 41, 59, .5); }
.dw-role { color: #64748b; font-size: max(10px, calc(11px * var(--s))); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dw-name { display: flex; align-items: center; gap: calc(6px * var(--s)); min-width: 0; }
.dw-nick { overflow: hidden; color: #f1f5f9; font-size: max(13px, calc(15px * var(--s))); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dw-sub { width: calc(18px * var(--s)); height: calc(18px * var(--s)); }
.dw-sub .st-ico { width: calc(11px * var(--s)); height: calc(11px * var(--s)); }
/* The page's mark a little larger, the mark alone (the user, 18.11, after a look at it with its word), and in the
   middle of the name's letters: between its capitals' middle and its lowercase letters' (most names are lowercase),
   within 0.7 px of either. Not the stream and its overlay (the word with it, stream.css). */
html:not(.stream-page) .dw-sub { position: relative; top: calc(max(13px, calc(15px * var(--s))) * .045); width: calc(22px * var(--s)); height: calc(22px * var(--s)); }
html:not(.stream-page) .dw-sub .st-ico { width: calc(13px * var(--s)); height: calc(13px * var(--s)); }
/* The mark's word: the stream and its overlay show it (stream.css), the map page the mark alone. */
.dw-sub-word { display: none; }
.dw-heroes { display: flex; align-items: center; justify-content: center; gap: calc(6px * var(--s)); min-width: 0; }
.dw-h { display: flex; flex-direction: column; align-items: center; gap: calc(3px * var(--s)); flex: none; width: max(46px, calc(54px * var(--s))); }
.dw-h img { width: calc(38px * var(--s)); aspect-ratio: 16 / 9; border-radius: 2px; object-fit: cover; background: #101827; transition: filter .2s ease, opacity .2s ease; }
.dw-h small { color: #94a3b8; font-family: var(--lp-mono); font-size: max(10.5px, calc(11.5px * var(--s))); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity .2s ease; }
.dw-h b,
.dw-h em { color: #e2e8f0; font-style: normal; font-weight: 700; }
.dw-h i { margin: 0 .12em; color: #475569; font-style: normal; }
.dw-h .up em { color: #34d399; }
.dw-h .down em { color: #f87171; }
.dw-h.gone img { filter: grayscale(1); opacity: .4; }
.dw-h.gone small { opacity: .45; }
/* A hero his own team has picked (the user, 18.11): ringed in indigo, the site's colour of a selection (DESIGN.md:
   emerald and red are the win rates under it), 2 px. Every player of the team who has the hero is ringed: the team
   has it, who plays it is known once the game starts. No legend under the window (the user, 18.11). */
.dw-h img { outline: max(2px, calc(2px * var(--s))) solid transparent; outline-offset: 1px; transition: filter .2s ease, opacity .2s ease, outline-color .2s ease; }
/* The pictures larger with the legend's room (the user, 18.11): as wide as their cell lets them, the cell as wide as
   before, so a row's three fit where they did. Not the stream and its overlay (their own rows, stream.css). */
html:not(.stream-page) .dw-h img { width: calc(46px * var(--s)); }
/* The picture and its numbers in the row's middle as the word and the name are (the user, 18.11): the numbers' line
   trimmed to their digits, its room under them had lifted the pair 2-3 px; the gap over them as it looked. */
html:not(.stream-page) .dw-h { gap: calc(5px * var(--s)); }
html:not(.stream-page) .dw-h small { line-height: 1; }
@supports (text-box: trim-both cap alphabetic) {
    html:not(.stream-page) .dw-h small { text-box: trim-both cap alphabetic; }
}
.dw-h.mine img { outline-color: #818cf8; }
/* Each in the middle of its column (the user, 18.11): the position's word, the name (with a stand-in's mark), the
   heroes; the team over the word and the name. Not on phones (their columns: below) nor the stream and its overlay
   (role over the name, stream.css). */
@media (min-width: 640px) {
    html:not(.stream-page) .dw-team,
    html:not(.stream-page) .dw-name { justify-content: center; }
    html:not(.stream-page) .dw-role { text-align: center; }
}
/* Before the window has its players (a series' break, a draft before its lobby's five; _draft_outline.html): its
   outlines (the user, 18.11), the frame and words as the window's, only its heroes' places outlined (fewer: the
   user, 18.11), each as the draft's empty slots (live-map.css .empty > .live-dv-art, a ban's corners). */
.dw-ol { display: block; flex: none; border-radius: calc(4.7px * var(--s)); background: rgba(15, 23, 42, .45); box-shadow: inset 0 0 0 1px rgba(51, 65, 85, .4); }
.dw-ol-pic { width: calc(46px * var(--s)); aspect-ratio: 16 / 9; }
/* Computers and tablets: larger heroes (the user, 18.11: room enough since the legend went, they looked small): the
   picture 56 and the numbers 12.5 at the scale, each cell 62. The position over the name (the user, 18.11, after
   real nicknames: beside the position 12 % of the registry's were cut, the name across the field 1.4 %), the two in
   the middle of the field and of the row, the team over them. A row's three heroes fit the chart's panel from
   1230 px (narrower: the window under the map). */
@media (min-width: 640px) {
    html:not(.stream-page) .dw-head,
    html:not(.stream-page) .dw-row { grid-template-columns: calc(156px * var(--s)) minmax(0, 1fr); column-gap: calc(8px * var(--s)); padding: 0 calc(10px * var(--s)); }
    html:not(.stream-page) .dw-team { grid-column: 1; }
    html:not(.stream-page) .dw-label { grid-column: 2; }
    html:not(.stream-page) .dw-row { grid-template-rows: auto auto; align-content: center; row-gap: calc(3px * var(--s)); }
    html:not(.stream-page) .dw-role { grid-column: 1; grid-row: 1; align-self: end; }
    html:not(.stream-page) .dw-name { grid-column: 1; grid-row: 2; align-self: start; }
    html:not(.stream-page) .dw-heroes { grid-column: 2; grid-row: 1 / 3; }
    html:not(.stream-page) .dw-bones { grid-column: 1; grid-row: 1 / 3; }
    /* Under the picture its ring's room (1 + 2 px) and 2 px more before the digits: 5 px at the scale's .85, 6 at 1
       (the user, 18.11: on some heroes the ring touched the numbers). The ring is drawn on the screen's pixels with the
       picture, the digits' line on its own: a gap that is not a whole number of the screen's pixels (4.25 px was 6.4
       of them at 150 %) rounded each row of the window its own way, a pixel less between them on most rows than on
       the rest. Whole numbers of them: 5 px at 100 % and 200 %, below at 125 % and 150 % (6 and 7 of theirs). Chrome,
       measured over the rows' fractions of a pixel: the same gap on 92-100 % of the rows, never under 2 px. */
    html:not(.stream-page) .dw-h { width: max(52px, calc(62px * var(--s))); gap: max(5px, calc(7px * var(--s) - 1px)); }
    html:not(.stream-page) .dw-h img,
    html:not(.stream-page) .dw-ol-pic { width: calc(56px * var(--s)); }
    html:not(.stream-page) .dw-h small { font-size: max(11px, calc(12.5px * var(--s))); }
}
@media (min-width: 640px) and (resolution: 1.25dppx) {
    html:not(.stream-page) .dw-h { gap: max(4.8px, calc(7px * var(--s) - 1.4px)); }
}
@media (min-width: 640px) and (resolution: 1.5dppx) {
    html:not(.stream-page) .dw-h { gap: max(calc(14px / 3), calc(7px * var(--s) - 5px / 3)); }
}
/* Where the position and the name go: the hero block's quiet bars before the picks (live-page.css .hs-bone), the
   longer over the shorter, in the middle of the two fields. */
.dw-bones { grid-column: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: calc(8px * var(--s)); min-width: 0; }
.dw-bone { display: block; width: 62%; height: calc(9.3px * var(--s)); border-radius: 4px; background: rgba(148, 163, 184, .1); }
span.dw-bone { width: 44%; height: calc(8px * var(--s)); }
@media (prefers-reduced-motion: reduce) {
    .dw-h img,
    .dw-h small { transition: none; }
    .dw .dw-p > * { animation: none !important; }
}
/* The multiview's «Крупно» tile: the window as tall as the map and the chart (live-map.js sets its height, .dw-fit),
   at their distance from the cards; its rows share the room, the rail and heads lower. */
.lp-embed-main .dw-under { margin-top: .75rem; }
.dw-under.dw-fit .dw-top { min-height: calc(30px * var(--s)); }
.dw-under.dw-fit .dw-rail > button { padding-block: calc(2px * var(--s)); }
.dw-under.dw-fit .dw-head { min-height: calc(30px * var(--s)); }
.dw-under.dw-fit .dw-row { flex: 1 1 0; min-height: 0; }
/* The multiview's «Сетка» (a panel a tile): no window, the tile's panels as they are. */
html[data-tile-panel] .dw { display: none !important; }
html[data-tile-panel] .live-visuals.dw-on { display: grid; }

/* Narrower screens: the chart's panel too small for ten rows; the window in the place of the map (only the draft's
   word on it then) and the empty chart, as wide as they are (the user, 15.11: not an empty panel over it). Below
   1230 px the chart's panel has no room for a row's three heroes either (1100 px: 116 px for their 148, measured
   18.11; the larger heroes need the panel's full 660 px at the scale's floor): the window under there too. */
@media (max-width: 1229px) {
    /* Not on the stream and its overlay: their canvas is 1920 wide whatever the window. */
    html:not(.stream-page) .live-view .live-gold-panel > .dw { display: none; }
    .live-visuals.dw-on { display: none; }
    .dw-under { display: flex; margin-top: calc(16px * var(--s)); overflow: hidden; border: 1px solid rgba(51, 65, 85, .58); border-radius: 8px; background: #0b1323; }
    .dw-under .dw-row { flex: none; min-height: calc(54px * var(--s)); }
}
@media (max-width: 639px) {
    .dw-cols { grid-template-columns: minmax(0, 1fr); }
    .dw-col + .dw-col { border-top: 1px solid var(--lp-rule); border-left: 0; }
    .dw-head,
    .dw-row { grid-template-columns: 60px minmax(0, 1fr) 150px; column-gap: 8px; padding: 0 10px; }
    .dw-head { min-height: 40px; }
    .dw-under .dw-row { min-height: 50px; }
    .dw-role { font-size: 9.5px; letter-spacing: .04em; }
    .dw-nick { font-size: 14px; }
    .dw-label { font-size: 9.5px; letter-spacing: .03em; }
    .dw-heroes { justify-content: flex-end; gap: 3px; }
    .dw-h { width: 48px; }
    .dw-h img,
    html:not(.stream-page) .dw-h img,
    .dw-ol-pic { width: 44px; }
    .dw-h small { font-size: 10px; }
    /* The team, the positions and the names each in the middle of its field (the user, 18.11), as on wider screens. */
    .dw-team,
    .dw-name { justify-content: center; }
    .dw-role { text-align: center; }
    /* The period's six in one row, as the page's own rail on phones (.hs-rail), 36 px targets. */
    .dw-top { padding: 8px 6px; }
    .dw-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; width: 100%; }
    .dw-rail > button { min-width: 0; min-height: 36px; padding: 0 1px; overflow: hidden; font-size: 12px; letter-spacing: -.01em; text-align: center; text-overflow: ellipsis; }
    /* The line under the chosen word, not the 36 px target's foot. */
    .dw-rail > button[aria-pressed="true"]::after { right: 22%; bottom: 6px; left: 22%; }
}
