body {
    font-family: Arial, sans-serif;
    background-color: #111;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.hidden {
    display: none;
}

.crt-container {
    background: #000;
    border: 4px solid #0f0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px #0f0;
    margin: 0 auto; /* Center horizontally */    
}

.crt-container:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.05) 3px,
        rgba(255, 255, 255, 0.05) 4px
    );
    pointer-events: none;
}


.neon-title {
    font-family: 'Press Start 2P', cursive;
    color: #0f0;
    font-size: 36px; /* Increased font size */
    transition: all 0.3s ease;
    text-shadow: 
        0 0 1px #0f0, 
        0 0 16px #0f0, 
        0 0 32px #0f0, 
        0 0 64px #0f0; /* Reduced brightness */
}

.neon-title:hover {
    font-family: 'Press Start 2P', cursive;
    color: #0f0;
    font-size: 36px; /* Increased font size */
    cursor: default;
    text-shadow: 
        0 0 16px #0f0, 
        0 0 32px #0f0, 
        0 0 32px #0f0, 
        0 0 64px #0f0; /* Reduced brightness */
    transform: scale(1.02);
}

#gameInterface {
    position: relative;
}

#gameCanvas {
    background-color: #000000;
    border: 1px solid #fff;
}

#score {
    font-size: 20px;
    margin-top: 10px;
}

#backButton {
    font-size: 20px;
    margin-top: 10px;
    padding: 10px 20px;
    border: 2px solid #fff;
    border-radius: 5px;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#backButton:hover {
    border-color: #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    color: #0f0;
}

#gameOverPopup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

/* Style for the Play Again button */
#gameOverPopup button {
    background-color: #282c34; /* Dark background color */
    color: #00ff00; /* Bright green text color */
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 2px solid #fff;
    border-radius: 10px;
}

#gameOverPopup button:hover {
    background-color: #3a3f47; /* Slightly lighter on hover */
    transform: scale(1.05); /* Slightly larger on hover */
}

#gameOverPopup button:active {
    background-color: #1f2328; /* Slightly darker when active */
}

#overlayText {
    font-family: 'Press Start 2P', cursive;
    position: absolute;
    top: 50%;
    left: 50%;
    color: green;
    transform: translate(-50%, -20%);
    font-size: 24px;
    color: #fff;
}

#overlayText p {
    color: rgba(255, 255, 255, 1);;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px 10px;
    border: 2px solid #fff;
    border-radius: 10px;
    z-index: 100;
}


.game-button {
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 10px; /* Add margin between buttons */
}

.game-button img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease; /* Add transition effect for smooth change */
}

.game-button:hover img {
    filter: brightness(40%); /* Darken the image */
    /* Alternatively, you can use opacity to reduce the opacity of the image:
    */
}

.game-button:hover {
    border-color: #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    transform: scale(1.08);
}

.game-button {
    position: relative;
    border: 2px solid #fff;
    border-radius: 5px;
    overflow: hidden;
    max-width: 400px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 10px; /* Add margin between buttons */
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); /* Adjust column width as needed */
    gap: 20px; /* Adjust gap between games */
    justify-items: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
}


.game-button img {
    width: 100%;
    height: auto;
    display: block;
}

.game-button .game-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-button:hover .game-title {
    opacity: 1;
}

.game-button:hover {
    border-color: #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

/* Virtual Controller */

#virtualController {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    box-sizing: border-box;
    z-index: 3;
}

.dpad-button, .action-button {
    width: 60px;
    height: 60px;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: auto; /* Align to the left */
}

#dpad div {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Add more space between the left and right buttons */
#left {
    margin-right: 40px; /* Adjust the value to create the desired space */
}

#right {
    margin-left: 40px; /* Adjust the value to create the desired space */
}

.fire-button-container {
    margin-left: -50px; /* Adjust this value to position the fire button closer to the center */
}

.action-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ff5722; /* Changed to a more fitting color */
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom styles for the D-pad to look like an Xbox controller */
#up {
    border-radius: 50% 50% 0 0;
    background-color: #3f51b5; /* Changed to a more fitting color */
    color: #fff;
}
#down {
    border-radius: 0 0 50% 50%;
    background-color: #3f51b5; /* Changed to a more fitting color */
    color: #fff;
}
#left {
    border-radius: 50% 0 0 50%;
    background-color: #3f51b5; /* Changed to a more fitting color */
    color: #fff;
}
#right {
    border-radius: 0 50% 50% 0;
    background-color: #3f51b5; /* Changed to a more fitting color */
    color: #fff;
}

/* Only show the virtual controller on mobile devices */
@media (min-width: 768px) {
    .dpad-button, .action-button {
    
        display: none;
    }
}
