body.pixel-background {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #1a1a1a;
    /* cursor: none !important; */
    /* width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; */
    -webkit-user-drag: none;
    -moz-user-drag: none;
    user-drag: none;
    background-image: url("../img/game/background.png");
    /* opacity: 0.5; */
}

#start-menu, #pause-menu, #settings-menu, #controls-menu {
    cursor: default; /* Show the default cursor in menus */
}

button {
    cursor: pointer; /* Ensure the cursor appears as a pointer over buttons */
}

/* Pixel trail */
#pixel-trail {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: difference;
    transition: transform 0.01s linear;
}

#boost-effect {
    position: fixed;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.6) 0%, rgba(255, 165, 0, 0.3) 70%, transparent 100%);
    pointer-events: none;
    border-radius: 50%;
    transform: scale(1);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: -1; /* Behind the ship */
}

#boost-effect.boosting {
    opacity: 1;
    transform: scale(2); /* Scale up during boost */
    animation: boost-trail 0.2s infinite alternate ease-in-out;
}

@keyframes boost-trail {
    0% {
        opacity: 0.8;
        transform: scale(2);
    }
    100% {
        opacity: 0.4;
        transform: scale(2.2);
    }
}


/* The ship */
#ship {
    position: absolute;
    width: 70px;
    height: 70px;
    /* background: blue; */
    border-radius: 50%;
    transform: translate(-50%, -50%); /* Center the ship visually */
}

#ship img {
    width: 100%; /* Ensure the image fits the container */
    height: 100%;
    object-fit: contain; /* Maintain aspect ratio */
    transform: rotate(90deg); /* Rotate the image 90 degrees */
}

#crosshair {
    position: absolute;
    width: 50px; /* Set the size of the crosshair */
    height: 50px; /* Ensure it scales properly */
    pointer-events: none; /* Prevent interaction */
    z-index: 2; /* Ensure it appears above other elements */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Floating geometry */
.geometry {
    width: 70px; /* Adjust size as needed */
    height: 70px; /* Adjust size as needed */
    position: absolute;
    z-index: 3;
    pointer-events: none; /* Prevent drag or interaction issues */
    transform: rotate(90deg); /* Rotate the image 90 degrees */
}

.armored .health-bar {
    background-color: blue; /* Blue for armored geometries */
}

.mine {
    width: 30px;
    height: 30px;
    /* background-color: red; */
    border-radius: 50%;
    position: absolute;
    animation: pulse 1s infinite;
    z-index: 3;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Bottom container for health and stamina bars */
#bottom-bar-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between bars */
    z-index: 10;
}

/* Health and stamina containers */
#health-container,
#stamina-container {
    width: 300px;
    height: 25px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

/* Bar styles (shared for health and stamina) */
#health-bar,
#stamina-bar {
    width: 100%;
    height: 100%;
    transition: width 0.1s linear;
    position: relative; /* To position text inside */
}

#health-bar {
    background-color: rgb(19, 134, 29); /* Default color */
}

#stamina-bar {
    background-color: orange; /* Default color */
}

/* Text styles for both bars */
#health-text,
#stamina-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white; /* Text color for readability */
    font-size: 14px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    pointer-events: none; /* Prevent interaction with the text */
}

#round-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #fff;
    font-family: Arial, sans-serif;
}

#player-health-container {
    margin: auto;
    position: absolute;
    bottom: 10px;
    left: 46%;
    width: 200px;
    height: 20px;
    background-color: #444;
    border: 2px solid #222;
    border-radius: 5px;
}

#player-health-bar {
    width: 100%; /* Starts full */
    height: 100%;
    background-color: #00ff00; /* Green for full health */
    border-radius: 5px;
    transition: width 0.3s ease; /* Smooth health bar reduction */
}

.health-bar-container {
    position: absolute;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3); /* Background for the healthbar */
    border-radius: 2px;
    overflow: hidden;
    z-index: 10;
}

.health-bar {
    height: 100%;
    transition: width 0.2s ease; /* Smooth shrinking */
    border-radius: 2px;
}

/* Damage popups */
.damage-popup {
    position: absolute;
    font-size: 14px;
    font-weight: bold;
    color: #ff4500;
    animation: fade-up 1s ease-out forwards;
}

@keyframes fade-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Score popups */
.score-popup {
    position: absolute;
    font-size: 16px;
    font-weight: bold;
    color: #00ff00;
    animation: fade-up 1s ease-out forwards;
}

/* Scoreboard */
#scoreboard {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 18px;
    color: #fff;
}

#scoreboard #player-name {
    font-weight: bold;
    margin-right: 10px;
}

#scoreboard #score-display {
    font-weight: normal;
}

#score-display {
    position: absolute;
    color: white;
    font-size: 16px;
    font-family: Arial, sans-serif;
    pointer-events: none; /* Prevent interaction */
    z-index: 100; /* Ensure it’s above other elements */
}

.bullet {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff; /* White color for visibility */
    border-radius: 50%; /* Optional: Make it circular */
    pointer-events: none; /* Prevent interference with clicks */
}

.geometry-bullet {
    position: absolute;
    width: 12px;
    height: 12px;
    background: red;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.geometry-bullet-armored {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgb(104, 10, 167);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.explosion {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255,0,0,1) 0%, rgba(255,165,0,0.8) 50%, rgba(255,255,0,0) 100%);
    border-radius: 50%;
    animation: explode 0.5s ease-out forwards; /* Animation lasts 0.5 seconds */
    pointer-events: none; /* Prevent interaction */
    z-index: 5; /* Ensure it's above other elements */
}

@keyframes explode {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.health-pack {
    /* border-radius: 50%;  */
    pointer-events: none; /* Prevent interaction issues */
    z-index: 3; /* Ensure it appears above the background */
}

.ammo-pack {
    pointer-events: none; /* Prevent interaction issues */
    z-index: 3; /* Ensure it appears above the background */
}

.controls-menu {
    position: fixed;
    top: 1%;
    left: 76.5%;
    /* transform: translate(-50%, -50%); */
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    z-index: 10;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-content: center;

}

/* GAME OVER / PAUSE SCREEN / START MENU*/
#pause-menu,
#start-menu,
#settings-menu,
#controls-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    /* background: #000 url('/img/game/background.png') no-repeat center center; */
    /* background-size: cover; */
    color: white;
    font-family: 'Press Start 2P', sans-serif; /* Retro font style */
    text-align: center;
}

#game-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

#creator {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 12px;
}

#game-name {
    font-size: 3rem;
    text-transform: uppercase;
    color: #3bd53d;
    text-shadow: 2px 2px 0px #000, -2px -2px 0px #3bd53d;
}

#menu-options {
    list-style: none;
    padding: 0;
}

#menu-options li {
    margin: 1rem 0;
}

#menu-options button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    text-shadow: 1px 1px 0px #000, -1px -1px 0px #fff;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#menu-options button:hover {
    color: #ffcc00;
    text-shadow: 2px 2px 0px #000, -2px -2px 0px #ffcc00;
}

#insert-coin {
    margin-top: 3rem;
    font-size: 1.5rem;
    color: #ffcc00;
    text-shadow: 2px 2px 0px #000, -2px -2px 0px #ffcc00;
    animation: blink 1s infinite;
}

/* Blinking animation for "1/1" */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#pause-menu h1,
#start-menu h1,
#settings-menu h1,
#controls-menu h1 {
    padding: 10px;
}

button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
}

button:hover {
    background-color: #00b35a;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

li {
    margin: 10px 0;
    font-size: 18px;
}

#start-menu h1 {
    font-size: 24px;
    margin: 0;
}

#start-menu p {
    font-size: 16px;
    margin: 10px 0;
}

#start-menu button {
    padding: 20px 80px;
    font-size: 26px;
    /* background-color: #007bff; */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-menu button:hover {
    background-color: #00b35a;
}


#pause-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    z-index: 10;
    font-family: Arial, sans-serif;
}

#game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    font-family: Arial, sans-serif;
    background: rgba(0, 0, 0, 0.8);
    padding: 50px;
    border-radius: 10px;
    z-index: 1000;
}

#game-over-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

#game-over-screen p {
    font-size: 24px;
    margin: 10px 0;
    color: #fff;
    font-family: Arial, sans-serif;
}

#restart-button {
    font-size: 24px;
    padding: 10px 20px;
    border: none;
    background: #ff0000;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

#restart-button:hover {
    background: #cc0000;
}

#weapon-display {
    position: absolute;
    right: 20px;
    top: 50px;
    width: 300px;
    background: #111;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

#weapon-display h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

#weapon-display p {
    font-size: 14px;
    margin: 5px 0;
}

#reload-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(0 0 0 / 18%);
    color: white;
    padding: 7px 20px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    text-align: center;
    display: none;
    z-index: 1000;
}

#upgrade-button {
    background: #3bd53d;
    color: #000;
    padding: 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

#upgrade-button:hover {
    background: #2a9c29;
}


.debug-circle {
    position: absolute;
    border: 2px dashed rgba(255, 166, 0, 0.582); /* Orange dashed border */
    background: rgba(255, 166, 0, 0.144); /* Transparent orange */
    pointer-events: none;
    border-radius: 50%;
    /* transform: translate(25%, 25%); */
}

.enemy-debug-circle {
    position: absolute;
    width: 150px; /* Diameter = radius * 2 */
    height: 150px; /* Diameter = radius * 2 */
    border: 1px solid red; /* Red outline for enemies */
    background: rgba(255, 0, 0, 0.144); /* Transparent orange */
    border-radius: 50%; /* Make it circular */
    pointer-events: none; /* Prevent interaction */
    transform: translate(-35%, -35%);
}

.leaderboards-input {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background-color: #1e1e1e; /* Dark background */
    border: 1px solid #333; /* Subtle darker border */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6); /* Softer shadow */
    font-family: Arial, sans-serif; /* Clean font */
    color: #f5f5f5; /* Light text color for contrast */
}

.leaderboards-input label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #cccccc; /* Slightly dimmed text color */
}

.leaderboards-input input[type="text"],
.leaderboards-input textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #444; /* Subtle border for input */
    border-radius: 5px; /* Rounded corners */
    font-size: 14px;
    color: #ffffff; /* Light text */
    box-sizing: border-box;
    background-color: #2a2a2a; /* Dark input background */
}

.leaderboards-input input[type="text"]:focus,
.leaderboards-input textarea:focus {
    border-color: #006142; /* Highlighted border color */
    outline: none; /* Remove outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Blue glow */
}

.leaderboards-input textarea {
    resize: none; /* Disable resize */
    height: 80px; /* Set a height for the textarea */
}

.leaderboards-input button {
    width: 48%; /* Buttons take equal space side-by-side */
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff; /* Button text color */
    background-color: #006142; /* Primary button color */
    border: none; /* Remove border */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer;
    transition: background-color 0.3s ease; /* Smooth transition */
}

.leaderboards-input button:hover {
    background-color: #003826; /* Darker shade on hover */
}

.leaderboards-input #restart-button {
    background-color: #6c757d; /* Gray for restart button */
}

.leaderboards-input #restart-button:hover {
    background-color: #5a6268; /* Darker gray on hover */
}

.leaderboards-input button + button {
    margin-left: 4%; /* Space between buttons */
}

/* General HUD */
#game-ui {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: 'Arial', sans-serif;
    color: white;
}

/* Day and Time */
#day-time-container {
    position: absolute;
    top: 10px;
    left: 10px;
    text-transform: uppercase;
    font-size: 18px;
    color: #80d8f7;
}

#day-time-container span {
    font-weight: bold;
    color: #fff;
}

/* Player Info */
#player-info-container {
    position: absolute;
    top: 80px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#player-icon {
    width: 50px;
    height: 50px;
    background: url('/img/game/spaceship.png') no-repeat center center / contain;
    border: 2px solid #80d8f7;
    border-radius: 5px;
}

#player-stats {
    display: flex;
    flex-direction: column;
}

#player-name {
    font-size: 18px;
    font-weight: bold;
}

#player-health-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

#health-bar {
    width: 100px;
    height: 10px;
    background: #3bd53d;
    border-radius: 3px;
}

#health-value {
    font-size: 14px;
    color: white;
}

/* Perks */
#player-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#player-points {
    position: absolute;
    color: white;
    font-size: 16px;
    font-family: Arial, sans-serif;
    pointer-events: none; /* Prevent interaction */
    z-index: 100; /* Ensure it’s above other elements */
}

.perk-icon {
    width: 30px;
    height: 30px;
    background: url('/img/game/perk-icon.png') no-repeat center center / contain;
    border: 2px solid white;
    border-radius: 5px;
}

/* Ship and Stamina */
#ship-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#stamina-bar-container {
    width: 100px;
    height: 5px;
    background: #333;
    border-radius: 3px;
    margin-bottom: 5px;
}

#stamina-bar {
    width: 100%;
    height: 100%;
    background: #f7d84c;
    border-radius: 3px;
}

/* Weapon Info */
#weapon-info-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    text-align: center;
    width: 250px;
}

#ammo-display {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #80d8f7;
}

#weapon-name {
    font-size: 20px;
    font-weight: bold;
    color: black;
    padding: 5px;
    border-radius: 5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

#weapon-icons {
    display: flex;
    justify-content: space-evenly;
    gap: 10px;
}

.weapon-icon {
    width: 40px;
    height: 40px;
    background: url('/img/game/weapon-icon.png') no-repeat center center / contain;
    opacity: 0.5;
    border: 2px solid #444;
    border-radius: 5px;
}

.weapon-icon.active {
    opacity: 1;
    border-color: #80d8f7;
}

/* General Menu Styling */
.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.8);
    color: white;
    font-family: 'Press Start 2P', sans-serif;
    z-index: 10;
    width: 80%;
    max-width: 500px;
}

.menu-hidden {
    display: none !important; /* Ensure it is completely hidden */
}

.menu h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: #ffcc00;
    text-shadow: 2px 2px 0px #000, -2px -2px 0px #ffcc00;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.menu ul li {
    font-size: 1rem;
    margin: 0.5rem 0;
    text-shadow: 1px 1px 0px #000, -1px -1px 0px #fff;
}

.menu button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    background: #3bd53d;
    color: black;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.menu button:hover {
    background: #2a9c29;
}

/* Settings Menu */
#settings-menu label {
    font-size: 1rem;
    margin: 0.5rem 0;
    display: block;
    text-align: left;
    color: #fff;
}

#settings-menu input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

#settings-menu select {
    padding: 0.5rem;
    font-size: 1rem;
    margin: 0.5rem 0;
}
