@font-face {
    font-family: 'WarGames';
    src: url('fonts/WarGames-Terminal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg:         #0a0a0a;
    --text:       #00ff41;
    --text-dim:   #00aa2e;
    --text-muted: #004d18;
    --accent:     #ff6600;
    --cursor:     #00ff41;
    --glow:       rgba(0, 255, 65, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'WarGames', 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.65;
    cursor: text;
    text-shadow: 0 0 4px var(--glow);
}

/* root mode switches to cyan */
body.root-mode {
    --text:   #00e5ff;
    --cursor: #00e5ff;
    --glow:   rgba(0, 229, 255, 0.4);
}

/* ── CRT scanlines ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.08) 0px,
        rgba(0,0,0,0.08) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 50;
}

/* ── CRT vignette ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 50;
}

/* ── Terminal container ── */
#terminal {
    height: 100vh;
    padding: 22px 26px 40px;
    overflow-y: auto;
    overflow-x: hidden;
}

#terminal-output {
    white-space: pre-wrap;
    word-break: break-word;
}

#terminal-output div {
    min-height: 1em;
}

/* ── Input line ── */
#input-line {
    display: none;
    align-items: baseline;
    white-space: pre;
    margin-top: 1px;
}

#prompt {
    color: var(--text-dim);
    flex-shrink: 0;
}

body.root-mode #prompt {
    color: var(--accent);
    text-shadow: 0 0 6px rgba(255,102,0,0.6);
}

#input-display {
    color: var(--text);
}

/* ── Blinking cursor ── */
.cursor {
    display: inline-block;
    color: var(--cursor);
    animation: blink 1s steps(1) infinite;
    margin-left: 1px;
}

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

/* ── Hidden input capture ── */
#hidden-input {
    position: fixed;
    top: -200px;
    left: -200px;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
}

/* ── Matrix canvas ── */
#matrix-canvas {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
}

/* ── Text color helpers ── */
.c-dim    { color: var(--text-dim); }
.c-muted  { color: var(--text-muted); }
.c-accent { color: var(--accent); }
.c-ok     { color: #00ff41; }
.c-err    { color: #ff3333; }
.c-warn   { color: #ffe033; }
.c-cyan   { color: #00e5ff; }
.c-white  { color: #cccccc; }

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

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); }

@media (max-width: 600px) {
    body { font-size: 12px; }
    #terminal { padding: 12px 14px 80px; }
}
