/* ═══════════════════════════════════════════════════════════════
   RetroBoard BBS — CRT Terminal Stylesheet
   ═══════════════════════════════════════════════════════════════ */

:root {
    --green: #33ff33;
    --green-dim: #1a8a1a;
    --green-glow: rgba(51, 255, 51, 0.4);
    --cyan: #00ffff;
    --cyan-glow: rgba(0, 255, 255, 0.3);
    --yellow: #ffff33;
    --red: #ff3333;
    --magenta: #ff33ff;
    --white: #e0e0e0;
    --blue: #3399ff;
    --amber: #ffaa00;
    --bg: #0a0a0a;
    --bg-screen: #050808;
    --border-color: #1a1a2e;
    --font: 'Share Tech Mono', 'Courier New', monospace;
}

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

body {
    background: #000;
    font-family: var(--font);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ─── CRT Frame ──────────────────────────────────────────── */
#crt-frame {
    width: 95vw;
    max-width: 960px;
    height: 92vh;
    background: var(--bg);
    border-radius: 18px;
    border: 3px solid #222;
    box-shadow:
        0 0 40px rgba(51, 255, 51, 0.08),
        inset 0 0 80px rgba(0, 0, 0, 0.9),
        0 0 2px #111;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Scanlines ──────────────────────────────────────────── */
#scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 18px;
}

/* ─── Screen Area ────────────────────────────────────────── */
#crt-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 8px;
    overflow: hidden;
}

/* ─── Terminal Output ────────────────────────────────────── */
#terminal-output {
    flex: 1;
    overflow-y: auto;
    color: var(--green);
    font-size: 14px;
    line-height: 1.5;
    text-shadow: 0 0 6px var(--green-glow);
    word-wrap: break-word;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: var(--green-dim) transparent;
}
#terminal-output::-webkit-scrollbar { width: 6px; }
#terminal-output::-webkit-scrollbar-track { background: transparent; }
#terminal-output::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 3px; }

/* ─── Color classes ──────────────────────────────────────── */
.green   { color: var(--green);   text-shadow: 0 0 6px var(--green-glow); }
.cyan    { color: var(--cyan);    text-shadow: 0 0 6px var(--cyan-glow); }
.yellow  { color: var(--yellow);  text-shadow: 0 0 6px rgba(255,255,51,0.3); }
.red     { color: var(--red);     text-shadow: 0 0 6px rgba(255,51,51,0.3); }
.magenta { color: var(--magenta); text-shadow: 0 0 6px rgba(255,51,255,0.3); }
.white   { color: var(--white);   text-shadow: 0 0 4px rgba(255,255,255,0.2); }
.blue    { color: var(--blue);    text-shadow: 0 0 6px rgba(51,153,255,0.3); }
.amber   { color: var(--amber);   text-shadow: 0 0 6px rgba(255,170,0,0.3); }
.dim     { color: #555;           text-shadow: none; }
.bold    { font-weight: bold; }

/* ─── Clickable lines ────────────────────────────────────── */
.line-clickable {
    cursor: pointer;
    transition: background 0.15s;
    display: block;
    padding: 1px 4px;
    border-radius: 2px;
}
.line-clickable:hover {
    background: rgba(51, 255, 51, 0.1);
}

/* ─── Input Area ─────────────────────────────────────────── */
#input-area {
    display: flex;
    align-items: center;
    padding: 8px 0 4px;
    border-top: 1px solid #1a3a1a;
    margin-top: 4px;
}
#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--green);
    font-family: var(--font);
    font-size: 14px;
    text-shadow: 0 0 6px var(--green-glow);
    caret-color: var(--green);
}

/* ─── Status Bar ─────────────────────────────────────────── */
#status-bar {
    display: flex;
    justify-content: space-between;
    padding: 6px 20px;
    background: #0d1a0d;
    border-top: 1px solid #1a3a1a;
    font-size: 12px;
    color: var(--green-dim);
    border-radius: 0 0 16px 16px;
}

/* ─── Flicker animation ─────────────────────────────────── */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
}
#crt-screen { animation: flicker 8s infinite; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    #crt-frame { width: 100vw; height: 100vh; border-radius: 0; border: none; }
    #scanlines { border-radius: 0; }
    #status-bar { border-radius: 0; }
    #terminal-output { font-size: 12px; }
}
