/* OSANIME Profile UI — Stage 2 v278
 * Hero identity, actions and statistics refinement.
 * Loaded after Stage 1; backend/social behaviour remains unchanged.
 */
body.profile-ui-stage2-v278 {
    --profile-s2-surface: rgba(7, 17, 33, .72);
    --profile-s2-surface-strong: rgba(7, 16, 31, .9);
    --profile-s2-border: rgba(255, 255, 255, .11);
    --profile-s2-pink: #ff4f93;
    --profile-s2-purple: #9b6cff;
    --profile-s2-green: #56d6a2;
}

body.profile-ui-stage2-v278 .profile-identity-card {
    position: relative !important;
    grid-template-columns: 146px minmax(0, 1fr) !important;
    gap: 28px !important;
    min-height: 308px !important;
    padding: 34px 36px !important;
}

body.profile-ui-stage2-v278 .profile-identity-card::before {
    transform: scale(1.015) !important;
    filter: saturate(.96) contrast(1.02) !important;
}

body.profile-ui-stage2-v278 .profile-identity-card::after {
    background:
        linear-gradient(90deg, rgba(2, 7, 18, .96) 0%, rgba(4, 11, 25, .91) 38%, rgba(5, 13, 28, .67) 69%, rgba(6, 13, 28, .48) 100%),
        linear-gradient(0deg, rgba(2, 7, 17, .58), rgba(2, 7, 17, .04)) !important;
}

body.profile-ui-stage2-v278 .profile-hero-avatar-shell {
    position: relative !important;
    z-index: 4 !important;
    width: 136px !important;
    height: 136px !important;
    align-self: start !important;
    margin-top: 5px !important;
}

body.profile-ui-stage2-v278 .profile-hero-avatar-shell .member-profile-avatar {
    width: 136px !important;
    height: 136px !important;
    display: block !important;
    object-fit: cover !important;
}

body.profile-ui-stage2-v278 .profile-avatar-presence {
    position: absolute !important;
    right: 4px !important;
    bottom: 5px !important;
    width: 28px !important;
    height: 28px !important;
    display: grid !important;
    place-items: center !important;
    border: 4px solid #081226 !important;
    border-radius: 50% !important;
    background: #6e7a8f !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.32) !important;
    font-size: 9px !important;
}
body.profile-ui-stage2-v278 .profile-avatar-presence i { color: #fff !important; }
body.profile-ui-stage2-v278 .profile-avatar-presence.is-online,
body.profile-ui-stage2-v278 .profile-avatar-presence.is-active { background: var(--profile-s2-green) !important; }
body.profile-ui-stage2-v278 .profile-avatar-presence.is-away { background: #f4bb55 !important; }

body.profile-ui-stage2-v278 .member-profile-info {
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

body.profile-ui-stage2-v278 .member-profile-name {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 11px !important;
}

body.profile-ui-stage2-v278 .profile-name-copy {
    min-width: 0 !important;
}
body.profile-ui-stage2-v278 .profile-name-copy h2 {
    max-width: min(100%, 780px) !important;
    font-size: clamp(29px, 2.5vw, 39px) !important;
    line-height: 1.05 !important;
    letter-spacing: -.72px !important;
}
body.profile-ui-stage2-v278 .profile-name-copy small {
    margin-top: 7px !important;
    color: #d0d7e4 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
}
body.profile-ui-stage2-v278 .member-badge {
    flex: 0 0 auto !important;
    min-height: 29px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 5px 11px !important;
    border: 1px solid rgba(255,79,147,.28) !important;
    border-radius: 999px !important;
    background: rgba(255,79,147,.13) !important;
    color: #ff9abe !important;
    font-size: 10.5px !important;
    font-weight: 850 !important;
}

body.profile-ui-stage2-v278 .member-joined {
    margin: 10px 0 7px !important;
}
body.profile-ui-stage2-v278 .profile-stage9-identity-community {
    order: 0 !important;
    margin: 7px 0 2px !important;
}
body.profile-ui-stage2-v278 .profile-stage9-presence {
    border-color: rgba(86,214,162,.20) !important;
    background: rgba(20,74,59,.34) !important;
}
body.profile-ui-stage2-v278 .member-bio {
    max-width: 820px !important;
    margin: 10px 0 13px !important;
}

/* Keep all profile actions in one semantic row, but give primary social
 * actions stronger hierarchy than utility actions. */
body.profile-ui-stage2-v278 .profile-identity-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 1px 0 13px !important;
}
body.profile-ui-stage2-v278 .profile-social-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
body.profile-ui-stage2-v278 .profile-social-btn,
body.profile-ui-stage2-v278 .profile-hero-action,
body.profile-ui-stage2-v278 .member-owner-link,
body.profile-ui-stage2-v278 .member-website-link {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 15px !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 11px !important;
    background: rgba(7,16,31,.72) !important;
    color: #e7edf7 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    transition: transform .16s ease, border-color .16s ease, background .16s ease !important;
}
body.profile-ui-stage2-v278 .profile-social-btn.follow,
body.profile-ui-stage2-v278 .member-owner-link {
    border-color: rgba(255,79,147,.42) !important;
    background: linear-gradient(135deg, rgba(255,79,147,.24), rgba(255,79,147,.12)) !important;
    color: #fff !important;
}
body.profile-ui-stage2-v278 .profile-social-btn.follow.active {
    background: linear-gradient(135deg, rgba(255,79,147,.91), rgba(226,48,126,.91)) !important;
}
body.profile-ui-stage2-v278 .profile-social-btn.like.active {
    border-color: rgba(255,79,147,.44) !important;
    background: rgba(255,79,147,.15) !important;
    color: #ff8fb8 !important;
}
body.profile-ui-stage2-v278 .profile-message-action { color: #d9e8ff !important; }
body.profile-ui-stage2-v278 .profile-hero-share { cursor: pointer !important; }
body.profile-ui-stage2-v278 .profile-social-btn:not(:disabled):hover,
body.profile-ui-stage2-v278 .profile-hero-action:hover,
body.profile-ui-stage2-v278 .member-owner-link:hover,
body.profile-ui-stage2-v278 .member-website-link:hover {
    transform: translateY(-1px) !important;
    border-color: rgba(255,79,147,.52) !important;
    background-color: rgba(255,255,255,.075) !important;
}
body.profile-ui-stage2-v278 .profile-social-btn:disabled,
body.profile-ui-stage2-v278 .profile-social-btn.is-restricted {
    opacity: .53 !important;
}

/* One cohesive stat strip instead of five unrelated mini cards. */
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social {
    width: min(100%, 900px) !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--profile-s2-border) !important;
    border-radius: 14px !important;
    background: rgba(3,10,23,.63) !important;
    backdrop-filter: blur(8px) !important;
}
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > div,
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > .profile-stat-button {
    min-height: 72px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 13px !important;
    border: 0 !important;
    border-left: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: left !important;
}
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > :first-child {
    border-left: 0 !important;
}
body.profile-ui-stage2-v278 .profile-stat-button {
    cursor: pointer !important;
}
body.profile-ui-stage2-v278 .profile-stat-button:not(:disabled):hover {
    background: rgba(255,255,255,.045) !important;
}
body.profile-ui-stage2-v278 .profile-stat-icon {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 10px !important;
    background: rgba(255,79,147,.11) !important;
    color: #ff76aa !important;
    font-size: 13px !important;
}
body.profile-ui-stage2-v278 .profile-stat-copy {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social b {
    color: #fff !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}
body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social small {
    margin-top: 5px !important;
    color: #9eabc0 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

body.profile-ui-stage2-v278 :where(.profile-hero-action):focus-visible {
    outline: 2px solid var(--profile-s2-pink) !important;
    outline-offset: 2px !important;
}

/* Desktop sidebar should support, not compete with, the identity hero. */
@media (min-width: 1181px) {
    body.profile-ui-stage2-v278 .profile-statistics-card {
        margin-top: 0 !important;
    }
}

@media (max-width: 1040px) {
    body.profile-ui-stage2-v278 .profile-identity-card {
        grid-template-columns: 126px minmax(0, 1fr) !important;
        gap: 23px !important;
        min-height: 0 !important;
        padding: 28px !important;
    }
    body.profile-ui-stage2-v278 .profile-hero-avatar-shell,
    body.profile-ui-stage2-v278 .profile-hero-avatar-shell .member-profile-avatar {
        width: 118px !important;
        height: 118px !important;
    }
    body.profile-ui-stage2-v278 .profile-avatar-presence {
        width: 26px !important;
        height: 26px !important;
        right: 1px !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social {
        grid-template-columns: repeat(3, minmax(0,1fr)) !important;
        gap: 1px !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > div,
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > .profile-stat-button {
        min-height: 68px !important;
        border: 1px solid rgba(255,255,255,.09) !important;
        border-radius: 12px !important;
        background: rgba(3,10,23,.59) !important;
    }
}

@media (max-width: 700px) {
    body.profile-ui-stage2-v278 .profile-identity-card {
        grid-template-columns: minmax(0,1fr) !important;
        gap: 12px !important;
        padding: 20px 17px !important;
    }
    body.profile-ui-stage2-v278 .profile-identity-card::after {
        background: linear-gradient(180deg, rgba(3,8,19,.34) 0%, rgba(4,10,23,.83) 28%, rgba(4,10,23,.97) 62%, rgba(4,10,23,.99) 100%) !important;
    }
    body.profile-ui-stage2-v278 .profile-hero-avatar-shell,
    body.profile-ui-stage2-v278 .profile-hero-avatar-shell .member-profile-avatar {
        width: 96px !important;
        height: 96px !important;
    }
    body.profile-ui-stage2-v278 .profile-hero-avatar-shell {
        margin-top: 0 !important;
    }
    body.profile-ui-stage2-v278 .profile-avatar-presence {
        width: 25px !important;
        height: 25px !important;
        border-width: 3px !important;
    }
    body.profile-ui-stage2-v278 .member-profile-name {
        align-items: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    body.profile-ui-stage2-v278 .profile-name-copy {
        flex: 1 1 100% !important;
    }
    body.profile-ui-stage2-v278 .profile-name-copy h2 {
        font-size: clamp(25px, 8.2vw, 32px) !important;
    }
    body.profile-ui-stage2-v278 .profile-stage9-identity-community {
        gap: 6px !important;
    }
    body.profile-ui-stage2-v278 .profile-identity-actions,
    body.profile-ui-stage2-v278 .profile-social-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
        gap: 8px !important;
    }
    body.profile-ui-stage2-v278 .profile-social-actions {
        grid-column: 1 / -1 !important;
    }
    body.profile-ui-stage2-v278 .profile-social-btn,
    body.profile-ui-stage2-v278 .profile-hero-action,
    body.profile-ui-stage2-v278 .member-owner-link,
    body.profile-ui-stage2-v278 .member-website-link {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px !important;
        padding: 0 11px !important;
        font-size: 12px !important;
    }
    body.profile-ui-stage2-v278 .is-own-profile .member-owner-link {
        grid-column: 1 / -1 !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social {
        grid-template-columns: repeat(3, minmax(0,1fr)) !important;
        gap: 7px !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > div,
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > .profile-stat-button {
        min-height: 70px !important;
        gap: 7px !important;
        padding: 10px !important;
    }
    body.profile-ui-stage2-v278 .profile-stat-icon {
        flex-basis: 30px !important;
        width: 30px !important;
        height: 30px !important;
        border-radius: 9px !important;
        font-size: 11px !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social b {
        font-size: 16px !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social small {
        font-size: 9.5px !important;
    }
    body.profile-ui-stage2-v278 .member-profile-share-card {
        display: none !important;
    }
}

@media (max-width: 420px) {
    body.profile-ui-stage2-v278 .profile-identity-card {
        padding: 18px 14px !important;
    }
    body.profile-ui-stage2-v278 .profile-identity-actions,
    body.profile-ui-stage2-v278 .profile-social-actions {
        grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > :last-child {
        grid-column: 1 / -1 !important;
    }
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > div,
    body.profile-ui-stage2-v278 .member-stats-inline.profile-stats-social > .profile-stat-button {
        min-height: 64px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.profile-ui-stage2-v278 .profile-social-btn,
    body.profile-ui-stage2-v278 .profile-hero-action,
    body.profile-ui-stage2-v278 .member-owner-link,
    body.profile-ui-stage2-v278 .member-website-link {
        transition: none !important;
    }
}
body.profile-ui-stage2-v278 .profile-stat-button.profile-stat-updated {
    background: rgba(255,79,147,.10) !important;
}
body.profile-ui-stage2-v278 .is-own-profile .member-owner-link {
    order: -2 !important;
}
body.profile-ui-stage2-v278 .profile-hero-share-status {
    min-height: 0 !important;
    margin: -4px 0 8px !important;
    color: #9ee6c7 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}
body.profile-ui-stage2-v278 .profile-hero-share-status:empty {
    display: none !important;
}
body.profile-ui-stage2-v278 .profile-hero-share-status.is-error {
    color: #ff9bac !important;
}
