body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#chessboard {
    display: grid;
    grid-template-columns: repeat(8, 50px);
    grid-template-rows: repeat(8, 50px);
    width: 400px;
    height: 400px;
    border: 5px solid #333;
}

.square {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    user-select: none; /* Prevents text selection on pieces */
}

.light {
    background-color: #f0d9b5;
}

.dark {
    background-color: #b58863;
}

.piece {
    cursor: pointer;
}

#status-panel {
    margin-top: 20px;
    font-size: 1.2em;
}

.selected {
    background-color: #a5c9a5;
}

.check {
    background-color: #ff7f7f;
}

.valid-move {
    background-color: #a5c9a5;
    opacity: 0.5;
}

.captured-panel {
    width: 100px;
    height: 400px;
    border: 1px solid #333;
    margin: 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
}

.move-history-panel {
    width: 200px;
    height: 400px;
    border: 1px solid #333;
    margin: 0 20px;
    overflow-y: scroll;
}

#promotion-choices {
    display: flex;
    justify-content: space-around;
    font-size: 36px;
}

.promotion-choice {
    cursor: pointer;
}

.modal {
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
