/* ============================================================
   Profile header
   ============================================================ */
.profile-header {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  max-width: 1400px;
  margin: 0 auto;
}

.header-banner {
  position: absolute;
  inset: 0;
  background-color: #1a1040;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter 0.3s ease;
}

.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.1) 0%,
    rgba(0,0,0,.4) 60%,
    rgba(0,0,0,.75) 100%);
}

.header-content {
  position: relative;
  z-index: 1;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0px;
}
@media (max-width: 600px) {
  /* Push content down enough to clear the absolute-positioned action buttons
     (top:16px + height:38px = 54px) — add generous buffer */
  .header-content { padding: 72px 16px 20px; }
}

/* Avatar wrapper — decorative sparkles via frames.css .avatar-framed class */
.header-avatar-wrap {
  margin-bottom: 10px;
  padding-top: 64px;
  padding-bottom: 20px;
}

/* Text group — wraps name/bio/meta/stats so desktop can flex them right of avatar */
.header-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ── Desktop: avatar LEFT, content RIGHT ── */
@media (min-width: 768px) {
  .header-content {
    flex-direction: row;
    align-items: center;
    text-align: left;
    /* gap: 40px; */
    padding: 60px 140px 32px 48px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }
  .header-avatar-wrap {
    flex-shrink: 0;
    margin-bottom: 0;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  /* Avatar size driven by --avatar-size var in frames.css */
  .header-text-group {
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
  }
  .header-bio   { font-size: 1rem; }
  .header-meta  { justify-content: flex-start; }
  .header-stats { justify-content: flex-start; }
}

.header-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 2.5rem;
  text-transform: uppercase;
}

.header-name {
  font-family: 'Cinzel Decorative';
  text-shadow: var(--accent-glow);
  font-size: 2.7rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
  letter-spacing: 0.01em;
}
@media (max-width: 600px) {
  .header-name { font-size: 1.8rem; }
}

/* @handle hidden — display_name is the identity */
.header-handle { display: none; }

.header-bio {
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
  max-width: 520px;
  line-height: 1.55;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
  justify-content: center;
}

.header-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .96rem;
  color: rgba(255,255,255,.55);
}
.header-meta-item svg { width: 13px; height: 13px; opacity: .7; }
.header-meta-item a   { color: rgba(255,255,255,.8); }
.header-meta-item a:hover { color: #fff; }

.header-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  justify-content: center;
}
.header-stats strong {color: #ffffff;font-size: 1rem;/* text-shadow: var(--accent-glow); */}
.stat-xclusive {
  color: var(--private-color);
  font-style: italic;
  font-weight: 600;
  font-family: Georgia, serif;
  letter-spacing: 0.01em;
}
.stat-xclusive strong { color: var(--private-color); font-size: inherit; }

.header-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.12);
}
.header-btn:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.header-btn:hover { text-decoration: none; }
.header-btn svg { width: 18px; height: 18px; }
.header-btn-login { }

/* Theme icons */
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============================================================
   Controls bar (search + tabs)
   ============================================================ */
.controls-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgb(10 10 20 / 44%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
[data-theme="light"] .controls-bar {
  background: rgb(230 230 245 / 61%);
  border-bottom-color: rgba(0,0,0,.08);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.search-wrap svg { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }
#search-input  { flex: 1; border: none; outline: none; font-size: 0.93rem;
                  background: transparent; color: var(--text); }
#search-input::placeholder { color: var(--text-muted); }
.search-clear  { color: var(--text-muted); font-size: 0.8rem; padding: 2px 8px;
                  border-radius: var(--radius-full); transition: background 0.15s ease; }
.search-clear:hover { background: var(--card-bg); }

.tabs { display: flex; }
.tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-align: center;
}
.tab:hover  { background: rgba(255,255,255,.04); color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

/* ============================================================
   Masonry grid
   ============================================================ */
/* Masonry grid — CSS native masonry where supported, JS row-span fallback elsewhere */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 10px;       /* JS fallback: spans are multiples of this unit */
  column-gap: 16px;
  row-gap: 0;                 /* JS fallback manages spacing via spans; native masonry uses gap override below */
  padding: 16px 16px 16px;
  width: 100%;
  min-height: 60px;
}
@media (max-width: 1399px) { .masonry-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1099px) { .masonry-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .masonry-grid { grid-template-columns: 1fr; } }

/* Native masonry overrides — browser handles packing, restore row gap */
@supports (grid-template-rows: masonry) {
  .masonry-grid {
    grid-template-rows: masonry;
    grid-auto-rows: auto;
    row-gap: 16px;
  }
}

/* ============================================================
   Transparent header mode
   ============================================================ */

.profile-header.header-transparent .header-overlay { display: none; }
.profile-header.header-transparent .header-banner {
  background-color: transparent !important;
  background-image: none !important;
}
/* Keep text readable against raw site background */
.profile-header.header-transparent .header-name,
.profile-header.header-transparent .header-handle,
.profile-header.header-transparent .header-bio,
.profile-header.header-transparent .header-meta-item,
.profile-header.header-transparent .header-stat-value,
.profile-header.header-transparent .header-stat-label {/* text-shadow: 0 1px 8px rgba(0,0,0,.8); */}

.header-btn.is-transparent-active {
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.35) !important;
}

/* ---- Xclusive toggle ---- */
.xclusive-toggle-btn {
  width: auto !important;
  padding: 0 10px !important;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px !important;
  letter-spacing: 0.02em;
}
.xclusive-toggle-label {
  display: inline-block;
}
.xclusive-toggle-btn.xclusive-hidden svg {
  opacity: 0.6;
}
.xclusive-toggle-btn.xclusive-hidden {
  background: rgba(255,20,147,.25) !important;
  border-color: rgba(255,20,147,.5) !important;
  color: #ff69b4 !important;
}
.xclusive-toggle-btn.xclusive-hidden:hover {
  background: rgba(255,20,147,.4) !important;
}
