/* 
// Regular License
// © 2024 Desktop4Kids. All Rights Reserved.
// Licensed for use in one (1) end product that can be freely distributed.
// This code cannot be used in commercial projects where end users are charged.
// See the CodeCanyon regular license for full details. 
*/

body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background-image: url('wp12331958.png'); /* Correct background for the whole page */
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
}

#menu {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('page-bg.jpg'); /* Correct background for the menu */
    background-size: cover;
    justify-content: center;
    align-items: center;
}

canvas {
    display: none;
    border: 1px solid #fff; /* Visibility border */
    width: 800px;  /* Ensure the canvas size is correct */
    height: 600px;
}

button {
    padding: 10px 20px;
    font-size: 18px;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'Orbitron', sans-serif;
}


button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

#questionBox {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Dark background with transparency */
    backdrop-filter: blur(5px); /* Blur effect for the background */
}

.modal-content {
    background: linear-gradient(135deg, #ef73fa, #9e3e91); /* Gradient background for space theme */
    border: 2px solid #fff; /* White border */
    border-radius: 15px; /* Rounded corners */
    margin: 15% auto;
    padding: 30px;
    width: 60%;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: #fff; /* White text color */
    font-family: 'Orbitron', sans-serif; /* Space-themed font */
    animation: appear 0.5s ease-in-out; /* Smooth appearance animation */
}

@keyframes appear {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

#howToPlay {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: auto;
    height: auto;
    z-index: 20; /* Ensure it's above other elements but below dialogs like Game Over */
    display: none; /* Hidden by default */
}

#muteButton {
    position: fixed;
    bottom: 20px;  /* Align it with the help icon vertically */
    right: 80px;  /* Place it to the left of the help icon, adjust spacing as needed */
    width: 50px;  /* Match the size of the help icon */
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#muteButton:hover {
    opacity: 0.5;  /* Slight fade effect on hover to indicate interactivity */
}

#helpIcon {
    position: fixed;
    bottom: 20px;  /* Adjust based on your layout needs */
    right: 20px;
    width: 50px;  /* Ensure the size is suitable */
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#helpIcon:hover {
    opacity: 0.5;  /* Slight fade effect on hover to indicate interactivity */
}

.close {
    color: #fff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: #ff5e5e; /* Red color on hover for effect */
    text-decoration: none;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#hpBar {
    position: fixed;
    right: 22px;  /* Adjust to position on the right side */
    top: 10px;
    width: 40px;  /* Increased width to accommodate the text label */
    height: 90%;  /* Full height of the game window */
    background-color: #333;
    border: 3px solid black;  /* Black border around the HP bar */
    border-radius: 10px;
    overflow: hidden;
    display: none;  /* Hide the HP bar initially */
    color: white;  /* Text color */
    font-weight: bold;  /* Bold text for the label */
    text-align: center;  /* Center the text horizontally */
    font-family: 'Orbitron', sans-serif;  /* Using Orbitron font for the label */
}

#hpLabel {
    position: absolute;
    top: 0;
    width: 100%;
    font-size: 10px;  /* Font size for the label */
}

#xpBar {
    position: fixed;
    left: 22px;  /* Positioned on the left side */
    top: 10px;
    width: 40px;  /* Same width as the HP bar */
    height: 90%;  /* Full height of the game window */
    background-color: #333;
    border: 3px solid black;  /* Black border around the XP bar */
    border-radius: 10px;
    overflow: hidden;
    display: none;  /* Initially hidden like the HP bar */
    color: white;
    font-weight: bold;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
}

#xpLabel {
    position: absolute;
    top: 0;
    width: 100%;
    font-size: 10px;  /* Font size for the label */
    color: black; 
}

#xpFill {
    width: 100%;
    background-color: rgb(235, 252, 8);  /* Different color to distinguish from HP bar */
    transition: height 0.2s ease;  /* Smooth transition for XP fill */
    box-sizing: border-box;
}

#hpFill {
    width: 100%;
    height: 100%;
    background-color: green;
    transition: height 0.2s ease;  /* Smooth transition when HP changes */
    box-sizing: border-box;  /* Include padding and borders in the width and height */
}

#robot div {
    position: absolute;
    width: 20%;
    height: 20%;
    left: 1vw;
    top: 60vh;
    background-size: cover;
    opacity: 0;
    animation: robotAnimation 1s infinite;
}

@keyframes explosionAnimation {
    0% { background-image: url('explosion01.png'); }
    20% { background-image: url('explosion02.png'); }
    40% { background-image: url('explosion03.png'); }
    60% { background-image: url('explosion04.png'); }
    80% { background-image: url('explosion05.png'); }
    100% { background-image: url('explosion06.png'); opacity: 0; }
}

#explosion {
    display: none; /* Only display during actual explosions */
    pointer-events: none; /* Ignore mouse events */
}


#howToPlay .modal-content {
    background: linear-gradient(135deg, #1e3a5f, #2a6f9e);
    border: 2px solid #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
}