:root {
    --crt-color: #00ff00;
    --crt-glow: rgba(0, 255, 0, 0.5);
    --crt-glow-strong: rgba(0, 255, 0, 0.8);
    --crt-bg: #1a1a1a;
    --crt-scanline-color: rgba(0, 0, 0, 0.25);
}

body.theme-amber,
.theme-amber {
    --crt-color: #ffb000;
    --crt-glow: rgba(255, 176, 0, 0.5);
    --crt-glow-strong: rgba(255, 176, 0, 0.8);
}

@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    weight: 400;
    font-display: swap;
    src: url('/fonts/PressStart2P-latin.woff2') format('woff2'),
         url('/fonts/PressStart2P-latin-ext.woff2') format('woff2'),
         url('/fonts/PressStart2P-Regular.ttf') format('truetype');
}

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

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #222;
    font-family: 'Press Start 2P', cursive, monospace;
    overflow-x: hidden;
    padding-bottom: 50px;
    transition: background-color 0.3s;
}

.monitor {
    width: 92%;
    max-width: 900px;
    background-color: #d3d3d3;
    border: 1px solid #888;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 5px 10px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.bezel {
    width: 100%;
    background-color: #bababa;
    padding: 25px;
    border-radius: 10px;
    box-shadow: inset 3px 3px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.screen {
    width: 100%;
    background-color: var(--crt-bg);
    color: var(--crt-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: pixelated;
    font-smooth: never;
}

.screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(18, 16, 16, 0) 50%,
            var(--crt-scanline-color) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    from { background-position: 0 0; }
    to { background-position: 0 40px; }
}

.screen-content {
    width: 100%;
    height: 100%;
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 2;
    padding-right: 12px;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.6;
    text-shadow: 0 0 5px var(--crt-color), 0 0 10px var(--crt-glow);
}

.screen-content::-webkit-scrollbar {
    width: 10px;
}
.screen-content::-webkit-scrollbar-track {
    background: #111;
    border-left: 2px solid #333;
}
.screen-content::-webkit-scrollbar-thumb {
    background: var(--crt-color);
    border: 2px solid #111;
}

.cursor {
    display: inline-block;
    background-color: var(--crt-color);
    width: 0.6em;
    height: 1.1em;
    margin-left: 4px;
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px var(--crt-color), 0 0 10px var(--crt-glow);
}

@keyframes blink {
    from, to { background-color: transparent; box-shadow: none; }
    50% { background-color: var(--crt-color); box-shadow: 0 0 5px var(--crt-color), 0 0 10px var(--crt-glow); }
}

.monitor-base {
    width: 40%;
    height: 20px;
    background-color: #a0a0a0;
    border: 1px solid #777;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin: -15px auto 0 auto;
    position: relative;
    z-index: -1;
    box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.3);
}

.monitor-neck {
    width: 15%;
    height: 25px;
    background-color: #b0b0b0;
    margin: -20px auto 0 auto;
    position: relative;
    z-index: -2;
    border-left: 1px solid #777;
    border-right: 1px solid #777;
}

/* CLI Interactive Prompt */
.cli-prompt-container {
    display: flex;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--crt-color);
    position: relative;
    z-index: 5;
}

.cli-prompt-label {
    color: var(--crt-color);
    margin-right: 8px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--crt-color);
    white-space: nowrap;
}

.cli-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--crt-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    text-shadow: 0 0 5px var(--crt-color);
    caret-color: var(--crt-color);
}

.cli-output-line {
    margin-bottom: 8px;
    word-break: break-word;
}

.cli-command-echo {
    color: #fff;
    text-shadow: 0 0 5px #fff;
    margin-bottom: 4px;
}

/* Staging Badge & Controls */
.staging-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #ff3333;
    color: #fff;
    font-size: 0.55rem;
    padding: 3px 6px;
    border-radius: 3px;
    letter-spacing: 1px;
    z-index: 20;
}

.controls-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    z-index: 10;
    font-size: 0.75rem;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--crt-color);
    color: var(--crt-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    padding: 6px 12px;
    cursor: pointer;
    text-shadow: 0 0 5px var(--crt-color);
    box-shadow: 0 0 5px var(--crt-color);
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--crt-color);
    color: #111;
    text-shadow: none;
}
