body { 
    background: #000; 
    color: #0f0; 
    font-family: 'VT323', monospace;
    margin: 0;
    padding: 0;
    font-size: 20px;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #0f0;
    text-align: center;
    font-size: 2.5em;
    text-shadow: 0 0 10px #0f0;
    animation: glitch 1s infinite;
    position: relative;
    z-index: 1;
    margin: 10px 0;
    flex-shrink: 0;
}

#game-output {
    position: relative;
    z-index: 2;
    background: rgba(0, 10, 0, 0.5);
    padding: 25px;
    border: 1px solid #0f0;
    height: 100%;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    overflow-y: scroll;
    white-space: pre-wrap;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: #0f0 rgba(0, 20, 0, 0.9);
    animation: 
        crtFlicker 8s infinite,
        screenDistort 12s infinite;
    transform-origin: center;
}

.room-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    border: 2px solid #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    animation: imageGlitch 5s infinite;
}

input[type="text"] {
    position: relative;
    z-index: 3;
    background: rgba(0, 20, 0, 0.9);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 12px;
    width: 100%;
    margin-bottom: 10px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

input[type="text"]:disabled {
    opacity: 0.7;
    cursor: wait;
}

.button {
    background: rgba(0, 20, 0, 0.9);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    text-shadow: 0 0 5px #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.button:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

/* Terminal styles */
.terminal-line {
    min-height: 1.2em;
    margin: 2px 0;
    padding: 2px 0;
    border-left: 3px solid transparent;
}

.terminal-command {
    color: #0fa;
    font-weight: bold;
    border-left: 3px solid #0fa;
    padding-left: 10px;
}

.terminal-processing {
    color: #ff0;
}

.terminal-processing::after {
    content: '...';
    animation: blink 1s infinite;
}

.terminal-response.new-line {
    animation: fadeIn 0.3s ease-out;
}

/* Layout */
.game-container {
    position: relative;
    width: 95%;
    height: 90vh;
    margin: 0 auto;
    box-sizing: border-box;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.restart-form {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.sound-toggle {
    position: fixed;
    top: 10px;
    right: 140px;
    background: none;
    border: none;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.sound-toggle:hover {
    text-shadow: 0 0 10px #0f0;
}

/* Terminal background and content */
#terminal-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: background-image 0.5s ease-in-out;
}

#terminal-content {
    position: relative;
    z-index: 2;
    text-shadow: 0 0 8px rgba(0, 0, 0, 1);
    animation: colorShift 10s infinite;
}

/* Scanline effect */
#game-output::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(0, 255, 0, 0.02) 50%,
        rgba(0, 0, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    animation: scanlines 1s linear infinite;
    z-index: 2;
}

/* Text styles */
#game-output strong, 
#game-output b {
    color: #0f0;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    font-size: 1.2em;
}

#game-output em,
#game-output i {
    color: #0fa;
    font-style: normal;
}

/* Animations */
@keyframes glitch {
    0% { text-shadow: 0 0 10px #0f0; }
    25% { text-shadow: -2px 0 #0f0, 2px 2px #0fa; }
    50% { text-shadow: 2px 0 #0f0, -2px -2px #0fa; }
    75% { text-shadow: -2px -2px #0f0, 2px 0 #0fa; }
    100% { text-shadow: 0 0 10px #0f0; }
}

@keyframes imageGlitch {
    0% { filter: none; }
    92% { filter: none; }
    93% { filter: hue-rotate(90deg) brightness(1.1); }
    94% { filter: none; }
    95% { filter: brightness(1.2); }
    96% { filter: none; }
    97% { filter: hue-rotate(-90deg) brightness(1.1); }
    98% { filter: none; }
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

@keyframes typing {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

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

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

/* Add CRT flicker effect */
@keyframes crtFlicker {
    0% {
        opacity: 1;
    }
    1% {
        opacity: 0.8;
    }
    2% {
        opacity: 0.9;
    }
    3% {
        opacity: 0.8;
    }
    4% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    51% {
        opacity: 0.8;
    }
    52% {
        opacity: 1;
    }
    97% {
        opacity: 1;
    }
    98% {
        opacity: 0.7;
    }
    99% {
        opacity: 0.9;
    }
    100% {
        opacity: 1;
    }
}

/* Add screen distortion effect */
@keyframes screenDistort {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    1% {
        transform: scale(1.01, 1) skew(0.2deg);
        filter: brightness(1.2);
    }
    2% {
        transform: scale(1);
        filter: brightness(1);
    }
    98% {
        transform: scale(1);
        filter: brightness(1);
    }
    99% {
        transform: scale(0.99, 1) skew(-0.2deg);
        filter: brightness(0.9);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Add subtle color shift effect */
@keyframes colorShift {
    0% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(0.5deg);
    }
    100% {
        filter: hue-rotate(0deg);
    }
} 

form {
    position: relative;
    z-index: 3;
    margin: 0;
    padding: 0;
    margin-bottom: 10px;
    flex-shrink: 0;
} 

/* Add CRT startup animation styles */
.crt-startup {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    pointer-events: none;
    animation: crtStartup 4s ease-out forwards;
}

.crt-lines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 255, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    animation: crtLines 4s ease-out forwards;
}

.crt-flash {
    position: fixed;
    inset: 0;
    background: #0f0;
    opacity: 0;
    animation: crtFlash 4s ease-out forwards;
}

@keyframes crtStartup {
    0% { transform: scale(1, 0.001); opacity: 0; }
    10% { transform: scale(1, 0.001); opacity: 1; }
    15% { transform: scale(1, 0.001); opacity: 0.5; }
    20% { transform: scale(1, 1); opacity: 0.2; }
    30% { transform: scale(1, 1); opacity: 0.5; }
    40% { transform: scale(1, 1); opacity: 0.2; }
    100% { transform: scale(1, 1); opacity: 0; }
}

@keyframes crtLines {
    0% { opacity: 0; transform: scaleY(0.001); }
    20% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(1); }
}

@keyframes crtFlash {
    0%, 10%, 20%, 40%, 100% { opacity: 0; }
    15%, 30% { opacity: 0.1; }
}

/* Update background container styles */
.terminal-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#terminal-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: background-image 0.5s ease-in-out;
}

/* Update game output styles to ensure alignment */
#game-output {
    position: relative;
    z-index: 2;
    background: rgba(0, 10, 0, 0.5);
    padding: 25px;
    border: 1px solid #0f0;
    height: 100%;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    overflow-y: scroll;
    white-space: pre-wrap;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: #0f0 rgba(0, 20, 0, 0.9);
    animation: 
        crtFlicker 8s infinite,
        screenDistort 12s infinite;
    transform-origin: center;
}

#terminal-content {
    position: relative;
    z-index: 2;
    /* ... rest of existing styles ... */
} 

/* Style the scrollbar for webkit browsers */
#game-output::-webkit-scrollbar {
    width: 8px;
}

#game-output::-webkit-scrollbar-track {
    background: rgba(0, 20, 0, 0.9);
    border-radius: 4px;
}

#game-output::-webkit-scrollbar-thumb {
    background-color: #0f0;
    border-radius: 4px;
    border: 2px solid rgba(0, 20, 0, 0.9);
}

#game-output::-webkit-scrollbar-thumb:hover {
    background-color: #0fa;
} 

/* Update z-index hierarchy to be simpler */
.terminal-background-container { z-index: 0; }
.game-container { z-index: 1; }
#game-output, #terminal-content { z-index: 2; }
form, input { z-index: 3; }
.restart-form, .sound-toggle { z-index: 1000; }