/* Global page styles */
body {
    background-color: black;
    color: lime;
    font-family: monospace;
    margin: 0;
    padding: 0;
    overflow: hidden; /* prevent scrollbars during gameplay */
}

/* Login and game container boxes */
#loginBox, #gameBox {
    padding: 20px;
}

/* Hide the game box until the user logs in */
#gameBox {
    display: none;
}

/* Logo styling */
#surfLogo, .login-logo {
    height: 30px;
    margin-right: 15px;
    background-color: #000;
    padding: 5px;
    border-radius: 4px;
}

/* Header with logo and title */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Form styling */
.form-centered {
    text-align: center;
}

.form-group {
    margin-bottom: 10px;
}

.form-group:last-of-type {
    margin-bottom: 15px;
}

/* Retro button styling */
.retro-button {
    background-color: black;
    color: lime;
    border: 1px solid lime;
    padding: 8px 20px;
    font-family: monospace;
    font-size: 16px;
    cursor: pointer;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Event log and leaderboard sections */
#events, #leaderboard {
    background-color: black;
    border: 1px solid lime;
    padding: 5px;
    margin: 10px 0;
    max-height: 150px;
    overflow-y: auto;
}

/* Main game canvas */
canvas {
    display: block;
    margin: 10px auto;
    background-color: black;
    border: 1px solid lime;
}

/* Heads-up display (HUD) showing player, score, and level */
#hud {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    font-size: 18px;
    color: lime;
    z-index: 5; /* make sure HUD appears above the canvas */
}

/* Game over overlay displayed when the player loses */
#gameOverOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* semi-transparent background */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-family: monospace;
    opacity: 0;               /* hidden by default */
    pointer-events: none;     /* clicks pass through when hidden */
    transition: opacity 0.5s ease; /* smooth fade-in/out */
    z-index: 10;              /* on top of everything */
}

/* Shown when game over */
#gameOverOverlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* Game restart text */
.restart-text {
    font-size: 20px; 
    margin-top: 10px;
}