body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    font-family: Arial, sans-serif;
}

#game-container {
    width: 800px;
    margin: 0 auto;
}

#game-area {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #111;
    overflow: hidden;
    border: 2px solid #333;
}

#player {
    position: absolute;
    left: 20px;
    /* Size will be set in JS */
    object-fit: contain; /* Maintain aspect ratio */
}

.enemy {
    position: absolute;
    /* Size will be set in JS */
    object-fit: contain; /* Maintain aspect ratio */
}

.enemy.frigate {
    /* No specific background color needed, using images */
}

.enemy.destroyer {
    /* No specific background color needed, using images */
}

.enemy.corvette {
    /* No specific styles needed, using images */
}

.enemy.boss {
    border: 5px solid yellow !important; /* Much more visible yellow border */
    box-shadow: 0 0 15px 8px rgba(255, 255, 0, 0.7) !important; /* Enhanced glow effect */
    z-index: 100 !important; /* Ensure boss appears above everything else */
    animation: pulse 1s infinite alternate; /* Add pulsing effect */
}

@keyframes pulse {
    from { box-shadow: 0 0 15px 8px rgba(255, 255, 0, 0.7); }
    to { box-shadow: 0 0 20px 12px rgba(255, 255, 0, 0.9); }
}

.shot {
    position: absolute;
    background-color: yellow;
    width: 10px;
    height: 5px;
}

.enemy-shot {
    position: absolute;
    background-color: red;
    width: 10px;
    height: 5px;
}

.enemy-shot.boss-shot {
    background-color: purple; /* Differentiate boss shots */
    width: 15px;
    height: 8px;
}

#game-info {
    color: white;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
}

.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#game-over {
    color: red;
    font-size: 24px;
    font-weight: bold;
}

#restart-button {
    padding: 5px 10px;
    background-color: #333;
    color: white;
    border: 1px solid white;
    cursor: pointer;
}

#score {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 100;
}

#high-score {
    position: absolute;
    top: 40px;
    left: 10px;
    color: gold;
    font-size: 18px;
    font-weight: bold;
    z-index: 100;
}

#level {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 100;
}

#highscore-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    color: white;
    pointer-events: none;
}

#highscore-container.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#highscore-container h2 {
    color: gold;
    margin-bottom: 20px;
}

#highscore-list {
    width: 60%;
    border: 1px solid #555;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.highscore-entry {
    display: grid;
    grid-template-columns: 30px 100px 1fr;
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.highscore-entry:last-child {
    border-bottom: none;
}

.highscore-entry .rank {
    text-align: right;
    padding-right: 10px;
}

.highscore-entry .initials {
    text-align: center;
    font-weight: bold;
    color: #90EE90;
}

.highscore-entry .score {
    text-align: left;
    padding-left: 10px;
}

#initial-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #555;
    padding: 20px;
    width: 300px;
    text-align: center;
    z-index: 300;
    color: white;
}

#initial-input h3 {
    color: gold;
    margin-top: 0;
}

#initials-input {
    background-color: #333;
    border: 1px solid #777;
    color: white;
    font-size: 18px;
    text-align: center;
    padding: 5px;
    width: 80px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

#submit-score {
    background-color: #555;
    color: white;
    border: 1px solid #777;
    padding: 5px 15px;
    cursor: pointer;
}

#submit-score:hover {
    background-color: #777;
}
