:root {
    --terminal-bg: #020617;
    --terminal-fg: #38bdf8;
    --terminal-prompt: #22c55e;
    --terminal-muted: #94a3b8;
    --terminal-success: #22c55e;
    --terminal-error: #ef4444;
    --terminal-panel: rgba(15, 23, 42, 0.72);
    --terminal-border: rgba(56, 189, 248, 0.34);
    --terminal-link: #7db7ff;
    --terminal-table: #cbd5f5;
    --terminal-shadow: rgba(56, 189, 248, 0.16);
}

body {
    background-color: var(--terminal-bg);
    color: var(--terminal-fg);
    font-family: monospace;
    margin: 0;
    padding: 28px;
    min-height: 100vh;
    box-sizing: border-box;
}

#main-site {
    min-height: calc(100vh - 56px);
}

.terminal-window {
    max-width: min(1180px, calc(100vw - 56px));
    margin: auto;
    background: var(--terminal-panel);
    border: 1px solid var(--terminal-border);
    border-radius: 10px;
    box-shadow: 0 0 32px var(--terminal-shadow);
    overflow: hidden;
}

.terminal-window__bar {
    align-items: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88));
    border-bottom: 1px solid var(--terminal-border);
    display: grid;
    grid-template-columns: minmax(74px, auto) 1fr auto;
    min-height: 38px;
    padding: 0 12px;
}

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

.window-control {
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
    display: inline-block;
    height: 12px;
    width: 12px;
}

.window-control--close {
    background: #ef4444;
}

.window-control--minimize {
    background: #eab308;
}

.window-control--maximize {
    background: #22c55e;
}

.terminal-window__title {
    color: var(--terminal-table);
    font-size: 13px;
    font-weight: 700;
    justify-self: center;
    letter-spacing: 0;
}

.terminal-window__status {
    color: var(--terminal-muted);
    font-size: 12px;
    justify-self: end;
}

.terminal {
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.18)),
        var(--terminal-panel);
    min-height: 72vh;
    padding: 22px;
}

#output {
    min-height: 58vh;
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 4px;
}

.terminal-output {
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt {
    color: var(--terminal-prompt);
    flex: 0 0 auto;
    margin-right: 8px;
    white-space: nowrap;
}

.input-line {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--terminal-border);
    gap: 0;
    margin-top: 14px;
    padding-top: 12px;
    min-width: 0;
}

input {
    background: transparent;
    border: none;
    color: var(--terminal-fg);
    font-family: monospace;
    font-size: 16px;
    outline: none;
    width: 100%;
    min-width: 0;
}

input:focus {
    text-shadow: 0 0 10px var(--terminal-shadow);
}

.command-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.command-chips button {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid var(--terminal-border);
    border-radius: 6px;
    color: var(--terminal-fg);
    cursor: pointer;
    font: inherit;
    padding: 6px 9px;
}

.command-chips button:hover,
.command-chips button:focus-visible {
    box-shadow: 0 0 14px var(--terminal-shadow);
    outline: 1px solid var(--terminal-fg);
}

.terminal-output--muted {
    color: var(--terminal-muted);
}

.terminal-output--success {
    color: var(--terminal-success);
}

.terminal-output--error {
    color: var(--terminal-error);
}

.terminal-output--prompt {
    color: var(--terminal-prompt);
}

.terminal-output--system {
    color: var(--terminal-muted);
}

.terminal-output--link {
    color: var(--terminal-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.terminal-output--table,
.terminal-output--list {
    color: var(--terminal-table);
}

.terminal-output--reward,
.terminal-output--html {
    color: var(--terminal-fg);
}

.terminal-reward {
    box-sizing: border-box;
    overflow: hidden;
}

.terminal-reward img {
    border-radius: 6px;
}

.terminal-theme-matrix {
    --terminal-bg: #020617;
    --terminal-fg: #22c55e;
    --terminal-prompt: #74f7c5;
    --terminal-muted: #9bbdb3;
    --terminal-success: #74f7c5;
    --terminal-error: #ff827d;
    --terminal-panel: rgba(3, 7, 7, 0.82);
    --terminal-border: rgba(116, 247, 197, 0.34);
    --terminal-link: #7db7ff;
    --terminal-table: #eafff8;
    --terminal-shadow: rgba(116, 247, 197, 0.18);
}

.terminal-theme-amber {
    --terminal-bg: #020617;
    --terminal-fg: #eab308;
    --terminal-prompt: #38bdf8;
    --terminal-muted: #cbd5f5;
    --terminal-success: #22c55e;
    --terminal-error: #f87171;
    --terminal-panel: rgba(15, 23, 42, 0.72);
    --terminal-border: rgba(234, 179, 8, 0.36);
    --terminal-link: #38bdf8;
    --terminal-table: #e5e7eb;
    --terminal-shadow: rgba(234, 179, 8, 0.18);
}

.terminal-theme-neural {
    --terminal-bg: #000000;
    --terminal-fg: #38bdf8;
    --terminal-prompt: #a78bfa;
    --terminal-muted: #94a3b8;
    --terminal-success: #22c55e;
    --terminal-error: #ef4444;
    --terminal-panel: rgba(15, 23, 42, 0.86);
    --terminal-border: rgba(167, 139, 250, 0.36);
    --terminal-link: #a78bfa;
    --terminal-table: #e5e7eb;
    --terminal-shadow: rgba(167, 139, 250, 0.2);
}

/* Booting screen */
#boot-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: black;
    color: var(--terminal-prompt);
    font-family: monospace;
    padding: 20px;
    z-index: 9999;
}

#boot-text {
    white-space: pre-line;
}
