/* ══════════════════════════════════════════════════════════════════
   TheLab — community.css
   ══════════════════════════════════════════════════════════════════ */

.comm-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.comm-coming-soon {
  font-size: 11px;
  color: #f59e0b;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 12px;
  text-align: center;
}

.comm-widget-body {
  /* content area below the coming soon banner */
}

.comm-add-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.comm-add-btn:hover {
  background: var(--purple2, #a3e324);
}

/* Compare Stats */
.comm-compare-slot {
  background: var(--bg2, #13132a);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.comm-compare-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #0d0d1a;
  margin: 0 auto 8px;
}

.comm-compare-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.comm-compare-row:last-child {
  border-bottom: none;
}
.comm-compare-val {
  font-size: 14px;
  font-weight: 700;
  width: 80px;
  text-align: center;
}
.comm-compare-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}

/* Streak Battles */
.comm-battle-card {
  background: var(--bg2, #13132a);
  border-radius: 10px;
  padding: 12px 14px;
}

/* Community Achievements */
.comm-ach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comm-ach-row:last-child {
  border-bottom: none;
}

/* ── Community tab IA rev 2 (index.html) 2026-05-29 ─────────────── */
.community-v1 { padding-top: 24px; padding-bottom: var(--content-pad-bottom); }
.community-head { margin: 0 4px 18px; }
.community-title {
  font-family: var(--font-display); font-size: 28px; font-weight: var(--w-semi);
  letter-spacing: -0.01em; color: var(--text); margin: 0 0 4px;
}
.community-sub { font-size: 13px; color: var(--text-2); margin: 0; }

.community-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; margin-bottom: 12px;
}
.community-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.community-card-title {
  font-family: var(--font-display); font-size: 13px; font-weight: var(--w-semi);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin: 0;
}
.community-card-eyebrow {
  font-size: 11px; font-weight: var(--w-semi); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-3);
}
.community-empty {
  padding: 16px; background: var(--surface-2);
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-3); font-size: 13px; line-height: 1.5;
}

.community-ranks-list { display: flex; flex-direction: column; gap: 8px; }
.community-rank-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none;
  transition: border-color var(--d-fast);
}
.community-rank-row:hover { border-color: var(--accent); }
.community-rank-main { min-width: 0; }
.community-rank-name {
  font-size: 13.5px; font-weight: var(--w-semi); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.community-rank-meta {
  font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.community-rank-tier { min-width: 120px; text-align: right; }
.community-rank-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: var(--w-semi);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.community-rank-bar {
  height: 4px; width: 100%; background: var(--surface);
  border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.community-rank-fill { height: 100%; border-radius: 2px; }

.community-lb-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.community-lb-tab {
  flex: 1; padding: 10px 12px;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-3); font-family: var(--font-sans);
  font-size: 13px; font-weight: var(--w-semi); cursor: pointer;
}
.community-lb-tab:hover { color: var(--text-2); }
.community-lb-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }

.community-lb-placeholder {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
}
.community-lb-placeholder > i {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--surface); border-radius: 10px;
  color: var(--text-3); font-size: 18px;
}
.community-lb-text b {
  display: block; font-family: var(--font-display); font-size: 14px;
  font-weight: var(--w-semi); color: var(--text); margin-bottom: 4px;
}
.community-lb-text p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }

.community-card--soon { opacity: 0.85; }
.community-soon-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
}
.community-soon-row > i {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--surface-2); border-radius: 10px;
  color: var(--text-3); font-size: 18px;
}
.community-soon-text b {
  display: block; font-family: var(--font-display); font-size: 14px;
  font-weight: var(--w-semi); color: var(--text); margin-bottom: 4px;
}
.community-soon-text small { font-size: 12px; line-height: 1.45; color: var(--text-3); display: block; }
.community-tile-soon {
  font-family: var(--font-mono); font-size: 9px;
  font-weight: var(--w-semi); letter-spacing: 0.12em; color: var(--text-3);
  padding: 3px 7px; border: 1px solid var(--border);
  border-radius: 999px; white-space: nowrap;
}

/* App top bar (brand lockup + Store) — 2026-06-01 */
.app-topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 10px; }
.app-topbar .brand-lockup { padding: 0; }
.topbar-store { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--surface); box-shadow: var(--elev-1); border: none; border-radius: 999px; color: var(--text); font-size: 13px; font-weight: var(--w-semi); text-decoration: none; }
.topbar-store i { font-size: 15px; }
.topbar-store:hover { color: var(--accent); }

/* ── Community | Friends sub-tabs (2026-06-01) ─────────────────────── */
.comm-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 0 16px 16px; }
.comm-tab { padding: 9px 8px; border: none; background: transparent; cursor: pointer; border-radius: 9px; color: var(--text-2); font-family: var(--font-sans); font-size: 13px; font-weight: var(--w-semi); transition: background var(--d-fast), color var(--d-fast); }
.comm-tab.is-on { background: var(--accent); color: var(--on-accent); }
.comm-pane[hidden] { display: none; }

.friends-bar { display: flex; gap: 8px; padding: 0 16px; margin-bottom: 14px; }
.friends-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--surface); box-shadow: var(--elev-1); border-radius: 12px; color: var(--text-3); }
.friends-search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; }
.friends-add { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; height: 44px; background: var(--accent); color: var(--on-accent); border: none; border-radius: 12px; font-size: 13px; font-weight: var(--w-semi); cursor: pointer; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.friend-row:last-of-type { border-bottom: none; }
.friend-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.friend-main { flex: 1; min-width: 0; }
.friend-name { font-size: 14px; font-weight: var(--w-semi); color: var(--text); }
.friend-meta { font-size: 12px; color: var(--text-3); }
.friend-vs { flex-shrink: 0; padding: 7px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); font-size: 12px; font-weight: var(--w-semi); cursor: pointer; }
.friend-vs:hover { border-color: var(--accent); color: var(--accent); }
.friends-empty-note { font-size: 11px; color: var(--text-3); text-align: center; padding: 12px 0 2px; }
.friends-cta { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-top: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); cursor: pointer; text-align: left; }
.friends-cta:first-of-type { margin-top: 0; }
.friends-cta-ic { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); border-radius: 10px; color: var(--accent); font-size: 18px; }
.friends-cta-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friends-cta-tx b { font-size: 14px; font-weight: var(--w-semi); }
.friends-cta-tx small { font-size: 11.5px; color: var(--text-3); }
.friends-cta-go { color: var(--text-3); }
.friends-cta--primary { justify-content: center; background: var(--accent); color: var(--on-accent); border: none; font-weight: var(--w-semi); }
.friends-cta--primary i { font-size: 16px; }

.comm-toast { position: fixed; left: 50%; bottom: calc(var(--nav-height,56px) + 20px); transform: translateX(-50%) translateY(12px); background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--elev-2); border-radius: 999px; padding: 10px 18px; font-size: 13px; color: var(--text); z-index: 6000; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.comm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Rank / friends podium (2026-06-02) */
.podium { padding: 6px 0 2px; }
.podium-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.podium-col > * { max-width: 100%; }
.podium-empty { opacity: 0; }
.podium-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--on-accent); border: 2px solid var(--border-strong); }
.podium-name { font-size: 12px; font-weight: var(--w-semi); color: var(--text); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-sub { font-size: 10.5px; font-weight: var(--w-medium); }
.podium-block { width: 100%; background: var(--surface-2); border-radius: 8px 8px 0 0; display: grid; place-items: start center; padding-top: 6px; }
.podium-place { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-3); }

/* ── Waka leaderboard + coach (2026-06-06) ──────────────────────────── */
.community-lb-loading { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-list--sm .lb-row { padding: 7px 4px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--border); }
.lb-row:first-child { border-top: none; }
.lb-row.is-me { background: var(--accent-quiet, rgba(201,197,189,.10)); border-radius: 8px; }
.lb-rank { width: 22px; flex-shrink: 0; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lb-rank-1 { color: #E6B845; } .lb-rank-2 { color: #C8CDD6; } .lb-rank-3 { color: #C77B3E; }
.lb-av { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-2); border: 1px solid var(--border); }
.lb-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: var(--w-semi); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you { font-size: 10px; font-weight: 700; color: var(--accent-strong); text-transform: uppercase; letter-spacing: .04em; }
.lb-meta { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.lb-score { font-family: var(--font-mono, var(--font-display)); font-size: 13px; font-weight: 700; color: var(--text); flex-shrink: 0; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.lb-foot { margin-top: 10px; font-size: 11px; color: var(--text-3); text-align: center; }
/* per-exercise search + pin */
.lbx-search { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; color: var(--text-3); }
.lbx-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.lbx-results { display: flex; flex-direction: column; gap: 2px; margin: -4px 0 10px; }
.lbx-result { text-align: left; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.lbx-result:active { background: var(--surface-2); }
.lbx-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 10px; }
.lbx-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lbx-title { font-size: 13px; font-weight: var(--w-semi); color: var(--text); }
.lbx-unpin { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 15px; }
.lbx-soon { font-size: 11px; color: var(--text-3); margin-top: 6px; }
/* coach pane */
.coach-card { padding: 14px; margin-bottom: 12px; }
.coach-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.coach-card-title { font-family: var(--font-display); font-size: 15px; font-weight: var(--w-bold,700); color: var(--text); margin: 0; }
.coach-due-name { font-size: 16px; font-weight: var(--w-bold,700); color: var(--text); }
.coach-due-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; margin-bottom: 12px; }
.coach-btn { width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface-2); color: var(--text); font-family: var(--font-display); font-weight: var(--w-semi); font-size: 14px; cursor: pointer; }
.coach-btn--primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.coach-btn:active { transform: translateY(1px); }
.coach-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 8px; color: var(--text-3); }
.coach-empty i { font-size: 26px; opacity: .8; }
.coach-empty p { font-size: 12.5px; line-height: 1.5; margin: 0; }
