body {
    background-color: #0d0d0d;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    color: #00ff00;
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    animation: backgroundScroll 20s linear infinite;
}

@keyframes backgroundScroll {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

/* CRT Scanline Overlay */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 2;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 0.7rem;
    color: #fff;
    box-sizing: border-box;
}

.flicker {
    color: #ff00ff;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 6px double #00ff00;
    padding-bottom: 20px;
    width: 100%;
    position: relative;
    z-index: 3;
}

h1 {
    font-size: 2.8rem;
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #ff00ff,
        0 0 30px #ff00ff,
        0 0 40px #ff00ff;
    animation: flicker 2s infinite alternate;
}

@keyframes flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.4;
    }
}

header p {
    font-size: 0.8rem;
    color: #00ffff;
    letter-spacing: 2px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 3;
}

.game-card {
    background: linear-gradient(135deg, #222 0%, #111 100%);
    border: 4px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    padding: 30px 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-card::after {
    content: "PLAY NOW";
    position: absolute;
    bottom: -30px;
    background: #ff00ff;
    color: #fff;
    width: 100%;
    padding: 5px 0;
    font-size: 0.7rem;
    transition: bottom 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: #ff00ff;
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

.game-card:hover::after {
    bottom: 0;
}

.game-card .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.game-card h2 {
    font-size: 1rem;
    margin: 10px 0;
}

.game-card p {
    font-size: 0.6rem;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 20px;
}

.high-score {
    font-size: 0.7rem;
    color: #ffff00;
    margin-top: auto;
    border: 1px dashed #ffff00;
    padding: 5px 10px;
    background: rgba(255, 255, 0, 0.1);
}

footer {
    margin-top: 50px;
    padding: 20px;
    font-size: 0.7rem;
    color: #444;
    text-align: center;
    border-top: 2px solid #222;
    width: 100%;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }
    .game-grid {
        grid-template-columns: 1fr;
    }
}
