@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap');

html {
    height: 100%;
    color-scheme: dark;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: white;
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* VIDEO */
#bgVideo {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -2;
    filter: blur(14px) brightness(0.48) saturate(1.2) contrast(1.08);
}

/* overlay — tinted wash so the background feels more vivid */
body::after {
    content: "";
    position: fixed;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(180, 120, 220, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 100% 60% at 100% 100%, rgba(255, 100, 160, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 0% 90%, rgba(100, 200, 220, 0.12) 0%, transparent 45%),
        linear-gradient(175deg, rgba(18, 12, 28, 0.72) 0%, rgba(14, 10, 22, 0.78) 100%);
    z-index: -1;
}

/* enter */
#enter {
    position: fixed;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(15px);
    background:
        radial-gradient(ellipse 90% 70% at 50% 30%, rgba(200, 140, 255, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 80% 90%, rgba(255, 120, 180, 0.18) 0%, transparent 50%),
        rgba(12, 8, 20, 0.72);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: 0.6s;
}

.enter-text {
    font-size: 27px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #ffb8e8;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .enter-text {
        background: linear-gradient(115deg, #ffb8e8 0%, #e8c8ff 40%, #b8e8ff 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        filter: drop-shadow(0 2px 12px rgba(200, 120, 255, 0.25));
    }
}

/* main */
#main {
    display: none;
    box-sizing: border-box;
    min-height: 100dvh;
    min-height: 100vh;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    justify-content: center;
    align-items: center;
    align-content: center;
}

/* card */
.card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: clamp(22px, 5vw, 35px);
    border-radius: 25px;
    background:
        linear-gradient(145deg, rgba(255, 185, 225, 0.14) 0%, rgba(200, 175, 255, 0.1) 42%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 170, 210, 0.28);
    backdrop-filter: blur(25px);
    box-shadow:
        0 12px 40px rgba(90, 40, 100, 0.22),
        0 0 0 1px rgba(255, 200, 235, 0.06) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    text-align: center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.card h1 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    line-height: 1.2;
    margin: 0.4em 0 0.5em;
    font-weight: 600;
    background: linear-gradient(120deg, #ffc8ea 0%, #dcc4ff 42%, #b8e8ff 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@supports not (background-clip: text) {
    .card h1 {
        color: #ffd0ea;
    }
}

/* avatar */
.avatar {
    width: 115px;
    border-radius: 50%;
    animation: float 3s infinite;
    box-shadow:
        0 0 0 3px rgba(255, 170, 210, 0.45),
        0 0 28px rgba(200, 130, 220, 0.35),
        0 8px 24px rgba(80, 40, 90, 0.35);
}

@keyframes float {
    50% { transform: translateY(-10px); }
}

.desc {
    color: #d8cce8;
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
    line-height: 1.55;
}

.desc em {
    font-style: italic;
    color: #f0c8ec;
}

.extra span {
    position: relative;
    z-index: 0;
    display: inline-block;
    margin: 4px;
    padding: 6px 12px;
    border-radius: 15px;
    background: linear-gradient(
        145deg,
        rgba(230, 210, 255, 0.14) 0%,
        rgba(255, 165, 215, 0.12) 100%
    );
    border: 1px solid rgba(220, 195, 250, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: tagPop 0.55s ease forwards;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        color 0.3s ease;
}

/* Glow pulse lives on ::after so hover never replaces tagPop (which was restarting → chips vanished). */
.extra span::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
    .extra span:hover {
        background: linear-gradient(
            145deg,
            rgba(215, 185, 255, 0.42) 0%,
            rgba(255, 175, 225, 0.34) 55%,
            rgba(200, 230, 255, 0.18) 100%
        );
        border-color: rgba(235, 210, 255, 0.72);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.22),
            inset 0 -1px 0 rgba(140, 100, 200, 0.12);
        color: #fffafc;
        transform: translateY(-3px) scale(1.04);
        cursor: default;
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
    .extra span:hover {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 0 1px rgba(230, 205, 255, 0.35),
            0 0 22px rgba(200, 165, 255, 0.38),
            0 6px 18px rgba(255, 150, 210, 0.15);
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .extra span:hover::after {
        opacity: 1;
        animation: tagHoverGlow 1.35s ease-in-out infinite;
    }
}

@keyframes tagHoverGlow {
    0%, 100% {
        box-shadow:
            0 0 14px rgba(200, 168, 255, 0.42),
            0 0 28px rgba(255, 155, 215, 0.28),
            0 0 36px rgba(170, 210, 255, 0.16),
            0 4px 12px rgba(120, 90, 180, 0.12);
    }
    50% {
        box-shadow:
            0 0 24px rgba(215, 185, 255, 0.58),
            0 0 40px rgba(255, 175, 225, 0.38),
            0 0 48px rgba(160, 205, 255, 0.22),
            0 6px 18px rgba(130, 95, 200, 0.14);
    }
}

.extra span:nth-child(1) { animation-delay: 0.06s; }
.extra span:nth-child(2) { animation-delay: 0.12s; }
.extra span:nth-child(3) { animation-delay: 0.18s; }
.extra span:nth-child(4) { animation-delay: 0.24s; }
.extra span:nth-child(5) { animation-delay: 0.30s; }

@keyframes tagPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* discord */
.status {
    margin-top: 15px;
}

#discordStatus {
    width: 100%;
}

.discord-card {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(
        155deg,
        rgba(45, 32, 68, 0.82) 0%,
        rgba(28, 22, 48, 0.88) 100%
    );
    border: 1px solid rgba(200, 165, 255, 0.22);
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 28px rgba(60, 30, 80, 0.35),
        0 0 0 1px rgba(255, 180, 230, 0.08) inset;
    text-align: left;
}

.discord-card-animate {
    animation: discordPop 0.55s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

@keyframes discordPop {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.discord-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.discord-card-main {
    flex: 1;
    min-width: 0;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: avatarGlow 3s ease-in-out infinite;
}

@keyframes avatarGlow {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(210, 170, 255, 0.25),
            0 0 0 0 rgba(255, 160, 210, 0.2);
    }
    50% {
        box-shadow:
            0 0 12px 2px rgba(200, 160, 255, 0.35),
            0 0 18px 3px rgba(255, 150, 200, 0.22);
    }
}

.discord-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.discord-name {
    font-weight: 600;
    color: #f0e4ff;
}

.discord-status-line {
    opacity: 0.85;
    font-size: 0.92em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.discord-activity-stack {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.discord-activity-row {
    animation: activityRowIn 0.48s ease backwards;
}

.discord-activity-row:nth-child(1) { animation-delay: 0.06s; }
.discord-activity-row:nth-child(2) { animation-delay: 0.14s; }

@keyframes activityRowIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.discord-activity-row--custom {
    font-size: 0.9rem;
    color: #ddd6f0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(180, 140, 255, 0.1);
    border: 1px solid rgba(220, 190, 255, 0.18);
}

.discord-activity-custom-inner {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.discord-custom-text {
    word-break: break-word;
}

.discord-inline-emoji {
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.2em;
    object-fit: contain;
}

.discord-activity-row--rich {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 140, 200, 0.08);
    border: 1px solid rgba(255, 190, 230, 0.15);
}

.activity-asset-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    position: relative;
}

.activity-asset-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.activity-asset-img.is-hidden {
    display: none !important;
}

.activity-asset-fallback {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.activity-asset-fallback.is-visible {
    display: flex;
}

.activity-text {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.25;
    color: #eee8ff;
}

.activity-detail {
    margin-top: 3px;
    font-size: 0.8rem;
    color: #c8b8dc;
    line-height: 1.3;
    word-break: break-word;
}

/* pulsing */
.status-dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* spotify */
.spotify-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: linear-gradient(
        120deg,
        rgba(30, 200, 120, 0.14) 0%,
        rgba(255, 255, 255, 0.06) 100%
    );
    border: 1px solid rgba(60, 220, 140, 0.35);
}

.spotify-box-animate {
    animation: spotifyEnter 0.55s ease backwards 0.12s,
               spotifyPulse 5s ease-in-out infinite 0.7s;
}

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

@keyframes spotifyPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(30,215,96,0);
        border-color: rgba(30,215,96,0.18);
    }
    50% {
        box-shadow: 0 0 18px 0 rgba(30,215,96,0.12);
        border-color: rgba(30,215,96,0.35);
    }
}

.spotify-cover {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    flex-shrink: 0;
    animation: coverNudge 4s ease-in-out infinite;
}

@keyframes coverNudge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.spotify-meta {
    min-width: 0;
}

.spotify-track {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    word-break: break-word;
}

.spotify-artist {
    margin-top: 3px;
    opacity: 0.72;
    font-size: 0.8rem;
}

/* button */
.add-btn {
    margin-top: 15px;
    min-height: 44px;
    padding: 12px 14px;
    box-sizing: border-box;
    border-radius: 15px;
    border: 1px solid rgba(255, 170, 210, 0.35);
    background: linear-gradient(
        165deg,
        rgba(255, 140, 200, 0.22) 0%,
        rgba(170, 140, 255, 0.18) 100%
    );
    color: #fff5fb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 18px rgba(120, 60, 120, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .add-btn:hover {
        filter: brightness(1.08);
        box-shadow:
            0 6px 24px rgba(180, 100, 180, 0.35),
            0 0 20px rgba(255, 160, 210, 0.2);
    }
}

.add-btn:active {
    transform: scale(0.98);
}