/* General Styling */
/* Reset body to remove scrollbars */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a1a; /* Match game theme */
    font-family: Arial, sans-serif;
}

/* Game container takes full screen */
#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex; /* Ensures centering if needed */
    justify-content: center;
    align-items: center;
}

/* Canvas takes the full size of its container */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black; /* Background color for canvas */
    display: block; /* Prevent inline gaps */
    touch-action: none; /* Prevent touch scrolling on mobile */
}

/* Popups (high scores, etc.) always overlay the canvas */
#highScoresPopup, #menu, #nameInputContainer {
    position: absolute;
    z-index: 1000; /* Ensure they are above the game canvas */
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Example positioning for popups */
#menu {
    position: absolute; /* Use absolute positioning */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center both horizontally and vertically */
    text-align: center;
    background: #333; /* Background color for contrast */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5); /* Add shadow for style */
    width: auto; /* Adjust width based on content */
    max-width: 90%; /* Ensure it doesn't overflow on smaller screens */
}
/* Center the high-scores popup */
#highScoresPopup {
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20%);
}

/* Mobile controls at the bottom */
#mobileControls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


h1 {
    font-size: 2em;
    margin-bottom: 1em;
}

button {
    font-size: 1em;
    padding: 0.5em 1em;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}
button:active {
    transform: scale(0.8);
}

/* Main Menu Styling */
#menu {
    text-align: center;
}

#menu button {
    margin: 0.5em;
}

#menu button#startGame {
    background-color: #28a745;
    color: white;
}

#menu button#settingsButton {
    background-color: #007bff;
    color: white;
}

#menu button#highScoresButton {
    background-color: #ffc107;
    color: black;
}

/* Settings Popup */
#settingsPopup {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    padding: 2em;
    border-radius: 1em;
    box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 25em;
	color:white;
}

#settingsPopup.active {
    display: block;
}

#settingsPopup h2 {
    margin-bottom: 1em;
    font-size: 1.5em;
}

#settingsPopup select {
    font-size: 1em;
    padding: 0.5em;
    margin-bottom: 1em;
    width: 100%;
    border: none;
    border-radius: 0.5em;
}

#settingsPopup .controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5em;
    margin-bottom: 1em;
}

#settingsPopup .controls-grid button {
    background-color: #444;
    color: white;
    border: 0.1em solid #555;
    text-align: center;
    padding: 0.5em;
    font-size: 1em;
    border-radius: 0.5em;
}

#settingsPopup .controls-grid button:hover {
    background-color: #555;
}

/* Save and Close Buttons */
#settingsPopup .action-buttons {
    display: flex;
    justify-content: space-between;
}

#saveSettings {
    background-color: #007bff;
    color: white;
	margin-left: 1em;
}

#closeSettings {
    background-color: #dc3545;
    color: white;
    margin-left: 14em;
}

footer {
    margin-top: 4em;
}
footer:hover {
    color: yellow;
}
footer:active {
    color: red;
}

#moveLeft {
    border-color: #1a1a1a;
    outline-color: #1a1a1a;
    background-color: #333333;
    border-radius: 5em;
    text-align: center;
    width: 6em;
    color: white;
    position: relative;
    top: 1em;
    right: 5em;
}

#moveRight {
    border-color: #1a1a1a;
    outline-color: #1a1a1a;
    background-color: #333333;
    border-radius: 5em;
    text-align: center;
    width: 6em;
    color: white;
    position: relative;
    top: 1em;
    left: 5em;
}

#moveUp {
    border-color: #1a1a1a;
    outline-color: #1a1a1a;
    background-color: #333333;
    border-radius: 5em;
    text-align: center;
    width: 6em;
    color: white;
    position: relative;
    bottom: 2em;
    left: 10em;
    margin-top: 1em;
    margin-bottom: 7em;
}

#moveDown {
    border-color: #1a1a1a;
    outline-color: #1a1a1a;
    background-color: #333333;
    border-radius: 5em;
    text-align: center;
    width: 6em;
    color: white;
    position: relative;
    top: 4em;
    right: 10.5em;
}

#difficulty {
    border-color: #1a1a1a;
    border: 1px;
    outline-color: #1a1a1a;
    background-color: #1a1a1a;
    border-radius: 5em;
    text-align: center;
    color: white;
}
#position{
	margin-left: 1em;
}
/* High Scores Popup */
#highScoresPopup {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    padding: 2em;
    border-radius: 1em;
    box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 25em;
}

#highScoresPopup.active {
    display: block;
}

#highScoresPopup h2 {
    margin-bottom: 1em;
    font-size: 1.5em;

}

#highScoresPopup ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: 1.2em;
    text-align: center; /* Center the text */
}

#highScoresPopup li {
    margin: 0.5em 0;
    text-align: center; /* Center each list item */
}

#highScoresPopup button {
    margin-top: 1em;
    background-color: #dc3545;
    color: white;
    padding: 0.5em 1em;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
}

#highScoresPopup button:hover {
    background-color: #ff4a4a;
}
/* High Score Input Styling */
#nameInputContainer {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1000;
}

#nameInputContainer h2 {
    color: white;
    margin-bottom: 15px;
}

#nameInputContainer label {
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
    display: block;
}

#nameInputContainer input {
    width: 80%;
    padding: 10px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
}

#nameInputContainer button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#nameInputContainer button:hover {
    background-color: #0056b3;
}
