/* ============================================================
   Bastion MUD — Game Layout Styles
   VERSION: 6001-BRASS-COSMIC-HORROR
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top, #141018 0, #050308 55%, #020106 100%);
    color: #f5f0e6;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================================================
   Container
   ============================================================ */

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ============================================================
   Header
   ============================================================ */

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 1rem;
    background: linear-gradient(to bottom, #0b080f 0, #07050a 100%);
    border-bottom: 1px solid #5f4b2a;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
}

#header-left h1 {
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f8e3a4;
}

#header-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #a89c8a;
}

#game-nav a {
    margin-left: 1rem;
    text-decoration: none;
    color: #a89c8a;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}

#game-nav a:hover {
    color: #f3c96a;
    text-shadow: 0 0 6px rgba(243, 201, 106, 0.6);
}

/* ============================================================
   Layout
   ============================================================ */

#game-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 260px;
    grid-template-rows: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    min-height: 0; /* allow middle column to shrink for scrolling */
}

/* ============================================================
   Panels
   ============================================================ */

#left-panel,
#right-panel {
    background: radial-gradient(circle at top, #151018 0, #07050a 55%, #050308 100%);
    border: 1px solid #5f4b2a;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.75);
}

.panel-section {
    border-top: 1px solid rgba(95, 75, 42, 0.6);
    padding-top: 0.5rem;
}

.panel-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.panel-section h2 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #f3c96a;
}

/* ============================================================
   Character summary
   ============================================================ */

#portrait-placeholder {
    width: 100%;
    height: 80px;
    border: 1px dashed rgba(95, 75, 42, 0.7);
    margin-bottom: 0.25rem;
    background: repeating-linear-gradient(
        135deg,
        rgba(10, 7, 14, 0.9),
        rgba(10, 7, 14, 0.9) 4px,
        rgba(18, 13, 24, 0.9) 4px,
        rgba(18, 13, 24, 0.9) 8px
    );
}

#character-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f8e3a4;
}

#stats-list {
    list-style: none;
    font-size: 0.8rem;
    color: #c7bca4;
}

/* ============================================================
   Flasks
   ============================================================ */

#flasks {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.flask {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.flask-label {
    font-size: 0.8rem;
    color: #e7d7b4;
    letter-spacing: 0.04em;
}

.flask-body {
    position: relative;
    width: 100%;
    height: 10px;
    border: 1px solid #5f4b2a;
    background: radial-gradient(circle at top, #151018 0, #050308 100%);
    overflow: hidden;
}

.flask-fill {
    height: 100%;
    width: 0%;
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.health-fill { background: linear-gradient(to right, #5a1111, #b33939); }
.mana-fill   { background: linear-gradient(to right, #0f3f46, #2f7f88); }
.will-fill   { background: linear-gradient(to right, #3f285f, #8b5fd1); }

.flask-percent {
    font-size: 0.75rem;
    color: #a89c8a;
}

/* ============================================================
   Quick actions
   ============================================================ */

#quick-actions button {
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    background: #120f18;
    color: #f5f0e6;
    border: 1px solid #5f4b2a;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

#quick-actions button:hover {
    background: #1a1521;
    color: #f8e3a4;
    box-shadow: 0 0 10px rgba(243, 201, 106, 0.4);
}

/* ============================================================
   Terminal
   ============================================================ */

#terminal-container {
    background: radial-gradient(circle at top, #151018 0, #050308 55%, #020106 100%);
    border: 1px solid #5f4b2a;
    display: flex;
    flex-direction: column;
    min-height: 0;   /* critical for nested flex scrolling */
    overflow: hidden;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.85);
}

/* scroll region is defined in terminal.css; this just ensures it can shrink */
#terminal-scroll-region {
    min-height: 0;
}

/* keep input styling here; scrolling is handled by terminal.css */
#terminal-input {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-top: 1px solid #5f4b2a;
    font-family: "Consolas", "Fira Code", monospace;
    font-size: 0.85rem;
    background: linear-gradient(to right, rgba(10, 7, 14, 0.95), rgba(5, 3, 8, 0.98));
}

#terminal-input .prompt {
    margin-right: 0.35rem;
    color: #f3c96a;
    text-shadow: 0 0 6px rgba(243, 201, 106, 0.7);
}

#terminal-command {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f5f0e6;
}

/* Terminal lines */
.terminal-line {
    margin-bottom: 0.15rem;
}

/* ============================================================
   Right panel: compass
   ============================================================ */

#compass-display {
    font-family: "Consolas", "Fira Code", monospace;
    text-align: center;
    margin-top: 0.25rem;
    color: #a89c8a;
}

#compass-display .dir {
    padding: 0.1rem 0.3rem;
    color: #6f6554;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

#compass-display .dir.active {
    color: #f5f0e6;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(248, 227, 164, 0.6);
}

#compass-display .dir.center {
    color: #4fd5c7;
    text-shadow: 0 0 8px rgba(79, 213, 199, 0.7);
}

.compass-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.vertical-exits {
    margin-top: 0.25rem;
    display: flex;
    justify-content: space-around;
}

/* ============================================================
   Light indicator
   ============================================================ */

#light-indicator {
    font-size: 0.8rem;
    color: #e7d7b4;
}

.light-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.15rem;
}

.light-label {
    color: #a89c8a;
}

.visibility-meter {
    position: relative;
    width: 100%;
    height: 6px;
    border: 1px solid #5f4b2a;
    background: radial-gradient(circle at top, #151018 0, #050308 100%);
    overflow: hidden;
    margin-top: 0.15rem;
}

.visibility-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #8a6a2c, #f3c96a);
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(243, 201, 106, 0.6);
}

/* ============================================================
   Footer
   ============================================================ */

#game-footer {
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
    color: #8f8470;
    border-top: 1px solid #5f4b2a;
    background: #050308;
    box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.8);
}

/* ============================================================
   Responsive tweaks
   ============================================================ */

@media (max-width: 960px) {
    #game-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    #left-panel,
    #right-panel {
        order: 0;
    }

    #terminal-container {
        order: 1;
        min-height: 300px;
        height: auto; /* allow natural growth on small screens */
    }
}