body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    background: #000; /* Consistent black background */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.game-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 9 / 16; /* Maintains a portrait aspect ratio */
}

#canvas {
    width: 100%;
    height: 100%;
    background-color: black;
    border: 2px solid cyan;
    box-shadow: 0 0 10px cyan;
}

.ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.score-container {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    pointer-events: none;
    white-space: nowrap;
}

.controls-container {
    position: absolute;
    bottom: 5%;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.joystick, .shoot-btn {
    pointer-events: auto;
}

.joystick {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystickKnob {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 191, 255, 0.8);
}

.shoot-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.8);
    border: 2px solid red;
    box-shadow: 0 0 15px red;
    text-align: center;
    line-height: 60px;
    color: white;
    font-weight: bold;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

.overlay h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.overlay p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.overlay button {
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    background: green;
    color: white;
    cursor: pointer;
}