﻿#profileScreen {
    position: fixed;
    inset: 0;
    z-index: 1004;
    display: block;
    overflow-y: auto;
    /* Padding: top | right | bottom | left â€” adjust the final number in each to reposition */
    padding:
        calc(env(safe-area-inset-top, 0px) + 0px)        /* Top gap (safe area + extra) */
        calc(env(safe-area-inset-right, 0px) + 0px)      /* Right gap (safe area + 0px for screen edge) */
        calc(env(safe-area-inset-bottom, 0px) + 50px)   /* Bottom gap (about 50px from screen edge) */
        calc(env(safe-area-inset-left, 0px) + 124px);     /* Left gap (safe area + 124px from hotbar â€” adjust 124 for closer/further) */
    box-sizing: border-box;
    background: #ffffff;
    will-change: opacity, transform;
    transform: translateZ(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#profileScreen::before {
    content: none;
}

#profileScreen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.profile-screen-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin-left: 0;
    margin-right: 0;
}

.friends-panel-shell {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    height: 100%;
    padding: clamp(44px, 5vw, 56px) clamp(22px, 2.4vw, 30px) 24px;
    margin-top: 0;
    margin-right: 0;
    border-radius: 0 0 0 28px;
    background: var(--profile-page-surface);
    contain: layout paint;
    will-change: transform;
    min-height: 0;
        box-shadow: none;
}

.profile-hero-card {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: clamp(18px, 2.4vw, 24px);
    align-items: stretch;
    padding: clamp(16px, 2vw, 22px);
    margin: -64px calc(clamp(22px, 2.4vw, 30px) * -1) 18px 0;
    max-height: 900px;
    overflow: hidden;
    background: url(../assets/images/darkMetalSheet.jpg);
    background-size: cover;
    background-position: center;

    border-radius: 0 0 0 30px;
    position: relative;
    will-change: opacity, transform, max-height;
    /* box-shadow removed */
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease, padding 0.4s ease, transform 0.35s ease;
}

#profileScreen.hero-collapsed .profile-hero-card {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateY(-8px);
}

.profile-avatar-card {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    width: min(100%, 220px);
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    /* box-shadow removed */
    overflow: hidden;
}

.profile-hero-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 24px;
}

.profile-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.9fr);
    gap: clamp(20px, 2vw, 28px);
    align-items: start;
    grid-column: 2;
    grid-row: 2;
}

.profile-recent-panel {
    align-self: start;
        box-shadow: none;
}

#profileNameHeading,
.profile-recent-panel h2 {
    margin: 0;
    color: #fff;
    font-family: "Founders Grotesk Text", sans-serif;
    font-style: normal;
}

#profileNameHeading {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 700;
    letter-spacing: -0.05em;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding-left: var(--profile-summary-main-offset-x);
}

.profile-summary-main {
    padding-left: var(--profile-summary-main-offset-x);
}

.chain-decor {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 8px 0 18px;
}

.chain-decor img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    transform: rotate(45deg);
    opacity: 0.85;
    /* No filter needed for white SVG */
}

.chain-decor-small {
    justify-content: center;
    margin-top: 6px;
    margin-bottom: 14px;
    gap: 0;
}

.chain-decor-small img {
    width: 16px;
    height: 16px;
    transform: rotate(45deg);
    opacity: 0.85;
    /* No filter needed for white SVG */
}

.profile-stat-line {
    margin: 0 0 14px;
    color: #fff;
    font-family: "Founders Grotesk Text", sans-serif;
    font-size: clamp(15px, 1.5vw, 22px);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 1.35;
}

.profile-stat-line span {
    font-family: "Founders Grotesk Mono", monospace;
    font-weight: 700;
}

/* Edit mode row */
.profile-edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

@keyframes edit-shake {
    0%, 100% { transform: rotate(0deg); }
    20%       { transform: rotate(-12deg); }
    40%       { transform: rotate(10deg); }
    60%       { transform: rotate(-8deg); }
    80%       { transform: rotate(6deg); }
}

.profile-edit-gear {
    position: static;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 2px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    width: 22px;
    height: 22px;
    flex: none;
}
.profile-edit-gear img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.profile-edit-gear:hover {
    opacity: 0.9;
    background: none !important;
    box-shadow: none !important;
}

/* Shake when edit mode is active */
.profile-edit-gear.editing {
    box-shadow: none;
    opacity: 1;
    animation: edit-shake 0.4s ease;
}

/* Hide edit controls when viewing another user's profile */
#profileScreen.is-viewing-other .profile-edit-row {
    display: none;
}

.profile-save-btn {
    background: #222;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}
.profile-save-btn:hover { background: #444; }
.profile-save-btn.hidden { display: none; }

.profile-save-msg {
    font-size: 0.8rem;
    min-height: 1em;
}

/* Edit mode â€” name becomes an inline input */
#profileScreen.edit-mode #profileNameHeading {
    border-bottom: 2px dotted #000;
    outline: none;
    cursor: text;
    background: transparent;
    min-width: 60px;
}

/* Edit mode â€” avatar becomes clickable */
#profileScreen.edit-mode .profile-avatar-card {
    cursor: pointer;
    position: relative;
}
#profileScreen.edit-mode .profile-avatar-card::after {
    content: 'âœŽ';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255,255,255,0.92);
    color: #111;
    font-size: 1rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.profile-recent-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-self: end;
    width: 100%;
}

.profile-recent-panel h2 {
    text-align: center;
    font-size: clamp(20px, 2.2vw, 30px);
    font-weight: 700;
    letter-spacing: -0.05em;
}

.recent-links-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.recent-link-pill {
    position: relative;
    display: block;
    min-width: min(100%, 230px);
    max-width: 100%;
    padding: 14px 20px 14px 36px;
    border: 2px solid rgba(0, 0, 0, 0.28);
    border-radius: 12px;
    background: var(--profile-metal-surface);
        box-shadow: none;
    color: #111;
    font-size: clamp(14px, 1.2vw, 18px);
    font-weight: 700;
    text-align: center;
}

.recent-link-pill::before,
.recent-link-pill::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    pointer-events: none;
}

.recent-link-pill::before {
    left: 10px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.45);
        box-shadow: none;
}

.recent-link-pill::after {
    left: 14px;
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.28);
}

.recent-links-list .recent-link-pill:nth-child(odd) {
    margin-right: 200px;
}

.recent-links-list .recent-link-pill:nth-child(even) {
    margin-right: 60px;
}

.recent-link-empty {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    padding: 4px 0;
}

.friends-search-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 6px 16px 18px 0;
    transition: margin 0.35s ease;
}

#profileScreen.hero-collapsed .friends-search-wrap {
    margin-top: 18px;
}

.profile-collapse-toggle {
    position: static;
    bottom: auto;
    left: auto;
    z-index: auto;
    flex: none;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    margin-right: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    box-shadow: none;
}

.profile-collapse-toggle:hover,
.profile-collapse-toggle:focus-visible {
    background: transparent;
    box-shadow: 0 0 0 1.5px #000000;
}

.collapse-arrow {
    width: 22px;
    height: 22px;
    border-top: 5px solid #111;
    border-left: 5px solid #111;
    border-radius: 2px;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

#profileScreen.hero-collapsed .collapse-arrow {
    transform: rotate(225deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.friends-search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 0 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
        box-shadow: none;
}

.friends-search-icon {
    position: relative;
    flex: none;
    width: 18px;
    height: 18px;
    border: 4px solid #111;
    border-radius: 50%;
    transform: translateY(-5px);
}

.friends-search-icon::after {
    content: "";
    position: absolute;
    right: -9px;
    bottom: -8px;
    width: 14px;
    height: 4px;
    border-radius: 999px;
    background: #111;
    transform: rotate(45deg);
    transform-origin: center;
}

.friends-search-bar input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #111;
    font-size: clamp(16px, 1.4vw, 20px);
    font-family: "Founders Grotesk Text", sans-serif;
    font-weight: 500;
    font-style: normal;
}

.friends-search-bar input::placeholder {
    color: #6c6c6c;
}

.friends-grid-wrap {
    padding: 10px 0 4px;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 20px;
}

.friend-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 6px;
    border-radius: 18px;
    position: relative;
    overflow: visible;
    transition: transform 0.16s ease;
}

/* Yellow stripe replica â€” avatar shape */
.friend-card::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: url("../assets/images/yellow striped texture.png") left top / 100px 100px repeat;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.22s ease;
}

/* Yellow stripe replica â€” name plate shape */
.friend-card::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 88px;
    right: 6px;
    height: 56px;
    border-radius: 16px;
    background: url("../assets/images/yellow striped texture.png") left top / 100px 100px repeat;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.22s ease;
}

.friend-card:hover {
    transform: translateY(-1px);
}

@keyframes card-shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    35%       { transform: translateX(5px); }
    55%       { transform: translateX(-4px); }
    75%       { transform: translateX(3px); }
}

.friend-avatar.is-shaking,
.friend-name.is-shaking {
    animation: card-shake 0.4s ease;
}

.friend-card.is-featured::before,
.friend-card.is-featured::after {
    opacity: 1;
}

.friend-card.is-filtered-out {
    display: none;
}

.friend-avatar,
.friend-name {
    display: flex;
    align-items: center;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: none;
    position: relative;
    z-index: 2;
    transition: transform 0.22s cubic-bezier(.4, 0, .2, 1), box-shadow 0.22s ease;
}

/* Remove plate-level pseudo-element backings */
.friend-avatar::after,
.friend-name::after {
    display: none;
}

.friend-card.is-featured .friend-avatar::after,
.friend-card.is-featured .friend-name::after {
    display: none;
}

.friend-card.is-featured .friend-avatar,
.friend-card.is-featured .friend-name {
    transform: translate(-8px, 8px);
    box-shadow: none;
}

.friend-avatar {
    justify-content: center;
    width: 56px;
    height: 56px;
    flex: none;
    padding: 0;
    aspect-ratio: 1;
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.friend-name {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    min-height: 56px;
    padding: 8px 18px;
    color: #000;
    line-height: 1.2;
    white-space: normal;
    gap: 3px;
}

.friend-name-text {
    font-family: "Founders Grotesk Text", sans-serif;
    font-size: clamp(16px, 1.35vw, 22px);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.friend-card-stats {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: clamp(10px, 0.95vw, 13px);
    font-weight: 400;
    color: #555;
    line-height: 1.4;
}

.friend-you-badge {
    display: inline-block;
    font-family: "Founders Grotesk Text", sans-serif;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: #222;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -1px;
}

.friends-empty {
    margin: 12px 0 0;
    color: #111;
    font-size: 15px;
    text-align: center;
}

.friends-empty.hidden {
    display: none;
}

/* Desktop-only profile card tweaks */
@media (min-width: 601px) {
    #profileNameHeading {
        align-self: end;
    }

    .profile-recent-panel {
        align-self: start;
        margin-top: -12px;
    }
}

@media (max-width: 980px) {
    #profileScreen {
        /* Tablet left gap â€” adjust the 14 to move panel closer/further from hotbar */
        padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
    }

    .profile-screen-shell {
        width: 100%;
        margin-right: 0;
    }

    .friends-panel-shell {
        margin-top: 0;
        margin-right: 0;
        border-radius: 0 0 0 26px;
    }

    .profile-summary-card {
        grid-template-columns: 1fr;
    }

    .profile-hero-card {
        margin: -52px calc(clamp(22px, 2.4vw, 30px) * -1) 18px 0;
        max-height: 900px;
    }

    .profile-avatar-card {
        width: min(180px, 100%);
    }

    .profile-recent-panel {
        justify-self: stretch;
    }

    .recent-links-list {
        align-items: stretch;
    }

    :root {
        --profile-summary-main-offset-x: 0px;
    }
}

@media (max-width: 600px) {
    #profileScreen {
        padding:
            calc(env(safe-area-inset-top, 0px) + 0px)    /* Top gap */
            calc(env(safe-area-inset-right, 0px) + 0px)  /* Right gap */
            calc(env(safe-area-inset-bottom, 0px) + 50px)/* Bottom gap */
            calc(env(safe-area-inset-left, 0px) + 76px); /* Mobile left gap â€” hotbar (52px) + offset (12px) + gap (12px) */
        overflow: hidden;
    }

    .profile-screen-shell {
        width: 100%;
        margin-right: 0;
    }

    .friends-panel-shell {
        margin-top: 0;
        margin-right: 0;
        padding: 26px 12px 16px;
        border-radius: 0 0 0 22px;
    }

    .profile-hero-card {
        grid-template-columns: clamp(90px, 28vw, 130px) 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        gap: 14px 8px;
        margin: -36px -12px 32px 0;
        padding: 14px 14px 20px;
        border-radius: 0 0 0 22px;
        overflow: visible;
    }

    .profile-avatar-column {
        grid-column: 1;
        grid-row: 1;
    }

    .profile-avatar-card {
        width: 100%;
        max-width: none;
        margin: 10px 0 0 0;
    }

    #profileNameHeading {
        /* Pin below avatar, independent of summary-card height */
        position: absolute;
        top: calc(clamp(90px, 28vw, 130px) + 2px); /* pulled up on mobile to tighten avatar/name/edit spacing */
        left: -126px;  /* 14px base - 140px */
        width: clamp(90px, 28vw, 130px);
        padding-left: 0;
        text-align: center;
        align-self: start;
        font-size: clamp(13px, 4.5vw, 20px);
        margin: 0;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    /* Edit mode â€” same position as own profile */
    #profileScreen.edit-mode #profileNameHeading {
        transform: none;
    }

    /* When viewing another user's profile, name sits below action buttons */
    #profileScreen.is-viewing-other #profileNameHeading {
        top: calc(clamp(90px, 28vw, 130px) + 52px); /* keep same relative layout, shifted up to match tighter spacing */
        
    }

    .profile-summary-card {
        grid-column: 2;
        grid-row: 1 / 3;
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 0 0 0 20px; /* Move 20px to the right */
    }

    .profile-summary-main {
        padding-left: 10px;
    }

    .profile-recent-panel {
        grid-column: unset;
        grid-row: unset;
        text-align: center;
        justify-self: stretch;
        display: flex;
        flex-direction: column;
        align-items: center;
        transform: translateX(-60px);
    }

    .recent-links-list {
        align-items: center;
        width: 100%;
        transform: translateX(-40px);
    }

    .recent-links-list .recent-link-pill {
        margin-left: auto;
        margin-right: auto;
    }

    .recent-links-list .recent-link-pill:nth-child(odd),
    .recent-links-list .recent-link-pill:nth-child(even) {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-stat-line {
        text-align: left;
        padding-left: 0;
    }

    .profile-stat-line span {
        display: block;
        text-align: left;
    }

    .profile-edit-row {
        position: absolute;
        top: 12px;
        right: 12px;
        left: auto;
        margin: 0;
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .profile-save-row {
        position: absolute;
        top: calc(clamp(90px, 28vw, 130px) + 120px);
        left: -126px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .friends-search-wrap {
        gap: 10px;
        margin: 40px 8px 14px 0;
    }

    .profile-collapse-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }

    .collapse-arrow {
        width: 16px;
        height: 16px;
        border-top-width: 4px;
        border-left-width: 4px;
    }

    .friends-search-bar {
        min-height: 52px;
        padding: 0 14px;
    }

    .friends-grid {
        grid-template-columns: 1fr;
    }

    .profile-screen-shell {
        height: 100%;
        min-height: 0;
    }

    .friends-panel-shell {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .recent-links-list .recent-link-pill:nth-child(odd),
    .recent-links-list .recent-link-pill:nth-child(even) {
        margin-right: 0;
    }
}

/* â”€â”€â”€ Notification bell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.notification-bell {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    right: calc(env(safe-area-inset-right, 0px) + 24px);
    left: auto;
    bottom: auto;
    z-index: 1010;
    width: 40px;
    height: 40px;
    padding: 4px;
    border: none;
    background: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.notification-bell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}
.notification-badge.hidden { display: none; }

/* â”€â”€â”€ Notification dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.notification-dropdown {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    right: calc(env(safe-area-inset-right, 0px) + 18px);
    z-index: 1011;
    width: min(320px, calc(100vw - 120px));
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    padding: 12px 14px;
}
.notification-dropdown.hidden { display: none; }
.notif-dropdown-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-empty { margin: 0; color: #999; font-size: 13px; }
.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: #f7f7f7;
}
.notif-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex: none;
}
.notif-item-info {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.notif-item-actions {
    display: flex;
    gap: 6px;
}
.notif-accept-btn, .notif-decline-btn {
    position: static;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    border: 1.5px solid #222;
    cursor: pointer;
    background: #222;
    color: #fff;
}
.notif-decline-btn {
    background: #fff;
    color: #222;
}

/* â”€â”€â”€ Avatar column (avatar + action buttons) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.profile-avatar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-row: 1 / 3;
    min-height: 0;
}

/* â”€â”€â”€ Profile action buttons (add friend + block) â”€â”€â”€â”€â”€â”€â”€â”€ */
.profile-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}
.profile-actions.hidden { display: none; }

.profile-action-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    aspect-ratio: 1 / 1;
    padding: 6px;
    border: none;
    border-radius: 12px;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer;
    flex: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.profile-action-btn:hover {
    transform: scale(1.08);
    background: #fff !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22) !important;
}
.profile-action-btn.is-active {
    background: #e74c3c !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35) !important;
}
.profile-action-btn.is-active img {
    filter: invert(1);
}
.profile-action-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#addFriendBtn {
    width: 32px;
    height: 32px;
    background: none !important;
    box-shadow: none !important;
    padding: 4px;
}
#addFriendBtn:hover {
    background: none !important;
    box-shadow: none !important;
}

#blockUserBtn {
    width: 32px;
    height: 32px;
    background: none !important;
    box-shadow: none !important;
    padding: 4px;
}
#blockUserBtn:hover {
    background: none !important;
    box-shadow: none !important;
}
#blockUserBtn.is-active {
    background: #e74c3c !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35) !important;
    border-radius: 12px;
}

/* â”€â”€â”€ Friend status tag (Pending / Friend Added icon) â”€â”€â”€â”€ */
.friend-status-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    padding: 4px 10px;
    margin: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex: none;
}
.friend-status-tag.hidden { display: none; }
.friend-status-tag.tag-pending {
    background: #222;
    color: #fff;
}
.friend-status-tag.tag-friend {
    background: none;
    box-shadow: none;
    padding: 0;
}
.friend-status-tag.tag-friend img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* â”€â”€â”€ Friend badge on nametag card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.friend-friend-badge {
    display: inline-block;
    font-family: "Founders Grotesk Text", sans-serif;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: #2ecc71;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -1px;
}

/* â”€â”€â”€ Edit button in name heading â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#profileNameHeading .profile-edit-gear {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 8px;
    width: 24px;
    height: 24px;
}
@media (max-width: 600px) {
    #profileNameHeading .profile-edit-gear {
        order: -1;
        margin-left: 0;
        margin-bottom: -8px;
        width: 28px;
        height: 28px;
    }
}
#profileScreen.is-viewing-other #profileNameHeading .profile-edit-gear {
    display: none;
}

/* â”€â”€â”€ Mobile adjustments for friend UI â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 600px) {
    .notification-bell {
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        right: calc(env(safe-area-inset-right, 0px) + 10px);
        width: 34px;
        height: 34px;
    }
    .notification-dropdown {
        top: calc(env(safe-area-inset-top, 0px) + 52px);
        right: calc(env(safe-area-inset-right, 0px) + 10px);
    }
    .profile-avatar-column {
        grid-row: 1;
    }
    .profile-actions {
        margin-top: 6px;
        transform: translateX(10px);
        min-height: 34px;
    }
    .profile-action-btn {
        width: 28px;
        height: 28px;
    }
    #addFriendBtn,
    #blockUserBtn {
        width: 28px;
        height: 28px;
        padding: 0;
    }
    .friend-status-tag {
        font-size: 0.6em;
    }
    /* The edit-row container is no longer needed â€” gear is in the heading */
    .profile-edit-row {
        display: none;
    }
}

/* Hide actions when viewing own profile */
#profileScreen:not(.is-viewing-other) .profile-actions {
    display: none !important;
}

