/* ---------- banner background ---------- */
body.has-banner::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(5, 3, 2, .78), rgba(0, 0, 0, .9)),
        var(--banner) center / cover no-repeat;
}

/* ---------- profile page: layouts, fonts, music, live editor ---------- */

.profile-body {
    --profile-font: var(--font-sans);
    --accent: var(--blood-bright);
}

body.font-system { --profile-font: var(--font-sans); }
body.font-gothic { --profile-font: 'gothic', 'Old English Text MT', 'Times New Roman', serif; }
body.font-mono { --profile-font: 'mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; }
body.font-fancy { --profile-font: 'fancy', 'Brush Script MT', cursive; }
body.font-casual { --profile-font: 'casual', 'Comic Sans MS', 'Segoe Print', cursive; }

.profile-page {
    font-family: var(--profile-font);
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    gap: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    width: 100%;
    padding: 12px 0 4px;
}

.profile-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.profile-avatar-img,
.profile-avatar {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(196, 30, 30, .35), rgba(0, 0, 0, .6));
    border: 1px solid var(--border-blood);
    box-shadow: 0 0 0 6px rgba(139, 0, 0, .10), 0 10px 40px rgba(0, 0, 0, .6);
    font-size: 44px;
    color: #ffd9d9;
    text-transform: uppercase;
    user-select: none;
}

.profile-meta { min-width: 0; }

.profile-handle {
    font-size: clamp(1.9rem, 6vw, 2.9rem);
    line-height: 1.05;
    letter-spacing: -.02em;
}

body.font-gothic .profile-handle { letter-spacing: 0; }
body.font-fancy .profile-handle { font-size: clamp(2.4rem, 8vw, 3.6rem); }

.profile-sub {
    color: var(--muted-foreground);
    font-size: .95rem;
    margin-top: 6px;
    word-break: break-all;
}

/* ---------- badges, stats, follow ---------- */
.profile-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .82rem;
    color: var(--muted-foreground);
}

.profile-stats .stat strong {
    color: var(--foreground);
    font-weight: 700;
}

body.layout-left .profile-badges,
body.layout-left .profile-stats { justify-content: flex-start; }
body.layout-right .profile-badges,
body.layout-right .profile-stats { justify-content: flex-end; }
body.layout-magazine .profile-badges,
body.layout-magazine .profile-stats { justify-content: flex-start; }
body.layout-compact .profile-badges,
body.layout-compact .profile-stats { justify-content: flex-start; }

/* ---------- premium effects (locked to premium accounts) ---------- */
body.effect-glow .profile-avatar-img,
body.effect-glow .profile-avatar {
    box-shadow: 0 0 0 6px rgba(139, 0, 0, .12), 0 0 34px var(--blood-glow), 0 10px 40px rgba(0, 0, 0, .6);
    border-color: rgba(196, 30, 30, .55);
}

body.effect-glow .profile-link:hover {
    border-color: var(--blood-bright);
    box-shadow: 0 0 22px var(--blood-glow);
}

body.effect-shimmer .profile-avatar-img,
body.effect-shimmer .profile-avatar {
    animation: shimmer 3.2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { box-shadow: 0 0 0 6px rgba(139, 0, 0, .10), 0 10px 40px rgba(0, 0, 0, .6); }
    50% { box-shadow: 0 0 0 6px rgba(196, 30, 30, .40), 0 0 40px var(--blood-glow); }
}

body.effect-scanline .profile-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0, transparent 3px,
        rgba(196, 30, 30, .10) 3px, rgba(196, 30, 30, .10) 4px
    );
}

body.effect-scanline .profile-link { position: relative; }

/* ---------- music player ---------- */
.music-bar {
    --cover: 56px;
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.25));
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.music-cover {
    width: var(--cover);
    height: var(--cover);
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(139,0,0,.2);
    border: 1px solid var(--border-blood);
}

.music-body { flex: 1 1 auto; min-width: 0; }

.music-track {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-artist {
    color: var(--muted-foreground);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-viz {
    width: 100%;
    height: 34px;
    display: block;
    margin-top: 4px;
}

.music-play {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, var(--blood-bright), var(--blood-dark));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 6px 20px var(--blood-glow);
    transition: transform .1s ease;
}

.music-play:active { transform: scale(.94); }
.music-play svg { width: 18px; height: 18px; }
.music-play .icon-pause { display: none; }
.music-bar.is-playing .music-play .icon-play { display: none; }
.music-bar.is-playing .music-play .icon-pause { display: block; }
.music-bar.is-playing .music-cover { animation: spin 8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- links ---------- */
.profile-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(0,0,0,.18));
    transition: border-color .15s ease, transform .1s ease, background .15s ease;
}

.profile-link:hover {
    border-color: var(--border-blood);
    background: linear-gradient(180deg, rgba(196,30,30,.10), rgba(0,0,0,.2));
    transform: translateY(-1px);
}

.profile-link-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.04);
    flex: 0 0 auto;
}

.profile-link-img { width: 18px; height: 18px; object-fit: contain; }
.profile-link-label { font-weight: 500; }

/* ---------- layout: left ---------- */
body.layout-left .profile-page { align-items: flex-start; }
body.layout-left .profile-hero {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 20px;
}
body.layout-left .profile-avatar-img,
body.layout-left .profile-avatar { width: 96px; height: 96px; font-size: 36px; }
body.layout-left .profile-links { max-width: 520px; }

/* ---------- layout: right ---------- */
body.layout-right .profile-page { align-items: flex-end; }
body.layout-right .profile-hero {
    flex-direction: row-reverse;
    align-items: center;
    text-align: right;
    gap: 20px;
}
body.layout-right .profile-avatar-img,
body.layout-right .profile-avatar { width: 96px; height: 96px; font-size: 36px; }
body.layout-right .profile-links { max-width: 520px; }
body.layout-right .profile-link { flex-direction: row-reverse; }
body.layout-right .profile-link-label { flex: 1 1 auto; text-align: right; }
body.layout-right .music-bar { flex-direction: row-reverse; }
body.layout-right .music-body { text-align: right; }

/* ---------- layout: magazine ---------- */
body.layout-magazine .profile-page { max-width: 860px; }
body.layout-magazine .profile-hero {
    flex-direction: row;
    align-items: flex-end;
    text-align: left;
    gap: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-blood);
}
body.layout-magazine .profile-avatar-img,
body.layout-magazine .profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 18px;
    font-size: 60px;
}
body.layout-magazine .profile-handle { font-size: clamp(2.6rem, 7vw, 4rem); }
body.layout-magazine .profile-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
body.layout-magazine .music-bar { max-width: 100%; }

/* ---------- layout: compact ---------- */
body.layout-compact .profile-page { max-width: 560px; padding-top: 26px; }
body.layout-compact .profile-hero {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 0;
}
body.layout-compact .profile-avatar-img,
body.layout-compact .profile-avatar { width: 64px; height: 64px; font-size: 24px; }
body.layout-compact .profile-handle { font-size: 1.6rem; }
body.layout-compact .profile-links { flex-direction: row; flex-wrap: wrap; }
body.layout-compact .profile-link { flex: 1 1 auto; padding: 9px 13px; border-radius: 999px; }
body.layout-compact .profile-link-icon { width: 24px; height: 24px; }
body.layout-compact .profile-link-img { width: 15px; height: 15px; }

/* ---------- editor ---------- */
.edit-toggle {
    align-self: flex-end;
    margin-bottom: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: rgba(196, 30, 30, .85);
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.edit-toggle:hover { background: var(--blood-bright); }

.editor {
    width: 100%;
    max-width: 520px;
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--border-blood);
    border-radius: 16px;
    background: rgba(10, 5, 5, .85);
    text-align: left;
}
body.editing .editor { display: flex; }
body.editing .profile-link,
body.editing .profile-avatar-wrap { outline: 1px dashed rgba(196,30,30,.5); outline-offset: 4px; border-radius: 12px; }

.editor-row { display: flex; flex-direction: column; gap: 6px; }
.editor-row label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.editor select,
.editor input[type="text"] {
    font: inherit;
    font-size: .9rem;
    width: 100%;
    padding: 9px 11px;
    color: var(--foreground);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.editor select:focus,
.editor input[type="text"]:focus { outline: none; border-color: var(--border-blood); }

.btn {
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--foreground);
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
}
.btn:hover { border-color: var(--border-blood); }
.btn-danger { color: #ffb4b4; }
.btn-danger:hover { background: rgba(196,30,30,.15); border-color: var(--border-blood); }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.avatar-edit {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: none;
    place-items: center;
    cursor: pointer;
    font-size: 15px;
    color: #fff;
    background: var(--blood-bright);
    border: 2px solid var(--background-deep);
}
body.editing .avatar-edit { display: grid; }

.editor-note { font-size: .74rem; color: var(--muted-foreground); }
.editor-error { font-size: .78rem; color: #ff8a8a; min-height: 1em; }

.editor-block {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}
.editor-song-on {
    color: #ff5a5a;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    font-size: .72rem;
}
.editor select:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- premium custom cursors (name-specific) ---------- */
.cursor-crosshair, .cursor-crosshair * { cursor: crosshair !important; }
.cursor-pointer,  .cursor-pointer  * { cursor: pointer !important; }
.cursor-text,     .cursor-text     * { cursor: text !important; }
.cursor-wait,     .cursor-wait     * { cursor: wait !important; }
.cursor-help,     .cursor-help     * { cursor: help !important; }
.cursor-grab,     .cursor-grab     * { cursor: grab !important; }
.cursor-move,     .cursor-move     * { cursor: move !important; }
.cursor-cell,     .cursor-cell     * { cursor: cell !important; }
.cursor-copy,     .cursor-copy     * { cursor: copy !important; }
.cursor-zoom-in,  .cursor-zoom-in  * { cursor: zoom-in !important; }

@media (max-width: 560px) {
    body.layout-magazine .profile-links { grid-template-columns: 1fr; }
    body.layout-magazine .profile-hero { flex-direction: column; align-items: flex-start; }
}
