* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.game-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    justify-content: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-weight: bold;
    color: #666;
}

.status-value {
    color: #333;
    font-size: 1.1em;
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-selector {
    text-align: center;
}

.difficulty-selector label {
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.difficulty-selector select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.board-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

#chess-board {
    border: 3px solid #333;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
    cursor: pointer;
}

.move-history {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
    max-height: 600px;
    overflow-y: auto;
}

.move-history h3 {
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

#moves-list {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.move-item {
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: white;
}

.move-item.white {
    border-left: 3px solid #fff;
    background: #f8f9fa;
}

.move-item.black {
    border-left: 3px solid #000;
    background: #e9ecef;
}

.instructions {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.instructions p {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .control-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .board-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .move-history {
        max-height: 200px;
        width: 100%;
        padding: 10px;
    }
    
    #chess-board {
        width: 100%;
        max-width: 100%;
        height: auto;
        touch-action: none; /* 스크롤 방지 */
    }
    
    .instructions {
        font-size: 0.85em;
        padding: 10px;
    }
    
    .instructions p {
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .status-value {
        font-size: 1em;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}
