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

body {
    background: #000;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
}

/* Matrix rain canvas */
#c {
    position: fixed;
    inset: 0;
    display: block;
    z-index: 0;
}

/* ── Terminal window ─────────────────────────────────────────────────────── */
#terminal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(860px, 92vw);
    height: min(540px, 85vh);
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255,255,255,0.06);
}

/* Title bar — macOS-style dark bar */
#term-titlebar {
    background: #1e1e1e;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    user-select: none;
}

.term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }

#term-title {
    margin-left: 8px;
    font-size: 13px;
    color: #8a8a8a;
    letter-spacing: 0.02em;
}

/* Terminal body */
#term-body {
    background: rgba(10, 10, 10, 0.88);
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #00ff46;
    display: flex;
    flex-direction: column;
}

/* Scroll bar */
#term-body::-webkit-scrollbar       { width: 6px; }
#term-body::-webkit-scrollbar-track { background: transparent; }
#term-body::-webkit-scrollbar-thumb { background: rgba(0,255,70,0.2); border-radius: 3px; }

/* Output area grows to push input to bottom */
#term-output {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Each printed line */
.term-line {
    display: block;
    min-height: 1.6em;
}

/* Dim colour for old prompts */
.term-line.prompt { color: #00cc38; }

/* Output text slightly dimmer */
.term-line.output { color: #a0ffa0; }

/* Error text */
.term-line.error  { color: #ff6060; }

/* Input row always at the bottom */
#term-input-row {
    flex-shrink: 0;
    padding-top: 2px;
    line-height: 1.6;
}

#term-prompt {
    color: #00ff46;
    white-space: pre;
}

#term-typed {
    color: #e8e8e8;
    white-space: pre;
}

/* Blinking block cursor */
#term-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: #00ff46;
    vertical-align: -0.1em;
    animation: blink 1s step-end infinite;
}

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