:root {
    --terminal-green: #00FF00;
    --terminal-bg: #0b0b0b;
    --terminal-window-bg: #0c0c0c;
    --body-bg: #000000;
}

*:not(body):not(html) {
    animation: fadeIn 1s ease-out;
}

* {
    cursor: none !important;
}

body {
    background-color: var(--body-bg);
    background-image: 
        linear-gradient(
            0deg,
            rgba(20, 16, 16, 0.1) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(23, 15, 15, 0.1) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
    background-position: center;
    transition: background-position 0.1s;
    backdrop-filter: blur(0px);
    position: relative;
    color: var(--terminal-green);
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Updated radial gradient with green glow */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, var(--terminal-bg) 100%), radial-gradient(circle at center, rgba(0, 255, 0, 0.5) 0%, /* Green glow */ #00000000 60%);
    pointer-events: none;
    z-index: -1;
}

.terminal {
    background-color: var(--terminal-window-bg);
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 800px;
    box-shadow: 
        calc(0px + var(--glow-x)) calc(0px + var(--glow-y)) 20px rgba(0, 255, 0, 0.4),
        calc(0px + var(--glow-x)) calc(0px + var(--glow-y)) 40px rgba(0, 255, 0, 0.2),
        calc(0px + var(--glow-x)) calc(0px + var(--glow-y)) 60px rgba(0, 255, 0, 0.1),
        inset 0 0 30px rgba(0, 255, 0, 0.3);
    border: 2px solid rgba(0, 255, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: 
        fadeIn 0.3s ease-out,
        terminalPulse 4s ease-in-out infinite;
    --glow-x: 0px;
    --glow-y: 0px;
}

@keyframes terminalPulse {
    0% {
        box-shadow: 
            0 0 20px rgba(0, 255, 0, 0.4),
            0 0 40px rgba(0, 255, 0, 0.2),
            0 0 60px rgba(0, 255, 0, 0.1),
            inset 0 0 30px rgba(0, 255, 0, 0.3);
        border-color: rgba(0, 255, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(0, 255, 0, 0.5),
            0 0 50px rgba(0, 255, 0, 0.3),
            0 0 75px rgba(0, 255, 0, 0.2),
            inset 0 0 40px rgba(0, 255, 0, 0.4);
        border-color: rgba(0, 255, 0, 0.7);
    }
    100% {
        box-shadow: 
            0 0 20px rgba(0, 255, 0, 0.4),
            0 0 40px rgba(0, 255, 0, 0.2),
            0 0 60px rgba(0, 255, 0, 0.1),
            inset 0 0 30px rgba(0, 255, 0, 0.3);
        border-color: rgba(0, 255, 0, 0.5);
    }
}

/* Enhanced scan lines effect */
.terminal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.5),    /* Much darker lines */
        rgba(0, 0, 0, 0.5) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scanlines 8s linear infinite;
    z-index: 1;
    opacity: 0.95;            /* Higher opacity */
}

/* Adjusted screen flicker to complement stronger scanlines */
.terminal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.04);  /* Slightly stronger green tint */
    pointer-events: none;
    animation: flicker 0.15s infinite;
    z-index: 2;
}

@keyframes scanlines {
    from { transform: translateY(0); }
    to { transform: translateY(2px); }
}

@keyframes flicker {
    0% { opacity: 0.2; }
    50% { opacity: 0; }
    100% { opacity: 0.2; }
}

#output {
    height: 300px;          /* Fixed height */
    overflow-y: auto;       /* Enable scrolling */
    margin-bottom: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    padding: 10px 0;
}

.input-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    position: relative;
}

.prompt {
    color: var(--terminal-green);
    white-space: nowrap;
}

#input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    outline: none;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.quicklinks {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.quicklink {
    color: var(--terminal-green);
    text-decoration: none;
    margin-top: 20px;
    font-size: 1.2em;
    padding: 5px 10px;
    border: 1px solid var(--terminal-green);
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    display: inline-block;
    backface-visibility: hidden; /* Reduces flickering */
    will-change: transform; /* Optimizes performance */
}

.quicklink:hover {
    background-color: var(--terminal-green);
    color: var(--terminal-window-bg);
    transform: scale(1.15) rotate(-2deg);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

/* Add alternating rotation directions */
.quicklink:nth-child(2n):hover {
    transform: scale(1.15) rotate(2deg);
}

.fart-emoji {
    font-size: 1.2em;
    margin-top: 20px;
}

/* Custom scrollbar */
#output::-webkit-scrollbar {
    width: 8px;
}

#output::-webkit-scrollbar-track {
    background: var(--terminal-window-bg);
}

#output::-webkit-scrollbar-thumb {
    background: var(--terminal-green);
    border-radius: 4px;
}

@media (max-width: 600px) {
    .terminal {
        width: 95%;
        padding: 15px;
    }
    
    #output {
        min-height: 200px;
    }
}

/* Add new loading animation styles */
.loading-dots::after {
    content: '';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.terminal-header {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: var(--terminal-green);
    text-shadow: 0 0 10px var(--terminal-green);
    margin-bottom: 20px;
    font-size: 2.5em;
    letter-spacing: 2px;
}

/* Enhance text glow */
#output, #input {
    text-shadow: 0 0 5px var(--terminal-green);
}

/* Floating fard text */
.floating-fard {
    position: fixed;
    color: var(--terminal-green);
    font-family: 'Press Start 2P', cursive;
    pointer-events: none;
    opacity: 0;
    font-size: 14px;
    text-shadow: 0 0 5px var(--terminal-green);
    z-index: -1;
    will-change: transform, opacity;
}

@keyframes floatAndFade {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    20% {
        opacity: 0.7;
    }
    80% {
        opacity: 0.7;
        transform: scale(1.2) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(1.5) translateY(-40px);
    }
}

.combo-multiplier {
    position: fixed;
    font-family: 'Press Start 2P', cursive;
    color: var(--terminal-green);
    font-size: 48px;
    text-shadow: 0 0 10px var(--terminal-green),
                 0 0 20px var(--terminal-green);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
    animation: comboPopup 1s ease-out forwards;
}

@keyframes comboPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Custom cursor styles */
.custom-cursor {
    width: 20px;
    height: 20px;
    position: fixed;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
}

.custom-cursor::before,
.custom-cursor::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 999999;
}

.custom-cursor::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.custom-cursor::after {
    height: 2px;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
}

/* Update body background properties */
body {
    /* ... existing styles ... */
    background-image: 
        linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
    background-position: center;
    transition: background-position 0.1s;
}

/* Add fade-in animation for content */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

html {
    scroll-behavior: smooth;
}

#output {
    scroll-behavior: smooth;
}

/* Add ambient glow to body */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at calc(50% + var(--glow-x)) calc(50% + var(--glow-y)),
        rgba(0, 255, 0, 0.1) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
}

/* Smooth transitions for background */
body {
    /* ... existing styles ... */
    transition: background-position 0.05s ease-out;
}

/* Optional: Add depth to terminal with transform */
.terminal {
    /* ... existing styles ... */
    transform-style: preserve-3d;
    transform: 
        perspective(1000px)
        rotateX(calc(var(--glow-y) * -0.01deg))
        rotateY(calc(var(--glow-x) * 0.01deg));
    transition: transform 0.1s ease-out;
}

.hover-letter {
    display: inline-block;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.space {
    display: inline-block;
    width: 0.5em; /* Adjust space width as needed */
}

.hover-letter:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--terminal-green);
    transform: translateY(-2px) scale(1.2);
    z-index: 1;
}

/* Create a wave effect for neighboring letters */
.hover-letter:hover + .hover-letter {
    transform: translateY(-1px) scale(1.1);
}

.hover-letter:hover + .hover-letter + .hover-letter {
    transform: translateY(-0.5px) scale(1.05);
}

/* Optional: Add subtle animation on page load */
.hover-letter {
    animation: letterFloat 0.5s ease-out backwards;
}

@keyframes letterFloat {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger the animation for each letter */
.hover-letter:nth-child(1) { animation-delay: 0.0s; }
.hover-letter:nth-child(2) { animation-delay: 0.05s; }
.hover-letter:nth-child(3) { animation-delay: 0.1s; }
/* ... and so on */

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    font-size: 0.8em;
    color: rgba(0, 255, 0, 0.6);
    z-index: 100;
}

.footer-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.separator {
    opacity: 0.5;
}

.creator-link {
    color: var(--terminal-green);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.creator-link:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--terminal-green);
    transform: scale(1.1);
}

.quicklink.copy-ca svg {
    width: 20px; /* Adjust the width as needed */
    height: 20px; /* Adjust the height as needed */
    margin-right: 5px; /* Space between the icon and the text */
    vertical-align: middle; /* Aligns the icon with the text */
    fill: var(--terminal-green); /* Change the color to match the theme */
}
