:root {
    --bg-color: #161616;
    --text-primary: rgba(255, 255, 255, 0.85);
    --text-sec: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-accent: rgba(255, 255, 255, 0.95);
    --font-mono: 'JetBrains Mono', monospace;
    --window-border: rgba(255, 255, 255, 0.08);
    --glow: 0 0 10px rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    background-color: #0b0b0b;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

::selection {
    background-color: var(--text-sec);
    color: #fff;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.6;
}

/* Outer Window */
.window {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background-color: var(--bg-color);
    border: 1px solid var(--window-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.02);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Header */
.window-header {
    height: 36px;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--window-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn.close {
    background-color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.btn.close:hover {
    background-color: #ff5f56;
}

.btn.close:hover::before {
    content: "×";
    color: #4c0002;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.btn.minimize {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn.maximize {
    background-color: rgba(255, 255, 255, 0.15);
}

.window-title {
    color: var(--text-muted);
    font-size: 12px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.window-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
}

.window-menu a:hover {
    color: var(--text-primary);
}

/* Body Layout */
.window-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Main Terminal */
.terminal-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.terminal-container::-webkit-scrollbar {
    width: 8px;
}

.terminal-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
}

#output {
    display: flex;
    flex-direction: column;
}

/* Output Typography */
.out-line {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.out-line.style-muted {
    color: var(--text-muted);
}

.out-cmd {
    color: #fff;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
}

.out-prompt {
    color: var(--text-accent);
    margin-right: 8px;
}

.out-err {
    color: rgba(255, 255, 255, 0.6);
}

.out-ascii {
    white-space: pre;
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-primary);
    text-shadow: var(--glow);
    margin-bottom: 15px;
    overflow-x: auto;
}

.out-table {
    display: table;
    margin: 5px 0;
    width: 100%;
}

.out-table-row {
    display: table-row;
}

.out-table-cell {
    display: table-cell;
    padding: 4px 15px 4px 0;
}

/* Specific styles for console output */
.text-sec {
    color: var(--text-sec);
}

.text-accent {
    color: var(--text-accent);
}

.text-white {
    color: #fff;
}

.bg-subtle {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 4px;
    border-left: 2px solid var(--text-sec);
    margin: 10px 0;
    display: inline-block;
}

/* Input Area */
.input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.prompt {
    color: var(--text-accent);
    margin-right: 8px;
    white-space: nowrap;
}

#cmdline {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 14px;
    flex: 1;
    outline: none;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
    caret-color: transparent;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: #fff;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    position: relative;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .window-body {
        flex-direction: column;
    }
}