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

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
}

h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.game-area {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

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

.square {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
}

.light {
    background-color: #f0d9b5;
}

.dark {
    background-color: #b58863;
}

.selected {
    background-color: yellow;
}

.valid-move {
    background-color: rgba(0, 255, 0, 0.5);
}

.controls, .status {
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 8px;
    width: 200px;
}

button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#currentPlayerDisplay, #gameStatusDisplay, #capturedPiecesDisplay, #moveHistoryDisplay {
    margin-top: 10px;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 4px;
}

footer {
    margin-top: 20px;
    color: #555;
    font-size: 0.8em;
}

@media (max-width: 768px) {
    .chessboard {
        width: 320px; /* 8 * 40px */
        height: 320px; /* 8 * 40px */
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }
    .square {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    .controls, .status {
        width: 80%;
        max-width: 320px;
    }
}


