/* ============ Friends Screen ============ */

#screen-friends {
    padding-bottom: 100px;
}

/* ---- Search Bar ---- */
.friends-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.friends-search-input {
    flex: 1;
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.friends-search-input:focus {
    border-color: var(--primary-color, #7c56de);
}

.friends-search-input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

.friends-search-btn {
    background: var(--primary-color, #7c56de);
    border: none;
    border-radius: 12px;
    color: #fff;
    width: 44px;
    height: 44px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.friends-search-btn:hover {
    opacity: 0.85;
}

/* ---- User Cards ---- */
.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friend-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-color, #7c56de);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-meta {
    font-size: 11px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    margin-top: 2px;
}

.friend-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.friend-action-btn {
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.15s;
}

.friend-action-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.btn-add-friend {
    background: var(--primary-color, #7c56de);
    color: #fff;
}

.btn-view-profile {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.btn-accept {
    background: #2ecc71;
    color: #fff;
}

.btn-reject {
    background: rgba(255, 255, 255, 0.08);
    color: #ff4d6d;
    border: 1px solid rgba(255, 77, 109, 0.4);
}

.btn-remove {
    background: rgba(255, 77, 109, 0.1);
    color: #ff4d6d;
    border: 1px solid rgba(255, 77, 109, 0.3);
}

.btn-pending {
    background: rgba(255, 200, 0, 0.1);
    color: #ffc800;
    border: 1px solid rgba(255, 200, 0, 0.3);
    cursor: default;
}


/* ============ Public Profile — Fullscreen Page ============ */

.pub-profile-page-overlay {
    position: fixed;
    inset: 0;
    z-index: 3500;
    pointer-events: none;
    /* no dim bg — full page covers everything */
}

.pub-profile-page-overlay.active {
    pointer-events: all;
}

.pub-profile-page {
    position: absolute;
    inset: 0;
    background: var(--app-bg, #0f0f1e);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    scrollbar-width: none;
    padding: 16px 16px 100px;
}

.pub-profile-page::-webkit-scrollbar {
    display: none;
}

.pub-profile-page-overlay.active .pub-profile-page {
    transform: translateY(0);
}

/* ---- Action Buttons Row ---- */
.pub-profile-actions {
    display: flex;
    gap: 10px;
    padding: 16px 0 4px;
}



/* ---- Sticky top header ---- */
.pub-profile-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pub-profile-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.pub-profile-back-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pub-profile-back-btn:active {
    transform: scale(0.92);
}

.pub-profile-topbar-name {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Hero ---- */
.pub-profile-hero {
    position: relative;
    overflow: hidden;
    height: 220px;
    margin-bottom: 0;
}

.pub-profile-hero-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center top;
    filter: blur(18px) saturate(1.5);
    opacity: 0.5;
    transform: scale(1.12);
}

.pub-profile-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(10, 10, 25, 0.1) 0%,
            rgba(10, 10, 25, 0.9) 100%);
}

.pub-profile-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 0 20px 20px;
}

.pub-profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color, #7c56de), var(--accent-color, #a855f7));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.pub-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-profile-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 2px;
}

.pub-profile-name {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
    margin-bottom: 8px;
    line-height: 1;
}

.pub-profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Friend action button in hero ---- */
.profile-sheet-friend-btn {
    border: none;
    border-radius: 14px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
    margin-bottom: 2px;
}

.profile-sheet-friend-btn:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.profile-sheet-friend-btn:active {
    transform: scale(0.96);
}

.profile-sheet-friend-btn.add {
    background: var(--primary-color, #7c56de);
    color: #fff;
}

.profile-sheet-friend-btn.pending {
    background: rgba(255, 200, 0, 0.15);
    color: #ffc800;
    cursor: default;
}

.profile-sheet-friend-btn.friends-btn {
    background: rgba(255, 77, 109, 0.2);
    color: #ff4d6d;
    border: 1px solid rgba(255, 77, 109, 0.4);
}

.profile-sheet-friend-btn.accept-btn {
    background: #2ecc71;
    color: #fff;
}

/* ---- Stats ---- */
.pub-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px 16px 0;
}

/* ---- Section Title ---- */
.pub-profile-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    padding: 20px 16px 12px;
}

/* ---- Favourite Cards ---- */
.pub-profile-favs {
    display: flex;
    gap: 12px;
    padding: 0 16px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pub-profile-favs::-webkit-scrollbar {
    display: none;
}


/* ---- Level badge & streak (reused from profile page) ---- */
.level-badge-hero {
    background: rgba(108, 92, 231, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.pub-profile-no-favs {
    padding: 20px 16px;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    font-size: 13px;
    text-align: center;
}

/* ============ Guest Inventory Overlay ============ */

.guest-inventory-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    pointer-events: none;
}

.guest-inventory-overlay.active {
    pointer-events: all;
}

.guest-inventory-page {
    position: absolute;
    inset: 0;
    background: var(--app-bg, #0f0f1e);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    scrollbar-width: none;
    padding: 0 16px 100px;
}

.guest-inventory-page::-webkit-scrollbar {
    display: none;
}

.guest-inventory-overlay.active .guest-inventory-page {
    transform: translateY(0);
}

/* ---- Header ---- */
.guest-inv-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 0 -16px;
    background: var(--app-bg, #0f0f1e);
}

.guest-inv-title {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.guest-inv-title span:first-child {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-inv-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    flex-shrink: 0;
}

/* ---- Card Grid ---- */
.guest-inv-grid {
    padding-top: 4px;
}