/* =============================================
   FRIENDS FEED – Explore People
   ============================================= */

/* =============================================
   PROFILE EDITOR – Cover + Hero Layout
   ============================================= */

/* Hide old top card */
.profile-top-card { display: none !important; }

/* ── Cover / Header image area ── */
.profile-cover-area {
    width: 100%;
    height: 220px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}

/* Empty state (no cover set): dashed pink border + dark tinted bg */
.profile-cover-area:not(.has-cover) {
    background: linear-gradient(160deg, var(--bg-secondary, #161218) 0%, var(--bg-tertiary, #1C1620) 60%, rgba(233,30,99,0.08) 100%);
    border: 2px dashed rgba(233, 30, 99, 0.38);
}
.profile-cover-area:not(.has-cover):active {
    border-color: rgba(233, 30, 99, 0.7);
}

/* Cover set: photo fills area */
.profile-cover-area.has-cover {
    background: linear-gradient(160deg, var(--bg-secondary, #161218) 0%, var(--bg-tertiary, #1C1620) 55%, rgba(233,30,99,0.25) 100%);
}

.profile-cover-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
}

/* Subtle bottom-fade so avatar ring is readable */
.profile-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

/* ── Empty state prompt ── */
.profile-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    z-index: 2;
}
.profile-cover-area.has-cover .profile-cover-empty {
    display: none;
}

.profile-cover-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(233, 30, 99, 0.12);
    border: 1.5px solid rgba(233, 30, 99, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(233, 30, 99, 0.85);
    margin-bottom: 6px;
    transition: background 0.15s;
}
.profile-cover-area:not(.has-cover):active .profile-cover-empty-icon {
    background: rgba(233, 30, 99, 0.25);
}

.profile-cover-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
}

.profile-cover-empty-sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── "Edit Cover" pill – top-right, only visible when has-cover ── */

.profile-cover-edit-btn {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    background: rgba(0, 0, 0, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 7px 14px 7px 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: none; /* hidden by default (no cover) */
    align-items: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none; /* clicks pass through to parent div */
}
/* Show pill only when cover is set */
.profile-cover-area.has-cover .profile-cover-edit-btn {
    display: flex;
}

/* ── Hero row: name below cover ── */
.profile-hero-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 24px;
    background: var(--app-bg, #0D0A0F);
    text-align: center;
    position: relative;
}

/* Name below cover */
.profile-hero-row .profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 14px;
}

/* ── Friend profile modal – avatar row ── */
.fpm-avatar-row {
    padding: 0 22px;
    background: var(--app-bg, #0D0A0F);
    display: none; /* shown via JS when header pic set */
}

.fpm-avatar-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-light, #F06292));
    padding: 3px;
    margin-top: -38px;
    box-shadow: 0 0 0 4px var(--app-bg, #0D0A0F);
}

.fpm-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-secondary, #1a1a1a);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent, #E91E63);
}

/* Add top padding to fpm-body when avatar row is visible */
.fpm-avatar-row + .fpm-body {
    padding-top: 14px;
}

/* ── User Landing – avatar row ── */
.ul-avatar-row {
    padding: 0 22px;
    background: var(--app-bg, #0D0A0F);
}

.ul-avatar-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-light, #F06292));
    padding: 3px;
    margin-top: -38px;
    box-shadow: 0 0 0 4px var(--app-bg, #0D0A0F);
}

.ul-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-secondary, #1a1a1a);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent, #E91E63);
}

#friendsScreen {
    flex-direction: column;
    background: var(--app-bg, #0D0A0F);
    overflow: hidden;
}

/* ── Refresh button ──────────────────────── */
.friends-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-dark, #C2185B));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(233, 30, 99, 0.35);
}

.friends-refresh-btn:active {
    transform: scale(0.95);
}

.friends-refresh-btn[disabled] {
    background: var(--bg-tertiary, #1C1620);
    color: var(--text-muted, #666);
    cursor: default;
    box-shadow: none;
}

.friends-cooldown-hint {
    font-size: 11px;
    color: var(--text-muted, #666);
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
}

/* ── Bottom refresh area ─────────────────── */
#friendsRefreshArea {
    display: flex;
    justify-content: center;
    padding: 20px 20px 12px;
}

/* ── Scrollable page body ─────────────────── */
/* Contains both invitations section and 25-profile feed */
.friends-page-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 90px; /* nav bar clearance */
}

/* ── Feed container (no own scroll) ──────── */
.friends-feed-container {
    padding: 10px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Persona cards container gets slightly tighter spacing */
#personaCardsContainer {
    gap: 14px;
}

/* ── Empty state ──────────────────────────── */
.friends-empty {
    text-align: center;
    padding: 70px 24px;
    color: var(--text-muted, #666);
}

.friends-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.friends-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary, #B0B0B0);
    margin: 0 0 10px;
}

.friends-empty p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ── Load-more / end indicator ────────────── */
.friends-load-more {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #666);
    font-size: 13px;
}

.friends-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(233, 30, 99, 0.2);
    border-top-color: var(--primary-color, #E91E63);
    border-radius: 50%;
    animation: friendsSpin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* =============================================
   INVITATIONS SECTION
   ============================================= */

#friendsInvitationsSection {
    padding: 20px 16px 0;
}

.friends-invites-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.friends-invites-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.friends-invites-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 2px;
}

.friends-invites-subtitle {
    font-size: 12px;
    color: var(--text-muted, #888);
    margin: 0;
}

.friends-invites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section divider between invitations and 25 profiles */
.friends-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 0;
    color: var(--text-muted, #555);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.friends-section-divider::before,
.friends-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #2E2433);
}

/* =============================================
   PROFILE CARD
   ============================================= */

.friend-card {
    border-radius: 22px;
    overflow: hidden;
    background: var(--bg-secondary, #161218);
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform 0.18s ease;
    cursor: pointer;
}

.friend-card:active {
    transform: scale(0.985);
}

/* Invited card subtle accent border */
.friend-card--invited {
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(233, 30, 99, 0.25);
}

/* Cover / photo area */
.friend-card-cover {
    position: relative;
    height: 340px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.friend-card-cover-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
}

/* Gradient overlay */
.friend-card-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0)    20%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.80) 100%
    );
}

/* Invite badge overlaid on persona card photo */
.persona-card__invite-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    background: linear-gradient(135deg, #FF1E64, #C01898);
    color: #fff;
    font-size: 8.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.7px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(255, 30, 100, 0.5);
}

/* Name / joined line */
.friend-card-cover-info {
    position: relative;
    z-index: 2;
    padding: 14px 18px;
    width: 100%;
}

.friend-card-cover-name {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    letter-spacing: 0.2px;
}

.friend-card-joined {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Body section */
.friend-card-body {
    padding: 18px 18px 20px;
}

.friend-card-bio {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary, #B0B0B0);
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.friend-card-no-bio {
    font-size: 14px;
    color: var(--text-muted, #666);
    font-style: italic;
    margin: 0 0 14px;
}

/* Tags */
.friend-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(233, 30, 99, 0.10);
    color: var(--primary-color, #E91E63);
    border: 1px solid rgba(233, 30, 99, 0.22);
}

/* =============================================
   PERSONA CARD — Neon Noir Cinema
   Vertical 2:3 layout: big cinematic photo top,
   bold bio section, quiz + CTA at bottom.
   ============================================= */

@keyframes pcFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Staggered entry for cards in the feed.
   Pure opacity fade — no translateY to prevent layout-shift vibration.
   animation-fill-mode: both keeps cards invisible until delay elapses. */
#personaCardsContainer .persona-card {
    animation: pcFadeIn 0.3s ease both;
}
#personaCardsContainer .persona-card:nth-child(1) { animation-delay: 0.02s; }
#personaCardsContainer .persona-card:nth-child(2) { animation-delay: 0.06s; }
#personaCardsContainer .persona-card:nth-child(3) { animation-delay: 0.10s; }
#personaCardsContainer .persona-card:nth-child(4) { animation-delay: 0.14s; }
#personaCardsContainer .persona-card:nth-child(5) { animation-delay: 0.18s; }
#personaCardsContainer .persona-card:nth-child(n+6) { animation-delay: 0.20s; }

.persona-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(160deg, #16112A 0%, #1E1438 55%, #180E28 100%);
    box-shadow:
        0 0 0 1px rgba(255, 30, 100, 0.22),
        0 0 28px rgba(255, 30, 100, 0.09),
        0 0 56px rgba(160, 50, 255, 0.06),
        0 14px 44px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.22s ease;
}

.persona-card:active {
    transform: scale(0.975);
    box-shadow:
        0 0 0 1.5px rgba(255, 30, 100, 0.5),
        0 0 36px rgba(255, 30, 100, 0.2),
        0 0 72px rgba(160, 50, 255, 0.12),
        0 6px 24px rgba(0, 0, 0, 0.75);
}

/* ── Photo zone — 2:3 aspect ratio, cinematic ── */
.persona-card__photo {
    position: relative;
    aspect-ratio: 2 / 2.2;
    overflow: hidden;
}

/* Compact photo zone for users without a profile image */
.persona-card__photo--compact {
    aspect-ratio: auto;
    min-height: 120px;
}

.persona-card__photo-bg {
    position: absolute;
    inset: 0;
    background-color: #1A1030;
    background-size: cover;
    background-position: center 18%;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Gradient background for users without an image */
.persona-card__photo-bg--initials {
    background: linear-gradient(145deg, #2A1845 0%, #1A1035 40%, #2D1250 100%);
}

/* Large initials inside compact photo */
.persona-card__initials {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: rgba(255, 111, 168, 0.35);
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 30, 100, 0.2);
    margin-bottom: 6px;
}

.persona-card:active .persona-card__photo-bg {
    transform: scale(1.04);
}

.persona-card__photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0)    30%,
        rgba(0, 0, 0, 0.08) 55%,
        rgba(22, 17, 42, 0.92) 100%
    );
    z-index: 1;
}

/* Name + tagline overlay on bottom of photo */
.persona-card__identity {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 16px 20px 18px;
}

.persona-card__name {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.4px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95);
}

/* Tagline — neon pink glow */
.persona-card__tagline {
    font-size: 12px;
    font-weight: 600;
    color: #FF6FA8;
    margin: 5px 0 0;
    text-shadow: 0 0 12px rgba(255, 30, 100, 0.65);
    letter-spacing: 0.2px;
}

/* ── Right wrapper (used only for horizontal friend cards) ── */
.persona-card__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Bio section — BOLD, eye-catching ── */
.persona-card__content {
    padding: 18px 20px 0;
}

.persona-card__bio {
    font-size: 14.5px;
    line-height: 1.65;
    color: #EDE8FF;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Left accent bar for emphasis */
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #FF1E64, #A032FF) 1;
    padding-left: 14px;
}

/* ── Quiz block ── */
.persona-card__quiz {
    margin: 14px 16px 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 30, 100, 0.16);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.persona-card__quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.persona-card__quiz-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #6B6085;
}

/* Difficulty badges — vivid */
.persona-card__quiz-diff {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.persona-card__quiz-diff--easy {
    background: rgba(0, 230, 155, 0.14);
    color: #00E69B;
    border: 1px solid rgba(0, 230, 155, 0.32);
}

.persona-card__quiz-diff--medium {
    background: rgba(255, 185, 0, 0.14);
    color: #FFB900;
    border: 1px solid rgba(255, 185, 0, 0.32);
}

.persona-card__quiz-diff--hard {
    background: rgba(255, 50, 100, 0.14);
    color: #FF3264;
    border: 1px solid rgba(255, 50, 100, 0.32);
}

/* Stats row */
.persona-card__quiz-stats {
    display: flex;
    align-items: center;
    gap: 6px;
}

.persona-card__quiz-count {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    letter-spacing: -1px;
}

.persona-card__quiz-passed-label {
    font-size: 12px;
    color: #8A80AA;
    font-weight: 500;
}

.persona-card__quiz-threshold {
    margin-left: auto;
    font-size: 11px;
    color: #6A5F88;
    font-weight: 500;
}

/* ── THE BUTTON — neon magenta-violet glow ── */
.persona-card__quiz-btn {
    position: relative;
    width: 100%;
    padding: 14px 0;
    border-radius: 12px;
    border: none;
    background: linear-gradient(125deg, #FF1E64 0%, #C01898 40%, #8B28E8 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow:
        0 0 0 1px rgba(255, 30, 100, 0.2),
        0 4px 20px rgba(255, 30, 100, 0.5),
        0 10px 40px rgba(139, 40, 232, 0.3);
}

/* Moving shimmer sweep */
.persona-card__quiz-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    transform: skewX(-18deg);
    animation: btnShimmer 3.5s ease infinite;
}

@keyframes btnShimmer {
    0%   { left: -120%; }
    40%  { left: 160%; }
    100% { left: 160%; }
}

.persona-card__quiz-btn:active {
    transform: scale(0.96);
    box-shadow:
        0 0 0 1.5px rgba(255, 30, 100, 0.55),
        0 2px 14px rgba(255, 30, 100, 0.6),
        0 6px 28px rgba(139, 40, 232, 0.45);
}

/* Continue Quiz — electric violet variant */
.persona-card__quiz-btn--progress {
    background: linear-gradient(125deg, #7C3AED 0%, #5B21B6 60%, #3B0F9E 100%);
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.25),
        0 4px 20px rgba(124, 58, 237, 0.5),
        0 10px 40px rgba(91, 33, 182, 0.3);
}

/* ── Load More button ── */
.persona-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
}

.persona-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 34px;
    border-radius: 32px;
    border: 1.5px solid rgba(255, 30, 100, 0.32);
    background: linear-gradient(135deg, rgba(255, 30, 100, 0.10), rgba(139, 40, 232, 0.08));
    color: #FF6FA8;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow:
        0 0 20px rgba(255, 30, 100, 0.10),
        0 0 40px rgba(139, 40, 232, 0.07);
}

.persona-load-more-btn:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, rgba(255, 30, 100, 0.18), rgba(139, 40, 232, 0.14));
    box-shadow:
        0 0 28px rgba(255, 30, 100, 0.2),
        0 0 56px rgba(139, 40, 232, 0.14);
}

.persona-load-more-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* Disabled state: weekly limit reached */
.persona-load-more-btn--disabled {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #6A5F88;
    cursor: default;
    box-shadow: none;
}

.persona-load-more-btn--disabled:active {
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

/* Weekly loads remaining hint */
.persona-load-more-hint {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #5A5070;
    margin-top: 8px;
    font-weight: 500;
}

/* Center hint below button */
.persona-load-more-wrap {
    flex-direction: column;
    align-items: center;
}

/* =============================================
   USER PROFILE MODAL
   ============================================= */

.friend-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--app-bg, #0D0A0F);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fpmSlideIn 0.28s cubic-bezier(0.34, 1.1, 0.64, 1) both;
}

@keyframes fpmSlideIn {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.fpm-back-bar {
    display: flex;
    align-items: center;
    padding: 16px 18px 12px;
    gap: 12px;
    background: var(--app-bg, #0D0A0F);
    flex-shrink: 0;
}

.fpm-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #fff;
    cursor: pointer;
}

.fpm-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 120px;
}

/* Hero cover */
.fpm-cover {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-dark, #C2185B));
}

.fpm-cover-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.fpm-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.75) 100%);
}

.fpm-cover-initials {
    display: none;
}

.fpm-cover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 22px;
    z-index: 2;
}

.fpm-cover-name {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.fpm-cover-joined {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

/* Body */
.fpm-body {
    padding: 24px 22px 0;
}

.fpm-bio {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary, #B0B0B0);
    margin: 0 0 20px;
}

.fpm-no-bio {
    font-size: 15px;
    color: var(--text-muted, #555);
    font-style: italic;
    margin: 0 0 20px;
}

.fpm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

/* Sticky Quiz button */
.fpm-quiz-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 22px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--app-bg, #0D0A0F) 70%, transparent);
    z-index: 10000;
}

.fpm-quiz-btn {
    width: 100%;
    padding: 17px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-dark, #C2185B));
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.45);
    transition: transform 0.15s, box-shadow 0.15s;
}

.fpm-quiz-btn:active {
    transform: scale(0.97);
    box-shadow: 0 3px 12px rgba(233, 30, 99, 0.35);
}

/* =============================================
   USER PUBLIC PROFILE LANDING
   Shown when a non-logged-in user visits ?p=userId
   ============================================= */

#userLandingScreen {
    flex-direction: column;
    background: var(--app-bg, #0D0A0F);
    overflow: hidden;
}

.ul-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Cover image / gradient ─────────────────── */

.ul-cover {
    width: 100%;
    height: 52vh;
    min-height: 300px;
    max-height: 440px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-dark, #C2185B));
}

.ul-cover-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.ul-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0)    25%,
        rgba(0, 0, 0, 0.12) 55%,
        rgba(0, 0, 0, 0.78) 100%
    );
}

.ul-cover-initials {
    display: none;
}

.ul-cover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    z-index: 2;
}

.ul-online-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 10px;
}

.ul-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 0 7px rgba(76, 175, 80, 0.9);
}

.ul-name {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.ul-joined {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
    margin: 0;
}

/* ── Body ───────────────────────────────────── */

.ul-body {
    padding: 26px 22px 56px;
}

.ul-invite-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(233, 30, 99, 0.11);
    border: 1px solid rgba(233, 30, 99, 0.28);
    color: var(--primary-color, #E91E63);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 20px;
    margin-bottom: 18px;
}

.ul-bio {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary, #B0B0B0);
    margin: 0 0 28px;
}

/* ── Action buttons ─────────────────────────── */

.ul-actions {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 26px;
}

.ul-btn-quiz,
.ul-btn-chat {
    width: 100%;
    padding: 17px 20px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.14s, box-shadow 0.14s;
}

.ul-btn-quiz {
    border: none;
    background: linear-gradient(135deg, var(--primary-color, #E91E63), var(--primary-dark, #C2185B));
    color: #fff;
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.42);
}

.ul-btn-quiz:active {
    transform: scale(0.97);
    box-shadow: 0 3px 12px rgba(233, 30, 99, 0.3);
}

.ul-btn-chat {
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    box-shadow: none;
}

.ul-btn-chat:active {
    background: rgba(255, 255, 255, 0.11);
}

/* ── Login hint ─────────────────────────────── */

.ul-account-hint {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted, #666);
    margin: 0;
}

.ul-login-link {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    color: var(--primary-color, #E91E63);
    cursor: pointer;
}

/* ─── Profile form: save row + auto-save badge ─── */
.profile-save-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-save-row .btn-save {
    flex-shrink: 0;
}

.profile-autosave-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #4ade80;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.profile-autosave-badge.visible {
    opacity: 1;
}
