:root {
    --green: #00ff41;
    --green-dim: #00cc33;
    --green-glow: rgba(0, 255, 65, 0.15);
    --amber: #ffb000;
    --cyan: #00d4ff;
    --bg: #0a0a0a;
    --bg-terminal: #0d1117;
    --border: #1a2332;
    --text-dim: #4a6a4a;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--green);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
}

/* CRT scanline effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
}

.scanline::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

/* Terminal window */
.terminal {
    width: min(900px, 90vw);
    height: min(600px, 85vh);
    margin: 5vh auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0, 255, 65, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

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

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-min { background: #febc2e; }
.btn-max { background: #28c840; }

.terminal-title {
    color: #8b949e;
    font-size: 12px;
}

.terminal-body {
    background: var(--bg-terminal);
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ASCII art */
.ascii-art {
    color: var(--green);
    font-size: clamp(6px, 1.4vw, 14px);
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 0 10px var(--green-glow);
    white-space: pre;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ascii-art.visible {
    opacity: 1;
}

/* Terminal output */
.output {
    flex: 1;
}

.output .line {
    margin-bottom: 4px;
    line-height: 1.6;
    font-size: 13px;
    opacity: 0;
    animation: fadeIn 0.1s ease forwards;
}

.output .line.command {
    color: var(--green);
}

.output .line.response {
    color: #8b949e;
}

.output .line.highlight {
    color: var(--cyan);
}

.output .line.amber {
    color: var(--amber);
}

.output .line.dim {
    color: var(--text-dim);
}

.output .line .key {
    color: var(--amber);
}

.output .line .value {
    color: #8b949e;
}

.output .line a {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.output .line a:hover {
    border-bottom-color: var(--cyan);
}

/* Input line */
.input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 8px;
    flex-shrink: 0;
}

.prompt {
    color: var(--green);
    white-space: nowrap;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--green);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 600px) {
    .terminal {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }
    
    .terminal-body {
        padding: 16px;
    }
    
    .ascii-art {
        font-size: 5.5px;
    }
}
