@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 80%;
    font-family: 'Press Start 2P', cursive;
    color: #fff; 
    image-rendering: pixelated; /* Ensures that images remain pixelated */;
    background-image: url('/assets/images/preview2_6.png'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
}

body {
    cursor: url('/assets/images/arrow-157245_640.png'), auto;
}


#game-container {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 80vh;
    margin: 140px auto;
    border: 4px solid #00CC00;
    box-shadow: 0 0 20px #ffff00;
    background-size: cover;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
}



#phaser-game {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    background-color: #333; 
    position: absolute;
    top: 30px; /* Adjust the position of the game */
    left: 0;

}

/*Heads-up-display*/
#hud {
    display: flex; 
    justify-content: space-between; 
    align-items: center; /* Center them vertically */
    padding: 10px; /* Adjust padding as needed */
    width: 100%;
}


#main-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}


#main-menu h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

#main-menu button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.1s;
   
    background-color: #42ae42; 
    color: #000; 
    box-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700, 0 0 10px #FFD700;
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 10px;
    display: block;
    width: 100%;
}
#start-button {
    animation: pulse 1.5s infinite;
}


@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px #fff;
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgb(255, 0, 0);
    }
}
    
#start-button:active {
    transform: scale(0.95);              
}


#start-button:hover {
    background-color: #FFD700; /* Gold background on hover */
    color: #ffffff;
    border-color: #00FF00; /* Green border on hover */
    box-shadow: 0 0 5px #00FF00, 0 0 10px #00FF00;
}

/* High Scores and Instructions Button Styles */
#high-scores-button, 
#instructions-button {
    background-color: #444;
    color: #FFF;
    border: 2px solid #888;
    padding: 10px 20px;
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    margin-top: 20px;
    transform: scale(1); /* Reset scale to default */
    filter: drop-shadow(2px 2px 2px #000);
}

#high-scores-button:hover, 
#instructions-button:hover {
    background-color: #888;
    color: #ffffff;
    border-color: #000;
    box-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700;
    transform: scale(1.1);
    filter: drop-shadow(2px 2px 2px #000);
}

/*Instruction modal*/
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    padding-top: 60px;
    font-family: 'Press Start 2P', cursive;
}

.modal-content {
    background-color: #222;
    margin: 5% auto;
    padding: 20px;
    border: 4px solid #888;
    border-radius: 8px;
    width: 70%;
    color: #00FF00;
    box-shadow: 0 0 10px #00FF00, 0 0 20px #00FF00, 0 0 30px #00FF00;
    text-align: center;

}

.modal-content h2 {
    font-size: 24px;
    color: #FFD700; 
    text-shadow: 2px 2px #000; /* Shadow effect for 3D look */
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 16px;
    line-height: 1.5;
}

.close {
    color: #FFD700;
    float: right;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px #000;
}

.close:hover,
.close:focus {
    color: #FF0000; /* Red color on hover for emphasis */
    text-decoration: none;
    cursor: pointer;
}

/* High Scores Modal */
#highScoresModal .modal-content {
    background-color: #222;
    margin: 5% auto;
    padding: 20px;
    border: 4px solid #888;
    width: 70%;
    color: #00FF00;
    font-family: 'Press Start 2P', cursive;
    box-shadow: 0 0 10px #00FF00, 0 0 20px #00FF00, 0 0 30px #00FF00;
    text-align: center;
    z-index: 100;
}


#game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: red;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
/*CSS animations to create pixelated transitions and effects.*/

@keyframes pixel-fade {
    from {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/*Implement screen transitions between game states*/

#main-menu {
    animation: pixel-fade 0.5s ease-in-out;
}

@keyframes pixelate {
    0% { filter: pixelate(0px); }
    100% { filter: pixelate(5px); }
}

#phaser-game {
    animation: pixelate 0.5s ease-in;
}

#health-bar-container {
    width: 30%;
    height: 20px;
    background-color: #333;
    border: 2px solid #fff;
    padding: 2px;
    margin-right: 50px;
    margin-left: 10px;
    box-sizing: border-box; /* Ensure padding and border are included in the total width */
}

#health-bar {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #ff0000, /* Start with red for full health */
        #ff0000 10px,
        #ff5a5a 10px,
        #ff5a5a 20px
    );
    transition: width 0.3s ease, background-color 0.3s ease; /* Smooth transition when health and color change */
    image-rendering: pixelated; /* Force pixelated rendering */
    box-sizing: border-box; /* Ensure any padding does not affect the width */
}


#lives {
    font-size: 20px;
    margin-right: 80px;
}

#score {
    font-size: 20px;
}
    
#speaker-button {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    cursor: pointer;
    z-index: 10; /* Ensure it appears on top */
}

#speaker-icon {
    width: 32px; /* Adjust the size as needed */
    height: 32px;
}

/* New CSS for the logo */
#logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100px; 
    height: 50px;
    z-index: 15; 
}

/* Battle City Title */
#battle-city-title {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px; 
    color: #ffffff; 
    text-shadow: 2px 2px 0 #000, /* Adds a shadow for 3D effect */
                 4px 4px 0 #00FF00, 
                 6px 6px 0 #000;
    font-family: 'Press Start 2P', cursive; 
    letter-spacing: 2px; 
    text-transform: uppercase;
    z-index: 10; 
    image-rendering: pixelated; 
    background: repeating-linear-gradient(
        45deg,
        #00FF00, /* Bright green stripes */
        #00FF00 10px,
        #007700 10px,
        #007700 20px
    );
    padding: 10px;
    border: 4px solid #000; 
    border-radius: 8px;
    box-shadow: 0 0 10px #00FF00, 0 0 20px #00FF00; /* Glow effect */
}


