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

body {
    background-color: #000;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    /* perspective: 1000px; */
}

body.page-home {
    overflow: hidden;
    height: 100vh;
    align-items: center;
}

body.page-gallery {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    align-items: flex-start;
    padding: 40px 0;
}

#bg-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
opacity: 0.3;
pointer-events: none;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
                                rgba(255,255,255,0) 50%,
                                rgba(0,0,0,0.2) 50%,
                                rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 11;
}

.container {
    position: relative;
    z-index: 5;
    background: rgba(0, 0, 0, 0.85);
    box-shadow: 0 0 20px #00ff00, inset 0 0 20px #00ff00;
    text-align: center;
    border: 4px double #00ff00;
}

body.page-home .container {
    width: 90%;
    max-width: 600px;
    padding: 20px;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

body.page-gallery .container {
    width: 95%;
    max-width: 900px;
    padding: 25px;
    margin-bottom: 50px;
    background: rgba(0, 0, 0, 0.9);
}

.logo-box {
    margin-bottom: 30px;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 10px;
}

h1.logo {
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    color: #fff;
    text-shadow: 2px 2px #ff00ff, -2px -2px #00ffff;
    animation: glitch 1s infinite linear alternate-reverse;
}

body.page-home h1.logo {
    font-size: 3rem;
}

body.page-gallery h1.logo {
    font-size: 2rem;
    margin: 0 auto;
}

h1.logo::before, h1.logo::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #000;
    overflow: hidden;
}

h1.logo::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

h1.logo::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

.subtitle {
    font-size: 0.8rem;
    letter-spacing: 4px;
    margin-top: 5px;
    color: #00ff00;
}

.links-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

a.retro-btn {
    display: block;
    text-decoration: none;
    color: #000;
    background-color: #00ff00;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 15px;
    border: 2px solid #00ff00;
    text-transform: uppercase;
    position: relative;
    transition: all 0.2s;
    box-shadow: 5px 5px 0px #004400;
}

a.retro-btn:hover {
    background-color: #000;
    color: #00ff00;
    box-shadow: -5px -5px 0px #00ff00;
    transform: translate(2px, 2px);
}

a.retro-btn::before {
    content: ">";
    margin-right: 10px;
    animation: blink 1s step-end infinite;
}

a.wiki-btn {
    background-color: #00ffff;
    border-color: #00ffff;
    box-shadow: 5px 5px 0px #004444;
}
a.wiki-btn:hover {
    color: #00ffff;
    box-shadow: -5px -5px 0px #00ffff;
}

a.yt-btn {
    background-color: #ff0055;
    border-color: #ff0055;
    box-shadow: 5px 5px 0px #440011;
    color: #fff;
}
a.yt-btn:hover {
    color: #ff0055;
    box-shadow: -5px -5px 0px #ff0055;
}
a.img-btn {
    background-color: #aa00ff;
    border-color: #aa00ff;
    box-shadow: 5px 5px 0px #110044;
    color: #fff;
}
a.img-btn:hover {
    color: #aa00ff;
    box-shadow: -5px -5px 0px #aa00ff;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

a.back-btn {
    text-decoration: none;
    color: #000;
    background-color: #00ff00;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #00ff00;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px #004400;
    font-size: 1rem;
    transition: 0.2s;
    display: inline-block;
}

a.back-btn:hover {
    background-color: #000;
    color: #00ff00;
    box-shadow: -4px -4px 0px #00ff00;
    transform: translate(2px, 2px);
}

a.back-btn::before {
    content: "< ";
}

button.kaif-btn {
    background-color: #000;
    color: #ff00ff;
    border: 2px solid #ff00ff;
    padding: 10px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    box-shadow: 4px 4px 0px #550055;
    text-transform: uppercase;
    transition: 0.2s;
    margin: 10px 0;
    display: block;
}

button.kaif-btn:hover {
    background-color: #ff00ff;
    color: #000;
    box-shadow: -4px -4px 0px #ff00ff;
    transform: translate(2px, 2px);
}

button.kaif-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 10px;
}

.meme-card {
    position: relative;
    border: 2px solid #005500;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #001100;
}

.meme-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) sepia(20%) hue-rotate(90deg) contrast(1.2);
    transition: 0.3s;
    opacity: 0.8;
}

.meme-card:hover {
    border-color: #00ff00;
    box-shadow: 0 0 15px #00ff00;
    transform: scale(1.05);
    z-index: 20;
}

.meme-card:hover img {
    filter: none;
    opacity: 1;
}

.meme-title-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    padding: 8px 0;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: bold;
    border-top: 1px solid #00ff00;
    transform: translateY(100%);
    transition: transform 0.2s ease-out;
    letter-spacing: 1px;
}

.meme-card:hover .meme-title-box {
    transform: translateY(0);
}

.marquee-container {
    margin-top: 20px;
    border-top: 1px dashed #00ff00;
    border-bottom: 1px dashed #00ff00;
    background: #002200;
    overflow: hidden;
    display: flex;
}

.marquee-content {
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 10px;
    animation: scroll-text 30s linear infinite;
}

.counter {
    font-size: 0.7rem;
    margin-top: 15px;
    color: #555;
    border: 1px inset #555;
    display: inline-block;
    padding: 2px 5px;
    background: #000;
}
.counter span { color: red; }

.kaif-message {
    position: fixed;
    pointer-events: none;
    font-weight: 900;
    text-transform: uppercase;
    z-index: 9999;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    text-shadow: 3px 3px 0px #000000;
    --rot: 0deg;
    animation: kaif-appear 3s forwards;
}

@keyframes scroll-text {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

@keyframes flicker {
    0% { opacity: 0.9; }
    5% { opacity: 0.8; }
    10% { opacity: 0.95; }
    100% { opacity: 0.9; }
}

@keyframes glitch {
    0% { text-shadow: 2px 2px #ff00ff, -2px -2px #00ffff; }
    25% { text-shadow: -2px 2px #ff00ff, 2px -2px #00ffff; }
    50% { text-shadow: 2px -2px #ff00ff, -2px 2px #00ffff; }
    75% { text-shadow: -2px -2px #ff00ff, 2px 2px #00ffff; }
    100% { text-shadow: 2px 2px #ff00ff, -2px -2px #00ffff; }
}

@keyframes glitch-anim {
    0% { clip: rect(20px, 9999px, 80px, 0); }
    20% { clip: rect(10px, 9999px, 100px, 0); }
    40% { clip: rect(50px, 9999px, 60px, 0); }
    60% { clip: rect(80px, 9999px, 20px, 0); }
    80% { clip: rect(30px, 9999px, 90px, 0); }
    100% { clip: rect(70px, 9999px, 120px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(80px, 9999px, 20px, 0); }
    20% { clip: rect(30px, 9999px, 90px, 0); }
    40% { clip: rect(70px, 9999px, 120px, 0); }
    60% { clip: rect(20px, 9999px, 80px, 0); }
    80% { clip: rect(10px, 9999px, 100px, 0); }
    100% { clip: rect(50px, 9999px, 60px, 0); }
}

@keyframes kaif-appear {
    0% { opacity: 0; transform: scale(0.5) rotate(var(--rot)); }
    10% { opacity: 1; transform: scale(1) rotate(var(--rot)); }
    85% { opacity: 1; transform: scale(1.1) rotate(var(--rot)); }
    100% { opacity: 0; transform: scale(1.5) rotate(var(--rot)); }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .header-bar {
        flex-direction: column-reverse;
    }
}
