body { 
    font-family: sans-serif; 
    text-align: center; 
    background: #222; 
    color: #fff; 
}

#setup {
    display: flex;
    justify-content: center;
    gap: 30px;
    max-width: 800px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.control-box {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    flex: 1;
}

.lobby-item {
    background: #444;
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(3, 100px); 
    gap: 5px; 
    margin: 20px auto; 
    width: 310px; 
}

.cell { 
    width: 100px; 
    height: 100px; 
    background: #333; 
    font-size: 2rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    border-radius: 8px; 
}

.cell:hover { background: #444; }

#status { 
    font-size: 1.2rem; 
    margin: 20px; 
    min-height: 30px; 
    color: #00ffcc; 
}

input, button { 
    padding: 10px; 
    font-size: 1rem; 
    border-radius: 4px; 
    border: none; 
    box-sizing: border-box;
}

input {
    width: 90%;
    margin-bottom: 10px;
    background: #fff;
    color: #000;
}

button { 
    background: #007bff; 
    color: white; 
    cursor: pointer; 
    border-radius: 4px;
}
button:hover { background: #0056b3; }
.join-btn { background: #28a745; padding: 5px 12px; }
.join-btn:hover { background: #218838; }

#gameContainer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 750px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.chat-box {
    background: #333;
    width: 320px;
    height: 310px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.95rem;
}

.chat-msg {
    margin-bottom: 8px;
    word-break: break-word;
}

.chat-msg .sender {
    font-weight: bold;
    color: #00ffcc;
    margin-right: 5px;
}

.chat-input-area {
    display: flex;
    background: #444;
    padding: 5px;
}

.chat-input-area input {
    flex: 1;
    margin: 0;
    padding: 8px;
    background: #fff;
    color: #000;
}

.chat-input-area button {
    margin: 0 0 0 5px;
    padding: 8px 15px;
}
