:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #0077b5;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    /* For falling animation and matrix rain */
    transition: background-color 0.1s;
}

.container {
    text-align: center;
    z-index: 10;
    position: relative;
}

.profile-wrapper {
    position: relative;
    display: inline-block;
}

#profile-pic {
    width: 400px;
    height: 400px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    position: relative;
    z-index: 20;
}

/* Animations */
@keyframes stretch {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scaleX(1.3) scaleY(0.8);
    }

    100% {
        transform: scale(1);
    }
}

.stretch-anim {
    animation: stretch 0.3s ease-in-out;
}

@keyframes egregiousStretch {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scaleX(3) scaleY(0.1);
    }

    100% {
        transform: scale(1);
    }
}

.egregious-stretch-anim {
    animation: egregiousStretch 0.5s ease-in-out;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spin-anim {
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes rainbowBg {
    0% {
        background-color: #ffb3ba;
    }

    /* Pastel Red */
    16% {
        background-color: #ffdfba;
    }

    /* Pastel Orange */
    33% {
        background-color: #ffffba;
    }

    /* Pastel Yellow */
    50% {
        background-color: #baffc9;
    }

    /* Pastel Green */
    66% {
        background-color: #bae1ff;
    }

    /* Pastel Blue */
    83% {
        background-color: #dcb3ff;
    }

    /* Pastel Purple */
    100% {
        background-color: #ffb3ba;
    }
}

.rainbow-mode {
    --text-color: #1a1a1a;
    animation: rainbowBg 0.5s infinite;
}

@keyframes rainbowText {
    0% {
        color: #ffb3ba;
    }

    16% {
        color: #ffdfba;
    }

    33% {
        color: #ffffba;
    }

    50% {
        color: #baffc9;
    }

    66% {
        color: #bae1ff;
    }

    83% {
        color: #dcb3ff;
    }

    100% {
        color: #ffb3ba;
    }
}

.comic-sans-rainbow,
.comic-sans-rainbow h1,
.comic-sans-rainbow a {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive !important;
}

.comic-sans-rainbow h1,
.comic-sans-rainbow a {
    animation: rainbowText 1s infinite alternate;
}

.dan-background-mode {
    --text-color: #1a1a1a;
    background-image: url('profile.jpg');
    background-size: 150px 150px;
    background-repeat: repeat;
    background-color: transparent !important;
    /* override the dark mode or rainbow mode */
    animation: none;
    /* stop rainbow background if active */
}

@keyframes gravityFall {
    0% {
        transform: translateY(0) rotate(0);
    }

    100% {
        transform: translateY(200vh) rotate(45deg);
    }
}

.gravity-fall-anim {
    animation: gravityFall 2s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

h1 {
    margin-top: 30px;
    font-size: 2rem;
    font-weight: 700;
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: var(--text-color);
    font-size: 2.5rem;
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.social-links a[aria-label="Instagram"]:hover {
    color: #e1306c;
}

/* Emoji explosions */
.emoji-particle {
    position: absolute;
    pointer-events: none;
    font-size: 2rem;
    animation: explode var(--dur) ease-out forwards;
    z-index: 50;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}

/* Confetti */
.confetti {
    position: absolute;
    pointer-events: none;
    width: 10px;
    height: 10px;
    background-color: var(--color);
    animation: explodeConfetti var(--dur) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 50;
    border-radius: var(--br);
}

@keyframes explodeConfetti {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}

/* Mario Coin */
.mario-coin {
    position: absolute;
    width: 30px;
    height: 40px;
    background-color: gold;
    border-radius: 50%;
    border: 4px solid #b8860b;
    pointer-events: none;
    z-index: 60;
    animation: coinJump 0.5s ease-out forwards;
    box-shadow: inset 0 0 10px #ffffe0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #b8860b;
    font-weight: bold;
    font-family: sans-serif;
}

.mario-coin::after {
    content: "|";
    font-size: 20px;
}

@keyframes coinJump {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-100px) scale(1.2) rotateY(180deg);
    }

    100% {
        transform: translateY(-150px) scale(0);
        opacity: 0;
    }
}

/* Matrix Rain */
.matrix-mode {
    background-color: #000 !important;
    --text-color: #0f0;
}

.matrix-mode h1,
.matrix-mode .social-links a {
    text-shadow: 0 0 5px #0f0;
}

#rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.matrix-char {
    position: absolute;
    color: #0f0;
    font-family: monospace;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px #0f0;
    animation: rainDrop cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

@keyframes rainDrop {
    0% {
        transform: translateY(-10vh);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(110vh);
        opacity: 0;
    }
}