/* Leaderboard + public profile */

.lb-hero {
  margin-bottom: 12px;
}

.lb-hero h2 {
  margin: 4px 0 6px;
}

.lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lb-hint {
  font-size: 0.78rem;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
}

.lb-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) repeat(4, minmax(48px, auto));
  align-items: center;
  gap: 8px 8px;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  background: rgba(247, 241, 230, 0.72);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-stamp);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lb-row:hover,
.lb-row:focus-visible {
  transform: translateY(-1px);
  background: var(--bone);
}

.lb-row.me {
  border-color: var(--moss);
  background: rgba(47, 107, 92, 0.1);
}

.lb-row.gold {
  background: linear-gradient(135deg, rgba(196, 149, 58, 0.18), rgba(247, 241, 230, 0.9));
}

.lb-row.silver {
  background: linear-gradient(135deg, rgba(140, 140, 150, 0.16), rgba(247, 241, 230, 0.9));
}

.lb-row.bronze {
  background: linear-gradient(135deg, rgba(166, 104, 58, 0.16), rgba(247, 241, 230, 0.9));
}

.lb-rank {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}

.lb-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lb-who strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-title {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--seal-deep);
  background: rgba(196, 60, 40, 0.1);
  border: 1px solid rgba(196, 60, 40, 0.35);
  border-radius: 999px;
  width: fit-content;
  white-space: nowrap;
}

.profile-title {
  margin: 6px 0 0;
}

.lb-who .muted {
  font-size: 0.72rem;
}

.lb-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 44px;
}

.lb-stat strong {
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.1;
}

.lb-stat span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.lb-empty {
  padding: 28px 12px;
  text-align: center;
  border: 2px dashed rgba(26, 22, 18, 0.25);
  border-radius: 8px;
}

.profile-modal {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 18px;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-head h2 {
  margin: 4px 0 2px;
  font-size: 1.35rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.profile-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(247, 241, 230, 0.65);
  text-align: center;
}

.profile-stats strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.profile-stats span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.lb-mon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.lb-mon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: rgba(247, 241, 230, 0.7);
  text-align: center;
}

.lb-mon.locked {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.lb-mon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.lb-mon-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-mon-meta {
  font-size: 0.65rem;
  font-weight: 700;
}

.lb-mon-count {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 560px) {
  .lb-row {
    grid-template-columns: 36px minmax(0, 1fr) repeat(2, minmax(44px, auto));
    grid-template-rows: auto auto;
  }

  .lb-stat:nth-child(3),
  .lb-stat:nth-child(4) {
    grid-row: 1;
  }

  .lb-stat:nth-child(5),
  .lb-stat:nth-child(6) {
    grid-row: 2;
  }
}
