* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    font-family: Arial, sans-serif;
}

#game {
    display: block;
    width: 100vw;
    height: 100vh;
    background: #222;
}

#hud {
    position: fixed;
    top: 15px;
    left: 15px;

    padding: 10px 14px;

    background: rgba(0, 0, 0, 0.65);
    color: white;

    border-radius: 8px;

    font-size: 14px;

    pointer-events: none;

    z-index: 10;
}

#playerCount {
    font-weight: bold;
    margin-bottom: 5px;
}

#controls {
    color: #bbb;
}

#chat {
    position: fixed;

    left: 15px;
    bottom: 15px;

    width: 330px;

    background: rgba(0, 0, 0, 0.72);

    border-radius: 10px;

    padding: 10px;

    z-index: 20;
}

#messages {
    height: 170px;

    overflow-y: auto;

    margin-bottom: 8px;

    color: white;

    font-size: 14px;
}

.message {
    margin-bottom: 5px;

    word-wrap: break-word;
}

.message .name {
    font-weight: bold;
}

#chatForm {
    display: flex;
    gap: 6px;
}

#chatInput {
    flex: 1;

    min-width: 0;

    padding: 8px 10px;

    border: none;
    border-radius: 6px;

    background: #333;

    color: white;

    outline: none;
}

#chatInput:focus {
    background: #444;
}

#chatForm button {
    padding: 8px 12px;

    border: none;
    border-radius: 6px;

    background: #4d8cff;

    color: white;

    cursor: pointer;
}

#chatForm button:hover {
    background: #6a9fff;
}