/* ============================================================
   community.css — /community Social Layer layout
   ============================================================ */

.community-hero {
  padding: calc(var(--nav-h) + var(--sp-16)) var(--sp-8) var(--sp-12);
  text-align: center;
}

.community-hero h1 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-4);
}

.community-hero p {
  color: var(--clr-muted);
  font-size: var(--fs-lg);
  max-width: 52ch;
  margin-inline: auto;
}

.community-coming-soon {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

/* ── Leaderboard ──────────────────────────────────────────────────────────── */
.community-layout {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: var(--sp-12) var(--sp-8);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-8);
  align-items: start;
}

.section-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
}

.section-card-header h2 {
  font-size: var(--fs-lg);
}

.section-card-body {
  padding: var(--sp-6);
}

/* Leaderboard table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}

.leaderboard-table thead th {
  color: var(--clr-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.leaderboard-table tbody tr:hover {
  background: var(--clr-surface-alt);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: var(--fs-xs);
  background: var(--clr-surface-alt);
  color: var(--clr-muted);
}

.rank-badge--1 { background: #b8860b; color: #ffe066; }
.rank-badge--2 { background: #5a6272; color: #c0c7d4; }
.rank-badge--3 { background: #6b3a2a; color: #cd7f59; }

.elo-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--clr-accent);
}

.elo-delta {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}

.elo-delta--up   { color: #4caf82; }
.elo-delta--down { color: var(--clr-p2); }

/* Skeleton placeholder rows (shown before API data) */
.skeleton-row td {
  height: 42px;
}

.skeleton-cell {
  height: 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--clr-surface-alt) 25%, var(--clr-border) 50%, var(--clr-surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Open lobbies ────────────────────────────────────────────────────────── */
.lobby-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.lobby-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast);
}

.lobby-card:hover {
  border-color: var(--clr-accent);
}

.lobby-variant {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-accent);
  background: var(--clr-accent-glow);
  border-radius: var(--r-sm);
  padding: 2px var(--sp-2);
}

.lobby-info {
  flex: 1;
  min-width: 0;
}

.lobby-host {
  font-weight: 600;
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-meta {
  font-size: var(--fs-xs);
  color: var(--clr-muted);
}

.lobby-join {
  flex-shrink: 0;
}

/* ── Leaderboard variant filter pills ────────────────────────────────────── */
.leaderboard-filters {
  display: flex;
  gap: var(--sp-2);
}

/* ── Nav auth area ────────────────────────────────────────────────────────── */
.nav-auth {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .community-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Profile modal ────────────────────────────────────────────────────────── */
#profile-modal[hidden] { display: none; }

.profile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
}

.profile-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  min-width: 300px;
  max-width: min(420px, 90vw);
}

.profile-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  background: none;
  border: none;
  color: var(--clr-muted);
  font-size: var(--fs-lg);
  cursor: pointer;
  line-height: 1;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  transition: color var(--t-fast);
}
.profile-close:hover { color: var(--clr-text); }

.profile-username {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--sp-1);
  padding-right: var(--sp-8);
}

.profile-joined {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-bottom: var(--sp-6);
}

.profile-ratings {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.profile-ratings th,
.profile-ratings td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}
.profile-ratings thead th {
  color: var(--clr-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.profile-link {
  background: none;
  border: none;
  color: var(--clr-text);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.profile-link:hover {
  color: var(--clr-accent);
  text-decoration-color: var(--clr-accent);
}
