/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE — Premium Gaming Style V2 (Disruptif)
   Prefix : profile-
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens Profil ─── */
:root {
    --profile-bronze: #cd7f32;
    --profile-silver: #c0c0c0;
    --profile-gold: #ffd700;
    --profile-diamond-1: #b9f2ff;
    --profile-diamond-2: #667eea;
    --profile-diamond-3: #818cf8;
    --profile-diamond-4: #ff6b6b;

    --profile-cat-collection: #667eea;
    --profile-cat-pokedex: #ef4444;
    --profile-cat-scan: #3b82f6;
    --profile-cat-value: #f59e0b;
    --profile-cat-streak: #ff6b35;
    --profile-cat-special: #a855f7;
    --profile-cat-secret: #6366f1;
}

/* @property for animated border */
@property --profile-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ─── Page Container ─── */
.profile-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-md) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ─── Section base (GSAP handles visibility now) ─── */
.profile-section {
    opacity: 1;
}

/* Fallback fade-in if GSAP not loaded */
.profile-section.profile-section--css-anim {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.profile-section--css-anim.profile-section--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Section Header ─── */
.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.profile-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.profile-section-badge {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--border-radius-full);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 1 : HERO BANNER + PARTICLES
   ═══════════════════════════════════════════════════════════════ */
.profile-hero {
    background: var(--bg-dark-secondary, #1a1f3a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-xl);
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    min-height: 180px;
}

/* Particles container */
#profile-particles-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Subtle gradient overlay */
.profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
}

/* XP Ring SVG — Premium with gradient + glow */
.profile-xp-ring-wrapper {
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}

.profile-xp-ring {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.5));
}

.profile-xp-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 7;
}

.profile-xp-ring-fill {
    fill: none;
    stroke: url(#profileXpGrad);
    stroke-width: 7;
    stroke-linecap: round;
    /* GSAP will animate stroke-dashoffset */
}

/* Orbital particles around ring */
.profile-xp-orbital {
    animation: profile-orbital-spin 6s linear infinite;
    transform-origin: 70px 70px;
    opacity: 0.8;
}
.profile-xp-orbital:nth-child(4) { animation-duration: 8s; animation-direction: reverse; }
.profile-xp-orbital:nth-child(5) { animation-duration: 10s; }

@keyframes profile-orbital-spin {
    to { transform: rotate(360deg); }
}

/* Glow pulse on ring */
.profile-xp-ring-glow {
    animation: profile-ring-pulse 3s ease-in-out infinite;
}

@keyframes profile-ring-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.profile-xp-ring-level {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1;
    z-index: 1;
}

.profile-xp-ring-title-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 55%);
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 1;
}

/* Hero Info */
.profile-hero-info {
    flex: 1;
    z-index: 1;
    min-width: 0;
}

.profile-hero-username {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.profile-hero-title {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: var(--space-sm);
}

.profile-hero-xp-bar {
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius-full);
    height: 8px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 4px;
    overflow: hidden;
    position: relative;
}

.profile-hero-xp-bar-fill {
    background: linear-gradient(90deg, #3b82f6, #667eea, #818cf8);
    height: 100%;
    border-radius: var(--border-radius-full);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* XP bar shine animation */
.profile-hero-xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: profile-xp-shine 3s ease-in-out infinite;
}

@keyframes profile-xp-shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.profile-hero-xp-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--space-md);
}

/* Hero Badges */
.profile-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.profile-hero-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius-full);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.profile-hero-badge .badge-icon {
    font-size: 0.9rem;
}

/* Streak flame SVG animation */
.profile-streak-flame {
    animation: profile-flame-flicker 1.5s ease-in-out infinite alternate;
}

@keyframes profile-flame-flicker {
    0% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.15) rotate(2deg); }
    100% { transform: scale(1.05) rotate(-1deg); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 2 : STATS DASHBOARD — Animated Borders
   ═══════════════════════════════════════════════════════════════ */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.profile-stat-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s, border-color 0.3s;
    overflow: hidden;
}

.profile-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.15);
}

/* Animated rotating border on hover */
.profile-stat-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: conic-gradient(from var(--profile-angle), transparent 60%, var(--primary) 80%, var(--secondary) 90%, transparent 100%);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    animation: profile-border-rotate 4s linear infinite;
}

.profile-stat-card:hover::before {
    opacity: 1;
}

@keyframes profile-border-rotate {
    to { --profile-angle: 360deg; }
}

/* Sparkline background */
.profile-stat-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    opacity: 0.12;
    pointer-events: none;
}

.profile-stat-sparkline polyline {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 1.5;
}

.profile-stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.profile-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-light-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Gold variant */
.profile-stat-card--gold {
    border-color: rgba(243, 156, 18, 0.3);
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.08), rgba(241, 196, 15, 0.04));
}

.profile-stat-card--gold .profile-stat-value {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 3 : OBJECTIFS QUOTIDIENS
   ═══════════════════════════════════════════════════════════════ */
.profile-objectives-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.profile-objective-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-sm) var(--space-md);
}

.profile-objective-icon {
    font-size: 1.3rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.profile-objective-info {
    flex: 1;
    min-width: 0;
}

.profile-objective-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.profile-objective-bar {
    background: rgba(255,255,255,0.08);
    border-radius: var(--border-radius-full);
    height: 6px;
    overflow: hidden;
}

.profile-objective-bar-fill {
    height: 100%;
    border-radius: var(--border-radius-full);
    background: var(--primary-light);
    transition: width 0.8s ease-out;
}

.profile-objective-bar-fill--done {
    background: var(--success);
}

.profile-objective-progress {
    font-size: 0.75rem;
    color: var(--text-light-secondary);
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
}

.profile-objective-check {
    color: var(--success);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.profile-objective-xp {
    font-size: 0.7rem;
    color: var(--primary-light);
    font-weight: 600;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 4 : COLLECTION HIGHLIGHTS
   ═══════════════════════════════════════════════════════════════ */
.profile-highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.profile-highlight-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    transition: transform 0.3s, border-color 0.3s;
}

.profile-highlight-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.15);
}

.profile-highlight-card img {
    width: 60px;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-xs);
}

.profile-highlight-label {
    font-size: 0.7rem;
    color: var(--text-light-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-highlight-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.profile-highlight-sub {
    font-size: 0.7rem;
    color: var(--text-light-secondary);
}

/* Value Chart */
.profile-value-chart-wrapper {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    height: 200px;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 4b : GYM BADGES — Badge Case
   ═══════════════════════════════════════════════════════════════ */
.profile-badge-case {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.profile-region {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
}

.profile-region-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.profile-region-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.profile-region-count {
    font-size: 0.7rem;
    color: var(--text-light-muted);
    font-weight: 600;
}

.profile-region-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.profile-gym-badge {
    position: relative;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.3s;
}

.profile-gym-badge img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    transition: filter 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.profile-gym-badge-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-gym-badge-achieve {
    font-size: 0.5rem;
    color: var(--text-light-muted);
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Unlocked badge */
.profile-gym-badge--unlocked {
    border-color: rgba(255, 215, 0, 0.3);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08), transparent);
}

.profile-gym-badge--unlocked:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.5);
}

/* Locked badge */
.profile-gym-badge--locked img {
    filter: grayscale(1) brightness(0.3);
}

.profile-gym-badge--locked {
    border-color: rgba(255, 255, 255, 0.04);
}

.profile-gym-badge-lock {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.6rem;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 5 : ACHIEVEMENTS — Premium Badge System
   ═══════════════════════════════════════════════════════════════ */

/* Category Radial Rings */
.profile-category-rings {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.profile-cat-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.profile-cat-ring:hover {
    transform: scale(1.08);
}

.profile-cat-ring--active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    border-radius: 1px;
}

.profile-cat-ring svg {
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
}

.profile-cat-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 4;
}

.profile-cat-ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-cat-ring-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
}

.profile-cat-ring-label {
    font-size: 0.6rem;
    color: var(--text-light-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Achievement Grid */
.profile-achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: var(--space-md);
}

/* Achievement Card — Premium with tilt support */
.profile-achievement-card {
    height: 190px;
    perspective: 1000px;
    cursor: default;
}

.profile-achievement-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.profile-achievement-card:hover .profile-achievement-card-inner {
    transform: rotateY(180deg);
}

/* Disable flip when VanillaTilt is active (unlocked cards) */
.profile-achievement-card--unlocked:hover .profile-achievement-card-inner {
    transform: none;
}

.profile-achievement-front,
.profile-achievement-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--border-radius-lg);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    overflow: hidden;
}

/* Front face — Glass */
.profile-achievement-front {
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
}

.profile-achievement-front .achievement-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.profile-achievement-front .achievement-xp {
    font-size: 0.65rem;
    font-weight: 600;
}

/* ─── Badge SVG System ─── */
.profile-badge {
    width: 64px;
    height: 64px;
    position: relative;
    margin-bottom: 4px;
}

.profile-badge svg {
    width: 100%;
    height: 100%;
}

/* Badge hexagon frame fills */
.profile-badge-frame {
    transition: opacity 0.3s;
}

/* Tier: Bronze */
.profile-badge--bronze .profile-badge-frame {
    fill: url(#profileBadgeBronze);
}
.profile-badge--bronze .profile-badge-icon {
    fill: #8b4513;
}
.profile-achievement-card--unlocked.profile-tier-bronze .profile-achievement-front {
    border-color: rgba(205, 127, 50, 0.3);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.15);
}
.profile-tier-bronze .achievement-xp {
    color: var(--profile-bronze);
}

/* Tier: Silver */
.profile-badge--silver .profile-badge-frame {
    fill: url(#profileBadgeSilver);
}
.profile-badge--silver .profile-badge-icon {
    fill: #606060;
}
.profile-achievement-card--unlocked.profile-tier-silver .profile-achievement-front {
    border-color: rgba(192, 192, 192, 0.3);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.15);
}
.profile-tier-silver .achievement-xp {
    color: var(--profile-silver);
}

/* Tier: Gold */
.profile-badge--gold .profile-badge-frame {
    fill: url(#profileBadgeGold);
}
.profile-badge--gold .profile-badge-icon {
    fill: #8b6914;
}
.profile-achievement-card--unlocked.profile-tier-gold .profile-achievement-front {
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.profile-tier-gold .achievement-xp {
    color: var(--profile-gold);
}

/* Tier: Diamond — Holographic */
.profile-badge--diamond .profile-badge-frame {
    fill: url(#profileBadgeDiamond);
}
.profile-badge--diamond .profile-badge-icon {
    fill: #4a5568;
}

.profile-achievement-card--unlocked.profile-tier-diamond .profile-achievement-front {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.25), 0 0 50px rgba(240, 147, 251, 0.1);
}

/* Holographic overlay for Diamond tier */
.profile-achievement-card--unlocked.profile-tier-diamond .profile-achievement-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,0,0,0.06) 0%,
        rgba(255,127,0,0.06) 14%,
        rgba(255,255,0,0.06) 28%,
        rgba(0,255,0,0.06) 42%,
        rgba(0,0,255,0.06) 57%,
        rgba(75,0,130,0.06) 71%,
        rgba(148,0,211,0.06) 85%,
        rgba(255,0,0,0.06) 100%
    );
    background-size: 200% 200%;
    mix-blend-mode: screen;
    pointer-events: none;
    border-radius: inherit;
    animation: profile-holo-shift 4s ease-in-out infinite alternate;
}

@keyframes profile-holo-shift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.profile-tier-diamond .achievement-xp {
    background: linear-gradient(90deg, #3b82f6, #667eea, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Category glow colors for unlocked */
.profile-achievement-card--unlocked[data-category="collection"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(102, 126, 234, 0.2);
}
.profile-achievement-card--unlocked[data-category="pokedex"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}
.profile-achievement-card--unlocked[data-category="scan"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}
.profile-achievement-card--unlocked[data-category="value"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}
.profile-achievement-card--unlocked[data-category="streak"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(255, 107, 53, 0.2);
}
.profile-achievement-card--unlocked[data-category="special"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}
.profile-achievement-card--unlocked[data-category="secret"] .profile-achievement-front {
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

/* Progress bar for locked */
.profile-achievement-progress {
    width: 80%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.profile-achievement-progress-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: var(--border-radius-full);
}

.profile-achievement-progress-text {
    font-size: 0.6rem;
    color: var(--text-light-muted);
}

/* Back face */
.profile-achievement-back {
    background: var(--bg-dark-tertiary, #1e2340);
    border: 1px solid rgba(255,255,255,0.08);
    transform: rotateY(180deg);
    padding: var(--space-md) var(--space-sm);
    justify-content: center;
}

.profile-achievement-back .achievement-desc {
    font-size: 0.7rem;
    color: var(--text-light-secondary);
    line-height: 1.4;
}

.profile-achievement-back .achievement-date {
    font-size: 0.6rem;
    color: var(--text-light-muted);
    margin-top: 4px;
}

.profile-achievement-back .achievement-xp {
    margin-top: 6px;
}

/* Locked state */
.profile-achievement-card--locked .profile-achievement-front {
    opacity: 0.5;
}

.profile-achievement-card--locked .profile-badge {
    filter: grayscale(1) brightness(0.5);
}

/* Secret state — mysterious */
.profile-achievement-card--secret .profile-badge {
    filter: blur(6px) brightness(0.4);
}

.profile-achievement-card--secret .achievement-name {
    color: var(--text-light-muted);
    font-style: italic;
}

/* Secret hover flash hint */
.profile-achievement-card--secret .profile-achievement-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: inherit;
}

.profile-achievement-card--secret:hover .profile-achievement-front::before {
    opacity: 1;
    animation: profile-secret-flash 0.6s ease-out;
}

@keyframes profile-secret-flash {
    0% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Recently unlocked glow */
.profile-achievement-card--recent .profile-achievement-front {
    animation: profile-recent-glow 2s ease-in-out infinite alternate;
}

@keyframes profile-recent-glow {
    0% { box-shadow: 0 0 15px rgba(102, 126, 234, 0.2); }
    100% { box-shadow: 0 0 30px rgba(102, 126, 234, 0.4), 0 0 60px rgba(102, 126, 234, 0.1); }
}

/* VanillaTilt glare override */
.profile-achievement-card .js-tilt-glare {
    border-radius: var(--border-radius-lg);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 6 : ACTIVITY TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.profile-timeline {
    position: relative;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Vertical line with gradient fade */
.profile-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-light), rgba(255,255,255,0.05));
    border-radius: 1px;
}

.profile-timeline-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px var(--space-sm);
    position: relative;
    border-radius: var(--border-radius-md);
    background: rgba(255,255,255,0.02);
    margin-left: 4px;
    transition: background 0.2s;
}

.profile-timeline-item:hover {
    background: rgba(255,255,255,0.04);
}

/* Dot on timeline */
.profile-timeline-dot {
    position: absolute;
    left: -26px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-dark-secondary, #1a1f3a);
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
    z-index: 1;
}

.profile-timeline-icon {
    font-size: 1rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.profile-timeline-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-light-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-timeline-xp {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
}

.profile-timeline-time {
    font-size: 0.65rem;
    color: var(--text-light-muted);
    flex-shrink: 0;
    min-width: 55px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 7 : LEADERBOARD
   ═══════════════════════════════════════════════════════════════ */
.profile-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-leaderboard-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 8px var(--space-md);
    transition: background 0.2s, transform 0.2s;
}

.profile-leaderboard-row:hover {
    background: var(--glass-bg-hover);
    transform: translateX(2px);
}

.profile-leaderboard-row--self {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
}

.profile-leaderboard-row--gold {
    border-color: rgba(241, 196, 15, 0.3);
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.06), transparent);
}

.profile-leaderboard-row--silver {
    border-color: rgba(189, 195, 199, 0.3);
    background: linear-gradient(90deg, rgba(189, 195, 199, 0.05), transparent);
}

.profile-leaderboard-row--bronze {
    border-color: rgba(205, 127, 50, 0.3);
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.05), transparent);
}

.profile-leaderboard-rank {
    font-size: 1rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
    color: var(--text-light-secondary);
}

.profile-leaderboard-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.profile-leaderboard-level {
    font-size: 0.75rem;
    color: var(--text-light-secondary);
    min-width: 50px;
    text-align: center;
}

.profile-leaderboard-xp {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
    min-width: 70px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION 8 : SETTINGS
   ═══════════════════════════════════════════════════════════════ */
.profile-settings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.profile-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-sm) var(--space-md);
}

.profile-setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-setting-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.profile-setting-desc {
    font-size: 0.7rem;
    color: var(--text-light-muted);
}

/* Toggle switch */
.profile-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.profile-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.profile-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.profile-toggle input:checked + .profile-toggle-slider {
    background: var(--primary);
}

.profile-toggle input:checked + .profile-toggle-slider::before {
    transform: translateX(20px);
}

/* ═══════════════════════════════════════════════════════════════
   PUBLIC PROFILE SETTINGS
   ═══════════════════════════════════════════════════════════════ */

.profile-public-link {
    font-size: 0.75rem;
    color: var(--primary, #667eea);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.profile-public-link:hover { opacity: 1; }

.pp-field-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.4rem;
}

.pp-text-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.pp-text-input:focus {
    border-color: var(--primary, #667eea);
}
.pp-text-input::placeholder {
    color: rgba(255,255,255,0.25);
}

.pp-textarea {
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
}

.pp-save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.65rem 1rem;
    background: var(--primary, #667eea);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.pp-save-btn:hover:not(:disabled) {
    background: #5a6fd6;
    transform: translateY(-1px);
}
.pp-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.pp-save-btn-success {
    background: #22c55e !important;
}

/* Binder selector */
.pp-binder-selector {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.pp-binder-selector-label {
    font-size: 0.75rem;
    color: var(--text-light-muted, rgba(255,255,255,0.5));
    margin-bottom: 0.5rem;
}

.pp-binder-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.pp-binder-option {
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.06);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}
.pp-binder-option:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.pp-binder-option input { display: none; }

.pp-binder-selected {
    border-color: var(--primary, #667eea) !important;
    box-shadow: 0 0 0 1px var(--primary, #667eea);
}

.pp-binder-option-cover {
    width: 100%;
    aspect-ratio: 4/3;
    background: rgba(255,255,255,0.03);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.15);
}

.pp-binder-option-name {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.pp-binder-option-warn {
    font-size: 0.55rem;
    color: #f59e0b;
    text-align: center;
    padding-bottom: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════
   LEVEL-UP CELEBRATION OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.profile-levelup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    backdrop-filter: blur(8px);
}

.profile-levelup-text {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.8), 0 0 80px rgba(240, 147, 251, 0.4);
}

.profile-levelup-number {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(102, 126, 234, 0.5));
}

.profile-levelup-title {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════ */
.profile-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.profile-skeleton-block {
    background: linear-gradient(90deg, var(--glass-bg), var(--glass-bg-hover), var(--glass-bg));
    background-size: 200% 100%;
    animation: profile-skeleton-shimmer 1.5s infinite;
    border-radius: var(--border-radius-lg);
}

.profile-skeleton-hero { height: 180px; }
.profile-skeleton-stats { height: 100px; }
.profile-skeleton-section { height: 200px; }

@keyframes profile-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   SVG DEFS (hidden, referenced by badges)
   ═══════════════════════════════════════════════════════════════ */
.profile-svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .profile-hero {
        flex-direction: column;
        text-align: center;
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-md);
    }

    .profile-hero-xp-bar {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-hero-badges {
        justify-content: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-highlights-grid {
        grid-template-columns: 1fr;
    }

    .profile-achievement-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: var(--space-sm);
    }

    .profile-achievement-card {
        height: 165px;
    }

    .profile-category-rings {
        gap: var(--space-sm);
    }

    .profile-cat-ring svg {
        width: 44px;
        height: 44px;
    }

    .profile-timeline-text {
        max-width: 140px;
    }

    .profile-xp-ring {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .profile-page {
        padding: 0 var(--space-sm) var(--space-lg);
        gap: var(--space-md);
    }

    .profile-gym-badge {
        width: 52px;
        height: 52px;
    }

    .profile-gym-badge img {
        width: 38px;
        height: 38px;
    }

    .profile-xp-ring {
        width: 100px;
        height: 100px;
    }

    .profile-xp-ring-level {
        font-size: 1.8rem;
    }

    .profile-hero-username {
        font-size: 1.3rem;
    }

    .profile-stat-value {
        font-size: 1.2rem;
    }

    .profile-achievement-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-achievement-card {
        height: 155px;
    }

    .profile-badge {
        width: 48px;
        height: 48px;
    }

    .profile-leaderboard-row {
        padding: 6px var(--space-sm);
    }

    .profile-levelup-text {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .profile-levelup-number {
        font-size: 3.5rem;
    }
}
