*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --links-gap-top: 40px;
    --width: 580px;
    --links-scrollbar-track: #543831;
    --links-scrollbar-thumb: #aa9c98;
}

@media (max-width: 580px) {
    :root {
        --width: 100%;
    }

    .links-wrap {
        margin: 0;
    }
}

html {
    scroll-behavior: smooth;
}

html {
    scrollbar-color: var(--links-scrollbar-thumb) var(--links-scrollbar-track);
}

.links-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    background-color: #2a221c;
    overflow-x: hidden;
}

.links-page--default {
    background-color: #3d342e;
}

.links-page-bg {
    position: fixed;
    inset: -20px;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(28px) brightness(0.45) saturate(1.1);
    transform: scale(1.08);
    pointer-events: none;
}

.links-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-height: 100dvh;
    padding: max(var(--links-gap-top), env(safe-area-inset-top)) 0 0;
    box-sizing: border-box;
}

.links-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: var(--width);
    min-height: calc(100dvh - max(var(--links-gap-top), env(safe-area-inset-top)));
    margin: 0 auto;
    background-color: #3d342e;
    border-radius: 24px 24px 0 0;
}

.links-wrap--has-bg {
    background-color: transparent;
}

.links-wrap__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.links-wrap__bg-img {
    display: block;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center top;
}

.links-wrap__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 100%);
}

.links-wrap__inner {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: calc(100dvh - max(var(--links-gap-top), env(safe-area-inset-top)));
    padding: 12px 28px max(32px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.links-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin-bottom: 40px;
    flex-shrink: 0;
}

.links-top__spacer {
    width: 44px;
    height: 44px;
}

.links-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.links-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.links-share-btn__icon {
    display: block;
    pointer-events: none;
}

.links-share-btn:hover,
.links-share-btn:focus-visible,
.links-home:hover,
.links-home:focus-visible {
    background: rgba(0, 0, 0, 0.42);
    outline: none;
}

.links-share-btn:active,
.links-home:active {
    transform: scale(0.94);
    opacity: 0.9;
}

.links-profile {
    text-align: center;
    margin-bottom: 30px;
}

.links-logo {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
}

.links-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #f5fafd;
}

.links-subtitle {
    margin: 0 auto;
    max-width: 500px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #f5fafd;
    white-space: pre-line;
    font-family: 'Inter', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}

.links-page--default .links-title,
.links-page--default .links-subtitle {
    color: #fff;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
    width: 100%;
}

.links-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 64px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.15s ease;
}

.links-card:hover,
.links-card:focus-visible {
    background: rgba(255, 255, 255, 0.28);
}

.links-card__thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    position: absolute;
    left: 7px;
}

.links-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.links-card__title {
    flex: 1;
    text-align: center;
}

.links-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.links-social__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 8px;
    transition: transform 0.15s ease;
}

.links-social__item:hover {
    transform: scale(1.07);
}

.links-social__item img {
    width: 32px;
    height: 32px;
    display: block;
    filter: brightness(0) invert(1);
}

@media (max-width: 580px) {
    :root {
        --links-gap-top: 0;
    }

    .links-wrap {
        border-radius: 0;
    }

    .links-card {
        font-size: 14px;
    }
}