* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #d0e7ff;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
}

body {
    animation: body-fade 0.4s ease-out both;
}

.stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bg-video {
    width: min(600px, 85vw);
    max-height: 70vh;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    animation: video-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s forwards;
}

.powered-by {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    animation: slide-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s forwards;
}

.powered-by .logo {
    height: 45px;
    width: auto;
}

.top-actions {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    animation: slide-down 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s forwards;
}

.discord-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    background: #5865F2;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.discord-btn:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.45);
}

.x-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 1.1rem;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 44px;
}

.x-btn span {
    color: #ffffffc2;
}

.x-btn:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.x-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.discord-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.discord-label {
    position: relative;
    z-index: 2;
}

.fireflies {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

.firefly {
    position: absolute;
    bottom: -4px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    animation: firefly-rise linear infinite;
}

.firefly:nth-child(1)  { left:  8%; animation-duration: 3.2s; animation-delay:  0.0s; }
.firefly:nth-child(2)  { left: 18%; animation-duration: 4.1s; animation-delay: -1.2s; }
.firefly:nth-child(3)  { left: 28%; animation-duration: 3.6s; animation-delay: -2.4s; }
.firefly:nth-child(4)  { left: 38%; animation-duration: 4.5s; animation-delay: -0.7s; }
.firefly:nth-child(5)  { left: 48%; animation-duration: 3.0s; animation-delay: -1.8s; }
.firefly:nth-child(6)  { left: 58%; animation-duration: 3.8s; animation-delay: -2.9s; }
.firefly:nth-child(7)  { left: 68%; animation-duration: 4.3s; animation-delay: -0.4s; }
.firefly:nth-child(8)  { left: 78%; animation-duration: 3.4s; animation-delay: -1.5s; }
.firefly:nth-child(9)  { left: 88%; animation-duration: 4.0s; animation-delay: -2.2s; }
.firefly:nth-child(10) { left: 95%; animation-duration: 3.7s; animation-delay: -0.9s; }

@keyframes firefly-rise {
    0%   { transform: translate(0, 0);    opacity: 0; }
    15%  { opacity: 1; }
    50%  { transform: translate(3px, -28px); }
    85%  { opacity: 1; }
    100% { transform: translate(-3px, -56px); opacity: 0; }
}

@keyframes slide-down {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes slide-up {
    0%   { opacity: 0; transform: translateX(-50%) translateY(20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes video-in {
    0%   { opacity: 0; transform: scale(0.94); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1);    filter: blur(0); }
}

@keyframes body-fade {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .top-actions {
        top: 1rem;
        gap: 0.5rem;
        width: max-content;
        max-width: calc(100vw - 2rem);
    }

    .discord-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
        gap: 0.45rem;
    }

    .discord-icon {
        width: 18px;
        height: 18px;
    }

    .x-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.7rem;
    }

    .x-icon {
        width: 14px;
        height: 14px;
    }

    .powered-by {
        bottom: 1rem;
        font-size: 11px;
    }

    .powered-by .logo {
        height: 32px;
    }
}

@media (max-width: 480px) {
    .top-actions {
        gap: 0.4rem;
    }

    .discord-btn {
        padding: 0.55rem 0.8rem;
        font-size: 0.72rem;
        gap: 0.4rem;
    }

    .discord-icon {
        width: 16px;
        height: 16px;
    }

    .x-btn {
        padding: 0.55rem 0.7rem;
        gap: 0.3rem;
    }

    .x-icon {
        width: 13px;
        height: 13px;
    }

    .x-label {
        font-size: 0.65rem;
    }

    .bg-video {
        width: 92vw;
        max-height: 60vh;
    }

    .powered-by .logo {
        height: 26px;
    }

    .powered-by {
        font-size: 10px;
    }
}

@media (max-height: 600px) {
    .bg-video {
        max-height: 55vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .firefly,
    body,
    .top-actions,
    .bg-video,
    .powered-by {
        animation: none;
    }
    .top-actions,
    .bg-video,
    .powered-by {
        opacity: 1;
    }
    .discord-btn,
    .x-btn {
        transition: none;
    }
}
