:root {
    --discord-blurple: #5865F2;
    --discord-green: #57F287;
    --discord-red: #ED4245;
    --discord-yellow: #FEE75C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a3e 50%, #24243e 100%);
    background-attachment: fixed;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(88, 101, 242, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(67, 233, 123, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.chess-container {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.game-header {
    text-align: center;
    margin-bottom: 24px;
}

.game-header h2 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.game-status {
    font-size: 18px;
    font-weight: 500;
    color: #ccc;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: inline-block;
}

.game-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.board-container {
    flex: 1;
    min-width: 350px;
    max-width: 600px;
}

#chessBoard {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

#chessBoard .board-1cf67 {
    width: 100% !important;
}

.move-history {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
}

.history-list {
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 4px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #5865F2;
    border-radius: 4px;
}

.history-item {
    font-size: 14px;
    color: #ccc;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.game-controls {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.difficulty-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.difficulty-selector label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diff-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.diff-btn.active {
    border-color: #5865F2;
    background: rgba(88, 101, 242, 0.2);
    color: white;
}

.diff-btn[data-difficulty="easy"]:hover,
.diff-btn[data-difficulty="easy"].active {
    border-color: #57F287;
    background: rgba(87, 242, 135, 0.15);
}

.diff-btn[data-difficulty="medium"]:hover,
.diff-btn[data-difficulty="medium"].active {
    border-color: #FEE75C;
    background: rgba(254, 231, 92, 0.15);
}

.diff-btn[data-difficulty="hard"]:hover,
.diff-btn[data-difficulty="hard"].active {
    border-color: #ED4245;
    background: rgba(237, 66, 69, 0.15);
}

.timer-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timer-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.timer-label {
    font-size: 14px;
    color: #888;
}

.timer-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.timer-player:first-child .timer-value {
    color: #57F287;
}

.timer-player:last-child .timer-value {
    color: #ED4245;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-timer {
    background: linear-gradient(135deg, #57F287, #43e97b);
    color: #0f0c29;
}

.btn-timer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(87, 242, 135, 0.3);
}

.btn-timer:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-new {
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: white;
}

.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.4);
}

.btn-resign {
    background: rgba(237, 66, 69, 0.2);
    color: #ED4245;
    border: 1px solid #ED4245;
}

.btn-resign:hover {
    background: #ED4245;
    color: white;
}

.captured-pieces {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.captured-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.captured-white, .captured-black {
    font-size: 24px;
    padding: 4px 0;
    min-height: 36px;
    letter-spacing: 4px;
}

.captured-white {
    color: #fff;
}

.captured-black {
    color: #888;
}

.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    min-height: 44px;
}

.message.success {
    background: rgba(87, 242, 135, 0.15);
    border: 1px solid #57F287;
    color: #57F287;
}

.message.error {
    background: rgba(237, 66, 69, 0.15);
    border: 1px solid #ED4245;
    color: #ED4245;
}

.message.info {
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid #5865F2;
    color: #5865F2;
}

@media (max-width: 900px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls {
        flex: 1;
        width: 100%;
        max-width: 600px;
    }
    
    .board-container {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .chess-container {
        padding: 20px;
    }
    
    .game-header h2 {
        font-size: 24px;
    }
    
    .game-status {
        font-size: 14px;
    }
    
    .timer-value {
        font-size: 16px;
    }
    
    .difficulty-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .diff-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
        font-size: 12px;
        padding: 6px 12px;
    }
}
/* Уведомление о шахе на доске */
#chessBoard {
    position: relative;
}

#checkNotification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(237, 66, 69, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow: 0 0 60px rgba(237, 66, 69, 0.6);
    z-index: 100;
    display: none;
    text-align: center;
    border: 3px solid #ff6b6b;
    pointer-events: none;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    animation: checkPulse 0.8s ease-in-out infinite, checkFlash 1.2s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes checkFlash {
    0%, 100% { box-shadow: 0 0 60px rgba(237, 66, 69, 0.6); }
    50% { box-shadow: 0 0 120px rgba(237, 66, 69, 0.9); }
}

/* Подсветка короля в шахе */
.square-in-check {
    animation: kingCheckPulse 0.6s ease-in-out infinite !important;
}

@keyframes kingCheckPulse {
    0%, 100% { box-shadow: inset 0 0 20px 10px rgba(237, 66, 69, 0.8); }
    50% { box-shadow: inset 0 0 35px 20px rgba(237, 66, 69, 0.4); }
}