* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.5em;
    background: linear-gradient(90deg, #f8b500, #fceabb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1em;
}

.cor-brancas {
    color: #f8f8f8;
    font-weight: bold;
}

.cor-pretas {
    color: #333;
    font-weight: bold;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-left: 15px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
}

.vez {
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.vez.ativo {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    animation: pulse 2s infinite;
}

.vez.aguardando {
    background: linear-gradient(90deg, #e67e22, #d35400);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

.turno {
    font-size: 1.2em;
}

.controls button, .controls a {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.controls button:hover, .controls a:hover {
    background: #2980b9;
}

.btn-reset {
    background: #e74c3c !important;
}

.btn-reset:hover {
    background: #c0392b !important;
}

.game-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }
}

.chess-board {
    display: inline-block;
    border: 10px solid #8b4513;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.row {
    display: flex;
}

.square {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

@media (max-width: 600px) {
    .square {
        width: 45px;
        height: 45px;
    }
}

.square.white {
    background-color: #f0d9b5;
}

.square.black {
    background-color: #b58863;
}

.square:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.square.selected {
    box-shadow: inset 0 0 0 3px #3498db;
}

.square.valid-move {
    box-shadow: inset 0 0 0 3px #2ecc71;
}

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

/* Estilos para peças usando caracteres Unicode */
.piece.branco::after, .piece.preto::after {
    font-size: 45px;
    line-height: 1;
}

@media (max-width: 600px) {
    .piece.branco::after, .piece.preto::after {
        font-size: 30px;
    }
}

.piece.branco.rei::after { content: '♔'; color: white; text-shadow: 1px 1px 2px black; }
.piece.branco.rainha::after { content: '♕'; color: white; text-shadow: 1px 1px 2px black; }
.piece.branco.torre::after { content: '♖'; color: white; text-shadow: 1px 1px 2px black; }
.piece.branco.bispo::after { content: '♗'; color: white; text-shadow: 1px 1px 2px black; }
.piece.branco.cavalo::after { content: '♘'; color: white; text-shadow: 1px 1px 2px black; }
.piece.branco.peao::after { content: '♙'; color: white; text-shadow: 1px 1px 2px black; }

.piece.preto.rei::after { content: '♚'; color: black; text-shadow: 1px 1px 2px white; }
.piece.preto.rainha::after { content: '♛'; color: black; text-shadow: 1px 1px 2px white; }
.piece.preto.torre::after { content: '♜'; color: black; text-shadow: 1px 1px 2px white; }
.piece.preto.bispo::after { content: '♝'; color: black; text-shadow: 1px 1px 2px white; }
.piece.preto.cavalo::after { content: '♞'; color: black; text-shadow: 1px 1px 2px white; }
.piece.preto.peao::after { content: '♟'; color: black; text-shadow: 1px 1px 2px white; }

.game-sidebar {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
}

.historico {
    margin-bottom: 30px;
}

.historico h3 {
    margin-bottom: 15px;
    color: #f8b500;
}

#historico-jogadas {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
}

.jogada {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

.instrucoes h3, .info-jogo h3 {
    margin-bottom: 15px;
    color: #f8b500;
}

.instrucoes p, .info-jogo p {
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 2px solid #2ecc71;
}

.info-jogo {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-piece {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.mensagem {
    background: rgba(52, 152, 219, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.mensagem.erro {
    background: rgba(231, 76, 60, 0.2);
}

.mensagem.sucesso {
    background: rgba(46, 204, 113, 0.2);
}

.login-container {
    max-width: 500px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-container h1, .login-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.login-container h2 {
    color: #f8b500;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1em;
}

.form-group input:focus {
    outline: 2px solid #3498db;
}

.login-container button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: linear-gradient(90deg, #2980b9, #1c6ea4);
}

.credenciais {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.credenciais h3 {
    color: #f8b500;
    margin-bottom: 15px;
}

.erro {
    background: rgba(231, 76, 60, 0.3);
    color: #ff9999;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
}