:root {
    --page-bg: radial-gradient(circle at top, #1f365c 0%, #08101c 52%, #04070d 100%);
    --text: #f2f5ff;
    --muted: #b8c3df;
    --card-color: #74d4ff;
    --card-opacity: 1;
    --chip-bg: rgba(255, 255, 255, 0.12);
    --chip-hover: rgba(255, 255, 255, 0.2);
    user-select: none;
}

* {
    box-sizing: border-box;
}

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

html {
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100dvh;
    color: var(--text);
    font-family: "Zalando Sans Expanded", sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(79, 180, 255, 0.2), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(5, 10, 18, 0.96), rgba(4, 8, 15, 1));
    overflow-x: hidden;
}

body.is-loading {
    overflow: hidden;
}

.page-shell {
    position: relative;
    min-height: 100dvh;
    padding: 1.5rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease;
}

body.is-ready .page-shell {
    opacity: 1;
    visibility: visible;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        linear-gradient(180deg, rgba(5, 10, 18, 0.96), rgba(4, 8, 15, 1)),
        radial-gradient(circle at 15% 20%, rgba(79, 180, 255, 0.2), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.08), transparent 24%);
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.is-ready .page-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader__panel {
    min-width: min(320px, 100%);
    padding: 1.25rem 1.4rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(7, 17, 29, 0.88);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    text-align: center;
    backdrop-filter: blur(12px);
}

.page-loader__spinner {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--card-color);
    animation: profile-loader-spin 0.9s linear infinite;
}

.page-loader__text {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.page-background-image,
.page-background-scrim {
    position: absolute;
    inset: 0;
}

.page-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-background-scrim {
    background:
        linear-gradient(180deg, rgba(5, 10, 18, 0.36), rgba(4, 8, 15, 0.82)),
        radial-gradient(circle at 15% 20%, rgba(79, 180, 255, 0.2), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.08), transparent 24%);
    pointer-events: none;
}

.ambient {
    position: fixed;
    inset: auto;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
}

.ambient-one {
    top: -8rem;
    left: -10rem;
    background: rgba(92, 173, 255, 0.35);
}

.ambient-two {
    right: -8rem;
    bottom: -10rem;
    background: rgba(90, 255, 212, 0.18);
}

.profile-stage {
    min-height: calc(100dvh - 3rem);
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
}

.user-card {
    width: min(440px, 100%);
    min-height: 610px;
    border-radius: 1.2rem;
    border: 2px solid color-mix(in srgb, var(--card-color), white 30%);
    background: rgba(7, 17, 29, var(--card-opacity));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    position: relative;
    padding: 1.6rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    isolation: isolate;
    backdrop-filter: blur(10px);
}

.profile-photo-wrap,
.username,
.bio,
.music-player,
.url-preview,
.platform-links,
.view-count {
    position: relative;
    z-index: 1;
}

.profile-photo-wrap {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 4px;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--card-color), rgba(255, 255, 255, 0.88));
}

.profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: rgba(11, 20, 32, 0.92);
}

.username {
    margin: 0.95rem 0 0;
    font-size: clamp(1.2rem, 2.8vw, 1.35rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-align: center;
    word-break: break-word;
}

.username-text {
    display: inline-block;
}

.premium-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--card-color), white 36%);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--card-color), rgba(255, 255, 255, 0.22) 22%), rgba(255, 255, 255, 0.08)),
        rgba(7, 17, 29, 0.72);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    cursor: help;
    outline: none;
}

.premium-badge[hidden] {
    display: none !important;
}

.premium-badge__logo {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
}

.premium-badge::before,
.premium-badge::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.premium-badge::before {
    content: "";
    bottom: calc(100% + 0.18rem);
    transform: translate(-50%, 0.3rem);
    border-width: 0.38rem 0.34rem 0;
    border-style: solid;
    border-color: rgba(9, 17, 28, 0.96) transparent transparent;
}

.premium-badge::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 0.55rem);
    transform: translate(-50%, 0.3rem);
    padding: 0.45rem 0.65rem;
    border-radius: 0.65rem;
    background: rgba(9, 17, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    font-size: 0.73rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.premium-badge:hover::before,
.premium-badge:hover::after,
.premium-badge:focus-visible::before,
.premium-badge:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.premium-badge:focus-visible {
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.22),
        0 0 0 2px color-mix(in srgb, var(--card-color), white 18%);
}

.bio {
    margin: 0.45rem 0 0;
    color: #d8def0;
    text-align: center;
    max-width: 290px;
}

.music-player {
    --music-progress: 0%;
    position: absolute;
    right: 1.1rem;
    bottom: 0.95rem;
    width: min(224px, calc(100% - 9rem));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.45rem;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(7, 17, 29, 0.9), rgba(7, 17, 29, 0.72)),
        radial-gradient(circle at top right, color-mix(in srgb, var(--card-color), white 10%) 0%, transparent 58%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(14px);
}

.music-audio {
    display: none;
}

.music-volume-control {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.music-volume-control::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 2.25rem;
    height: 0.85rem;
    transform: translateX(-50%);
}

.music-btn {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.music-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}

.music-btn:active {
    transform: translateY(0);
}

.music-btn:focus-visible,
.music-progress:focus-visible,
.music-volume:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--card-color), white 18%);
    outline-offset: 2px;
}

.music-btn--play {
    background: color-mix(in srgb, var(--card-color), rgba(255, 255, 255, 0.24) 18%);
    color: #04121c;
}

.music-btn--play:hover {
    background: color-mix(in srgb, var(--card-color), white 18%);
}

.music-btn-icon {
    width: 1rem;
    height: 1rem;
    display: block;
}

.icon-pause,
.icon-muted {
    display: none;
}

.music-btn--play.is-playing .icon-play,
.music-btn--mute.is-muted .icon-volume {
    display: none;
}

.music-btn--play.is-playing .icon-pause,
.music-btn--mute.is-muted .icon-muted {
    display: block;
}

.music-progress {
    width: 100%;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--card-color), white 8%) 0%,
            color-mix(in srgb, var(--card-color), white 8%) var(--music-progress),
            rgba(255, 255, 255, 0.18) var(--music-progress),
            rgba(255, 255, 255, 0.18) 100%);
    border-radius: 999px;
    height: 0.36rem;
    cursor: pointer;
}

.music-progress:disabled {
    cursor: default;
    opacity: 0.55;
}

.music-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 0.75rem;
    height: 0.75rem;
    border: 0;
    border-radius: 50%;
    background: #f7fbff;
    box-shadow: 0 0 0 2px rgba(4, 18, 28, 0.32);
}

.music-progress::-moz-range-thumb {
    width: 0.75rem;
    height: 0.75rem;
    border: 0;
    border-radius: 50%;
    background: #f7fbff;
    box-shadow: 0 0 0 2px rgba(4, 18, 28, 0.32);
}

.music-volume-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.35rem);
    width: 2.75rem;
    min-height: 7.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(7, 17, 29, 0.94);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2;
    transform: translateX(-50%) translateY(0.25rem);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.music-volume-control:hover .music-volume-popover,
.music-volume-control:focus-within .music-volume-popover,
.music-volume-control.is-open .music-volume-popover,
.music-volume-popover:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}

.music-volume-control.is-open .music-btn--mute {
    background: rgba(255, 255, 255, 0.18);
}

.music-volume {
    --music-volume: 25%;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 88px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--card-color), white 8%) 0%,
            color-mix(in srgb, var(--card-color), white 8%) var(--music-volume),
            rgba(255, 255, 255, 0.18) var(--music-volume),
            rgba(255, 255, 255, 0.18) 100%);
    border-radius: 999px;
    height: 0.32rem;
    cursor: pointer;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
}

.music-volume:disabled {
    cursor: default;
    opacity: 0.55;
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 0.68rem;
    height: 0.68rem;
    border: 0;
    border-radius: 50%;
    background: #f7fbff;
    box-shadow: 0 0 0 2px rgba(4, 18, 28, 0.32);
}

.music-volume::-moz-range-thumb {
    width: 0.68rem;
    height: 0.68rem;
    border: 0;
    border-radius: 50%;
    background: #f7fbff;
    box-shadow: 0 0 0 2px rgba(4, 18, 28, 0.32);
}

.url-preview {
    margin: 0.7rem 0 0;
    font-size: 0.85rem;
    color: #bed0f6;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
}

.platform-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: auto;
    margin-bottom: 4.25rem;
    padding-inline: 0.1rem;
}

.platform-link {
    width: 100%;
    max-width: 78px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background: var(--chip-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    text-decoration: none;
    justify-self: center;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.platform-link:hover {
    transform: translateY(-3px);
    background: var(--chip-hover);
    border-color: color-mix(in srgb, var(--card-color), white 25%);
}

.platform-link:active {
    transform: translateY(0);
}

.platform-link img {
    width: 28px;
    height: 28px;
}

.view-count {
    position: absolute;
    left: 1.25rem;
    bottom: 1.1rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

@media (max-width: 560px) {
    .page-shell {
        padding: 0.85rem;
    }

    .page-loader__panel {
        width: 100%;
    }

    .profile-stage {
        min-height: calc(100dvh - 1.7rem);
    }

    .user-card {
        min-height: 520px;
        padding: 1.2rem 1rem;
    }

    .platform-link {
        max-width: 64px;
    }

    .platform-link img {
        width: 24px;
        height: 24px;
    }

    .music-player {
        right: 0.9rem;
        bottom: 0.8rem;
        width: min(198px, calc(100% - 7.4rem));
        padding: 0.35rem 0.4rem;
    }

    .music-btn {
        width: 1.8rem;
        height: 1.8rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .music-volume-control::after {
        display: none;
    }

    .music-volume-popover {
        bottom: calc(100% + 0.3rem);
        width: 2.4rem;
        min-height: 6.2rem;
        padding: 0.55rem 0.35rem;
    }

    .music-volume {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }
}
