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

:root {
    --bg: #0a0a0a;
    --text: #777;
    --text-dim: #3a3a3a;
    --text-bright: #999;
    --red: #884444;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    min-height: 100vh;
    padding: 2rem;
    -webkit-font-smoothing: antialiased;
}

.terminal {
    width: 100%;
    max-width: 620px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Output lines */
#output .line {
    white-space: pre-wrap;
    word-break: break-all;
}

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

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

#output .line.err {
    color: var(--red);
}

#output .line.spacer {
    height: 1.7em;
}

/* Prompt line */
.prompt-line {
    display: flex;
    align-items: center;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prompt-line.visible {
    opacity: 1;
}

.prompt-label {
    color: var(--text-dim);
    white-space: pre;
    flex-shrink: 0;
}

#prompt-input {
    background: transparent;
    border: none;
    color: var(--text-bright);
    font: inherit;
    outline: none;
    width: 0;
    min-width: 0;
    flex: 0 1 auto;
    caret-color: transparent;
    letter-spacing: 0;
}

#prompt-input.masked {
    color: transparent;
    width: 0 !important;
    position: absolute;
    opacity: 0;
}

.cursor-block {
    display: inline-block;
    width: 7px;
    height: 1.1em;
    background: var(--text);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

.cursor-block.hide {
    display: none;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Mask overlay — shows blocks over the invisible text */
.mask-display {
    color: var(--text-bright);
    white-space: pre;
}

/* Lockout */
.lockout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a0000;
    z-index: 50;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lockout-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#lockout-output {
    display: inline-block;
    font-family: inherit;
    font-size: inherit;
    line-height: 2;
    text-align: left;
}

#lockout-output .line {
    white-space: pre-wrap;
}

#lockout-output .line.warn {
    color: #cc0000;
    font-size: 1.1em;
    letter-spacing: 4px;
    margin-bottom: 0.8em;
}

#lockout-output .line.dim {
    color: #441111;
}

#lockout-output .line.err {
    color: #993333;
}

#lockout-output .line.bright-err {
    color: #cc4444;
    margin-top: 0.8em;
}

#lockout-output .cursor-block {
    animation: blink 1s step-end infinite;
    background: #993333;
}


/* Responsive */
@media (max-width: 480px) {
    body {
        font-size: 11px;
        padding: 1rem;
    }
}
