:root {
    --bg: #040508;
    --card-bg: rgba(12, 14, 20, 0.78);
    --card-border: rgba(255, 255, 255, 0.1);
    --item-bg: rgba(255, 255, 255, 0.038);
    --item-hover: rgba(255, 255, 255, 0.08);
    --text: #f3f4f6;
    --text-muted: #8b949e;
    --accent-purple: #c084fc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 36px;
    overflow-x: hidden;
    position: relative;
    letter-spacing: -0.01em;
}

.ambient-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow::before,
.ambient-glow::after {
    content: '';
    position: absolute;
    width: min(550px, 90vw);
    height: min(550px, 90vw);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.22;
    animation: drift 18s infinite alternate ease-in-out;
}

.ambient-glow::before {
    background: radial-gradient(circle, #7c3aed, transparent 70%);
    top: 5%;
    left: 10%;
}

.ambient-glow::after {
    background: radial-gradient(circle, #0284c7, transparent 70%);
    bottom: 5%;
    right: 10%;
    animation-duration: 22s;
    animation-direction: alternate-reverse;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.1); }
    100% { transform: translate(-30px, 50px) scale(0.95); }
}

#stars-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.card-wrap {
    position: relative;
    width: 100%;
}

.bio-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--card-border);
    border-radius: clamp(24px, 6vw, 30px);
    padding: clamp(50px, 12vw, 58px) clamp(16px, 5vw, 24px) clamp(20px, 5vw, 26px);
    position: relative;
    overflow: hidden !important;
    box-shadow: 
        0 30px 70px -15px rgba(0, 0, 0, 0.85),
        0 0 50px -10px rgba(192, 132, 252, 0.15);
}

.flag-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #FF3B30 0%, #FF3B30 16.6%, 
        #FF9500 16.6%, #FF9500 33.3%, 
        #FFCC00 33.3%, #FFCC00 50%, 
        #34C759 50%, #34C759 66.6%, 
        #007AFF 66.6%, #007AFF 83.3%, 
        #AF52DE 83.3%, #AF52DE 100%
    );
    box-shadow: 0 0 12px rgba(255, 149, 0, 0.6);
    z-index: 2;
}

.flag-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #D94B8A 0%, #D94B8A 14.3%,
        #E896BE 14.3%, #E896BE 28.6%,
        #FFFFFF 28.6%, #FFFFFF 42.9%,
        #38B6E8 42.9%, #38B6E8 57.2%,
        #FFFFFF 57.2%, #FFFFFF 71.5%,
        #E896BE 71.5%, #E896BE 85.8%,
        #D94B8A 85.8%, #D94B8A 100%
    );
    box-shadow: 0 0 12px rgba(217, 75, 138, 0.6);
    z-index: 2;
}

.avatar-container {
    position: absolute;
    top: clamp(-40px, -9vw, -46px);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(76px, 18vw, 88px);
    height: clamp(76px, 18vw, 88px);
    z-index: 10;
}

.avatar-glow {
    position: absolute;
    inset: -4px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.65), rgba(56, 182, 232, 0.45));
    filter: blur(12px);
    opacity: 0.7;
    z-index: 0;
}

.avatar-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    background: #111319;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.profile-info, .links-list {
    position: relative;
    z-index: 2;
}

.profile-info {
    text-align: center;
    margin-bottom: clamp(18px, 4vw, 22px);
}

.nickname {
    font-family: 'Syne', sans-serif;
    font-size: clamp(20px, 5.4vw, 24px);
    font-weight: 800;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #d8b4fe;
    text-shadow: 
        0 0 12px rgba(192, 132, 252, 0.45),
        0 0 24px rgba(168, 85, 247, 0.25);
    word-break: break-word;
}

.mini-flag {
    width: 20px;
    height: 13px;
    border-radius: 3.5px;
    overflow: hidden;
    display: inline-flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    vertical-align: middle;
    flex-shrink: 0;
}

.mini-flag span {
    flex: 1;
    width: 100%;
}

.bio-subtitle {
    font-size: clamp(12px, 3vw, 13px);
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dot-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    display: inline-block;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.link-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--item-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: clamp(11px, 3vw, 13px) clamp(13px, 3.5vw, 16px);
    border-radius: 15px;
    text-decoration: none;
    color: var(--text);
    font-size: clamp(13.5px, 3.4vw, 14.5px);
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.22s ease;
}

.link-pill-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.link-pill-left span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.pill-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pill-arrow {
    color: rgba(255, 255, 255, 0.25);
    transition: transform 0.22s ease, color 0.22s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pill-arrow svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2.2;
    display: block;
}

.link-pill:hover {
    background: var(--item-hover);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.link-pill:hover .pill-icon {
    background: rgba(192, 132, 252, 0.15);
    color: var(--accent-purple);
}

.link-pill:hover .pill-arrow {
    color: #fff;
    transform: translateX(3px);
}

.channel-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: clamp(16px, 4vw, 20px);
    padding: clamp(10px, 2.5vw, 12px) clamp(13px, 3.5vw, 16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    gap: 12px;
}

.channel-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.channel-avatar {
    width: clamp(38px, 9vw, 42px);
    height: clamp(38px, 9vw, 42px);
    border-radius: 11px;
    object-fit: cover;
    background: #141720;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: block;
    flex-shrink: 0;
}

.channel-name {
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.channel-subs {
    font-size: clamp(11.5px, 2.8vw, 12px);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    white-space: nowrap;
}

.online-point {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    flex-shrink: 0;
}

.join-btn {
    background: #0088cc;
    color: #fff;
    text-decoration: none;
    padding: clamp(6px, 1.8vw, 7px) clamp(14px, 3.8vw, 18px);
    border-radius: 999px;
    font-size: clamp(12px, 3vw, 13px);
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.4);
    flex-shrink: 0;
}

.join-btn:hover {
    background: #0099e6;
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.6);
}

@media (max-width: 480px) {
    body {
        padding: 48px 12px 28px;
    }
    .link-pill:hover {
        transform: none;
    }
}