body {
    margin: 0;
    padding: 0;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden; /* Prevent scrollbars */
}

#game-container {
    position: relative;
    width: 804px; /* 800px + 2px border on each side */
    height: 604px; /* 600px + 2px border on each side */
    overflow: hidden; /* Ensure content doesn't spill out */
}

#game-canvas {
    border: 2px solid #00ff00;
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 800px;
    height: 600px;
}

#hud {
    position: absolute;
    top: 10px;
    width: 100%;
    color: #00ff00;
    display: flex;
    justify-content: space-between;
    padding: 0 10px; 
    font-size: 14px;
    z-index: 10;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #00ff00;
    z-index: 20; /* Ensure overlay appears above everything */
}

/* Common styling for all overlay screens */
#initial-screen, #title-screen, #game-over, #victory, #level-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
}

/* General heading styles */
#overlay h1 {
    font-size: 48px;
    margin: 10px;
}

/* General paragraph styles */
#overlay p {
    font-size: 24px;
    margin: 5px;
}

/* Special styling for initial screen */
#initial-screen h1 {
    color: #00ff00;
    font-size: 64px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #00ff00;
    letter-spacing: 2px;
    animation: glow 1.5s infinite alternate;
}

#initial-screen p {
    color: #00ff00;
    font-size: 24px;
    animation: blink 1.5s infinite;
}

/* Story container */
#story-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15; /* Make sure it appears above the game but below other overlay elements */
}

#epilogue-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25; /* Higher than overlay's z-index of 20 */
}

/* EMP text */
#emp-text {
    font-size: 36px;
    color: #0000ff;
}

/* Utility classes */
.hidden {
    display: none !important; /* Force hidden elements to be truly hidden */
}

.game-button {
    background-color: #00ff00;
    color: black;
    border: 2px solid #00ff00;
    padding: 10px 20px;
    margin-top: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.game-button:hover {
    background-color: black;
    color: #00ff00;
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
    }
    to {
        text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px #00ff00;
    }
}