body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.game-wrapper {
    max-width: 450px;
    width: 100%;
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

h1 {
    margin-top: 0;
    font-size: 24px;
}

.status-banner {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.board-container {
    margin-bottom: 20px;
    width: 100%;
}

.input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

#moveInput {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 5px;
    width: 60%;
    transition: border-color 0.2s;
}

#moveInput:focus {
    outline: none;
    border-color: #3498db;
}

#submitBtn {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submitBtn:hover {
    background-color: #2980b9;
}

/* --- Cheat Sheet Styles --- */
#cheat-sheet {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.8;
    text-align: left;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.piece-group {
    margin-bottom: 5px;
}

.piece-label {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
    display: inline-block;
    width: 80px; 
}

.clickable-move {
    color: #0066cc;
    cursor: pointer;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #eef5fa;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block;
}

.clickable-move:hover {
    background-color: #3498db;
    color: white;
    text-decoration: none;
}

/* --- Misc Styles --- */
.pgn-box {
    margin-top: 20px;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    text-align: left;
    min-height: 20px;
    word-wrap: break-word;
}

.reset-button {
    margin-top: 20px;
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.reset-button:hover {
    background-color: #c0392b;
}

/* --- FEN Control Panel Styles --- */
.fen-control-panel {
    margin-top: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#fenInput {
    padding: 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box; 
    font-family: monospace; /* Best for FEN strings */
}

#fenInput:focus {
    outline: none;
    border-color: #2ecc71;
}

.fen-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.action-button {
    flex: 1;
    padding: 10px;
    background-color: #2ecc71; /* Green to indicate loading/success */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.action-button:hover {
    background-color: #27ae60;
}

.reset-button {
    flex: 1;
    padding: 10px;
    margin-top: 0; /* Overrides your previous reset button margin */
    background-color: #e74c3c; /* Red to indicate wiping the board */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.reset-button:hover {
    background-color: #c0392b;
}

/* --- Output Display Styles --- */
.output-container {
    margin-top: 15px;
    text-align: left;
}

.output-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
    margin-top: 0;
}

.output-box-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch; /* Makes button height match the text box */
}

/* Replaces your old .pgn-box class */
.output-box {
    flex-grow: 1;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 5px;
    font-family: monospace;
    font-size: 13px;
    min-height: 20px;
    word-wrap: break-word;
    border: 1px solid #ddd;
    overflow-x: auto;
    display: flex;
    align-items: center;
}

/* --- Copy Buttons --- */
.copy-btn {
    padding: 0 15px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #2c3e50;
}

.copy-btn.success {
    background-color: #27ae60; /* Turns green on success */
}

/* --- Secondary Action Button (Flip Board) --- */
.secondary-btn {
    background-color: #f39c12; /* Orange color */
}

.secondary-btn:hover {
    background-color: #e67e22;
}