html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: black;
    color: white;
    font-family: monospace;
}

body {
    display: flex;
    justify-content: space-between;
}

.container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    height: 100%;
}

.enemies,
.reactorControls,
.flightControls,
.status,
.enemy-visual-box,
.comms-box {
    border: 1px solid white;
    padding: 10px;
    box-sizing: border-box;
}

.attacks,
.statusReports {
    margin-bottom: 30px;
    font-style: italic;
}

.playarea {
    width: 18%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    background-color: black;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status,
.reactorControls,
.flightControls {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    position: absolute;
    z-index: 1;
    background-color: black;
}

.status {
    width: 25%;
    height: 18%;
    top: 3%;
    left: 1%;
}

.reactorControls {
    width: 15%;
    height: 40%;
    top: 23%;
    left: 1%;
}

.flightControls {
    width: 15%;
    height: 12%;
    top: 64%;
    left: 1%;
}

#coreTemperature,
#enemyDistance {
    font-size: large;
    font-style: bold;
    margin-top: 5px;
}

:root {
    --status-height: 200px;
}

.controls {
    margin-top: 20px;
}

.control-group,
.enemy-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.enemies {
    width: 25%;
    height: 23%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    position: absolute;
    top: 3%;
    right: 2%;
    z-index: 1;
    background-color: black;
    overflow: hidden;
    flex-wrap: wrap;
    padding: 10px;
}

.enemy-meter,
.meter {
    font-size: small;
    margin-bottom: 5px;
}

.enemy-meter-label,
.meter-label {
    margin-top: 6px;
    font-size: small;
}

.enemy-meter-title,
.meter-title {
    font-size: large;
}

.enemy-visual-box {
    width: 18%;
    height: 15%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    background-color: black;
    z-index: 4;
    top: 40%; 
    right: 2%;
}

.enemy-visual-label {
    position: absolute;
    top: 0;
    right: 0%;
    background-color: black;
    color: white;
    padding: 6px;
    z-index: 2;
}

.enemyVisual {
    font-size: inherit;
    margin-top: 30px;
}


.levelbutton,
#continueButton {
    font-family: monospace;
    font-size: 14px;
    font-style: bolder;
    padding: 6px 12px;
    margin-right: 3px;
    margin-top: 8px;
    background-color: #222;
    color: #ccc;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.btn{
    font-family: monospace;
    font-size: 12px;
    font-style: bolder;
    padding: 6px 12px;
    margin-right: 2px;
    margin-top: 6px;
    background-color: #222;
    color: #ccc;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.btn:hover,
#level1button:hover,
#level2button:hover {
    background-color: #444;
    color: #fff;
}

.highlightedButton {
    background-color: #ff8438;
    color: #000;
}

#continueButton {
    position: absolute;
    top: 600px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.meter {
    /* Your meter styles */
    font-size:small;
    margin-bottom: 4px;
}

.meter-label {
    /* Your meter styles */
    margin-top: 6px;
    font-size:small;
}

.meter-title {
    font-size:large;
}


.thrusters {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-family: monospace;
    color: #ff8438;
    bottom: -8px;
}

.fire1,
.fire2 {
    animation: fireAnimation 0.09s infinite linear;

}


.thrusters .fire1 {
    position: relative;
    left: -55px;
    bottom: 30px;
}

.thrusters .fire2 {
    position: relative;
    left: 55px;
    bottom: 30px;
}

@keyframes fireAnimation {
    0% {
        opacity: 1;
        transform: translateY(calc(60px * var(--scale-factor) * 1)) scale(var(--scale-factor)) rotate(0deg);
        color: #ad4200;
    }

    25% {
        opacity: 1;
        transform: translateY(calc(60px * var(--scale-factor) * 1.2)) scale(calc(var(--scale-factor) * 1.05)) rotate(0deg);
        color: #de5500;
    }

    50% {
        opacity: 1;
        transform: translateY(calc(60px * var(--scale-factor) * 1.5)) scale(calc(var(--scale-factor) * 1.1)) rotate(0deg);
        color: #ff6200;
    }

    75% {
        opacity: 1;
        transform: translateY(calc(60px * var(--scale-factor) * 2)) scale(calc(var(--scale-factor) * 1.2)) rotate(0deg);
        color: #ff924e;
    }

    100% {
        opacity: 1;
        transform: translateY(calc(60px * var(--scale-factor) * 2.7)) scale(calc(var(--scale-factor) * 1.1)) rotate(0deg);
        color: #ffd8c0;
    }
}


.shield {
    position: absolute;
    color: rgba(calc(255 - var(--shield-power) * 25.5),
            /* Red component */
            calc(255 - var(--shield-power) * 25.5),
            /* Green component */
            calc(255 + var(--shield-power) * 15),
            /* Blue component */
            calc(0.1 + var(--shield-power) * 0.05));
    animation: shieldAnimation 3s infinite linear;
    z-index: 3;
}


@keyframes shieldAnimation {

    0%,
    100% {
        opacity: calc(var(--shield-health) * 0.005);
    }

    50% {
        opacity: calc(var(--shield-health) * 0.007);
    }
}





#notificationBox1 {
    position: absolute;
    top: 10%;
    left: 50%;
    width: 28%;
    display: flex;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 5px;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    transform: translate(-50%);
    font-size: x-large;
    z-index: 2;
    font-style: italic;
}

#notificationBox2 {
    position: absolute;
    top: 60%;
    padding: 10px;
    color: white;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
    width: 18%;
    right: 2%;
    z-index: 4; 
    background-color:black;
    font-size:large;
}


#comms-box {
    position: absolute;
    bottom: 4%;
    padding: 10px;
    padding-top: 50px; /* Adjust this value to create enough space for the label */
    color: white;
    border: 1px solid white;
    border-radius: 0px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    width: 21%;
    height: 18%;
    left: 1%;
    z-index: 1;
    background-color: black;
    font-size: large;
    overflow: hidden;
    align-items: flex-start;
}

.comms-name {
    float: left;
    font-weight:900;
    font-style: normal;
}


.comms-message {
    display: block;
    animation: fadeIn 1s, fadeOutComms 15s;
    animation-fill-mode: forwards;
    animation-play-state: running;
    white-space: pre-wrap; /* Make the message wrap */
    overflow: hidden;
    margin-top: 5px;
    z-index: 2;
    font-size: 0.75vw;
    font-style: italic;

}


@keyframes typeOut {
    0% {
        width: 0;
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}





@keyframes fadeOutComms {
    0%, 93.33% { /* Adjust this percentage to delay the start of the fade-out */
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    0% {
        visibility: hidden;
        opacity: 0;
    }
    100% {
        visibility: visible;
        opacity: 1;
    }
}

.comms-label {
    position: absolute;
    top: 0;
    left: 0;
    background-color: black;
    color: white;
    padding: 10px;
    z-index: 3;
    font-size: large;
}


.notification {
    opacity: 0;
    animation: fadeInOut 7s ease-out;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
    }

    10%,
    90% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ship {
    position: relative; /* Ensure the ship is positioned */
    font-family: monospace;
    white-space: pre-wrap;
    font-weight: bold;
    /* background-color: black; */ /* Comment out or remove this line */
    z-index: 1;
}


@keyframes explode {
    0% {
        transform: scale(1);
        opacity: 1;
        color: #ffd8c0
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
        color: #fc5522
    }

    100% {
        transform: scale(2);
        opacity: 0;
        color: #ad4200
    }
}

.explode {
    animation: explode 2s forwards;
}


body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
    overflow: hidden;
}


@keyframes moveDown {
    0% {
        transform: translateY(calc(var(--speed) * -1px));
    }

    100% {
        transform: translateY(100vh);
    }
}



.stars {
    position: absolute;
    width: 1px;
    height: 1px;
    background-color: #fff;
    animation: moveDown 10s linear infinite, twinkle 4s infinite alternate;
    animation-fill-mode: forwards;
    animation-play-state: running;
}


@keyframes twinkle {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}
.playarea, .ship, .weapons {
    overflow: visible;
}
.weapons, .ship, .playarea {
    margin: 0;
    padding: 0;
}



.laserEffect {
    position: absolute;
    bottom: 0;
    width: 3px; /* Adjust width for better visibility */
    height: 0;
    background-color: rgba(255, 0, 0, 0.9); /* Bright red */
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7); /* Add a glow effect */
    /* Remove transition for instant effect */
    /* transition: height 0.2s linear; */
    z-index: 5; /* Ensure lasers are above other elements */
    animation: laserFire 0.2s ease-out;

}

@keyframes laserFire {
    0% {
        height: 0;
        opacity: 1;
    }
    10% {
        height: 500px; /* Match distanceToTop */
        opacity: 1;
    }
    100% {
        height: 0;
        opacity: 0;
    }
}



.weapons {
    position: absolute;
    bottom: 55%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
    background: none; /* Ensure no background is applied */
    width: 0; /* Ensure no unintended width */
    height: 0; /* Ensure no unintended height */
}




.leftLaser {
    left: 50px; /* Adjust this value to align with the left side of your ship */
}

.rightLaser {
    right: 50px; /* Adjust this value to align with the right side of your ship */
}



