* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    background: #1b1c1e;
    color: #e1e1e1;
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.chat {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #141414;
}

#settings {
    position: relative;
}

#settingsMenu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: -10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    max-height: 0;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: max-height 0.2s ease, padding 0.2s ease;
}

#settingsMenu.open {
    max-height: 140px;
    padding: 8px;
    background: #0f0f0f;
    border-color: #222222;
}

#gearButton {
    width: 40px;
    padding: 0;
    color: #d1d1d1;
    font-size: 18px;
}

.input-area {
    padding-left: 10px;
}

#messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 6px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

#messages::-webkit-scrollbar {
    width: 6px;
}

#messages::-webkit-scrollbar-track {
    background: transparent;
}

#messages::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

.message {
    padding: 3px 5px;
    margin: 0;
    color: #d1d1d1;
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 2px;
    transition: background 0.15s ease;
}

.message:hover {
    background: #1a1a1a;
}

.name {
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 3px;
}

.input-area {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: #0f0f0f;
    border-top: 1px solid #222222;
}

#messageInput {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #282828;
    border-radius: 2px;
    outline: none;
    background: #181818;
    color: #ffffff;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

#messageInput::placeholder {
    color: #666666;
}

#messageInput:hover {
    background: #1c1c1c;
}

#messageInput:focus {
    background: #1c1c1c;
}

#sendButton {
    display: none;
}

button {
    height: 40px;
    padding: 0 16px;
    border: 1px solid #282828;
    border-radius: 2px;
    background: #222222;
    color: #ffffff;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.timestamp {
    display: inline-block;
    margin-left: 8px;
    color: #666;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s ease;
    vertical-align: baseline;
}

.message:hover .timestamp {
    opacity: 1;
}

button:hover {
    background: #2c2c2c;
    border-color: #383838;
}

button:active {
    background: #333333;
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    #messages {
        padding: 10px;
    }

    .input-area {
        padding: 10px;
    }

    .message {
        font-size: 13px;
    }

    #sendButton {
        display: block;
    }
}
