/* ─────────────────────────────────────────────────────────────────────────────
   Profile, the single-table game view, and project difficulty badges.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Profile ───────────────────────────────────────────────────────────────── */
.pf-hero {
  position: relative; padding: 28px 20px 24px; border-radius: 22px; text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rank) 18%, transparent), transparent 70%),
    linear-gradient(180deg, #15102E, var(--surface-card));
  border: 1px solid color-mix(in srgb, var(--rank) 25%, var(--neutral-border));
  overflow: hidden;
}

/* Progress ring around the avatar: conic-gradient to --pct, then a masked inner disc. */
.pf-ring {
  width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rank) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.07) 0);
  padding: 4px;
}
.pf-avatar {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; font-weight: 900; letter-spacing: 0.5px; color: #fff;
  background: linear-gradient(160deg, #1B1440, #0C0920);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.pf-name { margin: 14px 0 0; font-size: 20px; font-weight: 900; }
.pf-email { margin-top: 3px; font-size: 11.5px; color: var(--text-gray); word-break: break-word; }
.pf-rank {
  display: inline-block; margin-top: 12px; padding: 5px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--rank); background: color-mix(in srgb, var(--rank) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rank) 35%, transparent);
}
.pf-next { margin-top: 8px; font-size: 11.5px; color: rgba(255, 255, 255, 0.45); }

.pf-streak {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 16px;
  border-radius: 18px;
  background: linear-gradient(100deg, rgba(255, 171, 0, 0.10), rgba(255, 171, 0, 0.02));
  border: 1px solid rgba(255, 171, 0, 0.22);
}
.pf-streak-flame { font-size: 30px; line-height: 1; }
.pf-streak-num { font-size: 20px; font-weight: 900; color: var(--amber-warm); }
.pf-streak-label { margin-top: 2px; font-size: 11.5px; line-height: 16px; color: var(--text-gray); }

.pf-metrics { margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--surface-card); border: 1px solid var(--neutral-border); }
.pf-metric + .pf-metric { margin-top: 16px; }
.pf-metric-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pf-metric-label { font-size: 12px; font-weight: 600; color: var(--text-gray); }
.pf-metric-value { font-size: 15px; font-weight: 900; }
.pf-metric-total { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, 0.3); }
.pf-metric-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.pf-metric-fill { height: 100%; border-radius: 4px; transition: width 500ms var(--ease-standard); }

.stat-grid { margin-top: 12px; }
.stat-tile { padding: 18px 14px; }

/* ── Game: one table at a time ─────────────────────────────────────────────── */
.schema-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.schema-hint { font-size: 10.5px; color: rgba(255, 255, 255, 0.32); }
.table-tabs { display: flex; gap: 6px; margin: 12px 0 10px; overflow-x: auto; scrollbar-width: none; }
.table-tabs::-webkit-scrollbar { display: none; }
.table-tab {
  flex: none; padding: 7px 12px; border-radius: 9px;
  font-family: "Roboto Mono", monospace; font-size: 11.5px; font-weight: 500;
  color: var(--text-gray); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--neutral-border);
  white-space: nowrap;
}
.table-tab.active { color: #05030C; background: var(--cyan-link); border-color: var(--cyan-link); font-weight: 700; }
.table-single { margin-top: 10px; }
.table-single-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.table-single .table-name { font-family: "Roboto Mono", monospace; font-size: 14px; font-weight: 700; color: var(--cyan-link); }

/* ── Projects: difficulty badges ───────────────────────────────────────────── */
.pj-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pj-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pj-level {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.3px;
}
.pj-level.tone-easy { color: var(--success-green); background: rgba(0, 200, 150, 0.12); }
.pj-level.tone-medium { color: var(--amber-warm); background: rgba(255, 171, 0, 0.12); }
.pj-level.tone-hard { color: #FF6B6B; background: rgba(255, 107, 107, 0.12); }
.pj-stars { letter-spacing: 1px; font-size: 10px; }
.pj-star { opacity: 0.25; }
.pj-star.on { opacity: 1; }
.pj-dur { font-size: 10.5px; color: rgba(255, 255, 255, 0.4); }

.pj-card.complete { border-color: rgba(0, 200, 150, 0.35); }
.pj-done {
  margin-left: 8px; padding: 2px 7px; border-radius: 5px; font-size: 9px; font-weight: 900;
  letter-spacing: 0.8px; color: var(--success-green); background: rgba(0, 200, 150, 0.14);
  vertical-align: middle;
}
.pj-bar { display: block; height: 4px; margin-top: 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.pj-bar-fill { display: block; height: 100%; border-radius: 3px; transition: width 400ms var(--ease-standard); }

.pj-dataset-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pj-copy-link {
  padding: 9px 14px; border-radius: 10px; font-size: 12px; font-weight: 700;
  color: var(--text-gray); background: var(--ghost-bg); border: 1px solid var(--neutral-border);
}
.pj-dataset-url {
  margin-top: 10px; font-family: "Roboto Mono", monospace; font-size: 10.5px; line-height: 16px;
  color: rgba(255, 255, 255, 0.3); word-break: break-all; user-select: all;
}

/* ── Optional sign-in (no wall) ────────────────────────────────────────────── */
.signin-card {
  margin-top: 16px; padding: 18px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(134, 93, 255, 0.12), rgba(134, 93, 255, 0.03));
  border: 1px solid rgba(134, 93, 255, 0.28);
}
.signin-card .settings-note { margin-top: 6px; color: rgba(255, 255, 255, 0.5); }
.signin-btn {
  display: block; width: 100%; height: 46px; margin-top: 14px; border-radius: 12px;
  font-size: 13.5px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, var(--brand-purple), #7C3AED);
}
.auth-back {
  position: absolute; top: max(18px, env(safe-area-inset-top)); left: 16px;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: #fff; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--neutral-border);
}
.auth-wrap { position: relative; }

/* ── Visitor badge & external roadmap card ─────────────────────────────────── */
.visitor-badge {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 18px 0 0; padding: 9px 14px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; color: var(--text-gray);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--neutral-border);
}
.visitor-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--success-green);
  box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.5); animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(0, 200, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}
@media (prefers-reduced-motion: reduce) { .visitor-dot { animation: none; } }

.rm-external { border-color: color-mix(in srgb, var(--card-accent) 45%, transparent); }
.rm-ext-badge {
  margin-left: auto; padding: 2px 8px; border-radius: 6px;
  font-size: 8.5px; font-weight: 900; letter-spacing: 0.8px;
  color: var(--card-accent); background: color-mix(in srgb, var(--card-accent) 14%, transparent);
}
.rm-ext-cta {
  display: block; margin-top: 12px; padding: 10px; border-radius: 10px; text-align: center;
  font-size: 12.5px; font-weight: 800; color: #fff;
  background: color-mix(in srgb, var(--card-accent) 85%, black);
}

/* ── Visitor pill: "N online · N visitors · see stats →" ───────────────────── */
.visitor-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  width: fit-content; max-width: 100%; margin: 26px auto 0; padding: 8px 16px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--neutral-border);
}
.vs-online { display: inline-flex; align-items: center; gap: 6px; color: var(--success-green); font-weight: 700; }
.vs-total { color: var(--text-gray); }
.vs-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.14); }
.vs-link { color: var(--text-white); text-decoration: none; font-weight: 700; white-space: nowrap; }
.vs-link:hover { color: var(--neon-lime); }

/* ── Leaderboard ───────────────────────────────────────────────────────────── */
.lb-you {
  margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; text-align: center;
  font-size: 13px; color: var(--text-gray);
  background: rgba(134, 93, 255, 0.10); border: 1px solid rgba(134, 93, 255, 0.28);
}
.lb-you strong { font-size: 16px; font-weight: 900; color: var(--brand-purple); }

.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  background: var(--surface-card); border: 1px solid var(--neutral-border);
}
.lb-row.me { border-color: var(--brand-purple); background: rgba(134, 93, 255, 0.08); }
.lb-place {
  width: 26px; flex: none; text-align: center;
  font-size: 13px; font-weight: 900; color: var(--text-gray);
}
.lb-place.gold { color: #FFD54F; }
.lb-place.silver { color: #CFD8DC; }
.lb-place.bronze { color: #D4A373; }
.lb-avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff;
  background: linear-gradient(160deg, #2A2150, #14102C);
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-you-tag {
  margin-left: 7px; padding: 2px 6px; border-radius: 5px; font-size: 8.5px; font-weight: 900;
  letter-spacing: 0.8px; color: var(--brand-purple); background: rgba(134, 93, 255, 0.2);
}
.lb-stats { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.lb-stars { font-size: 13px; font-weight: 900; color: var(--amber-warm); }
.lb-levels { font-size: 10.5px; color: rgba(255, 255, 255, 0.38); }
.list-icon.tone-amber { background: rgba(255, 171, 0, 0.12); color: var(--amber-warm); }
