/* ═══════════════════════════════════════════════════════
   ChartFlow — leaderboard.html 전용 (2026-10-18 개편)
   표 줄은 js/leaderboard.js 가 만듭니다 (rank-cell · trader-name · lb-days · lb-pct · lb-profit · lb-status · reason-cell).
   넓은 화면 = 보통 표, 좁은 화면(≤640px) = 줄마다 두세 줄짜리 목록 모양 (가로 스크롤 없이 읽히게).
   [2026-10-19] 역대 리더보드 표(.lb-table--all) · 요약(.lb-stats) 추가. 예전 API 용 --active · --inactive 는 그대로 둠
   ═══════════════════════════════════════════════════════ */

/* 요약 3칸 */
.lb-stats { max-width: 760px; margin-bottom: 40px; }

.lb-block + .lb-block { margin-top: 56px; }
.lb-block .ui-subhead .lb-section-title { margin-bottom: 0; }
.lb-block .ui-subhead .lb-updated { margin: 0; }

/* 넓은 화면 표 */
.lb-table .lb-rank-h, .lb-table .rank-cell { width: 72px; text-align: center; }
.lb-table .rank-cell { font-weight: 700; }
.lb-table .rank-cell.rank-medal { font-size: 1.25rem; line-height: 1.2; }
.lb-table .trader-name { font-weight: 600; }
.lb-table .reason-cell { max-width: none; min-width: 14em; white-space: normal; color: var(--c-ink-2); }
.lb-table--inactive .trader-name { color: var(--c-ink); }
/* 역대 표 — 긴 닉네임은 줄바꿈(표가 옆으로 길어지지 않게), 상태 칸 = 배지 + 종료일 */
.lb-table--all .trader-name { white-space: normal; overflow-wrap: anywhere; min-width: 9em; max-width: 22em; }
.lb-table--all .lb-status { white-space: nowrap; }
.lb-end-date { margin-left: 8px; font-size: 0.875rem; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
/* 지난 회차가 최고 기록인데 지금 새 회차로 활동 중인 트레이더 — 배지(기록 상태) 아래 한 줄 */
.lb-again { display: block; margin-top: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--c-up-ink); white-space: nowrap; }

/* 좁은 화면 — 줄을 목록 모양으로. 공통 틀(머리줄 숨김 · 줄 격자 · 칸 초기화)은 site.css 의 .ui-table--stack, 여기는 칸 배치만 */
@media (max-width: 640px) {
  .lb-cards .lb-table .trader-name { white-space: normal; overflow-wrap: anywhere; font-size: 1rem; } /* 긴 닉네임은 잘라 내지 않고 줄바꿈 */
  .lb-cards .lb-table .lb-pct { text-align: right; font-size: 1rem; }
  .lb-cards .lb-table .lb-days { font-size: 0.875rem; color: var(--c-ink-3); }
  .lb-cards .lb-table .lb-days::before { content: '거래 '; }

  /* 활동 중:  [순위] 닉네임 ······ 수익률
                     거래 n일 ······ 수익금      (상태 칸은 모두 '활동 중'이라 숨김) */
  .lb-cards .lb-table--active tr { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "rank name pct" "rank days profit"; }
  .lb-cards .lb-table--active .rank-cell { grid-area: rank; width: auto; text-align: center; }
  .lb-cards .lb-table--active .trader-name { grid-area: name; }
  .lb-cards .lb-table--active .lb-pct { grid-area: pct; }
  .lb-cards .lb-table--active .lb-days { grid-area: days; }
  .lb-cards .lb-table--active .lb-profit { grid-area: profit; text-align: right; font-size: 0.875rem; }
  .lb-cards .lb-table--active .lb-status { display: none; }

  /* 역대:  [순위] 닉네임 ················ 수익률
                  거래 n일  [상태] 종료일 ···· 수익금 */
  .lb-cards .lb-table--all tr { grid-template-columns: 32px auto minmax(0, 1fr) auto; grid-template-areas: "rank name name pct" "rank days status profit"; column-gap: 10px; }
  .lb-cards .lb-table--all .rank-cell { grid-area: rank; width: auto; min-width: 0; text-align: center; }
  .lb-cards .lb-table--all .trader-name { grid-area: name; min-width: 0; max-width: none; }
  .lb-cards .lb-table--all .lb-pct { grid-area: pct; }
  .lb-cards .lb-table--all .lb-days { grid-area: days; }
  .lb-cards .lb-table--all .lb-status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; white-space: normal; }
  .lb-cards .lb-table--all .lb-end-date { margin-left: 0; font-size: 0.8125rem; }
  .lb-cards .lb-table--all .lb-again { flex-basis: 100%; margin-top: 0; white-space: normal; }
  .lb-cards .lb-table--all .lb-profit { grid-area: profit; text-align: right; font-size: 0.875rem; }
  .lb-stats { margin-bottom: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } /* 세 칸을 한 줄로 (세로로 길게 쌓이지 않게) */
  .lb-stats .ui-stat { padding: 12px; }
  .lb-stats .ui-stat__label { font-size: 0.8125rem; line-height: 1.4; }
  .lb-stats .ui-stat__value { font-size: 1.0625rem; white-space: nowrap; overflow-wrap: normal; } /* '+152.40%' 가 '%' 만 다음 줄로 넘어가지 않게 */

  /* 종료된 계정:  닉네임 ············ 수익률
                   [상태] 거래 n일
                   사유 */
  .lb-cards .lb-table--inactive tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "name name pct" "status days days" "reason reason reason"; }
  .lb-cards .lb-table--inactive .trader-name { grid-area: name; }
  .lb-cards .lb-table--inactive .lb-pct { grid-area: pct; }
  .lb-cards .lb-table--inactive .lb-status { grid-area: status; }
  .lb-cards .lb-table--inactive .lb-days { grid-area: days; }
  .lb-cards .lb-table--inactive .reason-cell { grid-area: reason; min-width: 0; margin-top: 4px; font-size: 0.875rem; overflow-wrap: anywhere; }
}
