:root {
    --terminal-bg: #000000;
    --terminal-text: #00FF00;
    --terminal-glow: #00ff0080;
    --cursor-color: #00FF00;
    --font-family: 'Fira Code', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--terminal-bg);
    color: var(--terminal-text);
    font-family: var(--font-family);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    text-shadow: 0 0 5px var(--terminal-glow);
}

.terminal {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.header {
    margin-bottom: 20px;
}

.prompt {
    color: #ff00ff;
    /* Purple for user@host */
    margin-right: 10px;
}

#output {
    margin-bottom: 10px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.input-line {
    display: flex;
    align-items: center;
}

.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--cursor-color);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Game Menu UI */
.game-menu-container {
    margin-top: auto;
    width: 100%;
    border-top: 1px dashed var(--terminal-text);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
}

.game-selection {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
}

.game-box {
    background: rgba(0, 20, 0, 0.5);
    border: 2px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 15px;
    font-family: var(--font-family);
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    min-width: 180px;
    flex: 1;
    max-width: 300px;
}

.game-box:hover {
    background: var(--terminal-text);
    color: #000;
    box-shadow: 0 0 15px var(--terminal-text);
    transform: translateY(-2px);
}

.game-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.game-title {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.game-desc {
    font-size: 0.7rem;
    opacity: 0.8;
}

.system-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px;
}

.sys-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: rgba(0, 255, 0, 0.7);
    padding: 5px 15px;
    font-family: var(--font-family);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    text-transform: uppercase;
}

.sys-btn:hover {
    border-color: var(--terminal-text);
    color: var(--terminal-text);
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 5px var(--terminal-text);
}

.cmd-btn {
    background: transparent;
    border: 1px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 8px 16px;
    font-family: var(--font-family);
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.2s;
    text-shadow: 0 0 5px var(--terminal-glow);
    box-shadow: 0 0 5px var(--terminal-glow);
}

.cmd-btn:hover {
    background: var(--terminal-text);
    color: var(--terminal-bg);
    box-shadow: 0 0 15px var(--terminal-text);
}

.cmd-btn:active {
    transform: scale(0.98);
}

/* CRT Scanline Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    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%;
    pointer-events: none;
    z-index: 10;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #003300;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ff00;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .terminal {
        padding: 10px;
    }

    .game-selection {
        flex-direction: column;
        gap: 10px;
    }

    .game-box {
        width: 100%;
        max-width: none;
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px;
    }

    .game-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-right: 10px;
    }

    .game-desc {
        margin-left: auto;
    }

    .system-controls {
        gap: 5px;
    }

    .sys-btn {
        flex: 1 1 30%;
        text-align: center;
        padding: 8px 5px;
        font-size: 0.7rem;
    }
}

/* Game Styles */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container.hidden {
    display: none;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#game-ui {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#score {
    font-size: 2rem;
    font-weight: bold;
    color: var(--terminal-text);
    text-shadow: 0 0 10px var(--terminal-text);
}

#exit-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 10px 20px;
    font-family: var(--font-family);
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
}

#exit-btn:hover {
    background: var(--terminal-text);
    color: #000;
}

#instruction {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 10px;
}