body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f5f5f5;
    font-family: Arial, sans-serif;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.footer p {
    margin: 0;
}

.controls {
    text-align: center;
}

.controls h1 {
    margin: 0 0 15px 0;
    color: #333;
}

.time-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.time-controls label {
    font-size: 14px;
    color: #555;
}

.time-controls input {
    width: 60px;
    padding: 5px;
    margin-left: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.time-controls select {
    padding: 5px 10px;
    margin-left: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.color-switch {
    font-weight: bold;
}

.board-wrapper {
    position: relative;
    display: inline-block;
}

.time-controls button {
    padding: 8px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.time-controls button:hover {
    background-color: #45a049;
}

.game-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    min-width: 576px;
    box-sizing: border-box;
}

.timer.active {
    border-color: #4CAF50;
    background-color: #f0f8f0;
}

.timer.warning {
    border-color: #ff9800;
    background-color: #fff3e0;
}

.timer.danger {
    border-color: #f44336;
    background-color: #ffebee;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.player-name {
    font-weight: bold;
    color: #333;
}

.time {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #333;
}

#chessboard {
    display: grid;
    grid-template-columns: repeat(8, 72px);
    grid-template-rows: repeat(8, 72px);
    border: 4px solid #222;
}

.coordinates-bottom {
    display: flex;
    justify-content: space-around;
    margin-top: 5px;
    padding-left: 4px;
    padding-right: 4px;
}

.coordinates-bottom span {
    width: 72px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.coordinates-left {
    position: absolute;
    left: -25px;
    top: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 576px;
}

.coordinates-left span {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.square {
    width: 72px;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.square.light {
    background-color: #f0d9b5;
}

.square.dark {
    background-color: #b58863;
}

.square:hover {
    opacity: 0.8;
    cursor: pointer;
}

.square.selected {
    box-shadow: inset 0 0 0 3px #4CAF50;
}

/* Game Over Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 0.6s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.modal-content h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 28px;
}

.modal-content p {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pawn Promotion Modal */
.promotion-modal {
    max-width: 500px;
}

.promotion-pieces {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.promotion-piece {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: white;
}

.promotion-piece:hover {
    border-color: #4CAF50;
    background-color: #f0f8f0;
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

.promotion-piece span {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.promotion-piece .chess-piece {
    width: 60px;
    height: 60px;
    background-image: url('../img/chessPieces.png');
    background-size: 360px 120px;
    background-repeat: no-repeat;
}