/*
 * Estilos para o jogo de Xadrez. Reaproveitamos muitos padrões do
 * jogo de Paciência para manter coerência visual, ajustando cores
 * e dimensões para acomodar o tabuleiro de 8x8 da biblioteca
 * chessboard.js. O fundo escuro realça o tabuleiro claro.
 */

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #1a252f;
    color: #ecf0f1;
}

nav button, nav .home-link {
    margin-right: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: #27ae60;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}
nav button:hover, nav .home-link:hover {
    background: #1e8449;
}

#game-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.status {
    margin-top: 10px;
    font-size: 1rem;
}

/* Tabuleiro de xadrez customizado */
/* Tabuleiro de xadrez customizado */
#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    max-width: 480px;
    height: 480px;
    margin: 0 auto;
    border: 2px solid #ecf0f1;
    box-sizing: border-box;
}
.square {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}
.square.light {
    background: #f0d9b5;
    color: #2c3e50;
}
.square.dark {
    background: #b58863;
    color: #ecf0f1;
}
.square.highlight {
    outline: 3px solid #f1c40f;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-align: center;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content button {
    margin: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: #fff;
    cursor: pointer;
}
.modal-content button:hover {
    background: #2980b9;
}
.modal-content .close-btn {
    background: #c0392b;
}
.modal-content .close-btn:hover {
    background: #922b21;
}

#ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}
#ranking-list li {
    padding: 4px 0;
    border-bottom: 1px solid #ccc;
}

@media (max-width: 600px) {
    nav button, nav .home-link {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}