* {
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden; /* Hide scrollbars */
    display: flex;
    justify-content: center;
    height: 100vh;
}

canvas {
    background-color: #111;
    display: block; /* Remove extra space below canvas */
}

/* Loading Screen Styles */
#loadingScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* Solid black background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100; /* Ensure it's on top */
}

#loadingBarContainer {
    width: 80%;
    max-width: 400px;
    height: 20px;
    border: 1px solid #0f0;
    margin-top: 20px;
    position: relative;
}

#loadingBarFill {
    height: 100%;
    width: 0%; /* Starts empty */
    background-color: #0f0;
    transition: width 0.1s linear; /* Smooth transition for progress */
}

#loadingText {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 20px; /* Center text vertically */
    color: #000; /* Text color over the bar */
    font-weight: bold;
}

/* Base style for centered overlay boxes */
#startScreen, #gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    text-align: center;
    padding: 20px;
    border: 1px solid #fff;
    background-color: #111;
}

/* Style for full-screen overlays */
#pauseScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Black overlay with 50% opacity */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The actual content box for the pause menu */
.pause-content {
    width: 90%;
    max-width: 600px;
    text-align: center;
    padding: 20px;
    border: 1px solid #fff;
    background-color: rgba(17, 17, 17, 0.85); /* #111 with 85% opacity */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

h1, h2, h3 {
    margin-top: 0;
    color: #0f0; /* Un color verde neón para los títulos */
}

/* White color for specific sub-headers */
#pauseScreen h3, 
#gameOverScreen h2 {
    color: #fff;
}

button {
    background-color: #fff;
    color: #333;
    border: 1px solid #333;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s, color 0.3s;
}

button:hover {
    background-color: #a6fda6;
    color: #333;
}

/* Style for keyboard-focused buttons */
button.focused {
    background-color: #333;
    outline: 2px solid #0f0; /* Green neon outline */
    outline-offset: 1px;
    color: #0f0;
}

input[type="text"] {
    background-color: #333;
    color: #fff;
    border: 1px solid #fff;
    padding: 10px;
    font-size: 16px;
    text-align: center;
    width: 100px;
    text-transform: uppercase;
}

#highScoresTable {
    margin: 20px auto;
    width: 80%;
    border-collapse: collapse;
}

#highScoresTable th, #highScoresTable td {
    border: 1px solid #555;
    padding: 8px;
}

#highScoresTable th {
    background-color: #222;
    color: #0f0;
}



/* Media query para mejorar la legibilidad en móviles */
@media (max-width: 600px) {
    h1 {
        font-size: 8vw; /* Tamaño de fuente relativo al ancho de la pantalla */
    }

    h2, h3 {
        font-size: 6vw;
    }

    p, button, input, th, td {
        font-size: 4vw;
    }

    #highScoresTable {
        width: 95%; /* Usar más espacio en pantallas pequeñas */
    }

    button {
        padding: 8px 16px;
    }
}

/* Estilos para la ventana emergente de novedades */
#updatePopup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200; /* Asegurarse de que esté por encima de todo */
}

.update-content {
    width: 90%;
    max-width: 500px;
    text-align: left;
    padding: 20px 30px;
    border: 1px solid #0f0;
    background-color: #111;
}

.update-content h2 {
    text-align: center;
}

.update-content ul {
    list-style-type: "- ";
}

.update-content li {
    margin-bottom: 10px;
}

#closeUpdatePopupBtn {
    display: block;
    margin: 20px auto 0;
}