* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #333;
    font-size: 2.5em;
    margin: 0;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.canvas-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#drawCanvas {
    border: 3px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
    width: 100%;
    height: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.canvas-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

button:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.primary {
    background: #667eea;
    color: white;
}

button.primary:hover {
    background: #764ba2;
}

.word-display {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #333;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ddd;
}

.chat-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 550px;
}

.players-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    max-height: 150px;
    overflow-y: auto;
}

.players-list h3 {
    margin-bottom: 10px;
    color: #555;
    display: flex;
    justify-content: space-between;
}

#playerList {
    list-style: none;
}

#playerList li {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chat-box {
    flex: 1;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    max-width: 85%;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    align-self: flex-start;
}

.message.system {
    background: #e3f2fd;
    color: #1976d2;
    align-self: center;
    font-style: italic;
    font-size: 14px;
    max-width: 90%;
}

.message.correct {
    background: #c8e6c9;
    color: #2e7d32;
    font-weight: bold;
    align-self: center;
}

.chat-input {
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
}

#messageInput:focus {
    border-color: #667eea;
}

#sendBtn {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border-radius: 25px;
}

#sendBtn:hover {
    background: #764ba2;
}

@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .chat-section {
        height: 400px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
}