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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff;
}

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}

#bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url('https://images.unsplash.com/photo-1534430480872-3498386e7856?w=1920&q=80&fit=crop') center/cover no-repeat;
    filter: grayscale(100%) brightness(0.28);
}

#overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.14), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.1), transparent 40%),
                rgba(0, 0, 0, 0.45);
}

.hidden {
    display: none !important;
}

.card {
    width: 100%;
    max-width: 760px;
    background: rgba(18, 18, 24, 0.72);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 28px;
    padding: 36px;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.7s ease both;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.top {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 22px;
}

.avatar-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.avatar-lg {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.avatar-lg:hover {
    transform: scale(1.03);
}

.status-dot {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #94a3b8;
    border: 4px solid rgba(18, 18, 24, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 12px currentColor; }
    50% { box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 22px currentColor; }
}

.name-block h1 {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.6px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #ffffff 0%, #c7c7d1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.diamond {
    width: 18px;
    height: 18px;
    fill: #60a5fa;
    transform: translateY(1px);
    filter: drop-shadow(0 0 6px rgba(96,165,250,0.5));
}

.title {
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.joined {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
}

/* Rich Presence */
.presence {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 2px;
}

.presence-art {
    position: relative;
    flex-shrink: 0;
    width: 86px;
    height: 86px;
}

.presence-art img:first-child {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.presence-small {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(18, 18, 24, 0.9);
    object-fit: cover;
    background: #18181f;
}

.presence-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.presence-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
}

.presence-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.presence-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.presence-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* Spotify */
.spotify {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(30, 215, 96, 0.08);
    border: 1px solid rgba(30, 215, 96, 0.18);
    margin-top: 2px;
}

.spotify-art {
    flex-shrink: 0;
    width: 86px;
    height: 86px;
}

.spotify-art img {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.spotify-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.spotify-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #1ed760;
    text-transform: uppercase;
}

.spotify-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.spotify-bar > div {
    height: 100%;
    width: 0%;
    background: #1ed760;
    border-radius: 2px;
    transition: width 0.05s linear;
    will-change: width;
}

.spotify-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

.server-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-left: 32px;
    border-left: 1px solid rgba(255, 255, 255, 0.09);
    min-width: 230px;
    text-align: center;
}

.server-logo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.server-logo:hover {
    transform: scale(1.04);
}

.server-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.server-stat {
    display: grid;
    grid-template-columns: 12px 1fr;
    align-items: center;
    gap: 12px;
}

.stat-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.server-stat .count {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    line-height: 1;
}

.server-stat.online .count {
    color: #34d399;
    text-shadow: 0 0 18px rgba(52, 211, 153, 0.28);
}

.server-stat.offline .count {
    color: #94a3b8;
    text-shadow: 0 0 18px rgba(148, 163, 184, 0.22);
}

.server-stat .label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.45);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite;
}

.online-dot {
    background: #34d399;
    color: #34d399;
}

.offline-dot {
    background: #94a3b8;
    color: #94a3b8;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.join-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(168,85,247,0.2));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    transition: 0.2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.join-btn:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(168,85,247,0.3));
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.bottom {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.socials {
    display: flex;
    gap: 14px;
}

.social {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.85);
    transition: 0.2s ease;
    text-decoration: none;
}

.social:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.social svg {
    width: 22px;
    height: 22px;
}

.meta {
    display: flex;
    gap: 22px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 700;
}

.meta > span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 680px) {
    .card {
        padding: 26px;
    }

    .top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
    }

    .name-block h1 {
        justify-content: center;
    }

    .presence,
    .spotify {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .presence-info,
    .spotify-info {
        align-items: center;
    }

    .server-col {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.09);
        padding: 28px 0 0;
        width: 100%;
    }

    .bottom {
        flex-direction: column;
        align-items: center;
    }
}
