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

body {
    background-color: #171616;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 60px 40px;
    overflow-x: hidden;
}

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

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) translateX(var(--drift, 50px)) rotate(360deg);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(calc(var(--drift, 50px) * -1)) rotate(720deg);
        opacity: 0;
    }
}

.container {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header: Logo centered, intro below */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 60px;
}

.logo {
    height: 80px;
    width: auto;
}

.intro-container {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    min-height: 2em;
}

#intro-text {
    white-space: pre-wrap;
}

/* Main content: joke and giphy centered */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
}

.joke-container {
    font-size: 1rem;
    text-align: center;
    line-height: 1.6;
    min-height: 80px;
    opacity: 0.7;
}

#typewriter {
    white-space: pre-wrap;
}

.cursor {
    animation: blink 1s step-end infinite;
    font-weight: 100;
}

.cursor.hidden {
    display: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.giphy-container {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.giphy-container img {
    max-width: 400px;
    max-height: 300px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.giphy-container img.visible {
    opacity: 1;
}

/* Copyright - fixed bottom left */
.copyright {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 0.75rem;
    opacity: 0.4;
    color: #ffffff;
}

/* Giphy attribution - fixed bottom right */
.giphy-attribution {
    position: fixed;
    bottom: 20px;
    right: 20px;
    height: 24px;
    width: auto;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.giphy-attribution:hover {
    opacity: 0.8;
}

/* Macho Man Randy Savage overlay */
.macho-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.macho-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.macho-text {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: #ffcc00;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10001;
}

.macho-overlay img#macho-gif {
    width: auto;
    height: auto;
    min-width: 80%;
    min-height: 80%;
    max-width: 100%;
    max-height: 95%;
    object-fit: contain;
}

/* Like and Subscribe guy */
.like-subscribe-guy {
    position: fixed;
    height: 350px;
    width: auto;
    z-index: 500;
    bottom: -400px;
    left: -400px;
    right: auto;
    transition: bottom 0.5s ease-out, left 0.5s ease-out, right 0.5s ease-out, transform 0.5s ease-out;
}

.like-subscribe-guy.from-bottom {
    bottom: -400px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(0deg);
}

.like-subscribe-guy.from-bottom.visible {
    bottom: var(--pop-amount, -50px);
}

.like-subscribe-guy.from-left {
    left: -400px;
    right: auto;
    bottom: 50%;
    transform: translateY(50%) rotate(90deg);
}

.like-subscribe-guy.from-left.visible {
    left: var(--pop-amount, -50px);
}

.like-subscribe-guy.from-right {
    right: -400px;
    left: auto;
    bottom: 50%;
    transform: translateY(50%) rotate(-90deg);
}

.like-subscribe-guy.from-right.visible {
    right: var(--pop-amount, -50px);
}

/* Explosion effect */
.explosion {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-size: 4rem;
    animation: explode 3s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(3) rotate(180deg);
        opacity: 1;
    }
    60% {
        transform: scale(5) rotate(360deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(8) rotate(540deg);
        opacity: 0;
    }
}

/* Floating reaction emojis */
.reaction-emoji {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    animation: floatEmoji ease-out forwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@keyframes floatEmoji {
    0% {
        transform: translateY(0) translateX(0) scale(0.5);
        opacity: 0;
    }
    10% {
        transform: translateY(-20px) translateX(calc(var(--emoji-drift, 0px) * 0.1)) scale(1);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(-300px) translateX(var(--emoji-drift, 0px)) scale(0.8);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 40px 20px;
    }

    .header {
        gap: 20px;
        margin-bottom: 40px;
    }

    .logo {
        height: 60px;
    }

    .intro-container {
        font-size: 1rem;
    }

    .joke-container {
        font-size: 0.9rem;
    }

    .giphy-container img {
        max-width: 100%;
        max-height: 250px;
    }
}
