/* ==========================================================================
   User Card — profile popup (galaxy + planet pages)
   Same glass recipe as the home feed. No `will-change` (stacking-context trap).
   ========================================================================== */

#user-card-root {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: rgba(255, 255, 255, 0.94);
}

#user-card-root.is-open {
    display: flex;
}

.uc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 10, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.uc-card {
    position: relative;
    width: min(400px, calc(100vw - 28px));
    max-height: min(82vh, 620px);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    /* liquid glass — matches the home-feed sheet + page buttons */
    border: 1px solid rgba(255, 255, 255, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04) 90px),
        rgba(20, 22, 30, 0.72);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55), inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
    overflow: hidden;
    animation: uc-in 260ms cubic-bezier(0.22, 0.9, 0.26, 1);
}

@keyframes uc-in {
    from { transform: translateY(18px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.uc-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 14px;
}

.uc-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(140deg, rgba(125, 243, 255, 0.35), rgba(255, 118, 235, 0.3));
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.uc-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uc-identity {
    flex: 1;
    min-width: 0;
}

.uc-name {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uc-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}

.uc-close {
    align-self: flex-start;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: background 180ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.uc-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* action row: friendship + overflow */
.uc-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px 6px;
}

.uc-friend-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(125, 243, 255, 0.4);
    background: rgba(125, 243, 255, 0.14);
    cursor: pointer;
    transition: background 180ms ease, transform 150ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.uc-friend-btn:hover {
    background: rgba(125, 243, 255, 0.26);
}

.uc-friend-btn:active {
    transform: scale(0.98);
}

.uc-friend-btn[data-state="friends"] {
    border-color: rgba(120, 255, 180, 0.4);
    background: rgba(120, 255, 180, 0.12);
    cursor: default;
}

.uc-friend-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

.uc-report-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.uc-report-btn:hover {
    color: rgba(255, 140, 140, 0.95);
    border-color: rgba(255, 120, 120, 0.4);
    background: rgba(255, 100, 100, 0.1);
}

/* body */
.uc-body {
    padding: 6px 18px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.uc-body::-webkit-scrollbar {
    width: 5px;
}

.uc-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.uc-section-title {
    margin: 14px 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 7px;
}

.uc-strip {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 6px;
    touch-action: pan-x;
    scrollbar-width: none;
}

.uc-strip::-webkit-scrollbar {
    display: none;
}

.uc-tile {
    flex: 0 0 auto;
    width: 96px;
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: border-color 180ms ease, transform 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.uc-tile:hover {
    border-color: rgba(125, 243, 255, 0.45);
    transform: translateY(-2px);
}

.uc-tile .uc-tile-img {
    width: 100%;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.uc-tile .uc-tile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.uc-tile-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-shadow: 0 0 16px currentColor;
    opacity: 0.85;
}

.uc-tile-name {
    padding: 6px 8px 8px;
    font-size: 10.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uc-empty {
    padding: 10px 2px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.uc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 42px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12.5px;
}

.uc-loading svg {
    animation: uc-spin 1.1s linear infinite;
}

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

/* report form */
.uc-report-form {
    margin-top: 12px;
    padding: 13px 14px;
    border-radius: 15px;
    border: 1px solid rgba(255, 120, 120, 0.28);
    background: rgba(255, 100, 100, 0.06);
}

.uc-report-form h4 {
    margin: 0 0 9px;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 160, 160, 0.95);
    display: flex;
    align-items: center;
    gap: 7px;
}

.uc-report-form select,
.uc-report-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 9px;
    padding: 9px 11px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.94);
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(3, 5, 10, 0.5);
    outline: none;
}

.uc-report-form select option {
    background: #0b0e16;
    color: #fff;
}

.uc-report-form textarea {
    min-height: 64px;
    resize: vertical;
}

.uc-report-form .uc-report-submit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    color: #fff;
    border: 1px solid rgba(255, 120, 120, 0.5);
    background: rgba(255, 100, 100, 0.22);
    cursor: pointer;
    transition: background 180ms ease;
    touch-action: manipulation;
}

.uc-report-form .uc-report-submit:hover {
    background: rgba(255, 100, 100, 0.34);
}

.uc-report-form .uc-report-submit[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* toast inside the card */
.uc-toast {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 10px);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 650;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(9, 10, 14, 0.92);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
    white-space: nowrap;
}

.uc-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 480px) {
    #user-card-root {
        align-items: flex-end;
        padding: 0;
    }

    .uc-card {
        width: 100vw;
        max-height: 86vh;
        border-radius: 24px 24px 0 0;
        animation-name: uc-in-mobile;
    }

    @keyframes uc-in-mobile {
        from { transform: translateY(40px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}
