/* terminal-inja — shared base for all terminal templates */
:root {
    --bg: #0a0a08;
    --card-bg: #0f0f0c;
    --text: #33ff33;
    --text-secondary: #22aa22;
    --text-dim: #116611;
    --accent: #66ff66;
    --accent-glow: #88ff88;
    --accent-dim: #228822;
    --border: #1a331a;
    --code-bg: #080808;
    --bezel: #1a1a1a;
    --bezel-dark: #0d0d0d;
}

html {
    overflow: hidden;
    height: 100%;
}

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

body {
    font-family:
        'VT323', 'Courier New',
        'NSimSun', 'GB18030 Bitmap', 'Unifont',
        'WenQuanYi Bitmap Song', '文泉驿点阵宋体',
        'SimSun', '宋体',
        'Noto Serif CJK SC', 'AR PL UMing CN',
        'Noto Sans SC',
        serif, monospace;
    background: #000;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden !important;
    height: 100vh;
    width: 100vw;
}

/* ── Terminal Bezel ── */
.terminal {
    width: 100vw;
    height: 100vh;
    background: var(--bezel);
    position: relative;
    padding: 2.5vh 3vw 3.5vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        inset 0 0 3px rgba(255,255,255,0.04),
        inset 0 0 100px rgba(0,0,0,0.4),
        0 0 0 1.5px #444,
        0 0 0 3px var(--bezel-dark),
        0 0 0 5px #222,
        0 0 0 6px var(--bezel-dark);
}

.terminal-vent {
    position: absolute;
    top: 1vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
}

.terminal-vent-line {
    width: 2px;
    height: 7px;
    background: #0a0a0a;
    border-radius: 1px;
}

.terminal-label {
    position: absolute;
    bottom: 0.6vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: #111;
    letter-spacing: 0.3em;
}

.terminal-corner {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #111;
    border-radius: 1px;
}

.terminal-corner.tl { top: 0.8vh; left: 1.5vw; }
.terminal-corner.tr { top: 0.8vh; right: 1.5vw; }
.terminal-corner.bl { bottom: 1vh; left: 1.5vw; }
.terminal-corner.br { bottom: 1vh; right: 1.5vw; }

.terminal-led {
    position: absolute;
    bottom: 0.8vh;
    right: 3.5vw;
    width: 5px;
    height: 5px;
    background: var(--text);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--text), 0 0 10px var(--text);
}

.terminal-badge {
    position: absolute;
    bottom: 0.7vh;
    left: 3.5vw;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: #111;
    letter-spacing: 0.15em;
}

/* ── CRT Screen ── */
.screen {
    background: var(--bg);
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 30px;
    border: 3px solid #090909;
    box-shadow:
        inset 0 0 150px rgba(0,0,0,0.9),
        inset 0 0 40px rgba(51,255,51,0.02),
        inset 0 0 3px rgba(0,0,0,0.5),
        0 0 0 2px #0d0d0d,
        0 0 0 5px #111,
        0 2px 2px rgba(0,0,0,0.5) inset;
}

.crt-distort {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 50%,
        transparent 30%,
        rgba(0,0,0,0.08) 60%,
        rgba(0,0,0,0.3) 85%,
        rgba(0,0,0,0.75) 100%);
}

.screen-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.8) 100%);
}

.screen-glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(51,255,51,0.025) 0%,
        rgba(51,255,51,0.01) 30%,
        transparent 100%);
    border-radius: 30px 30px 0 0;
}

.screen-scanlines {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.25) 2px,
        rgba(0,0,0,0.25) 4px);
    border-radius: inherit;
}

.screen-phosphor {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.15) 85%, rgba(0,0,0,0.4) 100%);
}

/* ── Common Components ── */
.term-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.3rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: var(--text-dim);
}

/* scrollbar (shared across pages with scrollable content) */
.screen-content::-webkit-scrollbar { width: 4px; }
.screen-content::-webkit-scrollbar-track { background: transparent; }
.screen-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* footer */
.page-footer {
    color: var(--text-dim);
    font-size: 25px;
    text-shadow: 0 0 4px var(--text-dim);
}

/* page header */
.page-header {
    text-align: left;
    padding: 0.3rem 0 0.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

/* page title */
.page-title {
    font-size: 3rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px var(--accent-dim);
    image-rendering: pixelated;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    html { overflow: auto; height: auto; }
    body {
        overflow: auto !important;
        height: auto;
    }
    .terminal {
        height: auto;
        min-height: 100vh;
    }
    .screen {
        flex: none;
        overflow: visible;
        min-height: 100vh;
    }
}
