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

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

.container {
    text-align: center;
    padding: 20px;
}

h1 {
    margin-bottom: 30px;
    color: #ecf0f1;
}

.connection-panel {
    background-color: #34495e;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.peer-info p {
    margin-bottom: 10px;
}

#peer-id {
    font-weight: bold;
    color: #3498db;
}

.connect-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

#remote-peer-id {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #2c3e50;
    color: #ecf0f1;
    width: 300px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.status {
    font-weight: bold;
    margin-top: 10px;
}

.status.connected {
    color: #2ecc71;
}

.status.error {
    color: #e74c3c;
}

.game-container {
    display: none;
}

.game-container.active {
    display: block;
}

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

#turn-indicator {
    font-weight: bold;
    margin-bottom: 10px;
}

#color-display {
    font-weight: bold;
    text-transform: capitalize;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 80px);
    grid-template-rows: repeat(8, 80px);
    border: 3px solid #1a1a1a;
    margin: 0 auto;
    position: relative;
}

.square {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

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

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

.square.selected {
    background-color: #ffff33 !important;
}

.square.possible-move {
    position: relative;
}

.square.possible-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.square.possible-capture::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 0, 0, 0.5);
    box-sizing: border-box;
}

.piece {
    font-size: 60px;
    user-select: none;
    cursor: pointer;
}

.captured-pieces {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.captured {
    background-color: #34495e;
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
}

.captured h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.captured-piece {
    font-size: 30px;
    display: inline-block;
    margin: 2px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #34495e;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .chess-board {
        grid-template-columns: repeat(8, 50px);
        grid-template-rows: repeat(8, 50px);
    }
    
    .square {
        width: 50px;
        height: 50px;
    }
    
    .piece {
        font-size: 40px;
    }
}
