:root {
    color-scheme: dark;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(143, 35, 255, 0.18),
            transparent 35rem
        ),
        radial-gradient(
            circle at 0% 40%,
            rgba(92, 32, 173, 0.11),
            transparent 32rem
        ),
        #07070c;

    color: #fff;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.friends-auth-pending
.friends-shell {
    visibility: hidden;
}

.friends-ready
.friends-shell {
    visibility: visible;
}

.friends-login-wall {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: grid;
    place-items: center;

    padding: 24px;

    background:
        rgba(5, 5, 9, 0.97);
}

.friends-login-card {
    width: min(520px, 100%);
    padding: 32px;

    border:
        1px solid
        rgba(194, 58, 255, 0.35);

    border-radius: 22px;

    background:
        linear-gradient(
            150deg,
            rgba(118, 31, 188, 0.19),
            #111018 55%
        );

    text-align: center;

    box-shadow:
        0 30px 100px
        rgba(0, 0, 0, 0.42);
}

.friends-login-card h1 {
    margin:
        8px 0
        10px;

    font-size:
        clamp(
            34px,
            8vw,
            54px
        );

    line-height: 1;
}

.friends-login-card p {
    margin:
        0 auto
        24px;

    max-width: 390px;

    color: #b7afc2;

    line-height: 1.6;
}

.friends-primary-link,
.friends-secondary-link {
    display: block;

    padding:
        13px
        16px;

    border-radius: 11px;

    text-decoration: none;

    font-weight: 950;
}

.friends-primary-link {
    margin-bottom: 9px;

    background:
        linear-gradient(
            135deg,
            #8128ff,
            #d43fff
        );

    color: #fff;
}

.friends-secondary-link {
    border:
        1px solid
        rgba(255, 255, 255, 0.11);

    background: #17141d;

    color: #fff;
}

.friends-shell {
    width:
        min(
            1120px,
            calc(100% - 32px)
        );

    margin:
        0 auto;

    padding:
        54px
        0
        80px;
}

.friends-header {
    margin-bottom: 28px;
}

.friends-back {
    display: inline-block;

    margin-bottom: 26px;

    color: #c37cff;

    text-decoration: none;

    font-size: 13px;

    font-weight: 950;

    letter-spacing: 0.1em;
}

.friends-kicker {
    margin-bottom: 7px;

    color: #d73aff;

    font-size: 11px;

    font-weight: 950;

    letter-spacing: 0.14em;
}

.friends-header h1 {
    margin:
        0
        0
        11px;

    font-size:
        clamp(
            48px,
            9vw,
            82px
        );

    line-height: 0.95;

    letter-spacing: -0.045em;
}

.friends-header p {
    max-width: 650px;

    margin: 0;

    color: #b7afc3;

    line-height: 1.7;
}

.friends-panel {
    margin-bottom: 18px;

    padding: 24px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 20px;

    background:
        rgba(17, 15, 24, 0.94);

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.17);
}

.friends-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}

.friends-section-head {
    display: flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap: 16px;

    margin-bottom: 20px;
}

.friends-section-head h2 {
    margin: 0;

    font-size: 25px;
}

.friends-count {
    display: inline-grid;
    place-items: center;

    min-width: 36px;
    height: 30px;

    padding:
        0
        10px;

    border:
        1px solid
        rgba(190, 61, 255, 0.32);

    border-radius: 999px;

    background:
        rgba(143, 42, 210, 0.13);

    color: #d59aff;

    font-size: 12px;

    font-weight: 950;
}

.friends-search-row {
    display: grid;

    grid-template-columns:
        1fr
        auto;

    gap: 10px;

    margin-bottom: 14px;
}

.friends-search-row input {
    min-width: 0;

    padding:
        14px
        16px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    outline: none;

    background: #111017;

    color: #fff;
}

.friends-search-row input:focus {
    border-color: #bd37ff;
}

.friends-search-row button {
    padding:
        13px
        18px;

    border: 0;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #8128ff,
            #d33fff
        );

    color: #fff;

    font-weight: 950;
}

.friends-list {
    display: grid;
    gap: 9px;
}

.friends-list-large {
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
}

.friend-row {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 13px;

    padding:
        14px;

    border:
        1px solid
        rgba(255, 255, 255, 0.075);

    border-radius: 13px;

    background: #0e0d13;
}

.friend-identity {
    min-width: 0;
}

.friend-name {
    display: block;

    overflow: hidden;

    color: #fff;

    font-weight: 900;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.friend-sub {
    display: block;

    margin-top: 3px;

    color: #797281;

    font-size: 11px;
}

.friend-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    justify-content: flex-end;
}

.friend-button {
    padding:
        9px
        11px;

    border: 0;

    border-radius: 9px;

    background: #902cff;

    color: #fff;

    font-size: 11px;

    font-weight: 950;
}

.friend-button.secondary {
    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    background: #211d27;
}

.friend-button.danger {
    background: #45151f;

    color: #ffacb9;
}

.friend-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.friends-empty {
    padding:
        13px
        0;

    color: #766f80;

    font-size: 14px;
}

.friends-status {
    min-height: 22px;

    margin-top: 13px;

    color: #bdb5c9;

    font-size: 13px;
}

.friends-status.error {
    color: #ff8da0;
}

.friends-status.success {
    color: #8cffba;
}

.friends-global-status {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 100;

    max-width: min(390px, calc(100% - 44px));

    padding:
        13px
        16px;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 12px;

    background:
        rgba(19, 16, 26, 0.97);

    color: #fff;

    box-shadow:
        0 18px 60px
        rgba(0, 0, 0, 0.32);

    opacity: 0;

    pointer-events: none;

    transform:
        translateY(10px);

    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.friends-global-status.show {
    opacity: 1;

    transform:
        translateY(0);
}

.friends-global-status.error {
    border-color:
        rgba(
            255,
            80,
            110,
            0.3
        );

    color: #ffb4c0;
}

.friends-global-status.success {
    border-color:
        rgba(
            74,
            255,
            150,
            0.25
        );

    color: #a0ffc5;
}

.friends-block-panel {
    opacity: 0.92;
}

@media (max-width: 760px) {

    .friends-shell {
        width:
            min(
                100% - 18px,
                1120px
            );

        padding-top: 28px;
    }

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

    .friends-panel {
        padding: 17px;
        border-radius: 16px;
    }

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

    .friend-row {
        align-items: flex-start;

        flex-direction: column;
    }

    .friend-actions {
        justify-content: flex-start;
    }
}