/* After-Hours Board, карточки «Biggest moves», share-диалог */

[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* общий «пластинчатый» фон с неровным краем для мелких контролов */
.seg, .search, .sortsel, .tab, .seg__btn { position: relative; isolation: isolate; }
.seg::before, .search::before, .sortsel::before,
.tab[aria-selected="true"]::before, .seg__btn[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-mask: url(../img/rough-btn.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/rough-btn.svg) 0 0 / 100% 100% no-repeat;
}

/* ---------- шапка Board ---------- */
.board__head { margin-bottom: clamp(44px, 5.6vw, 72px); }
.board__title { max-width: 15em; }
.board__lede {
  max-width: 34em;
  margin-top: clamp(16px, 2vw, 24px);
  font-size: clamp(16px, 0.6vw + 12px, 20px);
  color: var(--paper-2);
  text-wrap: pretty;
}

/* ---------- Biggest moves ---------- */
.moves { margin-bottom: clamp(56px, 7vw, 96px); }
.moves__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}
.moves__title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(17px, 1.4vw, 21px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.seg { display: inline-flex; padding: 4px; }
.seg::before { background: var(--concrete-2); }
.seg__btn {
  border: 0;
  background: none;
  padding: 10px 20px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-2);
  cursor: pointer;
  transition: color 0.2s;
}
.seg__btn:hover { color: var(--paper); }
.seg__btn[aria-pressed="true"] { color: var(--ink); }
.seg__btn[aria-pressed="true"]::before { background: var(--paper); }

.moves__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 32px);
}
/* карточка — стена (бетон) с окном: горит у растущих, тёмное у падающих */
.mcard {
  position: relative;
  isolation: isolate;
  display: block;
  padding: clamp(12px, 1.4vw, 18px);
  color: var(--paper);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mcard::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--concrete);
  -webkit-mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
  transition: background-color 0.25s;
}
.mcard[href]:hover::before { background: var(--concrete-3); }
.mcard.is-empty { pointer-events: none; }
.mcard__pane {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 't rank' 'g g' 's s' 'p p';
  align-content: end;
  min-height: clamp(190px, 19vw, 250px);
  padding: clamp(16px, 1.8vw, 26px);
}
.mcard__pane::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  -webkit-mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
  transition: background-color 0.4s ease;
}
.mcard.is-lit { color: var(--ink); }
.mcard.is-lit .mcard__pane::before { background: var(--light); }
.mcard__rank { grid-area: rank; align-self: start; font-family: var(--f-mono); font-size: 12px; opacity: 0.5; }
.mcard__t {
  grid-area: t;
  align-self: start;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: clamp(26px, 2.8vw, 42px);
  line-height: 1;
  letter-spacing: 0.04em;
}
.mcard__g {
  grid-area: g;
  margin-top: clamp(28px, 4vw, 56px);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mcard__s { grid-area: s; margin-top: 8px; font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.mcard__p { grid-area: p; margin-top: 14px; font-family: var(--f-mono); font-size: 13px; opacity: 0.72; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .moves__cards { grid-template-columns: 1fr; }
  .mcard__pane {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: 'rank t g' 'rank s p';
    align-items: baseline;
    column-gap: 14px;
  }
  .mcard__rank { align-self: baseline; }
  .mcard__g { margin-top: 0; font-size: 28px; text-align: right; }
  .mcard__t { font-size: 26px; }
  .mcard__p { margin-top: 8px; text-align: right; }
  .mcard.is-empty .mcard__pane { min-height: 84px; }
}

/* ---------- фильтры, сортировка, поиск ---------- */
.bcontrols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 14px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab {
  border: 0;
  background: none;
  padding: 11px 14px;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-2);
  cursor: pointer;
  transition: color 0.2s;
}
.tab:hover { color: var(--paper); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::before { background: var(--paper); }
.tab__n { margin-left: 8px; font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.04em; opacity: 0.7; }
.tab__n:empty { display: none; }

.bcontrols__side { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 250px;
  height: 46px;
  padding: 0 16px;
  color: var(--paper-3);
}
.search::before { background: var(--concrete-2); }
.search svg { flex: none; width: 15px; height: 15px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
}
.search input::placeholder { color: var(--paper-3); text-transform: none; letter-spacing: 0.02em; }
.search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }
.search:focus-within { outline: 2px solid var(--paper); outline-offset: 3px; }

.sortsel { display: none; align-items: center; gap: 10px; height: 46px; padding: 0 14px; }
.sortsel::before { background: var(--concrete-2); }
.sortsel__l { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-3); }
.sortsel select {
  border: 0;
  background: none;
  max-width: 11em;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--paper);
  outline: none;
}
.sortsel select option { background: var(--concrete); color: var(--paper); }
.sortsel:focus-within { outline: 2px solid var(--paper); outline-offset: 3px; }

/* ---------- таблица ---------- */
.btable { position: relative; }
.brow {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(104px, 1.2fr) minmax(88px, 1fr) minmax(88px, 0.9fr) minmax(150px, 1.3fr) minmax(84px, 0.85fr) minmax(90px, 1fr) 156px;
  align-items: center;
  column-gap: clamp(10px, 1.4vw, 20px);
  min-height: 66px;
  padding: 0 4px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color 0.2s;
}
.brow:hover { background: rgba(33, 33, 38, 0.6); }
.brow--head { min-height: 58px; border-top: 0; cursor: default; align-items: end; padding-bottom: 12px; }
.brow--head:hover { background: none; }
.bbody { border-bottom: 1px solid var(--rule); }
.bbody:empty { border-bottom: 0; }
.bc { min-width: 0; }
.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.brow--head button, .brow--head .hd {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  color: var(--paper-2);
}
.brow--head button { cursor: pointer; position: relative; transition: color 0.2s; }
.brow--head button:hover, .brow--head button.is-on { color: var(--paper); }
.brow--head button.is-on::after {
  content: '';
  position: absolute;
  left: -14px;
  top: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.brow--head button.is-on[data-dir="asc"]::after { border-top: 0; border-bottom: 5px solid currentColor; }
.brow--head button.is-on[data-dir="abs"]::after { width: 8px; height: 8px; border: 1.5px solid currentColor; top: 2px; }
.brow--head small { font-size: 10.5px; letter-spacing: 0.08em; color: var(--paper-3); text-transform: none; }
.brow--head .bc--tick button, .brow--head .hd { align-items: flex-start; text-align: left; }
.brow--head .bc--tick button.is-on::after { left: auto; right: -14px; }
.brow--head .bc--bell, .brow--head .bc--gap, .brow--head .bc--now, .brow--head .bc--vol { text-align: right; }

.star {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper-3);
  cursor: pointer;
  transition: color 0.2s;
}
.star svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.star:hover { color: var(--paper); }
.star[aria-pressed="true"] { color: var(--paper); }
.star[aria-pressed="true"] svg { fill: currentColor; }

.tk { display: block; font-weight: 600; font-size: 18px; line-height: 1.1; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; }
.tk__cat { display: block; margin-top: 4px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-3); }
.bc--bell { font-size: 14px; color: var(--paper-2); }
.bc--gap { font-size: 15px; font-weight: 500; }
.bc--now .v {
  position: relative;
  display: inline-block;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 500;
  color: var(--paper);
}
/* изменение цены: короткое оранжевое подчёркивание ячейки, 600 мс */
.bc--now.is-tick .v::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--light);
  animation: tick 0.6s ease-out forwards;
}
@keyframes tick { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.bc--vol { font-size: 13.5px; color: var(--paper-3); }
.bc--spark svg { width: 100%; height: 28px; overflow: visible; }
.bc--spark polyline { fill: none; stroke: var(--paper); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }
.bc--act { position: relative; z-index: 1; display: flex; justify-content: flex-end; gap: 2px; }
.share-btn, .trade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  background: none;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-2);
  cursor: pointer;
  transition: color 0.2s;
}
.share-btn:hover, .trade:hover { color: var(--paper); }
.trade svg { width: 10px; height: 10px; }
.lbl { display: none; }

.bempty {
  margin: 0;
  padding: clamp(40px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--paper);
}
.bmore { display: flex; justify-content: center; margin-top: 28px; }
.bnote {
  max-width: 62em;
  margin-top: 28px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--paper-3);
}

@media (max-width: 1080px) and (min-width: 821px) {
  .brow { grid-template-columns: 32px minmax(96px, 1.1fr) minmax(84px, 1fr) minmax(80px, 0.9fr) minmax(110px, 1.1fr) minmax(76px, 0.8fr) 132px; }
  .bc--spark { display: none; }
}

@media (max-width: 820px) {
  .brow--head { display: none; }
  .sortsel { display: flex; }
  .bcontrols__side { width: 100%; }
  .search { flex: 1 1 0; width: auto; min-width: 0; }
  .sortsel { flex: 0 1 auto; min-width: 0; }
  .sortsel select { max-width: 8.5em; text-overflow: ellipsis; }
  .brow {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas:
      'star tick gap'
      'star now spark'
      'star bell vol'
      'star act act';
    column-gap: 12px;
    row-gap: 8px;
    padding: 16px 0 10px;
    align-items: center;
  }
  .bc--star { grid-area: star; align-self: start; margin-top: -4px; }
  .bc--tick { grid-area: tick; }
  .bc--gap { grid-area: gap; font-size: 18px; }
  .bc--now { grid-area: now; text-align: left; }
  .bc--spark { grid-area: spark; width: 104px; justify-self: end; }
  .bc--bell { grid-area: bell; text-align: left; font-size: 12.5px; }
  .bc--vol { grid-area: vol; font-size: 12.5px; }
  .bc--act { grid-area: act; justify-content: flex-end; margin-right: -10px; }
  .lbl { display: block; margin-bottom: 3px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-3); }
  .bc--bell .lbl, .bc--vol .lbl { display: inline; margin: 0 8px 0 0; }
  .bc--now .v { font-size: 22px; }
}

/* ---------- Night Mood: кнопка шаринга ---------- */
.movers__share { margin-top: 28px; }

/* ---------- футер ---------- */
.foot__ticker { margin-top: -6px; font-weight: 600; font-size: 14px; letter-spacing: 0.22em; color: var(--paper-2); }

/* ---------- share-диалог ---------- */
.share {
  width: min(920px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  overflow: visible;
}
.share::backdrop { background: rgba(13, 12, 11, 0.9); }
.share[open] { animation: share-in 0.35s ease-out; }
@keyframes share-in { from { opacity: 0; } to { opacity: 1; } }
.share__plate { position: relative; isolation: isolate; padding: clamp(16px, 2.6vw, 30px); }
.share__plate::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--concrete);
  -webkit-mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/rough-plate.svg) 0 0 / 100% 100% no-repeat;
}
.share__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.share__head .eyebrow { margin: 0; }
.share__close {
  padding: 8px 4px;
  border: 0;
  background: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-2);
  cursor: pointer;
}
.share__close:hover { color: var(--paper); }
.share__img { width: 100%; height: auto; aspect-ratio: 1200 / 675; background: var(--ink); }
.share__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
@media (max-width: 560px) {
  .share__actions { flex-direction: column; }
  .share__actions .btn { width: 100%; }
}
.mcard.is-empty .mcard__rank { visibility: hidden; }
