/* CSS Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --accent: #ff00ff;
    --border: #00ff00;
    --shadow: rgba(0, 255, 0, 0.5);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px
        );
}

/* Glitch Overlay Effect */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: glitch-overlay 0.3s infinite;
}

@keyframes glitch-overlay {
    0% { opacity: 0.1; }
    50% { opacity: 0.05; }
    100% { opacity: 0.1; }
}

/* Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* Navigation Bar */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: rgba(0, 255, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-link:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 10px var(--shadow);
    transform: translateY(-2px);
}

/* Glitch Text Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #ff00ff;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes glitch-2 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-bottom: 1px dashed var(--border);
}

.glitch-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 
        0 0 10px var(--shadow),
        0 0 20px var(--shadow),
        0 0 30px var(--shadow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 
            0 0 10px var(--shadow),
            0 0 20px var(--shadow),
            0 0 30px var(--shadow);
    }
    50% {
        text-shadow: 
            0 0 20px var(--shadow),
            0 0 40px var(--shadow),
            0 0 60px var(--shadow);
    }
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Button Gallery */
.button-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
    justify-items: center;
}

.button-item {
    position: relative;
    border: 2px solid var(--border);
    padding: 0.5rem;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.2);
}

.button-item:hover {
    transform: scale(1.1) rotate(1deg);
    box-shadow: 
        0 0 15px var(--shadow),
        0 0 30px var(--shadow);
    border-color: var(--accent);
    animation: glitch-item 0.2s;
}

@keyframes glitch-item {
    0%, 100% {
        transform: scale(1.1) rotate(1deg);
    }
    25% {
        transform: scale(1.1) rotate(-1deg) translate(-2px, 0);
    }
    75% {
        transform: scale(1.1) rotate(1deg) translate(2px, 0);
    }
}

.button-item img {
    display: block;
    width: 88px;
    height: 31px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: contrast(1.1) brightness(1.05);
}

.button-item:hover img {
    filter: 
        contrast(1.2) 
        brightness(1.1)
        drop-shadow(0 0 5px var(--shadow));
}

/* Footer */
.page-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px dashed var(--border);
}

.glitch-small {
    font-size: 0.9rem;
    letter-spacing: 2px;
    position: relative;
}

.glitch-small::before,
.glitch-small::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-small::before {
    animation: glitch-1 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #ff00ff;
    z-index: -1;
}

.glitch-small::after {
    animation: glitch-2 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #00ffff;
    z-index: -2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .glitch-text {
        font-size: 1.8rem;
    }
    
    .button-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .glitch-text {
        font-size: 1.5rem;
    }
    
    .button-gallery {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.8rem;
    }
}

/* Additional Glitch Effects */
@keyframes rgb-shift {
    0%, 100% {
        text-shadow: 
            -1px -1px 0 #ff00ff,
            1px 1px 0 #00ffff;
    }
    25% {
        text-shadow: 
            1px -1px 0 #ff00ff,
            -1px 1px 0 #00ffff;
    }
    50% {
        text-shadow: 
            -1px 1px 0 #ff00ff,
            1px -1px 0 #00ffff;
    }
    75% {
        text-shadow: 
            1px 1px 0 #ff00ff,
            -1px -1px 0 #00ffff;
    }
}

/* CRT Monitor Effect */
@keyframes flicker {
    0% { opacity: 0.95; }
    5% { opacity: 1; }
    10% { opacity: 0.97; }
    15% { opacity: 1; }
    20% { opacity: 0.95; }
    100% { opacity: 1; }
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    animation: flicker 0.15s infinite;
}