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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, #f5f5dc, #e6e6cc);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 20px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.game-info {
    margin-bottom: 20px;
}

.status {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
}

.room-info {
    font-size: 16px;
    color: #666;
}

.room-info button {
    margin-left: 10px;
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.room-info button:hover {
    background: #45a049;
}

.setup-option button {
    padding: 10px 20px;
    margin: 0 10px;
    font-size: 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.setup-option button:hover {
    background: #0b7dda;
}

.room-input {
    margin-top: 20px;
}

.room-input input {
    padding: 10px;
    font-size: 16px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.room-input button {
    padding: 10px 15px;
    margin: 0 5px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#confirmJoin {
    background: #4CAF50;
    color: white;
}

#cancelJoin {
    background: #f44336;
    color: white;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chessboard {
    display: inline-block;
    background: #dcb35c;
    border: 2px solid #966F33;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.chessboard .row {
    display: flex;
}

.chessboard .cell {
    width: 30px;
    height: 30px;
    border-right: 1px solid #966F33;
    border-bottom: 1px solid #966F33;
    position: relative;
    cursor: pointer;
}

.chessboard .cell:last-child {
    border-right: none;
}

.chessboard .row:last-child .cell {
    border-bottom: none;
}

.chessboard .cell:hover {
    background-color: rgba(255, 255, 0, 0.2);
}

.chessboard .cell.black::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #666, #000);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.chessboard .cell.white::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.chessboard .cell.last-move::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: red;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.game-controls {
    margin-top: 20px;
}

.game-controls button {
    padding: 10px 20px;
    margin: 0 10px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#restartBtn {
    background: #FF9800;
    color: white;
}

#leaveRoom {
    background: #f44336;
    color: white;
}

.game-controls button:hover {
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chessboard .cell {
        width: 25px;
        height: 25px;
    }
    
    .chessboard .cell::after {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .chessboard .cell {
        width: 20px;
        height: 20px;
    }
    
    .chessboard .cell::after {
        width: 16px;
        height: 16px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
}