/* ============================================================
   BASTION MUD — TERMINAL CSS (Canonical Edition)
   Location: static/css/terminal.css
   VERSION: 2002-BOTTOM-ANCHORED-SCROLLREGION
   ============================================================ */

/* ============================================================
   TERMINAL LAYOUT
   ============================================================ */

#terminal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* critical for nested flex scrolling */
    overflow: hidden; /* Prevent page scrollbars */
    background: rgba(0,0,0,0.25);
}

/* Scroll container: just a scrollable box */
#terminal-scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    /* no flex layout here; the inner output handles bottom anchoring */
}

/* Output: flex column, bottom-anchored */
#terminal-output {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* ⭐ anchor lines at the bottom */
    padding: 10px;
    color: #c7ccd6;
    font-family: "Fira Code", "Cascadia Mono", "Consolas", monospace;
    font-size: 15px;
    line-height: 1.35;
}

#terminal-output div {
    margin: 2px 0;
    white-space: pre-wrap;
}

/* Boot block (creation mode) */
.boot-block {
    flex: 0 0 auto;
    padding: 10px;
    white-space: pre-wrap;
}

/* Combat panel */
#combat-panel {
    flex: 0 0 auto;
    padding: 10px;
}

/* ============================================================
   INPUT BAR
   ============================================================ */

#terminal-input {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0,0,0,0.35);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-family: "Fira Code", "Cascadia Mono", "Consolas", monospace;
    font-size: 15px;
}

#terminal-input .prompt {
    margin-right: 6px;
    color: #88c0d0;
}

#terminal-command {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #eceff4;
    font-family: inherit;
    font-size: 15px;
}

/* ============================================================
   TERMINAL OUTPUT STYLING
   ============================================================ */

.terminal-line {
    margin: 2px 0;
    white-space: pre-wrap;
}

.terminal-line::selection {
    background: #3b4252;
}

/* ASCII banner */
.terminal-green {
    color: #00ff00;
    text-align: center;
    white-space: pre;
}

.terminal-room-name {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   STAT PANEL ENHANCEMENTS
   ============================================================ */

.terminal-line.stat-block {
    white-space: pre;
    font-family: "Fira Code", "Cascadia Mono", "Consolas", monospace;
}

.stat-block + .terminal-line,
.terminal-line + .stat-block {
    margin-top: 6px;
    margin-bottom: 6px;
}

.stat-columns {
    display: flex;
    flex-direction: row;
    gap: 40px;
    white-space: pre;
    font-family: inherit;
}

.stat-col {
    display: flex;
    flex-direction: column;
    white-space: pre;
}

.stat-col div {
    white-space: pre;
}

/* ============================================================
   COMMAND ECHO
   ============================================================ */

.cmd-echo {
    color: #88c0d0;
    font-weight: 600;
}

/* ============================================================
   CHAT LINES
   ============================================================ */

.chat-line {
    color: #a3be8c;
}

.term-npc {
    color: #8fc9ff;
}

.term-monster {
    color: #f4d35e;
}