/* ========== Reset & Base ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #e4e4e7;
    background: #0a0a0f;
}

/* ========== Sound Overlay ========== */
.sound-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 40px;
    cursor: pointer;
}

.sound-overlay.visible {
    display: flex;
    animation: fadeIn 0.5s ease both;
}

.sound-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #d4d4d8;
    font-size: 0.85rem;
    font-weight: 500;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 16px rgba(109, 40, 217, 0.2); }
    50%      { box-shadow: 0 0 28px rgba(109, 40, 217, 0.45); }
}

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

/* ========== Animated Background ========== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
    animation: float 12s ease-in-out infinite;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #6d28d9, transparent 70%);
    top: -10%;
    left: -5%;
    animation-duration: 14s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #0ea5e9, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-duration: 18s;
    animation-delay: -4s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ec4899, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 20s;
    animation-delay: -8s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(40px, -30px) scale(1.05); }
    50%      { transform: translate(-20px, 20px) scale(0.95); }
    75%      { transform: translate(30px, 40px) scale(1.02); }
}

/* ========== Page Wrapper ========== */
.page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

/* ========== Glass Card ========== */
.glass-card {
    width: 100%;
    max-width: 680px;
    padding: 36px 40px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: cardEntrance 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ========== GIF Hero ========== */
.gif-hero {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 16px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.gif-hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== 404 Heading ========== */
.error-code {
    font-size: clamp(56px, 12vw, 96px);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #a78bfa, #6d28d9, #ec4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    cursor: default;
    user-select: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ========== Content ========== */
.content-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f4f4f5;
    margin-bottom: 6px;
}

.content-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.content-box .sub {
    font-size: 0.82rem;
    color: #71717a;
    margin-bottom: 24px;
}

/* ========== Button ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.btn-leave {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35);
}

.btn-leave:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(109, 40, 217, 0.5);
}

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

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .glass-card {
        padding: 24px 16px 24px;
        border-radius: 20px;
    }

    .gif-hero {
        border-radius: 14px;
    }

    .content-box h2 {
        font-size: 1.15rem;
    }
}

/* ========== Prank Popup ========== */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-card {
    padding: 40px 48px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    position: relative;
}

.popup-overlay.visible .popup-card {
    transform: scale(1);
}

.popup-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f4f4f5;
    margin: 0;
}

.popup-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #6d28d9, #ec4899);
    transform-origin: left;
    animation: none;
}

.popup-overlay.visible .popup-timer {
    animation: countdown 5s linear forwards;
}

@keyframes countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}