:root {
    --terminal-bg: #000000;
    --terminal-text: #DFF5FD;
    --terminal-prompt: #DFF5FD;
    --link-color: #0000ee;
    --link-visited: #551a8b;
    --directory-bg: #5E96A6;  /* Lighter muted blue-teal, 30% brighter */
    --level-0-bg: #5E96A6;    /* Evalyn's Desktop - lighter muted blue */
    --level-1-bg: #487A8A;    /* Living Room - darker */
    --level-2-bg: #325E6E;    /* Kitchen - darker still */
    --level-3-bg: #1C4252;    /* Nursery - very dark */
    --level-4-bg: #000000;    /* Basement - black */
    --directory-text: #000000;
    --terminal-glow: rgba(223, 245, 253, 0.6);
    --terminal-font-size: 16px;
    --terminal-font-size-mobile: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background-color: var(--terminal-bg) !important;
    color: var(--terminal-text);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: var(--terminal-font-size);
}

/* Override 98.css backgrounds and borders for terminal elements */
#terminal, #terminal * {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#terminal pre {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#terminal input {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--terminal-text) !important;
}

.terminal {
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background-color: var(--terminal-bg);
    position: relative;
    font-size: var(--terminal-font-size);
}

/* Blinking cursor */
.cursor {
    color: var(--terminal-text);
    font-family: 'VT323', monospace;
    font-size: var(--terminal-font-size);
    line-height: 1.4;
    position: absolute;
    top: 40px;
    left: 20px;
    animation: blink 1.06s infinite;
    text-shadow: 
        0 0 3px var(--terminal-glow),
        0 0 8px var(--terminal-glow);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.ascii-banner {
    color: var(--terminal-text);
    margin-bottom: 30px;
    font-size: var(--terminal-font-size);
    line-height: 1;
    font-family: 'VT323', monospace;
    text-shadow: 
        0 0 5px var(--terminal-glow),
        0 0 10px var(--terminal-glow),
        0 0 15px var(--terminal-glow);
    white-space: pre;
    background-color: transparent;
    display: block;
    text-align: left;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* Fixed width to prevent reflow during typing */
    min-height: 6em; /* Pre-allocate space for 6 lines */
    max-width: 58ch; /* Width of the ASCII art */
}

.terminal-content {
    line-height: 1.5;
    width: 100%;
    background-color: transparent;
    font-size: var(--terminal-font-size);
}

.terminal-line {
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: var(--terminal-font-size);
    text-shadow: 
        0 0 3px var(--terminal-glow),
        0 0 8px var(--terminal-glow);
    min-height: 1.4em; /* Pre-allocate line height */
}

.terminal-prompt {
    display: flex;
    align-items: center;
    margin-top: 20px;
    background-color: transparent;
}

.prompt-symbol {
    color: var(--terminal-prompt);
    margin-right: 8px;
}

.password-input {
    background: transparent;
    border: none;
    color: var(--terminal-text);
    font-family: inherit;
    font-size: var(--terminal-font-size);
    width: 100%;
    max-width: 50ch; /* Limit to ~50 characters width */
    outline: none;
    caret-color: var(--terminal-text);
    text-shadow: 
        0 0 3px var(--terminal-glow),
        0 0 8px var(--terminal-glow);
}

.password-input::placeholder {
    color: var(--terminal-text);
    opacity: 0.3;
}

.submit-hint {
    color: var(--terminal-text);
    opacity: 0.5;
    font-size: var(--terminal-font-size);
    margin-left: 8px;
    white-space: nowrap;
    animation: fadeIn 0.3s ease-in;
    flex-shrink: 0; /* Prevent hint from shrinking */
    display: inline-flex;
    align-items: center;
}

/* Mobile submit button styling */
@media (max-width: 768px) {
    .submit-hint {
        opacity: 1; /* Full opacity on mobile for clickable button */
        padding: 0 8px; /* Add padding for easier tapping */
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

#terminal-output {
    margin-top: 10px;
}

.error {
    color: #ff0000;
}

.success {
    color: #00ff00;
}

.hidden {
    display: none !important;
}

/* Windows 95/98 Desktop */
.directory-listing {
    background-color: var(--directory-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'MS Sans Serif', sans-serif;
}

.desktop {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

.desktop-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 20px;
    padding: 20px;
    min-height: 400px;
    justify-items: center;
}

.desktop-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    user-select: none;
    border-radius: 0;
    width: fit-content;
    max-width: 90px;
}

/* Lock overlay container */
.desktop-icon .icon-with-lock {
    position: relative;
    display: inline-block;
}

.desktop-icon:hover .desktop-icon-label {
    background-color: #c0c0c0;
    color: #000000;
    outline: 1px dotted #000000;
}

.desktop-icon.selected .desktop-icon-label {
    background-color: #000080;
    color: #ffffff;
}

.desktop-icon.selected:hover .desktop-icon-label {
    background-color: #000080;
    color: #ffffff;
    outline: 1px dotted #ffffff;
}

.desktop-icon img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    image-rendering: pixelated;
}

.desktop-icon-label {
    font-size: 11px;
    color: #000;
    padding: 2px 4px;
    word-break: break-word;
    max-width: 74px;
    background: transparent;
}

.directory-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.directory-header h1 {
    font-size: 24px;
    font-weight: normal;
}

.file-list {
    list-style: none;
}

.file-item {
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    min-width: 50px;
    text-align: left;
    flex-shrink: 0;
}

.file-link {
    color: var(--link-color);
    text-decoration: underline;
    flex: 1;
}

.file-link:visited {
    color: var(--link-visited);
}

.file-link:hover {
    color: #ff0000;
}

.file-size {
    text-align: right;
    min-width: 80px;
    color: #666;
}

.file-date {
    min-width: 150px;
    color: #666;
}

.directory-link {
    font-weight: bold;
}

.parent-directory {
    margin-bottom: 10px;
}

/* Status bar text fix */
.status-bar-field {
    color: #000000 !important;
}

/* Media Modal Styles */
.media-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.media-window {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.media-content {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #c0c0c0;
    min-height: 200px;
}

/* Media Type Specific Styles */
.media-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.media-content video {
    max-width: 100%;
    max-height: 70vh;
}

.media-content audio {
    width: 100%;
}

.media-content .text-content {
    width: 100%;
    height: 60vh;
    padding: 10px;
    background: white;
    border: 2px inset #c0c0c0;
    overflow: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #000000;
    line-height: 1.4;
}

.media-content iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

/* Password Modal Styles */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    :root {
        --terminal-font-size: var(--terminal-font-size-mobile);
    }
    
    .ascii-banner {
        max-width: 100%;
        overflow-x: auto;
        min-height: 5em; /* Slightly smaller on mobile */
    }
    
    .terminal {
        padding: 20px 10px;
    }
    
    .directory-listing {
        padding: 10px;
    }
    
    .cursor {
        left: 10px;
        top: 20px;
    }
    
    .password-input {
        font-size: 16px !important; /* Prevent zoom on iOS - needs to be 16px */
        width: 100%;
    }
    
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 80px);
        gap: 15px;
        padding: 15px;
    }
    
    .desktop-icon {
        max-width: 75px;
    }
    
    .file-item {
        font-size: 12px;
    }
    
    .file-date {
        display: none;
    }
    
    .media-window {
        width: 95%;
        max-height: 85vh;
    }
    
    .window {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Adjust lock icon position on mobile */
    .lock-overlay {
        top: -2px !important;
        right: -2px !important;
    }
}