/* ============================================================================
   STARFALL — desk-members.css
   ----------------------------------------------------------------------------
   The public roster: the desk statistics strip, the leaderboard and the member
   profile card. Values come from js/desk-core.js; this file only decides how
   they are laid out.

   The leaderboard is one seven-column grid. Below 900px the seat, funded and
   join-date cells step aside so the row stays readable instead of scrolling
   sideways, and below 620px the rank pill drops as well.
   ========================================================================== */

/* ---- desk statistics strip ------------------------------------------- */
.mstats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.mstat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008));
  min-width: 0;
}
.mstat span {
  font: 600 9.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.mstat b {
  font: 800 clamp(1.15rem, 1.9vw, 1.5rem)/1 var(--mono);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mstat em {
  font-style: normal;
  font: 600 10.5px/1.3 var(--mono);
  color: var(--muted);
}

/* ---- leaderboard ------------------------------------------------------ */
.mlb {
  margin-top: 16px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  min-width: 0;
}
.mlb__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mlb__head .panel__hint { margin-left: auto; }
.mlb__head .panel__hint b { color: var(--ink-2); }

.mlb__cols,
.mlb__row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1.55fr) minmax(0, 0.95fr) 96px 108px 128px 118px;
  gap: 10px;
  align-items: center;
}
.mlb__cols {
  padding: 0 10px 8px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.mlb__cols span:nth-child(6),
.mlb__cols span:nth-child(7) { text-align: right; }

.mlb__rows { display: flex; flex-direction: column; }
.mlb__row {
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  background: transparent;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.25s, transform 0.25s var(--ease);
}
.mlb__row:hover { background: rgba(var(--accent-rgb), 0.07); transform: translateX(3px); }
.mlb__row:last-child { border-bottom: 0; }
.mlb__rank {
  font: 800 13px/1 var(--mono);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.mlb__row:nth-child(1) .mlb__rank { color: var(--accent); }
.mlb__row:nth-child(2) .mlb__rank { color: var(--ink-2); }
.mlb__row:nth-child(3) .mlb__rank { color: var(--ink-2); }

.mlb__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mlb__who > span:last-child { min-width: 0; }
.mlb__who b { display: block; font: 700 12.5px/1.2 var(--mono); color: var(--ink); }
.mlb__who em {
  display: block;
  font-style: normal;
  font: 600 10px/1.3 var(--mono);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mava {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
  background: var(--panel-2, #10151d);
}
/* the big one in the profile card: same generated image, larger */
.mprof__ava.mava, .mava--lg {
  width: 54px;
  height: 54px;
  border-radius: 15px;
}
.mlb__joined {
  font: 600 10.5px/1.3 var(--mono);
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the account a member runs — desk-funded, part funded from their own capital,
   or real money. It is a badge rather than a word because the board mixes the
   three and the colour is what makes the mix readable down the column at a
   glance; the tier still lives on the profile card. */
.mlb__acct {
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 700 9.5px/1.3 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.mlb__acct.is-funded { border-color: rgba(34, 211, 165, 0.42); color: #6ee7c6; background: rgba(34, 211, 165, 0.09); }
.mlb__acct.is-mixed { border-color: rgba(56, 189, 248, 0.42); color: #7dd3fc; background: rgba(56, 189, 248, 0.09); }
.mlb__acct.is-real { border-color: rgba(255, 187, 0, 0.45); color: #ffd166; background: rgba(255, 187, 0, 0.09); }
.mlb__funded { font: 700 11.5px/1 var(--mono); color: var(--ink-2); }
.mlb__profit { text-align: right; }
.mlb__profit b {
  display: block;
  font: 800 13px/1 var(--mono);
  color: var(--up);
  font-variant-numeric: tabular-nums;
}
.mlb__profit em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font: 600 10px/1 var(--mono);
  color: rgba(var(--up-rgb), 0.8);
}
.mlb__assets {
  text-align: right;
  font: 700 12.5px/1 var(--mono);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mlb__note {
  margin: 12px 0 0;
  font: 600 10.5px/1.5 var(--mono);
  color: var(--faint);
}

/* ---- newest joins ----------------------------------------------------- */
.mnew {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.02);
}
.mnew__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.mnew__title i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 10px var(--up);
}
.mnew__rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.mnew__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.24);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.mnew__row:hover { border-color: var(--line-gold); transform: translateY(-2px); }
.mnew__row b { display: block; font: 700 12px/1.2 var(--mono); color: var(--ink); }
.mnew__row em {
  display: block;
  font-style: normal;
  font: 600 9.5px/1.3 var(--mono);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mnew__meta { grid-column: 1 / -1; display: flex; gap: 10px; }
.mnew__meta i,
.mnew__meta u {
  font-style: normal;
  text-decoration: none;
  font: 600 9.5px/1 var(--mono);
  color: var(--muted);
}
.mnew__meta u { color: var(--up); }

/* ---- profile card ----------------------------------------------------- */
.mprof {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 8, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: mprofIn 0.25s var(--ease) both;
}
.mprof[hidden] { display: none; }
@keyframes mprofIn { from { opacity: 0; } }

.mprof__box {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 20px 22px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%),
    linear-gradient(180deg, rgba(12, 18, 30, 0.98), rgba(6, 9, 16, 0.99));
  box-shadow: var(--shadow-2), 0 0 110px -60px rgba(var(--accent-rgb), 1);
  animation: mprofBox 0.3s var(--ease) both;
}
@keyframes mprofBox { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.mprof__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}
.mprof__close:hover { color: #fff; border-color: var(--line-2); }

.mprof__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.mprof__ava {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font: 800 17px/1 var(--mono);
  color: #0a0d14;
}
.mprof__id { min-width: 0; flex: 1 1 auto; }
.mprof__id b { display: block; font: 800 17px/1.1 var(--mono); letter-spacing: 0.02em; }
.mprof__id em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font: 600 11px/1.3 var(--mono);
  color: var(--muted);
}
.mprof__flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mprof__flags span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font: 600 9.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.mprof__hero { text-align: right; flex: none; }
.mprof__hero em {
  display: block;
  font-style: normal;
  font: 600 9.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.mprof__hero b {
  display: block;
  margin: 6px 0 6px;
  font: 800 clamp(1.4rem, 3vw, 1.9rem)/1 var(--mono);
  color: var(--up);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(var(--up-rgb), 0.35);
}
.mprof__hero span { font: 600 10.5px/1.3 var(--mono); color: var(--muted); }

/* ---- the badges a seat earned, the split of its book, then the record ---- */
.mprof__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}
.mprof__tags span {
  padding: 4px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.06);
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
  white-space: nowrap;
}
.mprof__tags:empty { display: none; }

.mprof__book {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.26);
}
.mprof__book-cap { display: grid; gap: 2px; }
.mprof__book-cap em {
  font: 700 10px/1 var(--mono);
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.mprof__book-cap u {
  font: 600 9.5px/1 var(--mono);
  text-decoration: none;
  color: var(--faint);
}
.mprof__split {
  position: relative;
  display: block;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.34), rgba(var(--accent-rgb), 0.1));
}
.mprof__split i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--up), rgba(34, 211, 165, 0.55));
  box-shadow: 0 0 18px -4px rgba(34, 211, 165, 0.7);
  transition: width 0.5s var(--ease);
}
.mprof__book-key {
  font: 600 10px/1.4 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.mprof__book-key b { color: var(--ink); }

.mprof__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 16px 0 4px;
}
.mprof__grid div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}
.mprof__grid span { font: 600 11px/1.3 var(--mono); color: var(--muted); }
.mprof__grid b { font: 700 12px/1 var(--mono); color: var(--ink); white-space: nowrap; }

.mprof__chart {
  position: relative;
  height: 118px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.28);
}
.mprof__chart canvas { width: 100%; height: 100%; display: block; }

.mprof__note {
  margin: 12px 0 0;
  font: 600 10.5px/1.55 var(--mono);
  color: var(--faint);
}
.mprof__note b { color: var(--ink-2); }
.mprof__foot {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 1100px) {
  .mstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mnew__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mlb__cols,
  .mlb__row { grid-template-columns: 30px minmax(0, 1.5fr) minmax(0, 0.9fr) 96px 122px 112px; }
  /* the join date goes first: the account badge is the column that says what a
     row *is*, and a responsive board that drops it is a board of anonymous
     numbers */
  .mlb__joined { display: none; }
}
@media (max-width: 700px) {
  .mstats { grid-template-columns: minmax(0, 1fr); }
  .mnew__rows { grid-template-columns: minmax(0, 1fr); }
  .mlb__cols,
  .mlb__row { grid-template-columns: 26px minmax(0, 1fr) 112px 108px; }
  .mlb__funded { display: none; }
  .mlb__cols span:nth-child(3) { text-align: right; }
}
@media (max-width: 520px) {
  .mlb__cols,
  .mlb__row { grid-template-columns: minmax(0, 1fr) 104px; }
  .mlb__rank,
  .mlb__cols span:first-child { display: none; }
  .mlb__assets { display: none; }
  .mprof__head { flex-wrap: wrap; }
  .mprof__hero { text-align: left; }
  .mprof__grid { grid-template-columns: minmax(0, 1fr); }
  .mprof__book { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mprof,
  .mprof__box { animation: none !important; }
  .mlb__row:hover,
  .mnew__row:hover { transform: none; }
}
