/* Estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    width: 100%;
}

/* Estilos do painel de informações */
.game-info {
    text-align: center;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
}

h1 {
    margin-bottom: 15px;
    color: #ecf0f1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.player-info {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.player-info span {
    font-weight: bold;
}

.score-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.score {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.score.red {
    background-color: rgba(231, 76, 60, 0.7);
}

.score.blue {
    background-color: rgba(52, 152, 219, 0.7);
}

#reset-game {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#reset-game:hover {
    background-color: #c0392b;
}

/* Estilos do tabuleiro */
.board-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    aspect-ratio: 1/1;
    transform: rotateX(20deg);
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 8px solid #8b5a2b;
    border-radius: 5px;
    margin: 30px;
}

.square {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.square.dark {
    background-color: #8b4513;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.square.light {
    background-color: #d2b48c;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.square.selected {
    transform: scale(0.95);
    box-shadow: inset 0 0 15px rgba(255, 255, 0, 0.7);
}

.square.valid-move {
    position: relative;
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background-color: rgba(255, 255, 0, 0.5);
    border-radius: 50%;
    z-index: 1;
}

/* Coordenadas do tabuleiro */
.board-coordinates {
    position: absolute;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    z-index: 10;
}

.coordinate-row {
    position: absolute;
    left: 5px;
    transform: rotateX(20deg);
}

.coordinate-col {
    position: absolute;
    bottom: 5px;
    transform: rotateX(20deg);
}

/* Estilos das peças */
.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    z-index: 2;
}

.piece::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    top: 0;
    left: 0;
    transform: translateZ(-5px);
    filter: brightness(0.7);
}

.piece.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #e74c3c);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3), inset 0 -5px 10px rgba(0, 0, 0, 0.2), inset 0 5px 10px rgba(255, 255, 255, 0.5);
}

.piece.red::before {
    background: #c0392b;
}

.piece.blue {
    background: radial-gradient(circle at 30% 30%, #74b9ff, #3498db);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3), inset 0 -5px 10px rgba(0, 0, 0, 0.2), inset 0 5px 10px rgba(255, 255, 255, 0.5);
}

.piece.blue::before {
    background: #2980b9;
}

.piece.king::after {
    content: '♔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Responsividade */
@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .game-info {
        margin-right: 20px;
        margin-bottom: 0;
        width: 300px;
    }
}

@media (max-width: 767px) {
    .board {
        transform: rotateX(15deg);
    }
}

@media (max-width: 480px) {
    .board {
        transform: rotateX(10deg);
    }

    .piece {
        width: 70%;
        height: 70%;
    }

    h1 {
        font-size: 1.5rem;
    }

    .player-info, .score {
        font-size: 0.9rem;
    }
}