@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --phosphor-color: #33ff00;
    --phosphor-dim: #1a8000;
    --bg-color: #050505;
}

body, html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--phosphor-color);
    font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
    font-size: 18px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* CRT Screen Curvature and Vignette */
.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 10;
    background: radial-gradient(circle at center, transparent 60%, rgba(0, 50, 0, 0.4) 100%);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

/* Scanlines effect */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9;
    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;
}

/* Slight flicker */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 8;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.05; }
    50% { opacity: 0.01; }
    100% { opacity: 0.05; }
}

#terminal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 5px var(--phosphor-color);
}

.output-line {
    margin: 6px 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.output-line.system {
    color: var(--phosphor-dim);
    text-shadow: 0 0 3px var(--phosphor-dim);
}

.output-line.error {
    color: #ff3333;
    text-shadow: 0 0 5px #ff3333;
}

.output-line.highlight {
    color: #ffffff;
    text-shadow: 0 0 5px #ffffff;
}

.hidden {
    display: none !important;
}

#input-line {
    display: flex;
    margin-top: 15px;
    align-items: center;
}

#prompt {
    margin-right: 12px;
    white-space: nowrap;
}

#command-input {
    background: transparent;
    border: none;
    color: transparent; /* Text is invisible, caret is hidden by default browser styles, we use custom cursor */
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
    caret-color: transparent; /* Hide native cursor */
    position: absolute;
    opacity: 0;
    width: 100%;
}

/* Custom Block Cursor */
#cursor {
    display: inline-block;
    width: 10px;
    height: 1em;
    background-color: var(--phosphor-color);
    box-shadow: 0 0 5px var(--phosphor-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

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

/* The actual text typed by user shown beside the cursor */
.typed-text {
    color: var(--phosphor-color);
    text-shadow: 0 0 5px var(--phosphor-color);
    white-space: pre;
}

/* ASCII Art specific */
.ascii-art {
    white-space: pre;
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--phosphor-color);
}

::selection {
    background: var(--phosphor-color);
    color: var(--bg-color);
    text-shadow: none;
}
