/* ═══════════════════════════════════════════════════════════════════════════
   profile.css — the user profile, rebuilt in the Season 2 design language.

   Every class here is `pf-` prefixed, same reasoning as home-v2.css: main.css
   is one flat 4k-line global namespace and short modifier names collide
   silently. Loaded after home-v2.css so it can reuse the `hv-` shelf header,
   capsule and accent tokens.

   ⚠ Never give a `.page` element a top-level `display` rule here. main.css sets
   `.page { display:none }` / `.page.active { display:block }` at the same
   (0,1,0) specificity and this file loads later, so a bare rule would pin the
   page visible on every route. Scope to a descendant instead.

   Nothing hardcodes purple — every colour derives from --accent via color-mix,
   or from --sp-season-primary for the season strip, which deliberately wears
   the SEASON's colour rather than the user's accent (same rule as .hv-sban).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Section rhythm, mirroring .hv-home. Scoped under the profile view so the
   media-detail and Library views in the same page are untouched. */
/* ⚠ The sections are children of #comm-profile-content, not of the view wrapper
   — `#comm-view-profile > * + *` matches only the content div itself, and every
   section then sits flush. Exactly the bug home-v2.css hit with `.hv-home > * + *`. */
#comm-profile-content > * + * { margin-top: 36px; }
#comm-profile-content > .pf-hero { margin-top: 0; }
#comm-profile-content > .hv-sban { margin-top: 16px; }

/* ═══ HERO — the news rail's recipe, applied to a person ═══════════════════ */
.pf-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); min-height: 264px;
  display: flex; align-items: flex-end; isolation: isolate;
}
/* Backdrop is a strip of the covers this person has spent the most time in.
   grid-auto-flow keeps it even however many actually resolved. */
.pf-hero-bg {
  position: absolute; inset: 0; z-index: -2; display: grid;
  grid-auto-flow: column; grid-auto-columns: 1fr; opacity: .55;
}
.pf-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.pf-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(10,10,14,.99) 6%, rgba(10,10,14,.76) 46%, rgba(10,10,14,.30) 100%),
    linear-gradient(95deg, rgba(10,10,14,.94), rgba(10,10,14,.45) 66%);
}
.pf-hero-glow {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 66% 86% at 6% 100%, var(--hv-a-26), transparent 62%);
}
.pf-hero-in { position: relative; display: flex; align-items: flex-end; gap: 22px; padding: 26px 30px; width: 100%; }

.pf-av-wrap { position: relative; flex: none; }
.pf-av {
  width: 104px; height: 104px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--accent);
  background: linear-gradient(140deg, #3b3b52, #252533);
  box-shadow: 0 10px 34px rgba(0,0,0,.6);
}
.pf-av img { width: 100%; height: 100%; object-fit: cover; }
/* The tier pip is a season-coloured chip, not a grey circle — it's the same
   thing .hv-sb-lv shows on the home banner, at pip scale. */
.pf-av-pip {
  position: absolute; right: -4px; bottom: -2px; min-width: 34px; height: 26px; padding: 0 8px;
  border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 800; color: #0b1520;
  background: linear-gradient(140deg, var(--sp-season-primary, var(--accent)),
    color-mix(in srgb, var(--sp-season-primary, var(--accent)) 78%, #000));
  border: 2px solid rgba(10,10,14,.9); box-shadow: 0 3px 14px rgba(0,0,0,.5);
}

.pf-id { flex: 1; min-width: 0; }
.pf-name {
  font-family: var(--font-display); font-size: 38px; font-weight: 800; letter-spacing: -.035em;
  line-height: 1.02; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.pf-flair { font-size: 26px; line-height: 1; }
.pf-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 11px; font-size: 12px; color: var(--text-3); }
.pf-handle { font-weight: 600; }
.pf-sep { opacity: .35; }
.pf-rank {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 5px;
  background: var(--accent-dim); color: var(--accent); border: 1px solid var(--hv-a-28);
}
.pf-rank.gold { background: linear-gradient(135deg, #f5c518, #f59e0b); color: #2b1a00; border: none; }
.pf-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #86efac; }
.pf-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Pinned badges — a case, not four naked squares. Reuses .prof-pin-tile's tier
   colours from main.css; this only sizes the row. */
.pf-pins { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; }
.pf-pins .prof-pin-tile { width: 42px; height: 42px; border-radius: 11px; font-size: 21px; transition: .16s; }
.pf-pins .prof-pin-tile:hover { transform: translateY(-2px); }
.pf-pins .prof-pin-tile .badge-sprite { width: 26px; height: 26px; }

.pf-hero-r { flex: none; align-self: flex-end; text-align: right; }
.pf-xp-v {
  font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1;
  color: var(--sp-season-primary, var(--accent)); font-variant-numeric: tabular-nums;
}
.pf-xp-l { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin-top: 4px; }

/* ═══ PANELS — the shared shell for every block below ══════════════════════ */
.pf-card { border-radius: 14px; background: var(--hv-panel); border: 1px solid var(--border); overflow: hidden; }
.pf-card-h { display: flex; align-items: baseline; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pf-card-t { font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: -.015em; }
.pf-card-n { font-size: 11.5px; color: var(--text-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.pf-card-b { padding: 16px; }

/* ═══ THE TWO-UP: what they do, and how much of it ═════════════════════════ */
.pf-duo { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }

/* Counts, as a real grid instead of a space-around row of emoji. These are a
   tally; the breakdown next to them is the score. */
.pf-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pf-count { padding: 12px 11px; border-radius: 10px; background: var(--hv-panel-2); border: 1px solid var(--border); transition: .16s; }
.pf-count:hover { border-color: var(--hv-a-55); transform: translateY(-2px); }
.pf-count-v { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pf-count-v small { font-size: 14px; font-weight: 800; }
.pf-count-l { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.pf-count-l i { font-style: normal; font-size: 11px; opacity: .8; }

/* ═══ TABS — segmented pills, not an underlined text row ═══════════════════ */
.pf-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 3px 0; scrollbar-width: none; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab {
  display: flex; align-items: center; gap: 7px; flex: none; padding: 8px 15px; border-radius: 9px;
  font: inherit; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer; transition: .15s;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); white-space: nowrap;
}
.pf-tab:hover { background: rgba(255,255,255,.08); color: var(--text); }
.pf-tab.active { color: #fff; background: var(--accent-dim); border-color: var(--hv-a-55); }
.pf-tab .n { font-size: 11px; color: var(--text-3); font-weight: 600; }
.pf-tab.active .n { color: var(--accent); }
.pf-tab-content { display: none; }
.pf-tab-content.active { display: block; }
.pf-tab-content > * + * { margin-top: 36px; }

/* ═══ BADGE CASE ══════════════════════════════════════════════════════════ */
.pf-badge-hi { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 11px; }
.pf-bh { padding: 15px 12px; border-radius: 12px; text-align: center; transition: .17s; background: rgba(255,255,255,.035); border: 1px solid var(--border); }
.pf-bh:hover { transform: translateY(-3px); }
.pf-bh.tier-purple { background: linear-gradient(160deg, rgba(149,100,255,.13), rgba(149,100,255,.03)); border-color: rgba(149,100,255,.36); }
.pf-bh.tier-heardplanet {
  background: linear-gradient(160deg, rgba(149,100,255,.2), rgba(255,95,188,.07));
  border-color: rgba(149,100,255,.5); box-shadow: 0 0 22px rgba(149,100,255,.18);
}
.pf-bh-ico { font-size: 30px; line-height: 1; margin-bottom: 9px; height: 34px; display: grid; place-items: center; }
.pf-bh-ico .badge-sprite { width: 32px; height: 32px; }
.pf-bh-l { font-size: 12px; font-weight: 650; line-height: 1.3; }
.pf-bh-d { font-size: 10px; color: var(--text-3); margin-top: 3px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; }
/* The rest of the case reuses .badge-icon-pill from main.css — it already
   carries the tier colours, the sprite sizing and the event shimmer. */
.pf-badge-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pf-badge-strip:first-child { margin-top: 0; }

/* ═══ MONTHLY CHALLENGE WALL — the board's dot language ════════════════════ */
.pf-mh { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; }
.pf-mh::-webkit-scrollbar { height: 6px; }
.pf-mh::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }
.pf-mh-col { flex: none; width: 58px; padding: 10px 6px; border-radius: 10px; text-align: center; background: var(--hv-panel-2); border: 1px solid var(--border); transition: .16s; }
.pf-mh-col.swept { border-color: rgba(74,222,128,.42); background: rgba(74,222,128,.06); }
.pf-mh-col.empty { opacity: .42; }
.pf-mh-dots { display: flex; justify-content: center; gap: 3px; margin-bottom: 8px; min-height: 16px; }
.pf-mh-dot { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 8px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); filter: grayscale(1); opacity: .5; }
.pf-mh-dot.on { background: var(--hv-amber-dim); border-color: rgba(245,181,24,.45); filter: none; opacity: 1; }
.pf-mh-m { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.pf-mh-y { font-size: 9px; color: var(--text-3); margin-top: 1px; }

/* ═══ ACTIVITY — the live .hm-* grid, re-housed in a panel ═════════════════ */
.pf-streaks { display: flex; gap: 6px; margin-left: auto; }
.pf-streak { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--text-3); border: 1px solid var(--border); }
.pf-streak.lit { background: rgba(255,146,43,.14); color: #ffb26b; border-color: rgba(255,146,43,.32); }
/* The heatmap sections carry .prof-ov-section from _renderHeatmap; inside a
   panel its divider and padding are redundant. */
.pf-card .prof-ov-section { padding: 0; border-bottom: none; }
.pf-card .prof-ov-section .hm-head { display: none; }

/* ═══ EMPTY STATES ════════════════════════════════════════════════════════
   At 14 users most tabs on most profiles are empty, so the empty state IS the
   profile for a lot of people — it should say what would fill it. */
.pf-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; border: 1px dashed var(--border); border-radius: 12px; }
.pf-empty b { color: var(--text-2); font-weight: 650; display: block; margin-bottom: 4px; font-size: 13.5px; }

@media (max-width: 1180px) { .pf-duo { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .pf-hero { min-height: 0; }
  .pf-hero-in { flex-wrap: wrap; padding: 20px 16px; gap: 16px; }
  .pf-name { font-size: 28px; }
  .pf-av { width: 80px; height: 80px; font-size: 30px; }
  .pf-av-pip { min-width: 28px; height: 22px; font-size: 11.5px; }
  .pf-hero-r { flex: 1 1 100%; text-align: left; }
  .pf-counts { grid-template-columns: repeat(2, 1fr); }
  .pf-card-h { padding: 12px; }
  .pf-card-b { padding: 12px; }
  .pf-streaks { margin-left: 0; flex: 0 0 100%; }
}
