:root {
    --cs-green: #00FF00;
    --cs-dark-green: #004400;
    --cs-bg: #000000;
    --cs-panel: #1a1a1a;
    --cs-border: #4a4a4a;
    --cs-text: #00FF00;
    --cs-gold: #FFD700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--cs-bg);
    color: var(--cs-text);
    font-family: 'Courier Prime', monospace;
    overflow-x: hidden;
    height: 100vh;
}

/* CRT Effect */
.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* UI Layout */
.window-container {
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
    border: 2px solid var(--cs-border);
    box-shadow: 0 0 20px var(--cs-dark-green);
    background: var(--cs-bg);
    position: relative;
    z-index: 5;
}

/* Header & Nav */
.cs-header {
    background: #333;
    border-bottom: 2px solid var(--cs-border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: linear-gradient(to right, #444, #222);
    font-size: 0.8rem;
    color: #ccc;
}

.header-controls .btn {
    padding: 0 8px;
    border: 1px solid #666;
    margin-left: 5px;
    background: #444;
}

.btn-close {
    background: #900 !important;
}

.cs-nav {
    display: flex;
    padding: 10px;
    background: var(--cs-panel);
    gap: 20px;
}

.cs-nav a {
    color: var(--cs-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cs-nav a:hover {
    color: white;
    text-shadow: 0 0 5px var(--cs-green);
}

/* Content */
.cs-content {
    padding: 20px;
}

.terminal-box {
    border: 1px solid var(--cs-dark-green);
    background: rgba(0, 20, 0, 0.8);
    padding: 20px;
    margin-bottom: 20px;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--cs-gold);
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Grid Tools */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.tool-card {
    border: 2px solid var(--cs-dark-green);
    padding: 15px;
    background: #0a0a0a;
    transition: border-color 0.3s;
}

.tool-card:hover {
    border-color: var(--cs-green);
}

.tool-card h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

/* Buttons */
.cs-button {
    display: inline-block;
    padding: 8px 15px;
    background: var(--cs-dark-green);
    color: black;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid var(--cs-green);
    margin-top: 10px;
    cursor: pointer;
}

.cs-button:hover,
.cs-button.active {
    background: var(--cs-green);
    box-shadow: 0 0 10px var(--cs-green);
}

/* Game Styles */
.canvas-container {
    position: relative;
    width: 600px;
    margin: 20px auto;
    border: 4px solid #444;
}

#game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
}

canvas {
    background: black;
    display: block;
}

.game-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ins-box {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

/* Footer */
.cs-footer {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: #222;
    border-top: 1px solid var(--cs-border);
    font-size: 0.7rem;
    color: #888;
}

/* Animations */
@keyframes glitch {
    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);
    }
}

.glitch:hover {
    animation: glitch 0.3s linear infinite;
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .canvas-container {
        width: 100%;
    }
}