/* ============================================================
   GRIT — Profile Page (full redesign)
   profile.css
   ============================================================ */

:root {
  --bronze:   #cd7f32;
  --silver:   #c0c0c0;
  --gold:     #f4c430;
  --platinum: #78d9d9;
  --master:   #c77dff;
}

.profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

/* =============================================
   CINEMATIC BANNER
   ============================================= */
.profile-banner {
  position: relative;
  height: 280px;
  overflow: hidden;
  margin: 0 -24px;
  background: #05060f;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

#bannerCanvas {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  z-index: 0;
}

.banner-grid {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(rgba(124,124,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,124,255,0.055) 1px, transparent 1px);
  background-size: 48px 48px;
}

.banner-gradient {
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(ellipse 70% 90% at 15% 40%, rgba(124,124,255,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 55% 70% at 85% 20%, rgba(199,125,255,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 50% 80%, rgba(93,202,165,0.08) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 30%, rgba(5,6,14,0.98) 100%);
}

/* Animated glow orbs */
.banner-orb {
  position: absolute; z-index: 1;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.banner-orb-1 {
  width: 400px; height: 400px;
  top: -120px; left: -80px;
  background: rgba(124,124,255,0.18);
  animation: orbFloat1 8s ease-in-out infinite;
}
.banner-orb-2 {
  width: 300px; height: 300px;
  top: -80px; right: 10%;
  background: rgba(199,125,255,0.14);
  animation: orbFloat2 10s ease-in-out infinite 2s;
}
@keyframes orbFloat1 {
  0%,100% { transform: translate(0,0); }
  50%      { transform: translate(30px, 20px); }
}
@keyframes orbFloat2 {
  0%,100% { transform: translate(0,0); }
  50%      { transform: translate(-20px, 30px); }
}

/* =============================================
   PROFILE HEADER
   ============================================= */
.profile-header-card {
  position: relative;
  z-index: 10;
  margin-top: -60px;
  padding: 0 4px 32px;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
}

/* ── Avatar ───────────────────────────────────────────────── */
.avatar-ring-wrap { position: relative; flex-shrink: 0; }

.avatar-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--purple), var(--violet), #4c9fff);
  box-shadow:
    0 0 0 5px rgba(5,6,14,1),
    0 0 36px rgba(124,124,255,0.5),
    0 0 80px rgba(199,125,255,0.2);
  animation: avatarPulse 3.5s ease-in-out infinite;
}
@keyframes avatarPulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(5,6,14,1), 0 0 32px rgba(124,124,255,0.45), 0 0 70px rgba(199,125,255,0.15); }
  50%      { box-shadow: 0 0 0 5px rgba(5,6,14,1), 0 0 52px rgba(124,124,255,0.7),  0 0 100px rgba(199,125,255,0.3); }
}

.avatar-initials {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #12142a, #1c1e35);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 40px; font-weight: 700; color: #fff;
  overflow: hidden;
  text-shadow: 0 0 24px rgba(124,124,255,0.6);
}
.avatar-initials img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}

/* ── Identity ─────────────────────────────────────────────── */
.profile-identity {
  flex: 1; min-width: 200px; padding-bottom: 6px;
}

.profile-name-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 8px;
}

.profile-username {
  font-family: 'Rajdhani', sans-serif;
  font-size: 44px; font-weight: 700; margin: 0;
  color: #fff; letter-spacing: 0.4px; line-height: 1;
  text-shadow: 0 0 40px rgba(124,124,255,0.35);
}

.profile-rank-badge {
  display: none; align-items: center; gap: 5px;
  padding: 4px 14px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid;
}
.profile-rank-badge.visible { display: inline-flex; }
.profile-rank-badge.rank-master   { background: rgba(199,125,255,0.12); color: var(--master);   border-color: rgba(199,125,255,0.35); }
.profile-rank-badge.rank-platinum { background: rgba(120,217,217,0.1);  color: var(--platinum); border-color: rgba(120,217,217,0.3); }
.profile-rank-badge.rank-gold     { background: rgba(244,196,48,0.1);   color: var(--gold);     border-color: rgba(244,196,48,0.3); }
.profile-rank-badge.rank-silver   { background: rgba(192,192,192,0.1);  color: var(--silver);   border-color: rgba(192,192,192,0.25); }
.profile-rank-badge.rank-bronze   { background: rgba(205,127,50,0.1);   color: var(--bronze);   border-color: rgba(205,127,50,0.3); }

.profile-bio {
  margin: 0 0 10px; font-size: 15px;
  color: rgba(180,185,220,0.65);
  max-width: 520px; line-height: 1.65;
}

.profile-joined { font-size: 12px; color: rgba(255,255,255,0.25); }

/* ── Actions ──────────────────────────────────────────────── */
.profile-actions {
  margin-left: auto; display: flex;
  gap: 10px; align-items: flex-end;
  padding-bottom: 6px; flex-wrap: wrap;
}

.btn-follow {
  padding: 11px 28px; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--border-lit);
  background: var(--purple-dim); color: #a89bff;
  letter-spacing: 0.02em;
}
.btn-follow:hover {
  background: rgba(124,124,255,0.28); border-color: var(--purple);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--purple-glow);
}
.btn-follow.following { background: rgba(124,124,255,0.22); color: #fff; border-color: var(--purple); }
.btn-follow.following:hover { background: rgba(229,62,62,0.15); border-color: rgba(229,62,62,0.5); color: #ff8080; }

.btn-edit-profile {
  padding: 11px 20px; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-edit-profile:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.18); color: #fff; }

/* =============================================
   STATS STRIP
   ============================================= */
.stats-strip {
  display: flex; align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin: 0 0 36px;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.stat-block {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 22px 16px;
  transition: background 0.2s; cursor: default;
  position: relative;
}
.stat-block::after {
  content: '';
  position: absolute; top: 20%; bottom: 20%; right: 0;
  width: 1px; background: var(--border);
}
.stat-block:last-child::after { display: none; }
.stat-block:hover { background: rgba(124,124,255,0.05); }

.stat-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 30px; font-weight: 700; color: #fff;
  line-height: 1; margin-bottom: 5px;
  transition: color 0.2s;
}
.stat-block:hover .stat-num { color: #a89bff; }

.stat-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600;
}

/* =============================================
   ACHIEVEMENTS STRIP
   ============================================= */
.achievements-section { margin-bottom: 40px; }

.section-title-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 18px;
}

.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 700; margin: 0;
  color: #fff; letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 8px;
}

.section-link {
  font-size: 13px; color: var(--purple);
  text-decoration: none; font-weight: 500;
  transition: color 0.15s;
}
.section-link:hover { color: var(--violet); }

.achievements-strip {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,124,255,0.25) transparent;
}
.achievements-strip::-webkit-scrollbar { height: 3px; }
.achievements-strip::-webkit-scrollbar-thumb { background: rgba(124,124,255,0.3); border-radius: 3px; }

.ach-badge {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: none;
  background: none;
  cursor: pointer; min-width: 100px; max-width: 120px;
  position: relative;
  transition: transform 0.2s;
  text-decoration: none; color: inherit;
}
.ach-badge:hover { transform: translateY(-4px); }
.ach-badge.locked { display: none; }
.ach-badge.tier-bronze:hover  .ach-icon-wrap { box-shadow: 0 10px 32px rgba(205,127,50,0.4); }
.ach-badge.tier-silver:hover  .ach-icon-wrap { box-shadow: 0 10px 32px rgba(192,192,192,0.3); }
.ach-badge.tier-gold:hover    .ach-icon-wrap { box-shadow: 0 10px 32px rgba(244,196,48,0.45); }
.ach-badge.tier-platinum:hover .ach-icon-wrap { box-shadow: 0 10px 32px rgba(120,217,217,0.4); }
.ach-badge.tier-master:hover  .ach-icon-wrap { box-shadow: 0 14px 42px rgba(199,125,255,0.55); }

.ach-icon-wrap {
  width: 88px; height: 88px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  overflow: hidden; transition: box-shadow 0.2s;
}
.tier-bronze  .ach-icon-wrap { background: rgba(205,127,50,0.15); box-shadow: 0 0 14px rgba(205,127,50,0.25); }
.tier-silver  .ach-icon-wrap { background: rgba(192,192,192,0.12); box-shadow: 0 0 14px rgba(192,192,192,0.18); }
.tier-gold    .ach-icon-wrap { background: rgba(244,196,48,0.15); box-shadow: 0 0 18px rgba(244,196,48,0.3); }
.tier-platinum .ach-icon-wrap { background: rgba(120,217,217,0.12); box-shadow: 0 0 16px rgba(120,217,217,0.25); }
.tier-master  .ach-icon-wrap { background: rgba(199,125,255,0.18); box-shadow: 0 0 22px rgba(199,125,255,0.45); }

.ach-name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; max-width: 110px; line-height: 1.3; }

.ach-tier-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.tier-bronze  .ach-tier-label { color: var(--bronze); }
.tier-silver  .ach-tier-label { color: var(--silver); }
.tier-gold    .ach-tier-label { color: var(--gold); }
.tier-platinum .ach-tier-label { color: var(--platinum); }
.tier-master  .ach-tier-label { color: var(--master); }

.ach-mini-bar { width: 100%; height: 3px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.ach-mini-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

.ach-empty {
  padding: 24px; color: var(--text-muted); font-size: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; text-align: center;
}

#achCompletionPct {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  background: var(--purple-dim); border: 1px solid var(--border-lit);
  border-radius: 99px; padding: 2px 10px; margin-left: 8px;
}

/* =============================================
   TABS
   ============================================= */
.profile-tabs-wrap {
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.profile-tabs { display: flex; gap: 0; }

.ptab {
  padding: 14px 24px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
  margin-bottom: -1px; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}
.ptab:hover { color: #fff; background: rgba(255,255,255,0.03); }
.ptab.active { color: #fff; border-bottom-color: var(--purple); }
.ptab .tab-count {
  font-size: 11px; font-weight: 700;
  background: var(--purple-dim); border: 1px solid var(--border-lit);
  color: var(--purple); border-radius: 99px; padding: 1px 7px;
}

/* =============================================
   POST GRID — matches explore card quality
   ============================================= */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.3s ease both; }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.profile-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.profile-post-card {
  position: relative;
  height: 230px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  display: block;
}
.profile-post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(124,124,255,0.35);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,124,255,0.15);
}

.pcard-thumb {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.pcard-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
  transition: transform 0.4s ease, filter 0.3s;
}
.profile-post-card:hover .pcard-thumb img {
  transform: scale(1.05);
  filter: brightness(0.7);
}

.pcard-overlay {
  position: absolute; inset: 0;
  padding: 14px 16px;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(5,6,15,0.95) 0%, rgba(5,6,15,0.3) 55%, transparent 100%);
}

.pcard-type {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; border: 1px solid;
}
.pcard-type.guide { background: rgba(93,202,165,0.18); color: var(--teal); border-color: rgba(93,202,165,0.3); }
.pcard-type.build { background: rgba(124,124,255,0.18); color: #a89bff; border-color: rgba(124,124,255,0.3); }

.pcard-pinned {
  position: absolute; top: 12px; left: 12px;
  font-size: 14px; background: rgba(0,0,0,0.6);
  border-radius: 6px; padding: 3px 6px;
  backdrop-filter: blur(4px); z-index: 2;
}

.pcard-game { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--violet); margin-bottom: 5px; }
.pcard-title { font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 8px; }
.pcard-meta { display: flex; gap: 12px; font-size: 12px; color: rgba(255,255,255,0.55); }

/* ── Empty / loading ──────────────────────────────────────── */
.panel-empty {
  text-align: center; padding: 64px 24px;
  color: var(--text-muted); font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.panel-empty .empty-icon { font-size: 40px; opacity: 0.4; }
.panel-loading { text-align: center; padding: 48px; color: var(--text-muted); }

/* ── Animations ───────────────────────────────────────────── */
.profile-header-card { animation: fadeUp 0.45s ease both; }
.stats-strip          { animation: fadeUp 0.45s 0.08s ease both; }
.achievements-section { animation: fadeUp 0.45s 0.16s ease both; }
.profile-tabs-wrap    { animation: fadeUp 0.45s 0.22s ease both; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .profile-banner { height: 200px; }
  .profile-header-card { flex-direction: column; align-items: flex-start; }
  .profile-actions { margin-left: 0; width: 100%; }
  .btn-follow, .btn-edit-profile { flex: 1; justify-content: center; }
  .profile-username { font-size: 32px; }
  .profile-post-grid { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 24px; }
}
@media (max-width: 480px) {
  .profile-post-grid { grid-template-columns: 1fr; }
  .profile-banner { height: 160px; }
  .avatar-ring { width: 90px; height: 90px; }
  .avatar-initials { font-size: 30px; }
  .profile-username { font-size: 26px; }
}

/* ── Favourite game pills ─────────────────────────────────── */
.profile-fav-games {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.profile-game-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(124,124,255,0.1);
  border: 1px solid rgba(124,124,255,0.2);
  font-size: 12px;
  font-weight: 500;
  color: #a89bff;
}

/* ── Social links ─────────────────────────────────────────── */
.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.18s;
}
.profile-social-link:hover { transform: translateY(-1px); }
.profile-social-link.twitch  { background: rgba(145,71,255,0.1); color: #9147ff; border-color: rgba(145,71,255,0.25); }
.profile-social-link.twitch:hover  { background: rgba(145,71,255,0.2); }
.profile-social-link.youtube { background: rgba(255,0,0,0.1); color: #ff4444; border-color: rgba(255,0,0,0.25); }
.profile-social-link.youtube:hover { background: rgba(255,0,0,0.18); }
.profile-social-link.discord { background: rgba(88,101,242,0.1); color: #7289da; border-color: rgba(88,101,242,0.25); }
.profile-social-link.discord:hover { background: rgba(88,101,242,0.2); }

/* ── New social link colors ───────────────────────────────── */
.profile-social-link.instagram {
  background: rgba(220,50,100,0.1);
  color: #e1306c;
  border-color: rgba(220,50,100,0.25);
}
.profile-social-link.instagram:hover { background: rgba(220,50,100,0.18); }

.profile-social-link.tiktok {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}
.profile-social-link.tiktok:hover { background: rgba(255,255,255,0.12); }
