/* ==========================================================================
   WIRED SYSTEM MATRIX CORE LAYOUT (LAYER 02)
   ========================================================================== */

/* CRITICAL: Keeps main screen layers locked and dark during initialization */
#main-content.hidden {
    display: none !important;
}

html {
    background-color: #050505;
}

body {
    position: relative;
    background-color: #050505;
    color: #e02a2a; 
    font-family: "Courier New", Courier, monospace;
    font-size: 16px; 
    line-height: 1.6;
    padding: 50px;
    margin: 0;
    min-height: 100vh;
    text-shadow: 0 0 5px rgba(224, 42, 42, 0.5);
}

/* Stable Scanline Overlay Layer (SAFE FOR EPILEPSY - NO FLASHING) */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.04));
    z-index: 99999999;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

.directory-container {
    width: 100%;
    max-width: 1200px; /* Kept text blocks from spacing out infinitely */
    margin: 0 auto;
    text-align: left;
}

/* Master content alignment grid to split directory and server stats */
.terminal-layout-split {
    display: flex;
    flex-direction: row;
    gap: 60px;
    width: 100%;
    margin-top: 30px;
}

.directory-column {
    flex: 3;
}

.system-status-column {
    flex: 1;
    min-width: 280px;
    border-left: 1px dashed rgba(224, 42, 42, 0.3);
    padding-left: 40px;
}

/* Typography Mechanics */
h1 {
    font-size: 1.8rem; 
    font-weight: bold;
    margin: 20px 0;
    letter-spacing: 2px;
}

hr {
    border: 0;
    border-top: 1px solid #e02a2a;
    margin: 25px 0;
    opacity: 0.7;
}

/* Custom Spaced Row List Configuration */
.directory-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.directory-list li {
    display: flex;
    justify-content: flex-start;
    padding: 12px 8px; 
    border-bottom: 1px solid rgba(224, 42, 42, 0.08);
}

.directory-list li:hover {
    background-color: rgba(224, 42, 42, 0.08);
}

.directory-list .type {
    width: 90px; 
    color: #881a1a;
    font-weight: bold;
}

.directory-list a {
    color: #ff4d4d;
    text-decoration: none;
    flex-grow: 1;
    font-weight: bold;
}

.directory-list a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
}

.directory-list .date {
    color: #881a1a;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ASCII text framework rules (RESTORED FULL SIZE ON DESKTOP) */
.ascii-art {
    font-family: "Courier New", Courier, monospace;
    font-size: 14px; 
    line-height: 1.1;
    color: #ff2b2b;
    text-shadow: 0 0 8px rgba(255, 43, 43, 0.8);
    white-space: pre;
    margin: 0 0 35px 0;
    text-align: left;
}

.status-block {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.status-title {
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 8px;
}

footer {
    font-size: 0.9rem;
    color: #550000;
    margin-top: 60px;
    letter-spacing: 2px;
}

/* ==========================================================================
   BOOT INJECTION LOGIC STYLES
   ========================================================================== */

.terminal-line {
    margin: 6px 0;
    letter-spacing: 1px;
    font-size: 15px;
    color: #ff3b3b;
}

.terminal-line .prompt {
    color: #ffffff;
    font-weight: bold;
    animation: boot-cursor-flash 0.8s infinite alternate;
}

.warning-flash {
    color: #ffffff;
    font-weight: bold;
    animation: boot-cursor-flash 1s infinite alternate;
}

@keyframes boot-cursor-flash {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}
/* ==========================================================================
   ISOLATED SAFE MOBILE/TABLET RESPONSIVE SYSTEM
   ========================================================================== */
@media screen and (max-width: 768px) {
    body {
        padding: 15px !important;
        font-size: 14px !important;
        overflow-x: hidden !important;
    }

    /* Force columns to stack cleanly on mobile only */
    .terminal-layout-split {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .system-status-column {
        border-left: none !important;
        border-top: 1px dashed rgba(224, 42, 42, 0.3) !important;
        padding-left: 0 !important;
        padding-top: 30px !important;
        min-width: 100% !important;
        width: 100% !important;
    }

    /* Target headers, spans, and paragraphs inside the mainframe safely */
    h1, .mem-mainframe h1 {
        font-size: 1.3rem !important; /* Scales down header text to fit mobile */
        white-space: normal !important; /* Permits normal wrapping */
        overflow-wrap: break-word !important; /* Drops whole words like daemonlurk down */
        word-break: keep-all !important; /* STOP splitting words into fragments */
    }

    /* Wrap regular text nodes but preserve your block layouts */
    span, div, p, a {
        overflow-wrap: break-word !important;   
        word-break: break-all !important;      
    }

    /* Keep your custom mainframe content contained cleanly inside the borders */
    .mem-mainframe span, .mem-mainframe div, .mem-mainframe p {
        overflow-wrap: break-word !important;
        word-break: break-all !important;
        white-space: pre-wrap !important;
    }

    /* Boosted size to 13px so the logo displays large and crisp on phones */
    .ascii-art {
        font-size: 13px !important; 
        width: 100% !important;
        overflow-x: auto !important;
        white-space: pre !important;
    }

    .directory-list li {
        font-size: 0.85rem !important;
        gap: 5px !important;
    }

    /* --- RESTORE INPUT CHANNELS & DECRYPT PANEL FLEX FIELD ROWS --- */
    
    /* Forces the label string and password container box to align side-by-side */
    .scanned-telemetry-box div, 
    div[style*="display: flex"], 
    .deep-cyber-void div,
    form div,
    main div {
        display: flex !important;
        flex-direction: row !important; /* Forces prompt and input to sit side-by-side */
        flex-wrap: wrap !important;     /* Safely wraps to line two ONLY if screen is too narrow */
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* CRITICAL OVERRIDE: Prevents form label prompts from stacking text vertically */
    span[id*="key"], label, .prompt, .telemetry-title, .deep-cyber-void span, form span {
        display: inline-block !important;
        white-space: nowrap !important; /* Hard-locks text letters horizontally */
        word-break: keep-all !important; /* Disables the break-all from lines 31-34 */
        overflow-wrap: normal !important;
        flex-shrink: 0 !important;      /* Stops input grids from crushing the prompt label size */
    }

    /* Forces the password/decrypt input fields to fill the remaining box gap scale */
    input[type="password"], input[type="text"], input {
        display: inline-block !important;
        flex-grow: 1 !important;        /* Scales input field size to absorb remaining row space */
        min-width: 150px !important;    /* Provides a comfortable minimum field width constraint */
        box-sizing: border-box !important;
    }

    /* Restores your breach alert matrix positioning panels */
    .ai-popup-alert, .deep-cyber-void {
        display: block !important;       /* Bypasses general line overrides */
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        transform: none !important;
        left: 0 !important;
        top: 0 !important;
        margin: 20px 0 !important;      /* Safely pushes the alert boxes inside the viewport */
    }
} /* FIXED: All rules are now safely contained inside the mobile media bracket */
/* ==========================================================================
   BLACKWALL INTERFACE SPECIFIC OVERRIDES (PREVENTS MATRIX INHERITANCE OVERFLOW)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Cancels out the global display flex rule from lines 152-163 */
    main.log-mainframe div.terminal-input-row,
    .log-mainframe .terminal-input-row {
        display: flex !important;
        flex-direction: column !important; /* Stack elements vertically on small screens */
        align-items: flex-start !important;
        width: 100% !important;
        gap: 12px !important;
    }

    /* Standardizes the prompt so it drops into place natively */
    .log-mainframe .terminal-prompt {
        display: inline-block !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Sets the input field width bounded nicely within borders */
    .log-mainframe .cyber-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Sets the button bounds properly */
    .log-mainframe .cyber-btn {
        width: 100% !important;
        max-width: 140px !important;
        display: block !important;
        text-align: center !important;
    }
}
/* ==========================================================================
   FINAL OVERRIDE: FORCE INTERNAL CONTAINERS TO STAY LOCKED IN PLACE
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Hard overrides the global "main div" rule pushing the inner container out */
    main.log-mainframe div.access-terminal-gate,
    .log-mainframe .access-terminal-gate {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 20px 0 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
    }
}
/* ==========================================================================
   BREACH PAGE ISOLATION OVERRIDES
   ========================================================================== */
*, *:before, *:after {
    box-sizing: border-box !important;
}

/* Stops global flex grids from squishing Phase 1 content on mobile */
.deep-cyber-void, .deep-cyber-void div, .deep-cyber-void span {
    display: block !important;
    width: 100% !important;
    flex-direction: column !important;
    text-align: left !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: keep-all !important;
    white-space: pre-wrap !important;
}

/* Auto-scales monospace ASCII text art vectors based on screen width */
.rogue-ai-face {
    color: #ff0033;
    font-family: "Courier New", Courier, monospace !important;
    font-size: 2.15vw !important; /* Vector font scales to phone display width */
    line-height: 1.1 !important;
    white-space: pre !important;
    text-align: center !important;
    margin-bottom: 25px;
    text-shadow: 0 0 8px #ff0033;
    width: 100% !important;
    display: block !important;
    overflow: hidden !important;
}

@media (min-width: 768px) {
    .rogue-ai-face { font-size: 11px !important; } /* Hard lock caps layout stretch on desktop */
}
