body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

.game-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
}

.chess-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 30px;
    text-align: center;
    flex: 0 0 auto;
}

.game-notation {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 25px;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    height: fit-content;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.game-status {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
}

.game-status.check {
    background-color: #ffeb3b;
    color: #f57c00;
}

.game-status.checkmate {
    background-color: #f44336;
    color: white;
}

.game-status.stalemate {
    background-color: #9e9e9e;
    color: white;
}

.turn-indicator {
    font-size: 1.1em;
    margin-bottom: 20px;
    padding: 8px 16px;
    background-color: #e3f2fd;
    border-radius: 20px;
    display: inline-block;
    color: #1976d2;
    font-weight: bold;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 0;
    border: 3px solid #333;
    margin: 20px auto;
    background-color: #333;
}

.square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.square.light {
    background-color: #f0d9b5;
}

.square.dark {
    background-color: #b58863;
}

.square.selected {
    background-color: #7cb342 !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.square.possible-move {
    background-color: #81c784 !important;
}

.square.possible-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(76, 175, 80, 0.8);
    border-radius: 50%;
}

.square.capture-move {
    background-color: #e57373 !important;
}

.square.capture-move::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #f44336;
    border-radius: 50%;
    box-sizing: border-box;
}

.square:hover {
    transform: scale(1.05);
}

.piece {
    transition: all 0.3s ease;
}

.game-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.difficulty-selector label {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

#difficultySelect {
    padding: 5px 10px;
    border: 2px solid #2196f3;
    border-radius: 15px;
    background: white;
    color: #333;
    font-size: 0.9em;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

#difficultySelect:hover {
    border-color: #1976d2;
    background: #f3f9ff;
}

#difficultySelect:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

button {
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

#aiToggleBtn {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#aiToggleBtn.disabled {
    background: linear-gradient(45deg, #9e9e9e, #bdbdbd);
    box-shadow: 0 4px 15px rgba(158, 158, 158, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

button:active {
    transform: translateY(0);
}

.promotion-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    text-align: center;
}

.promotion-dialog h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.promotion-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.promotion-piece {
    font-size: 3em;
    padding: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.2s ease;
    background-color: #f5f5f5;
}

.promotion-piece:hover {
    border-color: #2196f3;
    background-color: #e3f2fd;
    transform: scale(1.1);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.game-notation h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.4em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.notation-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.notation-controls button {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85em;
    border-radius: 15px;
    min-width: 70px;
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.notation-controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

#clearBtn {
    background: linear-gradient(45deg, #f44336, #ef5350) !important;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3) !important;
}

#clearBtn:hover {
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4) !important;
}

.notation-display {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    text-align: left;
}

.pgn-header {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    line-height: 1.4;
}

.pgn-moves {
    color: #333;
    font-size: 1em;
    line-height: 1.8;
    word-wrap: break-word;
}

.move-pair {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

.move-number {
    font-weight: bold;
    color: #2196f3;
}

.white-move, .black-move {
    margin-left: 5px;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.white-move:hover, .black-move:hover {
    background-color: #e3f2fd;
}

.current-move {
    background-color: #ffeb3b !important;
    font-weight: bold;
}

@media (max-width: 1024px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .game-notation {
        max-width: 600px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 20px;
    }
    
    .chess-container {
        padding: 15px;
        margin: 0;
    }
    
    .chess-board {
        grid-template-columns: repeat(8, 45px);
        grid-template-rows: repeat(8, 45px);
    }
    
    .square {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-notation {
        padding: 15px;
    }
    
    .notation-display {
        min-height: 300px;
        max-height: 400px;
    }
}
