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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.player-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.player-black {
    border-left: 5px solid #2c3e50;
}

.player-white {
    border-left: 5px solid #ecf0f1;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.timer.low-time {
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.captured-pieces {
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.captured-piece {
    font-size: 1.5rem;
    opacity: 0.7;
}

.board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 500px;
    height: 500px;
    border: 3px solid #2c3e50;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.square.light {
    background-color: #f0d9b5;
}

.square.dark {
    background-color: #b58863;
}

.square:hover {
    transform: scale(1.05);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.3);
}

.square.selected {
    background-color: #7b61ff !important;
    color: white;
}

.square.valid-move {
    background-color: #90EE90 !important;
}

.square.valid-capture {
    background-color: #ff6b6b !important;
}

.square.check {
    background-color: #ffcccb !important;
}

.piece {
    user-select: none;
    transition: transform 0.2s ease;
}

.piece:hover {
    transform: scale(1.1);
}

.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.game-status {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.status-text {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.move-history {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.move-entry {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.move-number {
    font-weight: 600;
    color: #6c757d;
    min-width: 30px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal p {
    margin-bottom: 25px;
    color: #6c757d;
    line-height: 1.6;
}

.setting-group {
    margin-bottom: 20px;
    text-align: left;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .board {
        width: 350px;
        height: 350px;
    }
    
    .square {
        font-size: 2.5rem;
    }
    
    .player-info {
        min-width: 150px;
        padding: 15px;
    }
    
    .timer {
        font-size: 1.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        width: 100%;
        max-width: 350px;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .board {
        width: 300px;
        height: 300px;
    }
    
    .square {
        font-size: 2rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
}

/* Scrollbar Styling */
.move-history::-webkit-scrollbar {
    width: 6px;
}

.move-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.move-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.move-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 