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

:root {
    --red-primary: #dc2626;
    --red-dark: #991b1b;
    --red-light: #ef4444;
    --gold: #fbbf24;
    --gold-light: #fde68a;
    --navy: #1e3a5f;
    --white: #ffffff;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #2d4a6f 0%, #1e3a5f 100%);
    overflow: hidden;
    position: relative;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    z-index: 1;
}

.button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Floating Text */
.floating-text-container {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 100;
    margin-bottom: 100px;
}

.floating-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--gold);
    white-space: nowrap;
    animation: floatUp 0.5s ease-out forwards;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.5);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.1);
    }
    30% {
        transform: translateX(-50%) translateY(-5px) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(0.8);
    }
}

/* Main Button */
.genius-button {
    position: relative;
    width: 200px;
    height: 200px;
    padding: 1rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.1em;
    color: var(--white);
    background: linear-gradient(145deg, var(--red-light), var(--red-primary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 10px 40px rgba(220, 38, 38, 0.5),
        0 0 0 4px rgba(251, 191, 36, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.genius-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(220, 38, 38, 0.6),
        0 0 0 6px rgba(251, 191, 36, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.genius-button:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
        0 5px 20px rgba(220, 38, 38, 0.4),
        0 0 0 3px rgba(251, 191, 36, 0.4);
}

.genius-button {
    touch-action: manipulation;
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.genius-button:hover .btn-shine {
    left: 100%;
}

/* Counter */
.counter-container {
    position: fixed;
    bottom: 2rem;
    text-align: center;
    z-index: 1;
}

.counter-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.counter-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    transition: transform 0.2s ease, color 0.2s ease;
}

.counter-number.bump {
    transform: scale(1.3);
    color: var(--gold-light);
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    pointer-events: none; /* Allow clicks through overlay */
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    position: relative;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    padding: 4rem 5rem;
    border-radius: 2rem;
    text-align: center;
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 3px solid var(--gold);
    box-shadow: 
        0 0 60px rgba(251, 191, 36, 0.3),
        0 0 100px rgba(220, 38, 38, 0.2),
        inset 0 0 60px rgba(251, 191, 36, 0.05);
    overflow: hidden;
}

.popup-overlay.active .popup-content {
    transform: scale(1) rotate(0);
    opacity: 1;
}

.popup-overlay.closing .popup-content {
    transform: scale(0) rotate(10deg);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.popup-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    color: var(--white);
    text-shadow: 
        0 0 20px var(--gold),
        0 0 40px var(--gold),
        0 0 60px var(--red-primary);
    animation: titleGlow 1.5s ease-in-out infinite alternate;
    margin-bottom: 2rem;
}

@keyframes titleGlow {
    from {
        text-shadow: 
            0 0 20px var(--gold),
            0 0 40px var(--gold),
            0 0 60px var(--red-primary);
        transform: scale(1);
    }
    to {
        text-shadow: 
            0 0 30px var(--gold-light),
            0 0 60px var(--gold),
            0 0 80px var(--red-light);
        transform: scale(1.02);
    }
}


/* Stars Animation */
.stars-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
    overflow: visible;
    z-index: 10;
}

.star {
    position: absolute;
    font-size: 2rem;
    animation: starBurst 1s ease-out forwards;
}

@keyframes starBurst {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Firework burst effect */
.fireworks {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

.firework-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: fireworkBurst 0.8s ease-out forwards;
}

@keyframes fireworkBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--fx), var(--fy)) scale(0);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .genius-button {
        width: 150px;
        height: 150px;
        font-size: 1.8rem;
    }

    .popup-content {
        padding: 2.5rem 2rem;
        margin: 1rem;
    }

    .popup-title {
        font-size: 2.5rem;
    }

    .counter-number {
        font-size: 3rem;
    }
}
