/* style.css */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Use min-height for flexibility */
    background-color: #f4f4f4;
    user-select: none;
}

.container {
    display: flex;
    justify-content: center;
    /* Center horizontally */
    align-items: flex-start;
    /* Align items to the top */
    flex-wrap: wrap;
    /* Allow items to wrap */
    gap: 20px;
    /* Space between board and chat */
    max-width: 1400px;
    /* Limit maximum width */
    padding: 20px;
    /* Add some padding */
    box-sizing: border-box;
    /* Include padding in width */
}

.board {
    width: 500px;
    height: 500px;
    background-color: transparent;
    display: flex;
    flex-wrap: wrap;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    background-color: #fff;
    width: 400px;
    height: 500px;
    /* Consistent height with board */
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
    padding: 15px;
    box-sizing: border-box;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #fafafa;
}

.chat-input {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px 0;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.chat-input button {
    padding: 10px 15px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.room-container {
    display: flex;
    margin-bottom: 25px;
    align-items: center;
}

.room-container input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    width: 240px;
}

.room-container button {
    padding: 10px 12px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.square {
    width: calc(100% / 8);
    height: calc(100% / 8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
}

.square.white {
    background-color: #f0dab5;
}

.square.black {
    background-color: #b58962;
}

.square.white.moveable {
    background-color: #a1fe8e;
}

.square.black.moveable {
    background-color: #60ab51;
}

.piece {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out; /* Add transitions */
    position: relative; /* Ensure piece positioning context */
}

.player-turn {
    position: absolute;
    /* Or fixed, depending on layout */
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: bold;
    /* Initial color, will be updated */
    padding: 5px 10px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    /* Semi-transparent white */
}

.room-code-display {
    margin-top: 10px;
    text-align: center;
}

.room-code-display p {
    font-size: 1rem;
    font-style: italic;
}