:root {
    --term-color: #33ff00;
    /* Classic Terminal Green */
    --term-bg: #0a0a0a;
    --term-glow: text-shadow: 0 0 2px #003300, 0 0 5px #33ff00;
    --font-family: 'VT323', monospace;
    --font-size: 24px;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background-color: #000;
    overflow: hidden;
    /* Stop native scroll, manage inside terminal */
    font-family: var(--font-family);
}

/* ============================
   CRT Screen Effects 
   ============================ */
#terminal {
    height: 100%;
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    color: var(--term-color);
    font-size: var(--font-size);
    text-shadow: 0 0 5px var(--term-color);
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar */
#terminal::-webkit-scrollbar {
    width: 12px;
}

#terminal::-webkit-scrollbar-track {
    background: #001100;
}

#terminal::-webkit-scrollbar-thumb {
    background: var(--term-color);
    border: 1px solid #000;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background: radial-gradient(circle, rgba(16, 16, 16, 0) 50%, rgba(0, 0, 0, 0.6) 100%);
}

.scanlines {
    width: 100%;
    height: 100%;
    position: absolute;
    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;
    animation: scanlines 0.3s linear infinite;
}

/* Screen Flicker Animation */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    5% {
        opacity: 0.95;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.95;
    }

    20% {
        opacity: 0.99;
    }

    50% {
        opacity: 0.95;
    }

    80% {
        opacity: 0.98;
    }

    100% {
        opacity: 0.97;
    }
}

body {
    animation: flicker 0.1s infinite;
}

/* ============================
   Terminal Layout 
   ============================ */
#boot-sequence {
    margin-bottom: 20px;
}

.command-output {
    white-space: pre-wrap;
    margin-bottom: 10px;
    line-height: 1.2;
}

.directory {
    color: #5555ff;
    font-weight: bold;
    text-shadow: 0 0 5px #0000ff;
}

.file {
    color: var(--term-color);
}

.executable {
    color: #ff5555;
    text-shadow: 0 0 5px #ff0000;
}

.symlink {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

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

.prompt {
    margin-right: 10px;
    color: #ffcc00;
    /* Amber prompt */
    text-shadow: 0 0 5px #ffcc00;
}

#command-input {
    background: transparent;
    border: none;
    color: transparent;
    /* Use transparent text, we show it via other means or just strict cursor */
    /* Actually for simple implementation, we can show text but hide caret */
    color: var(--term-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    text-shadow: 0 0 5px var(--term-color);
    outline: none;
    caret-color: transparent;
    /* Hide native cursor */
    flex-grow: 1;
    width: 10px;
    /* Minimal width to start */
}

#cursor-block {
    display: inline-block;
    width: 12px;
    height: 24px;
    background-color: var(--term-color);
    animation: blink 1s step-end infinite;
    margin-left: -1px;
    /* Overlap input slightly */
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hidden {
    display: none !important;
}

/* ============================
   Response Helpers
   ============================ */
.ascii-art {
    font-size: 12px;
    line-height: 12px;
    white-space: pre;
    color: #00ffff;
    margin-bottom: 20px;
}

.help-table {
    display: table;
    width: 100%;
    max-width: 600px;
}

.help-row {
    display: table-row;
}

.help-cmd {
    display: table-cell;
    padding-right: 20px;
    font-weight: bold;
    color: #ffff00;
}

.help-desc {
    display: table-cell;
}

/* Mobile */
#mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

@media (max-width: 768px) {
    :root {
        --font-size: 16px;
    }

    #terminal {
        padding: 15px;
    }

    #mobile-controls {
        display: block;
    }

    #show-keyboard {
        background: var(--term-color);
        color: #000;
        border: none;
        padding: 10px 20px;
        font-family: var(--font-family);
        font-size: 18px;
        border-radius: 4px;
    }
}