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

body {
    font-family: 'FreeSerif', 'Times New Roman', serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.chess-workspace {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Панель с фигурами */
.pieces-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 200px;
}

.pieces-panel h3 {
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.pieces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.piece {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
    user-select: none;
}

.piece img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.piece:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.piece:active {
    cursor: grabbing;
}

.white-piece {
    color: #333;
}

.black-piece {
    color: #000;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #0056b3;
}

.btn-primary {
    background: #28a745;
}

.btn-primary:hover {
    background: #1e7e34;
}

/* Шахматная доска */
.chess-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.chess-board {
    position: relative;
    width: 800px;
    height: 800px;
    border: 4px solid #000;
    background: white;
}

.chess-square {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    cursor: pointer;
    user-select: none;
}

.chess-square.white {
    background: #FFFFFF;
}

.chess-square.black {
    background: #c0c0c0;
}

.chess-square:hover {
    background-color: rgba(255, 255, 0, 0.3) !important;
}

.chess-square.dragover {
    background-color: rgba(0, 255, 0, 0.3) !important;
}

/* Стили для фигур на доске */
.board-piece {
    transition: transform 0.1s ease;
}

.board-piece:hover {
    transform: scale(1.05);
}

.board-piece:active {
    transform: scale(0.95);
}

/* Подписи клеток */
.board-labels {
    position: absolute;
    font-family: 'FreeSerif', 'Times New Roman', serif;
    font-weight: bold;
    color: #000;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-labels.files {
    height: 50px;
    width: 100px;
    font-size: 50px;
}

.board-labels.ranks {
    width: 50px;
    height: 100px;
    font-size: 50px;
}

.board-labels.files.bottom {
    bottom: -54px;
}

.board-labels.ranks.left {
    left: -54px;
}

/* Кнопки экспорта */
.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    position: relative;
}

/* Уведомление о копировании */
.copy-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.copy-notification.show {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .chess-workspace {
        flex-direction: column;
        align-items: center;
    }
    
    .chess-board {
        width: 600px;
        height: 600px;
    }
    
    .chess-square {
        width: 75px;
        height: 75px;
        font-size: 45px;
    }
    
    .board-labels.files {
        width: 75px;
        height: 37px;
        font-size: 37px;
    }
    
    .board-labels.ranks {
        width: 37px;
        height: 75px;
        font-size: 37px;
    }
}

@media (max-width: 768px) {
    .chess-board {
        width: 400px;
        height: 400px;
    }
    
    .chess-square {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    
    .board-labels.files {
        width: 50px;
        height: 25px;
        font-size: 25px;
    }
    
    .board-labels.ranks {
        width: 25px;
        height: 50px;
        font-size: 25px;
    }
    
    .pieces-grid {
        grid-template-columns: 1fr;
    }
}
