
:root {
    --primary-green: #4CAF50;
    --light-green: #E8F5E9;
    --dark-green: #2E7D32;
    --bg-color: #f0f4f0;
    --chat-bubble-bg: #ffffff;
    --user-bubble-bg: #dcedc8;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: #333;
    display: flex;
    justify-content: center;
    height: 100vh;
}

#root {
    width: 100%;
    max-width: 600px;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
header {
    background-color: var(--primary-green);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}
.controls button:hover { background: rgba(255,255,255,0.3); }

/* Settings Panel */
.settings-panel {
    background: var(--light-green);
    padding: 10px 15px;
    border-bottom: 1px solid var(--primary-green);
    font-size: 0.9rem;
}
.setting-row { margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; }
.setting-row select, .setting-row input { padding: 4px; border-radius: 4px; border: 1px solid #ccc; }

/* Chat Area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-image: radial-gradient(var(--light-green) 1px, transparent 1px);
    background-size: 20px 20px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--primary-green);
}

.message-content {
    background: var(--chat-bubble-bg);
    padding: 10px 15px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 80%;

    font-size: 14pt; 
}

.message.user {
    flex-direction: row-reverse;
}

.message.user .avatar {
    margin-right: 0;
    margin-left: 10px;
    border-color: #666;
}

.message.user .message-content {
    background: var(--user-bubble-bg);
    border-top-left-radius: 12px;
    border-top-right-radius: 2px;
}

.sender-name {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 3px;
    font-weight: bold;
}

/* Input Area */
.input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;

    font-size: 14pt; 
}
.input-area input:focus { border-color: var(--primary-green); }

.send-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px; right: 10px;
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer;
}

.modal-emoji { font-size: 4rem; margin-bottom: 10px; display: block; }
.modal-name { font-size: 1.5rem; font-weight: bold; color: var(--dark-green); }
.modal-desc { margin-top: 10px; line-height: 1.5; color: #555; }
