body {
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 10px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.chess-container {
    display: inline-block;
    margin: 15px auto;
    border: 3px solid #333;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: #8B4513;
    max-width: 100%;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#chess-board {
    width: 100%;
    height: auto;
    max-width: 640px;
    max-height: 640px;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.game-info {
    margin: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

#game-status {
    font-size: 1.3em;
    font-weight: bold;
    margin: 8px 0;
    color: #495057;
}

.timers {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    gap: 10px;
}

.timer {
    padding: 8px 15px;
    background: #e9ecef;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    font-size: 1.1em;
    font-weight: bold;
    flex: 1;
}

.timer.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

#move-history {
    max-height: 120px;
    overflow-y: auto;
    background: white;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 0.9em;
}

.controls {
    margin: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 120px;
    min-height: 44px;
}

.captured-pieces {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    gap: 10px;
}

.captured-white, .captured-black {
    min-height: 25px;
    padding: 5px 8px;
    background: #e9ecef;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    font-size: 1em;
    flex: 1;
}

.timer.warning {
    background: #ffc107;
    color: #856404;
    border-color: #ffc107;
}

.timer.danger {
    background: #dc3545;
    color: white;
    border-color: #c82333;
}

/* Мобильные устройства */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
        border-radius: 10px;
        touch-action: pan-x pan-y;
    }
    
    h1 {
        font-size: 1.6em;
        margin-bottom: 10px;
    }
    
    #chess-board {
        max-width: 100%;
        height: auto;
    }
    
    .game-info {
        margin: 10px;
        padding: 10px;
    }
    
    #game-status {
        font-size: 1.1em;
    }
    
    .timers {
        flex-direction: column;
    }
    
    .timer {
        font-size: 1em;
        padding: 6px 12px;
    }
    
    .controls {
        margin: 10px;
        gap: 5px;
    }
    
    button {
        padding: 8px 12px;
        font-size: 0.85em;
        min-width: 100px;
        flex: 1 1 calc(50% - 10px);
    }
    
    .captured-pieces {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.4em;
    }
    
    button {
        flex: 1 1 100%;
        min-width: auto;
    }
    
    #move-history {
        max-height: 80px;
        font-size: 0.8em;
    }
    
    .timer {
        font-size: 0.9em;
    }
}