/* ─── Leaderboard shared styles ─── */

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
  gap: 14px;
}

.lb-row:hover {
  background-color: #f8faf8;
}

/* ── Rank badge ── */
.lb-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.lb-rank-1 {
  background: #f59e0b;
  color: #fff;
}

.lb-rank-2 {
  background: #94a3b8;
  color: #fff;
}

.lb-rank-3 {
  background: #c2855a;
  color: #fff;
}

.lb-rank-other {
  background: #f1f5f9;
  color: #94a3b8;
}

/* ── User info ── */
.lb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.lb-user user-dw {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
}

.lb-user a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.lb-user a:hover .lb-name {
  text-decoration: underline;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f1f5f9;
}

.lb-row:hover .lb-avatar {
  border-color: #e2e8f0;
}

.lb-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Score area ── */
.lb-score-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lb-score {
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lb-bar {
  width: 72px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.lb-rank-1 ~ .lb-score-area .lb-bar-fill,
.lb-bar-fill.lb-fill-1 {
  background: #f59e0b;
}

.lb-rank-2 ~ .lb-score-area .lb-bar-fill,
.lb-bar-fill.lb-fill-2 {
  background: #94a3b8;
}

.lb-rank-3 ~ .lb-score-area .lb-bar-fill,
.lb-bar-fill.lb-fill-3 {
  background: #c2855a;
}

.lb-bar-fill.lb-fill-other {
  background: #6aaa64;
}

/* ── Dividers between rows (except around top 3) ── */
.lb-row + .lb-row {
  border-top: 1px solid #f1f5f9;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .lb-row {
    padding: 8px 10px;
    gap: 10px;
  }

  .lb-rank {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .lb-user {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
  }

  .lb-name {
    font-size: 0.85rem;
  }

  .lb-score-area {
    margin-left: auto;
  }

  .lb-score {
    font-size: 0.85rem;
    min-width: 40px;
  }

  .lb-bar {
    display: none;
  }

  .lb-avatar {
    width: 28px;
    height: 28px;
  }

  .lb-user a {
    gap: 6px;
  }

  .lb-user user-dw {
    flex-shrink: 0;
    max-height: 10px;
    display: inline-flex;
    align-items: center;
    align-self: center;
    vertical-align: middle;
  }
}
