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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
}

.section {
    display: none;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section.active {
    display: block;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    text-align: center;
}

form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 4px;
}

.room-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.join-room {
    display: flex;
    gap: 10px;
}

#room-list {
    margin-top: 30px;
}

#room-list h3 {
    margin-bottom: 15px;
    color: #34495e;
}

.room-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: #ecf0f1;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.game-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.game-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #deb887;
    padding: 20px;
    border-radius: 8px;
}

#game-board {
    border: 2px solid #8b4513;
    cursor: pointer;
    background-color: #deb887;
}

.game-info {
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.player {
    padding: 15px;
    border-radius: 4px;
}

.player-black {
    background-color: #2c3e50;
    color: white;
}

.player-white {
    background-color: #ecf0f1;
    color: #333;
}

.game-controls {
    display: flex;
    justify-content: center;
}

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

#chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.chat-message {
    margin-bottom: 10px;
    padding: 5px 10px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

#chat-form {
    display: flex;
    gap: 10px;
}

#chat-form input {
    flex: 1;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    #game-board {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}