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

.wrapper-box {
    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);
}

/* --- Connection Panel Styles --- */
.info-box {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
}

.highlight-id {
    color: #2c3e50;
    letter-spacing: 1px;
    font-family: monospace;
    background: #eef5fa;
    padding: 10px;
    border-radius: 5px;
    word-wrap: break-word;
}

#opponent-id-input {
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
}

.status-text {
    color: #e67e22;
    font-weight: bold;
    margin-top: 15px;
}

/* Include all your previous styles below here exactly as they were */
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; }
#moveInput:disabled { background-color: #e9ecef; cursor: not-allowed; }

#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:not(:disabled) { background-color: #2980b9; }
#submitBtn:disabled { background-color: #bdc3c7; cursor: not-allowed; }

#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; }

.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; }
.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-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; }

.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; }
#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; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.action-button:hover { background-color: #27ae60; }
.secondary-btn { background-color: #f39c12; }
.secondary-btn:hover { background-color: #e67e22; }
.reset-button { flex: 1; padding: 10px; margin-top: 0; background-color: #e74c3c; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.reset-button:hover { background-color: #c0392b; }

/* --- Live Chat Styles --- */
.chat-container {
    margin-top: 25px;
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chat-box {
    height: 150px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.self {
    background-color: #3498db;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chat-message.opponent {
    background-color: #e2e8f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.chat-message.system {
    background-color: transparent;
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
    align-self: center;
    text-align: center;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
}

#chatInput {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

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

#sendChatBtn {
    padding: 10px 20px;
}