/* The main wrapper */
#sim-wrapper {
    width: 75%;
    margin: 0 auto 60px auto;
    /* Adding 40px margin to the bottom */
    position: relative;
    overflow: hidden;
    box-shadow: 12px 12px 60px #000000;
    margin-top: 60px;
}

#sim-wrapper p {
    padding-left: 0px;
    padding: 0px;
    padding-top: 0px;
    margin-top: 0;
}


/* The game container */
#simulator-container {

    width: 100%;
    padding-bottom: 50%;
    position: relative;
    background-color: black;
    color: green;
    font-family: 'Courier New', monospace;

    position: relative;
}

@keyframes scanlines {
    0% {
        background-position: 0 50%;
    }
}

#simulator-container::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    /* Adjust as necessary */
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.25) 51%);
    background-size: 100% 8px;
    /* Adjust size as necessary */
    animation: scanlines 2.5s steps(60) infinite;
}


#morale-warning {
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 3vw;
    color: green;
    font-weight: bold;
    animation: flash 0.5s infinite alternate;
    user-select: none;
}

@keyframes flash {
    from {
        opacity: 0.0;
    }

    to {
        opacity: 1;
    }
}


/* Buttons container */
#buttons-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    user-select: none;
}


#shop {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 25%;
    /* Takes 50% of the space between Code button and right edge */
    height: 75%;
    /* Takes 75% of the space from the bottom corner to the Money text */
    background-color: #222;
    /* Or any color you prefer */
    border: 1px solid green;
    user-select: none;
}

#upgrades-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    /* Makes it scrollable if there are many upgrades */
}

.upgrade-button {
    font-weight: bold;
    color: green;
    font-family: 'Courier New', monospace;
    font-size: 0.9vw;
}

.upgrade-button[disabled] {
    /* Dark background */
    color: #7d0101;
    cursor: not-allowed;
    /* Lighter text */
}


/* Game stats */
#left-stats {
    position: absolute;
    user-select: none;
    text-align: left;
    top: 10px;
    left: 10px;
    padding-left: 0px !important;
    font-size: 1.5vw;
    /* Responsive font size */
    margin: 0;
    padding: 0;
}

#right-stats {
    position: absolute;
    user-select: none;
    top: 10px;
    right: 10px;
    font-size: 1.5vw;
    /* Responsive font size */
    margin: 0;
    padding: 0;
    text-align: right;
}

#right-stats p,
#left-stats p {
    margin: 0 0 10px 0;
    /* top right bottom left */
}

/* The header */
#sim-header {
    width: 100%;
    height: 32px;
    background-size: 100% 100%;
    color: white;
    line-height: 32px;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    display: flex;
    z-index: 1;
    align-items: center;
    position: relative;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: url('../assets/images/header.png') no-repeat;
    background-size: 100% 100%;
}

#sim-header p {
    margin-left: 20px;
    font-size: 1.2vw;
    margin-top: auto;
    margin-bottom: auto;
    z-index: 1;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    text-shadow: 2px 2px 4px #000000;
    /* Responsive font size */
}

#shop-header {
    font-size: 1.2vw;
    /* Responsive font size */
    text-align: center;
    border-bottom: 1px solid green;
    user-select: none;
}

#buttons-container button {
    color: green;
    background-color: black;
    border: 1px solid green;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.5vw;
    /* Responsive font size */
    margin: 0 5px;
}

.flying-code {
    user-select: none;
    bottom: 0;
    /* or you could use top: 100%; */
    /* centering */
    position: absolute;
    animation: flyUp 1s linear;
    /* Removed infinite */
    color: green;
    z-index: 0;
    font-size: 1.5vw;
}

@keyframes flyUp {
    from {
        transform: translateY(200%) scale(1);
    }

    to {
        transform: translateY(-2000%) scale(0);
    }
}

#text-container {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* for visibility */
}

#tutorial {
    user-select: none;
    /* or you could use top: 100%; */
    /* centering */
    position: absolute;
    align-self: center;
    right: 50%;
    top: 50%;
    padding-left: 5vw;
    padding-right: 5vw;
    transform: translate(50%, -50%);
    /* Removed infinite */
    color: green;
    z-index: 0;
    font-size: 1.5vw;
    text-align: center;
}

@keyframes slideUp {
    0% {
        top: 100%;
        transform: translate(-50%, 0) scale(0%) rotate(45deg);
        /* -15 degrees */
    }

    15% {
        transform: translate(-50%, 0) scale(1%) rotate(30deg);
    }


    25% {
        transform: translate(-50%, 0) scale(50%) rotate(30deg);
    }


    60% {
        transform: translate(-50%, 0) scale(1) rotate(-45deg);
    }


    100% {
        top: -100%;
        transform: translate(-50%, 0) scale(-1) rotate(-60deg);
        /* back to -15 degrees */
    }
}




#upgrade {

    margin: 0 auto;
    z-index: 0;
    transform-origin: center;
}

#upgrade img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 128px;
    height: 128px;
    image-rendering: pixelated;
    margin: 0 auto;
}

#indicator {
    font-size: 40px;
    color: white;
    text-shadow: 2px 2px 4px #000000;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: black;
    transform: translateY(-5px) translateX(-10px);
    animation: flicker 1s steps(1) infinite;
}

.content h1 {
    color: white;
    text-shadow: 2px 2px 4px #000000;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: black;
    border-bottom: 1px solid #aaaaaa;
}
