/* =============================================================
   PROFILE HEX (V2 — neon level up)
   ============================================================= */

.profile-hex-hero {
    position: relative;
    width: 240px;
    height: 270px;
    margin: 24px auto 8px;
}

/* Corner brackets (decoration) */
.hex-corners i {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--av3d-accent, #306EFF);
    filter: drop-shadow(0 0 4px var(--av3d-accent, #306EFF));
}
.hex-corners i:nth-child(1) { top: 0;     left: 0;     border-right: none; border-bottom: none; }
.hex-corners i:nth-child(2) { top: 0;     right: 0;    border-left:  none; border-bottom: none; }
.hex-corners i:nth-child(3) { bottom: 0;  left: 0;     border-right: none; border-top:    none; }
.hex-corners i:nth-child(4) { bottom: 0;  right: 0;    border-left:  none; border-top:    none; }

/* Hexagon frame with animated neon border */
.hex-frame {
    position: absolute;
    inset: 20px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg,
        var(--av3d-accent, #306EFF), #00D9FF, var(--av3d-accent, #306EFF));
    padding: 3px;
    filter: drop-shadow(0 0 10px var(--av3d-accent-strong, rgba(48,110,255,.85)));
    animation: hexPulse 3s ease-in-out infinite;
}
.hex-inner {
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: radial-gradient(circle at 50% 30%, #14213d, #060810 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Inside the hex, the avatar-3d pseudo-elements get clipped anyway,
   so we disable them and rely on the hex-frame glow + hex-inner background
   for the 3D look. The avatar itself renders large and fills the hex. */
.hex-inner .avatar-wrap--large {
    width: 100%;
    height: 100%;
    filter: none;
    box-shadow: none;
}
.hex-inner .avatar-wrap--large::before,
.hex-inner .avatar-wrap--large::after {
    display: none;
}
.hex-inner .avatar-wrap--large svg.character-svg {
    width: 180px;
    height: 180px;
}
/* Scanline overlay */
.hex-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
        transparent 0 2px, rgba(255,255,255,0.04) 2px 3px);
    pointer-events: none;
    z-index: 5;
}
/* Bottom accent glow (rim light from below — sci-fi platform) */
.hex-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 50%;
    background: radial-gradient(50% 100% at 50% 100%, var(--av3d-accent-strong, rgba(48,110,255,.85)), transparent 70%);
    filter: blur(calc(10px * var(--av3d-glow, 1)));
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: screen;
}
@keyframes hexPulse {
    0%, 100% { filter: drop-shadow(0 0 8px var(--av3d-accent-strong, rgba(48,110,255,.85))); }
    50%      { filter: drop-shadow(0 0 20px var(--av3d-accent, #306EFF)); }
}

/* Rank badge (top-right corner of hex) */
.hex-rank-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 54px;
    height: 60px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, #8A8A85, #8A8A8599);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 0 14px rgba(138,138,133,0.5);
    z-index: 3;
}
.hex-rank-badge[data-rank="bronze"]   { background: linear-gradient(135deg, #CD7F32, #CD7F3299); box-shadow: 0 0 14px rgba(205,127,50,.6); }
.hex-rank-badge[data-rank="silver"]   { background: linear-gradient(135deg, #C0C0C0, #C0C0C099); box-shadow: 0 0 14px rgba(192,192,192,.6); }
.hex-rank-badge[data-rank="gold"]     { background: linear-gradient(135deg, #FFD700, #FFD70099); box-shadow: 0 0 14px rgba(255,215,0,.7); }
.hex-rank-badge[data-rank="platinum"] { background: linear-gradient(135deg, #00D9FF, #00D9FF99); box-shadow: 0 0 14px rgba(0,217,255,.7); }
.hex-rank-badge[data-rank="diamond"]  { background: linear-gradient(135deg, #5B8CFF, #5B8CFF99); box-shadow: 0 0 14px rgba(91,140,255,.8); }
.hex-rank-badge[data-rank="legend"]   { background: linear-gradient(135deg, #FF3D8B, #FF3D8B99); box-shadow: 0 0 14px rgba(255,61,139,.8); }

/* Level pill at base of hex */
.hex-level-pill {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--av3d-accent, #306EFF), #1034A6);
    color: #fff;
    padding: 5px 22px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
    box-shadow: 0 0 12px var(--av3d-accent-strong, rgba(48,110,255,.85)), 0 4px 12px rgba(0,0,0,0.5);
    font-variant-numeric: tabular-nums;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hex-level-pill strong { font-weight: 900; }

/* Pseudo block */
.profile-pseudo-block {
    text-align: center;
    margin: 16px 0 18px;
    position: relative;
}
.profile-pseudo {
    display: inline-block;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--accent);
    text-shadow: 0 0 12px var(--av3d-accent-strong, rgba(48,110,255,.85));
    text-transform: uppercase;
}
.profile-pseudo-edit {
    background: none;
    border: none;
    color: var(--accent-dim);
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    vertical-align: middle;
    transition: color 0.2s;
}
.profile-pseudo-edit:hover { color: var(--av3d-accent, #306EFF); }
.profile-rank-tag {
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 800;
    color: var(--accent-dim);
}

/* XP segments bar (replaces the old .xp-bar) */
.xp-segments-container {
    margin: 0 15px 20px;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(48,110,255,0.22);
    border-radius: 6px;
}
.xp-segments {
    display: flex;
    gap: 3px;
}
.xp-seg {
    flex: 1;
    height: 14px;
    background: var(--charcoal);
    border-radius: 1px;
    position: relative;
}
.xp-seg.on {
    background: linear-gradient(180deg, #00D9FF, var(--av3d-accent, #306EFF));
    box-shadow: 0 0 4px var(--av3d-accent, #306EFF), inset 0 1px 0 rgba(255,255,255,0.4);
}
.xp-seg.on::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent);
}
