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

#app {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#chess-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    width: 480px; /* 8 * 60px */
    height: 480px; /* 8 * 60px */
    border: 2px solid #333;
    margin: 20px auto;
}

.chess-cell {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em; /* For text pieces, if used */
    cursor: pointer;
    position: relative; /* For piece positioning */
}

.light-cell {
    background-color: #f0d9b5;
}

.dark-cell {
    background-color: #b58863;
}

.chess-piece {
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
}

/* Piece images - you would ideally use actual SVG/PNG images */
.p-w { background-image: url('/static/pieces/wp.png'); }
.p-b { background-image: url('/static/pieces/bp.png'); }
.r-w { background-image: url('/static/pieces/wr.png'); }
.r-b { background-image: url('/static/pieces/br.png'); }
.n-w { background-image: url('/static/pieces/wn.png'); }
.n-b { background-image: url('/static/pieces/bn.png'); }
.b-w { background-image: url('/static/pieces/wb.png'); }
.b-b { background-image: url('/static/pieces/bb.png'); }
.q-w { background-image: url('/static/pieces/wq.png'); }
.q-b { background-image: url('/static/pieces/bq.png'); }
.k-w { background-image: url('/static/pieces/wk.png'); }
.k-b { background-image: url('/static/pieces/bk.png'); }

/* Placeholder piece images - if actual images are not available */
/* To use these, you would need to adjust script.js to render 'text' pieces */
/*
.piece.white.pawn::before { content: '♙'; color: white; }
.piece.black.pawn::before { content: '♟'; color: black; }
.piece.white.rook::before { content: '♖'; color: white; }
.piece.black.rook::before { content: '♜'; color: black; }
.piece.white.knight::before { content: '♘'; color: white; }
.piece.black.knight::before { content: '♞'; color: black; }
.piece.white.bishop::before { content: '♗'; color: white; }
.piece.black.bishop::before { content: '♝'; color: black; }
.piece.white.queen::before { content: '♕'; color: white; }
.piece.black.queen::before { content: '♛'; color: black; }
.piece.white.king::before { content: '♔'; color: white; }
.piece.black.king::before { content: '♚'; color: black; }
*/

.selected-cell {
    background-color: rgba(0, 255, 0, 0.4); /* Green highlight for selected piece */
}

.possible-move {
    background-color: rgba(0, 0, 255, 0.4); /* Blue highlight for possible moves */
}

.illegal-move-start, .illegal-move-end {
    background-color: rgba(255, 0, 0, 0.4); /* Red highlight for illegal move */
}

#lobby-screen, #game-screen {
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
}

#player-name-input, #join-lobby-button {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#join-lobby-button {
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

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

#available-players-list, #in-game-players-list {
    list-style: none;
    padding: 0;
}

#available-players-list li,
#in-game-players-list li {
    background-color: #e9ecef;
    margin-bottom: 5px;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#available-players-list li button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

#available-players-list li button:hover {
    background-color: #218838;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal p {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 300px;
    text-align: center;
    border-radius: 8px;
}

.modal button {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
}

#accept-challenge-button {
    background-color: #28a745;
    color: white;
    border: none;
}

#decline-challenge-button {
    background-color: #dc3545;
    color: white;
    border: none;
}