body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

h1 {
    color: #333;
    text-align: center;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    resize: vertical;
}

.controls {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.depth-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

.loading {
    color: #007bff;
    font-style: italic;
}

.error {
    color: #dc3545;
    background-color: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.results {
    margin-top: 20px;
}

.results pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre-wrap;
}

.summary {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.moves-list {
    max-height: 400px;
    overflow-y: auto;
}

.move-item {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.move-item:last-child {
    border-bottom: none;
}

.blunder { background-color: #f8d7da; }
.mistake { background-color: #fff3cd; }
.inaccuracy { background-color: #d1ecf1; }

.move-header {
    font-weight: bold;
    margin-bottom: 4px;
}

.move-details {
    font-size: 0.9em;
    color: #6c757d;
}

.chesscom-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.chesscom-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.username-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.date-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.year-input, .month-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.username-input input, .year-input input, .month-input select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

label {
    font-weight: bold;
    color: #495057;
}

.game-selector {
    margin-top: 15px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.game-selector p {
    margin: 0 0 10px 0;
}

.game-selector-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-selector-controls input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.game-selector-controls button {
    padding: 5px 10px;
    font-size: 14px;
}

.board-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.board-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.board-info {
    flex: 1;
    min-width: 200px;
}

.chess-board-container {
    position: relative;
    width: 320px;
    height: 320px;
}

.chess-board-container .cg-wrap {
    width: 320px;
    height: 320px;
}

.board-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

.eval-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 0;
    font-weight: bold;
}

.eval-positive { background-color: #d4edda; color: #155724; }
.eval-negative { background-color: #f8d7da; color: #721c24; }
.eval-neutral { background-color: #e9ecef; color: #495057; }
