body { 
    text-align: center; 
    font-family: Arial; 
    background: #111; 
    color: white; 
    margin: 0; 
    padding: 10px; 
    overflow: auto; /* Enables scrolling when needed */
}
canvas { 
    border: 1px solid black; 
    background: #222; 
    max-width: 100%; 
    height: auto; 
    display: block; 
    margin: 0 auto;
}
#powerup-info { 
    font-size: 14px; 
    margin-top: 10px; 
}
#chat-box { 
    height: 80px; 
    overflow-y: auto; 
    border: 1px solid #333; 
    margin-top: 10px; 
    padding: 5px; 
    font-size: 12px;
}
#chat-input { 
    width: 80%; 
    margin-top: 5px; 
    font-size: 12px; 
}
#controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: none;
}

.joystick {
    position: absolute;
    width: 50px;
    height: 50px;
    background: gray;
    border-radius: 50%;
    left: 25px;
    top: 25px;
}

#aim-controls { 
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    opacity: 0.5;
    display: none;
}
#aim-joystick { 
    width: 50px; 
    height: 50px; 
    background: rgba(255, 0, 0, 0.7); 
    border-radius: 50%; 
    position: absolute; 
    top: 25px; 
    left: 25px; 
    pointer-events: none;
}
#shoot-btn {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid white;
    display: none;
    touch-action: none;
    padding: 10px 20px;
}
#share-x-btn {
    margin-top: 10px;
    padding: 5px 15px;
    background-color: #1DA1F2; /* X's brand color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
button, input { 
    font-size: 14px; 
    margin: 5px; 
}

#end-game {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 34, 34, 0.9); /* Dark gray with transparency */
    padding: 20px;
    border: 2px solid #333;
    border-radius: 10px;
    text-align: center;
    z-index: 10; /* Above canvas */
}

#end-game h2 {
    color: white;
    margin: 0 0 20px 0;
    font-size: 24px;
}

#end-share-x-btn, #end-refresh-btn {
    font-size: 16px;
    padding: 10px 20px;
    margin: 0 10px;
    background-color: #1DA1F2; /* X's blue */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#end-refresh-btn {
    background-color: #555; /* Gray for refresh */
}

#end-share-x-btn:hover, #end-refresh-btn:hover {
    opacity: 0.8;
}

@media (max-width: 1024px) {
    #controls, #aim-controls, #shoot-btn {
        display: block;
    }
}

