:root {
    --color-bg: #0b0b0b;
    --color-text: #ffb000;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg);
}

#terminal {
    width: 100%;
    height: 100%;

    background: var(--color-bg);
    color: var(--color-text);

    font-family: monospace;
    font-size: 16px;
    line-height: 1.5;

    padding: 2ch;
    box-sizing: border-box;

    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-direction: column;
}

#terminal p {
    margin: 0;
    min-height: 1ch;
}

#output {
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.input-line {
    display: flex;
    align-items: flex-start;
}

.prompt {
    margin-right: 1ch;
}

#terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font: inherit;
    width: 100%;
    caret-color: transparent;
    /* hide real caret */
    position: relative;
    z-index: 1;
}

.input-wrapper {
    position: relative;
    flex: 1;
    font: inherit;
}

.input-viewport {
    display: block;
    width: 100%;
    overflow: hidden;
}

/* Rendered text moves inside this */
#rendered-input {
    display: inline-block;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Invisible input */
#terminal-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    caret-color: transparent;
}

/* Inverted cursor (block over character) */
/* End-of-line cursor */
.cursor-block,
.cursor-eol {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Unfocused cursor: hollow block */
.cursor-unfocused {
    border: 1px solid var(--color-text);
    box-sizing: border-box;
}

.cursor-block,
.cursor-eol,
.cursor-unfocused {
    display: inline-block;
    width: 1ch;
    height: 1.5em;
    line-height: 1.5em;
    vertical-align: top;
    box-sizing: border-box;
}