.profile-wrapper {
    --profile-accent: #8b5cf6;
    --profile-accent-rgb: 139, 92, 246;
    --profile-accent-soft: rgba(var(--profile-accent-rgb), .14);
    --profile-accent-border: rgba(var(--profile-accent-rgb), .3);
}

.profile-wrapper.accent-cyan {
    --profile-accent: #22d3ee;
    --profile-accent-rgb: 34, 211, 238;
}

.profile-wrapper.accent-rose {
    --profile-accent: #fb7185;
    --profile-accent-rgb: 251, 113, 133;
}

.profile-wrapper.accent-amber {
    --profile-accent: #f59e0b;
    --profile-accent-rgb: 245, 158, 11;
}

.profile-wrapper.accent-emerald {
    --profile-accent: #34d399;
    --profile-accent-rgb: 52, 211, 153;
}

.profile-wrapper .btn-action,
.profile-wrapper .compact-btn,
.profile-wrapper .wall-btn {
    --accent: var(--profile-accent);
}

.profile-wrapper.hero-cinematic .profile-banner,
.profile-wrapper.hero-focus .profile-banner {
    height: 280px;
}

.profile-wrapper.hero-cinematic .profile-content {
    padding-top: 64px !important;
}

.profile-wrapper.hero-focus .profile-content {
    padding-top: 48px !important;
}

.profile-wrapper .avatar-wrapper.avatar-frame-wrapper {
    display: grid;
    margin: 0 auto 16px;
}

.profile-wrapper.hero-compact .profile-banner {
    height: 220px;
}

.profile-wrapper.hero-compact .container {
    top: -44px;
}

.profile-wrapper.hero-compact .profile-content {
    padding-top: 84px !important;
}

.profile-wrapper.hero-focus .profile-banner::after {
    height: 100%;
    background:
        radial-gradient(circle at 23% 78%, rgba(var(--profile-accent-rgb), .25), transparent 19rem),
        linear-gradient(to top, var(--bg-dark), transparent 72%);
}

.profile-wrapper.cards-solid .glass-panel,
.profile-wrapper.cards-solid .profile-canvas-module {
    backdrop-filter: none !important;
    background: color-mix(in srgb, var(--card-bg) 94%, #0b1020) !important;
}

.profile-wrapper.cards-outline .glass-panel,
.profile-wrapper.cards-outline .profile-canvas-module {
    background: rgba(9, 12, 20, .25) !important;
    border-color: var(--profile-accent-border) !important;
    box-shadow: none !important;
}

.profile-name-effect {
    display: inline-block;
    position: relative;
}

.profile-name-effect.name-neon-ink {
    color: #e0f2fe;
    text-shadow: 0 0 8px #22d3ee, 0 0 22px rgba(139, 92, 246, .7);
}

.profile-name-effect.name-system-glitch {
    color: #f8fafc;
    text-shadow: -2px 0 #fb7185, 2px 0 #22d3ee;
    animation: profile-name-glitch 3.4s steps(2, end) infinite;
}

.profile-name-effect.name-royal-gold {
    background: linear-gradient(100deg, #a16207, #fde68a 38%, #f59e0b 56%, #fef3c7 75%, #a16207);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, .3));
    animation: profile-gold-scan 4.8s linear infinite;
}

.profile-wrapper.profile-fx-aurora::after,
.profile-wrapper.profile-fx-starfall::after,
.profile-wrapper.profile-fx-singularity::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.profile-wrapper.profile-fx-aurora::after {
    background:
        radial-gradient(ellipse at 20% 18%, rgba(34, 211, 238, .12), transparent 34rem),
        radial-gradient(ellipse at 78% 26%, rgba(168, 85, 247, .13), transparent 36rem);
    animation: profile-aurora-drift 10s ease-in-out infinite alternate;
}

.profile-wrapper.profile-fx-starfall::after {
    opacity: .55;
    background-image:
        radial-gradient(circle at 12% 14%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 42% 38%, #c4b5fd 0 1px, transparent 2px),
        radial-gradient(circle at 74% 18%, #67e8f9 0 1px, transparent 2px),
        radial-gradient(circle at 88% 62%, #fff 0 1px, transparent 2px);
    background-size: 260px 240px;
    animation: profile-starfall 13s linear infinite;
}

.profile-wrapper.profile-fx-singularity::after {
    background:
        radial-gradient(circle at 76% 24%, transparent 0 7rem, rgba(34, 211, 238, .13) 9rem, rgba(139, 92, 246, .1) 12rem, transparent 18rem),
        radial-gradient(circle at 76% 24%, rgba(2, 6, 23, .48), transparent 20rem);
    animation: profile-singularity-breathe 6s ease-in-out infinite;
}

.profile-canvas-toolbar {
    align-items: center;
    background: rgba(10, 13, 21, .78);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 8px;
    position: relative;
    z-index: 30;
    backdrop-filter: blur(18px);
}

.profile-canvas-filters {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
}

.profile-canvas-filter,
.profile-canvas-edit {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    gap: 7px;
    padding: 8px 11px;
    white-space: nowrap;
}

.profile-canvas-filter:hover,
.profile-canvas-filter.is-active {
    background: var(--profile-accent-soft);
    border-color: var(--profile-accent-border);
    color: var(--text-main);
}

.profile-canvas-edit {
    background: var(--profile-accent);
    color: white;
    flex: none;
}

#profile-canvas {
    display: flex;
    flex-direction: column;
}

.profile-canvas-module {
    order: var(--profile-module-order, 20);
    position: relative;
    scroll-margin-top: 150px;
    transition: opacity .25s ease, transform .25s ease, border-color .25s ease;
}

.profile-canvas-module.is-filtered-out {
    display: none !important;
}

.profile-canvas-module.is-pinned {
    border-color: var(--profile-accent-border) !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.18), 0 0 0 1px var(--profile-accent-soft) !important;
}

.profile-canvas-module.is-pinned::before {
    background: var(--profile-accent);
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(var(--profile-accent-rgb), .55);
    content: "";
    height: 5px;
    position: absolute;
    right: 15px;
    top: 15px;
    width: 5px;
}

.profile-module-heading {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.profile-module-kicker {
    color: var(--profile-accent);
    display: block;
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .18em;
    margin-bottom: 5px;
}

.profile-module-heading h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 900;
    margin: 0;
}

.profile-module-link {
    align-items: center;
    border: 1px solid var(--profile-accent-border);
    border-radius: 10px;
    color: var(--profile-accent);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    gap: 7px;
    padding: 8px 10px;
    text-decoration: none;
}

.profile-academy-showcase {
    background:
        radial-gradient(circle at 88% 8%, rgba(245, 158, 11, .1), transparent 18rem),
        rgba(16, 19, 29, .8);
    border: 1px solid rgba(245, 158, 11, .16);
    border-radius: 18px;
    margin-bottom: 24px;
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.academy-unified-hero {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.academy-rank-orb {
    align-items: center;
    background: conic-gradient(from 210deg, #7c3aed, #22d3ee, #f59e0b, #7c3aed);
    border-radius: 20px;
    box-shadow: 0 0 28px rgba(139, 92, 246, .22);
    display: flex;
    height: 58px;
    justify-content: center;
    padding: 3px;
    width: 58px;
}

.academy-rank-orb span {
    align-items: center;
    background: #10131d;
    border-radius: 17px;
    color: white;
    display: flex;
    font-size: 1.4rem;
    font-weight: 950;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.academy-rank-copy {
    min-width: 0;
}

.academy-rank-copy > strong {
    color: white;
    display: block;
    font-size: .95rem;
    font-weight: 900;
}

.academy-rank-copy > span {
    color: #94a3b8;
    display: block;
    font-size: .72rem;
    margin-top: 3px;
}

.academy-progress-track {
    background: rgba(255,255,255,.07);
    border-radius: 999px;
    height: 5px;
    margin-top: 9px;
    overflow: hidden;
}

.academy-progress-track i {
    background: linear-gradient(90deg, #8b5cf6, #22d3ee);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.academy-certified {
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .28);
    border-radius: 999px;
    color: #fde68a;
    font-size: .68rem;
    font-weight: 850;
    padding: 7px 10px;
}

.academy-unified-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, 1fr);
    margin: 18px 0;
}

.academy-unified-stats div {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 11px 8px;
    text-align: center;
}

.academy-unified-stats strong {
    color: white;
    display: block;
    font-size: .95rem;
}

.academy-unified-stats span {
    color: #64748b;
    display: block;
    font-size: .6rem;
    font-weight: 800;
    margin-top: 3px;
    text-transform: uppercase;
}

.academy-unified-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.1fr .9fr;
}

.academy-skill-panel,
.academy-portfolio-panel {
    background: rgba(2, 6, 23, .24);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 14px;
}

.academy-skill-panel h4,
.academy-portfolio-panel h4 {
    color: #cbd5e1;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .1em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.academy-skill-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 84px minmax(0, 1fr) 26px;
    margin-top: 8px;
}

.academy-skill-row > span,
.academy-skill-row > strong {
    color: #94a3b8;
    font-size: .65rem;
}

.academy-skill-row > strong {
    color: #e2e8f0;
    text-align: right;
}

.academy-skill-row > div {
    background: rgba(255,255,255,.06);
    border-radius: 99px;
    height: 4px;
    overflow: hidden;
}

.academy-skill-row i {
    background: linear-gradient(90deg, #8b5cf6, #22d3ee);
    display: block;
    height: 100%;
}

.academy-portfolio-panel > a {
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #cbd5e1;
    display: flex;
    font-size: .72rem;
    gap: 12px;
    justify-content: space-between;
    padding: 9px 0;
    text-decoration: none;
}

.academy-portfolio-panel > a strong {
    color: #fbbf24;
}

.academy-empty-portfolio,
.academy-profile-empty {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: .72rem;
    gap: 9px;
}

.academy-profile-empty {
    justify-content: space-between;
}

.academy-profile-empty > div {
    display: grid;
    gap: 5px;
    grid-template-columns: auto 1fr;
}

.academy-profile-empty i {
    color: var(--profile-accent);
    font-size: 1.4rem;
    grid-row: span 2;
}

.academy-profile-empty strong {
    color: var(--text-main);
}

.academy-profile-empty a {
    background: var(--profile-accent);
    border-radius: 10px;
    color: white;
    flex: none;
    font-size: .72rem;
    font-weight: 850;
    padding: 9px 12px;
    text-decoration: none;
}

.profile-canvas-editor-backdrop {
    align-items: center;
    background: rgba(2, 6, 23, .78);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 100000;
    backdrop-filter: blur(12px);
}

.profile-canvas-editor-backdrop.is-open {
    display: flex;
}

.profile-canvas-editor {
    background: #0e111a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 22px;
    box-shadow: 0 24px 90px rgba(0,0,0,.55);
    max-height: min(88vh, 820px);
    max-width: 860px;
    overflow: hidden;
    width: 100%;
}

.profile-editor-head,
.profile-editor-actions {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 20px;
}

.profile-editor-head {
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.profile-editor-head h2 {
    color: white;
    font-size: 1.15rem;
    margin: 0;
}

.profile-editor-head p {
    color: #64748b;
    font-size: .72rem;
    margin: 4px 0 0;
}

.profile-editor-close {
    background: rgba(255,255,255,.06);
    border: 0;
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    height: 36px;
    width: 36px;
}

.profile-editor-body {
    display: grid;
    gap: 20px;
    grid-template-columns: .9fr 1.1fr;
    max-height: calc(88vh - 145px);
    overflow-y: auto;
    padding: 20px;
}

.profile-editor-section h3 {
    color: #cbd5e1;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.profile-preset-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}

.profile-preset {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    color: #cbd5e1;
    cursor: pointer;
    padding: 11px;
    text-align: left;
}

.profile-preset strong,
.profile-preset span {
    display: block;
}

.profile-preset strong {
    font-size: .73rem;
}

.profile-preset span {
    color: #64748b;
    font-size: .64rem;
    line-height: 1.4;
    margin-top: 3px;
}

.profile-editor-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-top: 16px;
}

.profile-editor-fields label {
    color: #94a3b8;
    font-size: .65rem;
    font-weight: 800;
}

.profile-editor-fields select {
    background: #111827;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    color: #e2e8f0;
    margin-top: 5px;
    padding: 8px;
    width: 100%;
}

.profile-module-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profile-editor-module {
    align-items: center;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    cursor: grab;
    display: grid;
    gap: 9px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    padding: 10px;
}

.profile-editor-module.is-dragging {
    opacity: .4;
}

.profile-editor-module > i {
    color: #64748b;
}

.profile-editor-module strong,
.profile-editor-module span {
    display: block;
}

.profile-editor-module strong {
    color: #e2e8f0;
    font-size: .72rem;
}

.profile-editor-module span {
    color: #64748b;
    font-size: .62rem;
    margin-top: 2px;
}

.profile-editor-module label {
    align-items: center;
    color: #94a3b8;
    display: flex;
    font-size: .62rem;
    gap: 4px;
}

.profile-editor-hint {
    color: #64748b;
    font-size: .67rem;
    line-height: 1.5;
    margin: 10px 0 0;
}

.profile-editor-actions {
    border-top: 1px solid rgba(255,255,255,.07);
}

.profile-editor-status {
    color: #94a3b8;
    font-size: .72rem;
}

.profile-editor-save {
    background: var(--profile-accent);
    border: 0;
    border-radius: 11px;
    color: white;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 900;
    padding: 10px 16px;
}

.profile-wrapper.motion-off *,
.profile-wrapper.motion-off *::before,
.profile-wrapper.motion-off *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
}

.profile-wrapper.motion-subtle .profile-fx-starfall::after,
.profile-wrapper.motion-subtle.profile-fx-starfall::after {
    animation-duration: 26s;
    opacity: .28;
}

.theme-sakura-night.profile-wrapper {
    background:
        radial-gradient(circle at 18% 14%, rgba(244, 114, 182, .16), transparent 28rem),
        radial-gradient(circle at 78% 24%, rgba(99, 102, 241, .14), transparent 32rem),
        linear-gradient(145deg, #090b18, #15102a 52%, #0b1020);
}

.theme-void-library.profile-wrapper {
    background:
        radial-gradient(circle at 72% 12%, rgba(109, 40, 217, .22), transparent 28rem),
        repeating-linear-gradient(90deg, rgba(255,255,255,.016) 0 1px, transparent 1px 80px),
        linear-gradient(145deg, #020617, #0f0a1f 55%, #020617);
}

@keyframes profile-name-glitch {
    0%, 91%, 100% { transform: translate(0); }
    92% { transform: translate(-1px, 0); }
    94% { transform: translate(2px, -1px); }
    96% { transform: translate(-1px, 1px); }
}

@keyframes profile-gold-scan {
    to { background-position: -220% center; }
}

@keyframes profile-aurora-drift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}

@keyframes profile-starfall {
    to { background-position: 80px 300px; }
}

@keyframes profile-singularity-breathe {
    50% { opacity: .7; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .profile-wrapper *,
    .profile-wrapper *::before,
    .profile-wrapper *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 900px) {
    .profile-wrapper.hero-cinematic .profile-content,
    .profile-wrapper.hero-compact .profile-content,
    .profile-wrapper.hero-focus .profile-content {
        padding-top: 0 !important;
    }

    .academy-unified-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .profile-editor-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-canvas-edit span {
        display: none;
    }

    .profile-canvas-filter {
        padding-inline: 9px;
    }

    .academy-unified-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .academy-certified {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .academy-unified-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .academy-unified-grid,
    .profile-preset-grid,
    .profile-editor-fields {
        grid-template-columns: 1fr;
    }

    .academy-profile-empty {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-editor-module {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profile-editor-module label {
        grid-column: auto;
    }
}
