:root {
    --primary-color: #1a73e8;
    --error-color: #d93025;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: none;
}

body {
    font-family: 'Noto Sans KR', -apple-system, system-ui, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-box {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 16px;
    text-align: center;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 16px;
    font-family: inherit;
}

textarea {
    height: 100px;
    resize: none;
}

button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.error {
    color: var(--error-color);
    margin-top: 8px;
    text-align: center;
}

.chat-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#online-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.connection-status {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 12px;
}

.online {
    background-color: #34a853;
    color: white;
}

.offline {
    background-color: #ea4335;
    color: white;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.message {
    margin-bottom: 16px;
}

.message-header {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message-content {
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    max-width: 80%;
    word-break: break-all;
}

.typing-indicator {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

.input-area {
    padding: 16px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#char-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.input-area button {
    width: auto;
    padding: 8px 16px;
}

@media (max-width: 600px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .screen {
        padding: 0;
    }
}