/* ================= RUGSWEEPER: PROFILE panel (js/profile.js) =================
   Self-contained: works with only css/style.css loaded (fonts). Matches css/hub.css. */

.pf {
  --pf-pump: #2fe07a;
  --pf-dump: #ff3b4a;
  --pf-gold: #ffd21a;
  --pf-ink: #e9f3ee;
  --pf-dim: #8fa198;
  --pf-line: rgba(255, 255, 255, 0.08);
  --pf-cut: 12px;
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--pf-ink);
  background: #040607;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pf.in { opacity: 1; transform: none; }
.pf.out { opacity: 0; transform: translateX(32px); transition-duration: 0.2s; }

.pf-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 80% 0%, rgba(47, 224, 122, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(255, 210, 26, 0.06), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at 60% 40%, #0f1a16, #040607 70%);
}

.pf > * { position: relative; }

/* ---------- head ---------- */

.pf-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(4, 6, 7, 0.6);
  backdrop-filter: blur(8px);
}

.pf-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 6px 12px 6px 6px;
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  font-family: "Michroma", Arial, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: #cfe0d7;
  cursor: pointer;
}
.pf-back svg { width: 18px; height: 18px; }
.pf-back:hover { background: rgba(255, 255, 255, 0.1); }

.pf-headtext { min-width: 0; }
.pf-kicker { font-family: "Michroma", Arial, sans-serif; font-size: 9px; letter-spacing: 0.3em; color: var(--pf-gold); white-space: nowrap; }
.pf-title {
  margin: 2px 0 0;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1;
}

.pf-offline {
  margin-left: auto;
  padding: 7px 10px;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  line-height: 1.4;
  color: #ffd9dc;
  background: rgba(255, 59, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 59, 74, 0.5);
}
.pf-offline[hidden] { display: none; }

/* ---------- body / layout ---------- */

.pf-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 224, 122, 0.5) transparent;
  padding: 16px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.pf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.pf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

@media (min-width: 960px) {
  .pf-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; }
  .pf-col { gap: 18px; }
  .pf-body { padding-top: 22px; }
}

.pf-box {
  padding: 18px;
  background: linear-gradient(160deg, rgba(20, 28, 32, 0.92), rgba(7, 9, 11, 0.92));
  box-shadow: inset 0 0 0 1px var(--pf-line);
  clip-path: polygon(var(--pf-cut) 0, 100% 0, 100% calc(100% - var(--pf-cut)), calc(100% - var(--pf-cut)) 100%, 0 100%, 0 var(--pf-cut));
  min-width: 0;
}
.pf-box[hidden] { display: none; }

.pf-h {
  margin-bottom: 12px;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: var(--pf-gold);
}
.pf-h::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; background: var(--pf-pump); vertical-align: 1px; }

.pf-lead { margin: 0 0 12px; font-size: 17px; line-height: 1.35; color: #dfe9e3; letter-spacing: 0.01em; }
.pf-lead.small { font-size: 15px; }
.pf-lead b { color: var(--pf-pump); font-weight: 600; }
.pf-sub { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: #b9c6bf; }
.pf-fine { margin: 10px 0 0; font-family: "Michroma", Arial, sans-serif; font-size: 9px; line-height: 1.75; letter-spacing: 0.06em; color: #74867d; }
.pf-fine.pad { padding: 4px 2px; }
.pf-fine b { color: var(--pf-ink); font-weight: 400; }
.pf-err { margin: 12px 0 0; padding: 8px 10px; font-size: 14px; color: #ffd9dc; background: rgba(255, 59, 74, 0.12); box-shadow: inset 2px 0 0 var(--pf-dump); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0; }

/* ---------- buttons / inputs ---------- */

.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pf-actions.end { justify-content: flex-end; margin-top: 14px; }

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 0;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #06140b;
  text-decoration: none;
  background: linear-gradient(180deg, #5effa0, #1fc061);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.15s, transform 0.15s;
}
.pf-btn:hover:not(:disabled) { filter: brightness(1.12); }
.pf-btn:active:not(:disabled) { transform: scale(0.97); }
.pf-btn:disabled { cursor: progress; opacity: 0.75; filter: grayscale(0.3); }
.pf-btn.ghost { color: #dfe9e3; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
.pf-btn.small { min-height: 36px; padding: 6px 14px; font-size: 9.5px; }
.pf-btn img { border-radius: 4px; }
.pf :is(button, a, input):focus-visible { outline: 2px solid var(--pf-gold); outline-offset: 2px; }

.pf-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  font: 500 15px "Oswald", sans-serif;
  color: var(--pf-ink);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  border-radius: 0;
}
.pf-input.mono { font-size: 12.5px; }

/* ---------- signed out ---------- */

.pf-connect { display: flex; gap: 20px; align-items: flex-start; }
.pf-connect-text { min-width: 0; flex: 1; }
.pf-wallets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.pf-wallets .pf-sub { flex-basis: 100%; margin: 0 0 2px; }

.pf-safe {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #bfe9cf;
  background: rgba(47, 224, 122, 0.07);
  box-shadow: inset 2px 0 0 var(--pf-pump);
}
.pf-lock {
  flex: none;
  width: 14px;
  height: 16px;
  margin-top: 2px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath d='M3 7V5a4 4 0 0 1 8 0v2' fill='none' stroke='%232fe07a' stroke-width='1.8'/%3E%3Crect x='1' y='7' width='12' height='9' fill='%232fe07a'/%3E%3C/svg%3E");
}

/* ---------- player card ---------- */

.pf-card { display: flex; gap: 18px; align-items: center; }
.pf-ident { min-width: 0; flex: 1; }
.pf-ident .pf-h { margin-bottom: 6px; }

.pf-avatar {
  position: relative;
  flex: none;
  width: 104px;
  height: 104px;
  overflow: hidden;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow: inset 0 0 0 2px rgba(47, 224, 122, 0.55);
  background: #05080a;
}
.pf-avatar.big { width: 120px; height: 120px; }
.pf-avatar svg { display: block; width: 100%; height: 100%; }
.pf-beams { animation: pf-laser 2.6s ease-in-out infinite; transform-origin: 32px 30px; }
@keyframes pf-laser { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; filter: brightness(1.4); } }
.pf-lvl {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 3px 8px 3px 6px;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: #06140b;
  background: var(--pf-pump);
}

.pf-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.pf-edit { flex: none; width: 32px; height: 32px; padding: 6px; border: 0; color: var(--pf-dim); background: rgba(255, 255, 255, 0.05); cursor: pointer; }
.pf-edit:hover { color: var(--pf-ink); background: rgba(255, 255, 255, 0.1); }
.pf-edit svg { width: 100%; height: 100%; display: block; }

.pf-nameform { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-nameform .pf-input { flex: 1 1 160px; font-size: 18px; }

.pf-addr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 8px;
  border: 0;
  font: 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #b9c6bf;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.pf-addr span { font-family: "Michroma", Arial, sans-serif; font-size: 8px; letter-spacing: 0.14em; color: var(--pf-pump); }

.pf-level { margin-top: 12px; }
.pf-level span { display: block; margin-top: 6px; font-family: "Michroma", Arial, sans-serif; font-size: 8.5px; letter-spacing: 0.16em; color: var(--pf-dim); }
.pf-level-bar, .pf-meter { height: 8px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.pf-level-bar i, .pf-meter i { display: block; height: 100%; background: linear-gradient(90deg, #1fc061, #5effa0); box-shadow: 0 0 12px rgba(47, 224, 122, 0.6); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

.pf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (min-width: 560px) { .pf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pf-stat { padding: 12px 12px 10px; background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--pf-line); min-width: 0; }
.pf-stat b { display: block; font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stat small { margin-left: 4px; font-size: 0.5em; font-weight: 500; color: var(--pf-dim); letter-spacing: 0.08em; }
.pf-stat span { display: block; margin-top: 5px; font-family: "Michroma", Arial, sans-serif; font-size: 8px; letter-spacing: 0.16em; color: var(--pf-dim); }
.pf-stat.hot { box-shadow: inset 0 0 0 1px rgba(47, 224, 122, 0.5), 0 0 24px rgba(47, 224, 122, 0.08); }
.pf-stat.hot b { color: var(--pf-pump); text-shadow: 0 0 14px rgba(47, 224, 122, 0.45); }

.pf-daily { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 8px; padding: 10px 12px; background: rgba(255, 210, 26, 0.06); box-shadow: inset 2px 0 0 var(--pf-gold); }
.pf-daily span { font-family: "Michroma", Arial, sans-serif; font-size: 9px; letter-spacing: 0.2em; color: var(--pf-gold); align-self: center; }
.pf-daily b { font-weight: 600; font-size: 15px; letter-spacing: 0.06em; }
.pf-daily.done { background: rgba(47, 224, 122, 0.06); box-shadow: inset 2px 0 0 var(--pf-pump); }
.pf-daily.done b { color: var(--pf-pump); }

/* ---------- multipliers ---------- */

.pf-mult + .pf-mult { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--pf-line); }
.pf-mult-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.pf-mult-top span { font-family: "Michroma", Arial, sans-serif; font-size: 9.5px; letter-spacing: 0.2em; color: #cfe0d7; }
.pf-mult-top b { font-weight: 700; font-size: 22px; color: var(--pf-pump); white-space: nowrap; }
.pf-mult-top b.gold { color: var(--pf-gold); font-family: "Michroma", Arial, sans-serif; font-size: 12px; letter-spacing: 0.18em; }
.pf-mult-sub { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 13px; color: var(--pf-dim); }
.pf-meter.diamond i { background: linear-gradient(90deg, #3d8fb0, #bff3ff); box-shadow: 0 0 12px rgba(143, 216, 240, 0.6); }
.pf-reset { font-family: "Michroma", Arial, sans-serif; font-size: 8.5px; letter-spacing: 0.16em; color: var(--pf-dump) !important; align-self: center; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { padding: 5px 9px; font-family: "Michroma", Arial, sans-serif; font-size: 8.5px; letter-spacing: 0.12em; color: var(--pf-dim); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--pf-line); }
.pf-chip.on { color: #06140b; background: var(--pf-pump); box-shadow: 0 0 14px rgba(47, 224, 122, 0.5); }

/* ---------- referral ---------- */

.pf-copyrow { display: flex; gap: 8px; }
.pf-refstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pf-refstats div { padding: 10px; background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--pf-line); min-width: 0; }
.pf-refstats b { display: block; font-weight: 700; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
.pf-refstats span { display: block; margin-top: 4px; font-family: "Michroma", Arial, sans-serif; font-size: 7.5px; letter-spacing: 0.14em; color: var(--pf-dim); }

/* ---------- leaderboard ---------- */

.pf-tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.pf-tabs button {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 6px 12px;
  border: 0;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--pf-dim);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.pf-tabs button[aria-selected="true"] { color: #06140b; background: var(--pf-pump); }
.pf-tabs button:hover:not([aria-selected="true"]) { color: var(--pf-ink); background: rgba(255, 255, 255, 0.08); }

.pf-lb-list { min-height: 120px; }
.pf-lb-head, .pf-rows li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pf-lb-head { padding: 0 10px 6px; font-family: "Michroma", Arial, sans-serif; font-size: 7.5px; letter-spacing: 0.2em; color: #5f7068; }
.pf-lb-head span:last-child { text-align: right; }
.pf-rows { list-style: none; margin: 0; padding: 0; max-height: min(56vh, 560px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(47, 224, 122, 0.4) transparent; }
.pf-rows.mine { max-height: none; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(255, 255, 255, 0.15); }
.pf-rows li { min-height: 42px; padding: 6px 10px; font-size: 16px; }
.pf-rows li:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.pf-rows .rk { font-weight: 700; color: var(--pf-dim); }
.pf-rows .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pf-rows .nm small { margin-left: 8px; font: 11px ui-monospace, "SF Mono", Menlo, monospace; color: #5f7068; }
.pf-rows .pt { font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-rows .pt em { margin-left: 6px; padding: 2px 5px; font-style: normal; font-family: "Michroma", Arial, sans-serif; font-size: 7px; letter-spacing: 0.12em; color: #06140b; background: var(--pf-pump); vertical-align: 2px; }
.pf-rows li.top1 .rk { color: var(--pf-gold); }
.pf-rows li.top2 .rk { color: #d6e2dc; }
.pf-rows li.top3 .rk { color: #e0a060; }
.pf-rows li.me { background: rgba(47, 224, 122, 0.12); box-shadow: inset 3px 0 0 var(--pf-pump); }
.pf-rows li.me .nm { color: var(--pf-pump); }

/* ---------- airdrop brief ---------- */

.pf-steps { list-style: none; margin: 0; padding: 0; counter-reset: pf; }
.pf-steps li { counter-increment: pf; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--pf-line); }
.pf-steps li::before { content: counter(pf, decimal-leading-zero); grid-row: span 2; font-family: "Michroma", Arial, sans-serif; font-size: 11px; color: var(--pf-pump); padding-top: 3px; }
.pf-steps b { font-family: "Michroma", Arial, sans-serif; font-weight: 400; font-size: 10px; letter-spacing: 0.2em; }
.pf-steps span { font-size: 15px; line-height: 1.4; color: #b9c6bf; }

/* ---------- phones ---------- */

@media (max-width: 559px) {
  .pf-head { gap: 10px; }
  .pf-back { padding-right: 10px; }
  .pf-kicker { font-size: 8px; letter-spacing: 0.2em; }
  .pf-offline { position: absolute; left: 0; right: 0; top: 100%; margin: 0; text-align: center; z-index: 2; }
  .pf-box { padding: 14px; }
  .pf-connect { flex-direction: column; align-items: center; text-align: center; }
  .pf-connect .pf-actions, .pf-connect .pf-wallets { justify-content: center; }
  .pf-connect .pf-btn:not(.small) { flex: 1 1 100%; }
  .pf-safe { text-align: left; }
  .pf-avatar { width: 84px; height: 84px; }
  .pf-avatar.big { width: 104px; height: 104px; }
  .pf-card { gap: 14px; align-items: flex-start; }
  .pf-lb-head, .pf-rows li { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
  .pf-rows .nm small { display: none; }
  .pf-refstats b { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf, .pf.out { transition: none; }
  .pf-beams { animation: none; }
}
.pf-ca { margin-top: 12px; }
