/* --------------------------------------
   PROFILE & LEADERBOARD STYLES
   -------------------------------------- */

/* Profile Views Container overlay */
.profile-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--background);
    z-index: 200;
    overflow-y: auto;
    padding: 20px;
    display: none;
    flex-direction: column;
}
.profile-overlay.active { display: flex; }

/* Sub Navigation */
.profile-nav {
    display: flex; gap: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--card-border); padding-bottom: 12px;
}
.p-nav-btn {
    background: transparent; border: none; color: var(--muted); font-weight: 700; font-size: 0.9rem; cursor: pointer; padding: 8px; transition: 0.2s;
}
.p-nav-btn.active { color: white; border-bottom: 2px solid var(--primary); }
.p-nav-close { margin-left: auto; color: white; border: none; background: rgba(255,255,255,0.1); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items:center; justify-content:center; cursor:pointer;}

/* Header Profile Card */
.profile-header-card {
    background: linear-gradient(145deg, var(--card), rgba(0,102,255,0.1));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.p-avatar-lg {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white; font-size: 2.5rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(0,102,255,0.4);
    border: 3px solid var(--card);
}
.p-username { font-size: 1.5rem; font-weight: 900; color: white; margin-bottom: 4px; }
.p-joindate { font-size: 0.8rem; color: var(--muted); }
.p-ranking-badge {
    position: absolute; top: 16px; right: 16px;
    background: rgba(251,191,36,0.2); border: 1px solid #fbbf24; color: #fbbf24;
    padding: 6px 12px; border-radius: 20px; font-weight: 800; font-size: 0.8rem;
}

/* Stats Summary */
.p-stats-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 32px;
}
.p-stat-box {
    background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; text-align: center;
}
.p-stat-val { font-size: 1.8rem; font-weight: 900; color: white; }
.p-stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-top: 4px; }
.p-stat-box.highlight { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.5); }
.p-stat-box.highlight .p-stat-val { color: var(--emerald); }

/* Badges section */
.p-badges-wrapper { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.p-badge { 
    background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); padding: 8px 12px; border-radius: 8px;
    display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: white;
}
.p-badge i { color: #fbbf24; }
.p-badge.locked { opacity: 0.3; filter: grayscale(1); }

/* Leaderboard Table */
.leaderboard-container { background: var(--card); border-radius: 12px; border: 1px solid var(--card-border); overflow:hidden;}
.lb-row { display: flex; padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); align-items: center; gap: 16px; }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-size: 1.2rem; font-weight: 900; color: var(--muted); width: 30px; text-align:center;}
.lb-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--card-border); display: flex; align-items: center; justify-content: center; font-weight: 800;}
.lb-info { flex: 1; }
.lb-name { font-weight: 700; font-size: 1rem; color: white; }
.lb-streak { font-size: 0.75rem; color: var(--emerald); font-weight: 700; }
.lb-pts { font-size: 1.2rem; font-weight: 900; color: var(--primary); text-align:right;}
.lb-row.first .lb-rank { color: #fbbf24; }
.lb-row.second .lb-rank { color: #9ca3af; }
.lb-row.third .lb-rank { color: #b45309; }

/* Enhanced Auth Forms */
.auth-mode-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--card-border); }
.auth-mode-tab { flex: 1; padding: 12px; background: transparent; border: none; color: var(--muted); cursor: pointer; font-weight: 700; border-bottom: 2px solid transparent;}
.auth-mode-tab.active { color: white; border-bottom: 2px solid var(--primary); }
